summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/mp3info.kvs
blob: b53241456c5f399bee71da73fa6ce0866aa0bab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%Xmms_play=$mp3player.getfilename;

%Prefix = $str.left(%Xmms_play,4)
%Postfix = $str.right(%Xmms_play,4)

		%Http_prefix = "http"
		%Cda_postfix = ".cda"
		if(%Prefix == %Http_prefix) {


			%Stime = $($mp3player.gettime/1000)
			%Mtime = 0
			%Ctime =" ";

			while(%Stime > 59) {
				%Mtime++
				%Stime-=60
			}
			
			%Htime=0

			while(%Mtime > 59) {
				%Htime++
				%Mtime-=60
			}

			if (%Stime < 10){
				%tmp = %Stime
				%Stime = $str.append("0",%tmp)
			}
			if (%Mtime < 10 && %Htime > 1){
				%tmp = %Mtime
				%Mtime = $str.append("0",%tmp)
			}


	
			if (%Htime > 0)
				%Ctime = $str.append %Htime:%Mtime:%Stime						
			
			

			if (%Mtime > 0 && %Htime < 1) 
				%Ctime = $str.append %Mtime:%Stime
				
			
			
			if (%Mtime < 1 && %Htime < 1) 
				%Ctime = %Stime
			


			me has currently [$mp3player.gettitle @ %Xmms_play - $($mp3player.getrate/1000) kbps - $($mp3player.getfreq/1000) kHz - seit: %Ctime (h:m:s)]
		}


		else if(%Postfix == %Cda_postfix) {
           %Xmms_play=$mp3player.getfilename; 

        }

  
		else {
            
            if ($mp3player.getchannels == 2) {
                 %Channels = Stereo
            }
            else {
                 %Channels = Mono
            }

            %Frequ = $mp3player.getfreq
            %Frequ2 = $(%Frequ/1000)

            %tmins = $($mp3player.getlength / 60000)
            %tsecs = $(($mp3player.getlength % 60000) / 1000)
            %tsecs1 = $(%tsecs / 10)
            %tsecs2 = $(%tsecs % 10)
            %mins = $($mp3player.gettime / 60000)
            %secs = $(($mp3player.gettime % 60000) / 1000)
            %secs1 = $(%secs / 10)
            %secs2 = $(%secs % 10)
            %rate = $($mp3player.getrate / 1000)
            %size = $file.size("$mp3player.getfilename")
            %msize = $(%size / (1024*1024))
            %ksize = $((%size - ((%size / (1024*1024)) * 1024 * 1024) - (%size % 1024)) / 1024)
     
            %bsize = $(%size % 1024)
            

            if(%msize > 0){
                    %size = "%msize MByte %ksize KByte"
            }
            else {
               if(%ksize > 0){
                            %size = "%ksize KByte %bsize Byte"
               }
               else {
                            %size = "%bsize Byte"
               }
            }
            me has currently [$mp3player.getmp3tag_artist - $mp3player.getmp3tag_title] - [Album: $mp3player.getmp3tag_album] - [Genre: $mp3player.getmp3tag_genre] - [Comment: $mp3player.getmp3tag_comment] - [MPEG$mp3player.getmp3tag_version Layer$mp3player.getmp3tag_layer] - [$($mp3player.getrate/1000) Bit] - [%Frequ2 kHz]  - [%Channels] - [%size] - [%mins:%secs1%secs2 min von %tmins:%tsecs1%tsecs2 min]
		}

        if (!$mp3player.isplaying)
		{
		me's player has currently stopped

}