diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
commit | a6d58bb6052ac8cb01805a48c4ad2f129126116f (patch) | |
tree | dd867a099fcbb263a8009a9fb22695b87855dad6 /doc/scriptexamples/mp3_kdemediaplayers.kvs | |
download | kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.tar.gz kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.zip |
Added KDE3 version of kvirc
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'doc/scriptexamples/mp3_kdemediaplayers.kvs')
-rw-r--r-- | doc/scriptexamples/mp3_kdemediaplayers.kvs | 206 |
1 files changed, 206 insertions, 0 deletions
diff --git a/doc/scriptexamples/mp3_kdemediaplayers.kvs b/doc/scriptexamples/mp3_kdemediaplayers.kvs new file mode 100644 index 00000000..98be29e9 --- /dev/null +++ b/doc/scriptexamples/mp3_kdemediaplayers.kvs @@ -0,0 +1,206 @@ + + +%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 muckelt grad [$mp3player.gettitle @ %Xmms_play - $($mp3player.getrate/1000) kbps - $($mp3player.getfreq/1000) kHz - seit: %Ctime (h:m:s)] + } + else if(%Postfix == %Cda_postfix) { + me muckelt grad [$mp3player.gettitle - Audio CD] + + } + + + 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" + } + } + if ($mp3player.isplaying){ + + if($mp3player.getmp3tag_artist != ""){ + %outartist= $mp3player.getmp3tag_artist + } + else { + %outartist="" + } + if ($mp3player.getmp3tag_title != ""){ + %outtitle= $mp3player.getmp3tag_title + } + else { + %outtitle="" + } + if ((%outartitst != "") && (%outtitle != "")) { + %outartisttitle="["%outartitst" - "%autartisttitle"]" + } + else { + if (%outtitle == ""){ + %outartisttitle="["%outartist"]" + } + else { + %outartisttitle="["%outtitle"]" + } + + } + + if (mp3player.getmp3tag_album !=""){ + %outalbum =" - [Album: "$mp3player.getmp3tag_album"]" + } + else { + %outalbum ="" + } + + if (mp3player.getmp3tag_genre !=""){ + %outgenre =" - [Genre: "$mp3player.getmp3tag_genre"]" + } + else { + %outgenre ="" + } + + + if ($mp3player.getmp3tag_comment !=""){ + %outcomment =" - [Comment: "$mp3player.getmp3tag_comment"]" + } + else { + %outcomment="" + } + if ($mp3player.getmp3tag_version != ""){ + %outmp3tagversion = "MPEG"$mp3player.getmp3tag_version + } + else { + %outmp3tagversion="" + } + if ($mp3player.getmp3tag_layer != ""){ + %outmp3taglayer = "Layer"$mp3player.getmp3tag_layer + } + else { + %outmp3taglayer = "" + } + if (%outmp3taglayer != "" && %outmp3tagversion != ""){ + %outmp3tagversionlayer = " - ["%outmp3tagversion" - "%outmp3taglayer"]" + } + else { + %outmp3tagversionlayer= "" + if (%outmp3tagversion != ""){ + %outmp3tagversionlayer= "["%mp3tagversion"]" + } + if (%outmp3taglayer != ""){ + %outmp3tagversionlayer= "["%mp3taglayer"]" + } + + } + + + %rate = $($mp3player.getrate/1000) + if (%rate != 0){ + %outrate=" - ["%rate KBps"]" + } + else { + %outrate="" + } + if (%Frequ2 != 0){ + %outfrequ2=" - ["%Frequ2 KHz"]" + } + else { + %outfrequ2="" + } + if (%Channels != 0){ + %outchannels = " - ["%Channels"]" + } + else { + %outchannels="" + } + if (%size != 0){ + %outsize = " - ["%size"]" + } + else { + %outsize="" + } + + me muckelt grad %outartisttitle %outalbum %outgenre %outcomment %outmp3tagversionlayer %outrate %outfrequ2 - [%mins:%secs1%secs2 min of %tmins:%tsecs1%tsecs2 min] - [Player: $mp3player.getplayer ] + } + } + if (!$mp3player.isplaying){ + me muckelt grad * nix * + + }
\ No newline at end of file |