diff options
Diffstat (limited to 'doc/scriptexamples/mp3info.kvs')
-rw-r--r-- | doc/scriptexamples/mp3info.kvs | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/doc/scriptexamples/mp3info.kvs b/doc/scriptexamples/mp3info.kvs new file mode 100644 index 00000000..b5324145 --- /dev/null +++ b/doc/scriptexamples/mp3info.kvs @@ -0,0 +1,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 + +} |