begin process at 2010 02 09 22:22:05
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

AddOns

 > ET ENCORE UN MP3 PLAYER ;P

ET ENCORE UN MP3 PLAYER ;P


 Information sur la source

Note :
Aucune note
Catégorie :AddOns Classé sous :lecteur, mp3, player, musique, audio Niveau :Débutant Date de création :03/08/2003 Date de mise à jour :03/08/2003 16:16:22 Vu / téléchargé :6 081 / 274

Auteur : Seregon

Ecrire un message privé
Commentaire sur cette source (9)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Et vi encore un, c'est celui que j'utilise dans mon script.
Il utilise pas mal de dlls mais je voulais donner le meilleur rendu possible.
Vala hesitez pas a donner vos critiques.
Je met le code ci-dessous mais vous aurez besoin de tous les fichier du zip pour le faire fonctionner.

Source

  • ;This addon needs mdx.dll (with associated .mdx files) popups.dll and common.dll to work correctly
  • :icons.dll is the icons library, it may conatains icons wich are not used with this addon because i used this library for some others systems in my script.
  • ;mp3.tos is the save file for mp3 hash table
  • ;For more info about instalation, please refer to readme.txt
  • ;Enjoy :p
  • ; Seregon
  • alias -l echo { if ($regex($1,^-j) == 1) { haltdef } | else { echo $1- } }
  • alias sF2 { if ($dialog(player) == $null) { dialog -md player player } }
  • on 1:start: {
  • hmake mp3 20
  • if ($exists(mp3.tos) == $true) { hload mp3 mp3.tos }
  • hmake prov 50
  • echo -j $dll(popups.dll, New, playlist 16 16)
  • dll popups.dll LoadImg playlist 1 icon small 1,icons.dll
  • dll popups.dll LoadImg playlist 2 icon small 3,icons.dll
  • dll popups.dll LoadImg playlist 3 icon small 4,icons.dll
  • dll popups.dll LoadImg playlist 4 icon small 5,icons.dll
  • dll popups.dll LoadImg playlist 5 icon small 6,icons.dll
  • dll popups.dll LoadImg playlist 6 icon small 16,icons.dll
  • echo -j $dll(popups.dll, AddItem, playlist 1 +> 2 2 Control $cr control) $dll(popups.dll, AddItem, playlist 2 +> 1 1 Add... $cr addelem) $dll(popups.dll, AddItem, playlist 3) $dll(popups.dll, AddItem, playlist 4 3 3 Options $cr options) $dll(popups.dll, AddItem, playlist 5 4 4 Volume $cr volume) $dll(popups.dll, AddItem, playlist 6)
  • echo -j $dll(popups.dll, AddItem, playlist 8 5 5 Withdraw selected $cr withdraw) $dll(popups.dll, AddItem, playlist 9 6 6 Clear playlist $cr clear),2),$null)
  • echo -j $dll(popups.dll, New, control 16 16)
  • dll popups.dll LoadImg control 1 icon small 7,icons.dll
  • dll popups.dll LoadImg control 2 icon small 8,icons.dll
  • dll popups.dll LoadImg control 3 icon small 9,icons.dll
  • dll popups.dll LoadImg control 4 icon small 10,icons.dll
  • dll popups.dll LoadImg control 5 icon small 11,icons.dll
  • dll popups.dll LoadImg control 6 icon small 12,icons.dll
  • dll popups.dll LoadImg control 7 icon small 13,icons.dll
  • echo -j $dll(popups.dll, AddItem, control 1 1 1 Previous $cr previous) $dll(popups.dll, AddItem, control 3 3 3 Play $cr play) $dll(popups.dll, AddItem, control 4 4 4 Pause $cr pause) $dll(popups.dll, AddItem, control 5 7 7 Stop $cr stop) $dll(popups.dll, AddItem, control 7 6 6 Next $cr next)
  • echo -j $dll(popups.dll, New, addelem 16 16)
  • dll popups.dll LoadImg addelem 1 icon small 0,icons.dll
  • dll popups.dll LoadImg addelem 2 icon small 2,icons.dll
  • dll popups.dll LoadImg addelem 3 icon small 14,icons.dll
  • dll popups.dll LoadImg addelem 4 icon small 15,icons.dll
  • echo -j $dll(popups.dll, AddItem, addelem 1 2 2 Add File $cr file) $dll(popups.dll, AddItem, addelem 2 1 1 Add Directory $cr rep) $dll(popups.dll, AddItem, addelem 3) $dll(popups.dll, AddItem, addelem 4 4 4 Add playlist $cr rep) $dll(popups.dll, AddItem, addelem 5 3 3 Make playlist $cr make_pl)
  • echo -j $dll(popups.dll, New, player_playlist 16 16)
  • dll popups.dll LoadImg player_playlist 1 icon small 1,icons.dll
  • dll popups.dll LoadImg player_playlist 2 icon small 6,icons.dll
  • dll popups.dll LoadImg player_playlist 3 icon small 16,icons.dll
  • echo -j $dll(popups.dll, AddItem, player_playlist 1 +> 1 1 Add... $cr pl_add) $dll(popups.dll, AddItem, player_playlist 2) $dll(popups.dll, AddItem, player_playlist 3 2 2 Withdraw selected $cr pl_with) $dll(popups.dll, AddItem, player_playlist 4 3 3 Clear list $cr pl_clear)
  • echo -j $dll(popups.dll, New, pl_add 16 16)
  • dll popups.dll LoadImg pl_add 1 icon small 0,icons.dll
  • dll popups.dll LoadImg pl_add 2 icon small 2,icons.dll
  • echo -j $dll(popups.dll, AddItem, pl_add 1 2 2 File $cr pl_file) $dll(popups.dll, AddItem, pl_add 1 1 1 Directory $cr pl_dir)
  • }
  • on 1:exit: { hsave -o mp3 mp3.tos | hfree mp3 | hfree prov }
  • dialog player {
  • title "Mp3 Player"
  • size -1 -1 169 234
  • option dbu
  • edit "", 1, 4 7 162 10, read autohs center
  • button "9", 2, 5 20 21 10
  • button "4", 4, 74 20 21 10
  • button ";", 6, 98 20 21 10
  • button ":", 7, 144 20 21 10
  • text "", 8, 5 33 161 8
  • edit "", 9, 5 44 44 10, read autohs center
  • edit "", 10, 62 44 44 10, read autohs center
  • edit "", 11, 120 44 44 10, read autohs center
  • box "", 12, 2 1 166 57
  • list 13, 6 70 159 157, sort size extsel
  • box "Playlist", 18, 3 62 165 169
  • button "<", 19, 51 20 21 10
  • button "7", 3, 28 20 21 10
  • button "8", 5, 121 20 21 10
  • menu "Mp3 Player", 14
  • item "Seetings", 15, 14
  • button "boo", 50, 800 800 10 10, ok
  • }
  • on 1:dialog:player:init:0: {
  • did -a $dname 1 Mp3 Player
  • echo -j $dll(mdx.dll, SetMircVersion, $version)
  • echo -j $dll(mdx.dll, MarkDialog, $dname)
  • dll mdx.dll SetDialog $dname icon 5 icons.dll
  • dll mdx.dll SetFont 2,3,4,5,6,7,19 18 400 Webdings
  • echo -j $dll(mdx.dll, SetControlMDX, 8 ProgressBar smooth > ctl_gen.mdx)
  • did -i $dname 8 1 bgcolor $rgb(61,123,218)
  • did -a $dname 8 0
  • echo -j $dll(mdx.dll, SetControlMDX, 13 listview showsel infotip report sortascending > views.mdx)
  • did -i $dname 13 1 headerdims 150 150 100 100 80 0
  • did -i $dname 13 1 headertext + 0 File $+ $chr(9) Title $+ $chr(9) Artist $+ $chr(9) Album $+ $chr(9) Time $+ $chr(9) rep
  • did -i $dname 13 1 seticon list 14,icons.dll
  • }
  • on 1:dialog:player:menu:15:{ if ($dialog(player_options) == $null) { dialog -ma player_options player_options } }
  • on 1:dialog:player:sclick:4: {
  • if ($hget(prov,player_pause) != $true) && ($hget(prov,player_file) != $null) { player_play $hget(prov,player_file) }
  • elseif ($hget(prov,player_pause) == $true) { hdel prov player_pause | .timerplayer_play -r | .timerplayer_end -r | splay resume }
  • }
  • on 1:dialog:player:sclick:2: {
  • if ($calc($hget(prov,player_linesel) - 1) > 1) {
  • .timerplayer_* off
  • splay stop
  • hadd prov player_linesel $calc($hget(prov,player_linesel) - 1)
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
  • %b = $7-
  • player_play %a $+ %b
  • unset %a
  • unset %b
  • }
  • }
  • on 1:dialog:player:sclick:6: { splay pause | .timerplayer_end -p | .timerplayer_play -p | hadd prov player_pause $true }
  • on 1:dialog:player:sclick:19: { splay stop | .timerplayer_* off | did -a player 8 1 | if ($hget(prov,player_pause) == $true) { hdel prov player_pause } }
  • on 1:dialog:player:sclick:7: {
  • if ($calc($hget(prov,player_linesel) + 1) <= $did(player,13).lines) {
  • .timerplayer_* off
  • splay stop
  • hadd prov player_linesel $calc($hget(prov,player_linesel) + 1)
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
  • %b = $7-
  • player_play %a $+ %b
  • unset %a
  • unset %b
  • }
  • }
  • on 1:dialog:player:sclick:13: {
  • if ($gettok($did(13,1),1,32) == sclick) {
  • hadd prov player_linesel $did(13).sel
  • tokenize 32 $gettok($did(13,$did($dname,13).sel).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(13,$did($dname,13).sel).text,1,9)
  • %b = $7-
  • hadd prov player_file %a $+ %b
  • unset %a
  • unset %b
  • }
  • if ($gettok($did(13,1),1,32) == rclick) {
  • tokenize 32 $dll(popups.dll,Popup,playlist +R $mouse.dx $mouse.dy)
  • if ($1- == OK addelem 1 file) {
  • %n = $sfile($mircdir\*.mp3,Choose a Mp3 File,Add...)
  • if (%n != $null) && ($exists(%n) == $true) {
  • did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n)
  • }
  • unset %n
  • }
  • elseif ($1- == OK addelem 2 rep) {
  • %f = $sdir($mircdir, Choose a Directory, Add...)
  • %i = 1
  • hadd Prov files_mp3 $findfile(%f,*.mp3,0,0)
  • while (%i <= $hget(Prov,files_mp3)) { %n = $findfile(%f,*.mp3,%i,0) | did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n) | inc %i }
  • unset %i
  • unset %f
  • unset %n
  • }
  • elseif ($1- == OK addelem 4 rep) {
  • %p = $sfile($mircdir\*.m3u, Select a valid playlist file, Add...)
  • if ($exists(%p) == $true) {
  • %i = 1
  • while (%i <= $lines(%p)) {
  • if ($nopath($read(%p,%i)) == $read(%p,%i)) && ($exists($nofile(%p) $+ $read(%p,%i)) == $true) { did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath($nofile(%p) $+ $read(%p,%i)) $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).title $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).artist $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).album $+ $chr(9) $duration($idtag($nofile(%p) $+ $read(%p,%i)).time) $+ $chr(9) $nofile($nofile(%p) $+ $read(%p,%i)) }
  • elseif ($nopath($read(%p,%i)) != $read(%p,%i)) && ($exists($read(%p,%i)) == $true) { did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath($read(%p,%i)) $+ $chr(9) $idtag($read(%p,%i)).title $+ $chr(9) $idtag($read(%p,%i)).artist $+ $chr(9) $idtag($read(%p,%i)).album $+ $chr(9) $duration($idtag($read(%p,%i)).time) $+ $chr(9) $nofile($read(%p,%i)) }
  • inc %i
  • }
  • unset %i
  • }
  • unset %p
  • }
  • elseif ($1- == OK playlist 4 options) { if ($dialog(player_options) == $null) { dialog -mar player_options player_options } }
  • elseif ($1- == OK playlist 5 volume) { if ($dialog(player_vol) == $null) { dialog -mar player_vol player_vol } }
  • elseif ($1- == OK playlist 7 withdraw) && ($did(13).sel != $null) {
  • %s = 1
  • while (%s <= $did(player,13,0).sel) {
  • .timer -m 1 5 did -d player 13 $did(13,%s).sel
  • inc %s
  • }
  • unset %s
  • }
  • elseif ($1- == OK playlist 8 clear) { did -r $dname 13 }
  • elseif ($1- == OK addelem 5 make_pl) { dialog -mar player_playlist player_playlist }
  • elseif ($1- == OK control 3 play) && ($hget(prov,player_pause) != $true) && ($hget(prov,player_file) != $null) { player_play $hget(prov,player_file) }
  • elseif ($1- == OK control 3 play) && ($hget(prov,player_pause) == $true) { hdel prov player_pause | .timerplayer_play -r | .timerplayer_end -r | splay resume }
  • elseif ($1- == OK control 1 previous) && ($calc($hget(prov,player_linesel) - 1) > 1) {
  • .timerplayer_* off
  • splay stop
  • hadd prov player_linesel $calc($hget(prov,player_linesel) - 1)
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
  • %b = $7-
  • player_play %a $+ %b
  • unset %a
  • unset %b
  • }
  • elseif ($1- == OK control 4 stop) { splay stop | .timerplayer_* off | did -a player 8 1 }
  • elseif ($1- == OK control 3 pause) { splay pause | .timerplayer_end -p | .timerplayer_play -p | hadd prov player_pause $true }
  • elseif ($1- == OK control 5 next) {
  • if ($calc($hget(prov,player_linesel) + 1) <= $did(player,13).lines) {
  • .timerplayer_* off
  • splay stop
  • hadd prov player_linesel $calc($hget(prov,player_linesel) + 1)
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
  • %b = $7-
  • player_play %a $+ %b
  • unset %a
  • unset %b
  • }
  • }
  • }
  • }
  • alias player_play {
  • if ($exists($1-) == $true) {
  • if ($insong == $true) { .timerplayer_play off | .timerplayer_end off | splay stop }
  • splay -p " $+ $1- $+ "
  • if ($dialog(player) != $null) && ($did(player,13).sel > 1) { did -u player 13 $did(player,13).sel }
  • if ($dialog(player) != $null) && ($hget(prov,player_linesel) > 1) { .timer -m 1 5 did -c player 13 $hget(prov,player_linesel) }
  • if ($dialog(player) != $null) { did -r player 1 | .timer -m 1 5 did -a player 1 $nopath($1-) - $idtag($1-).title }
  • if ($dialog(player) != $null) { did -r player 9 | .timer -m 1 5 did -a player 9 $idtag($1-).kbps $+ kbps }
  • if ($dialog(player) != $null) { did -r player 10 | .timer -m 1 5 did -a player 10 $duration($idtag($1-).time) }
  • if ($dialog(player) != $null) { did -r player 11 | .timer -m 1 5 did -a player 11 $iif($idtag($1-).year != $null, $idtag($1-).year, $chr(160)) }
  • .timerplayer_end 1 $calc($idtag($1-).time + 1) player_end
  • hadd Mp3 pos 1
  • .timerplayer_play $idtag($1-).time 1 player_pos $idtag($1-).time
  • if ($hget(Mp3,tags) == on) { scid $activecid $eval($hget(Mp3,mess), $iif($eval($active,0) isin $hget(Mp3,mess),2,1)) 10 $+ $iif($idtag($1-).title == $null, $nopath($1-), $idtag($1-).title) $+ $iif($idtag($1-).artist != $null, $chr(160) $+ 14-2 Artist:10 $idtag($1-).artist) $+ $iif($idtag($1-).album != $null, $chr(160) $+ 14-2 Album:10 $idtag($1-).album) 14- 2Time: 10 $+ $duration($idtag($1-).time) }
  • .timer -m 1 5 splay seek 250
  • }
  • else {
  • if ($dialog(player) != $null) { did -r player 1 | .timer -m 1 5 did -a player 1 Mp3 player - An error has occuried with $nopath($1-) }
  • if ($dialog(player) != $null) { did -r player 9 }
  • if ($dialog(player) != $null) { did -r player 10 }
  • if ($dialog(player) != $null) { did -r player 11 }
  • }
  • }
  • alias player_end {
  • if ($dialog(player) != $null) { did -a player 8 1 }
  • if ($hget(mp3,autoplay) == on) {
  • if ($dialog(player) != $null) && ($hget(prov,player_linesel) != $null) && ($did(player,13,$calc($hget(prov,player_linesel) + 1)).text != $null) {
  • tokenize 32 $gettok($did(player,13,$calc($hget(prov,player_linesel) + 1)).text,6,9)
  • %a = $5-
  • tokenize 32 $gettok($did(player,13,$calc($hget(prov,player_linesel) + 1)).text,1,9)
  • %b = $7-
  • hadd prov player_linesel $calc($hget(prov,player_linesel) + 1)
  • player_play %a $+ %b
  • unset %a
  • unset %b
  • }
  • }
  • }
  • alias player_pos {
  • if ($dialog(player) != $null) { did -a player 8 $int($hget(Mp3,pos)) }
  • hadd Mp3 pos $calc($hget(Mp3,pos) + $calc(100 / $1))
  • }
  • alias idtag {
  • if ($exists($1) == $false) { return $false }
  • else {
  • bread " $+ $1 $+ " 0 10 &idtag_1
  • if ($ascii($bvar(&idtag_1,1,3)) == ID3) {
  • bread " $+ $1 $+ " 10 $base($base($bvar(&idtag_1,7,1),10,2,7) $+ $base($bvar(&idtag_1,8,1),10,2,7) $+ $base($bvar(&idtag_1,9,1),10,2,7) $+ $base($bvar(&idtag_1,10,1),10,2,7),2,10) &idtag_2
  • if ($prop == title) { hadd Prov TIT2 $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TIT2).text != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TIT2).text + 10), $hget(Prov, TIT2))), $null) }
  • if ($prop == artist) { hadd Prov TPE1 $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TPE1).text != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TPE1).text + 10), $hget(Prov, TPE1))), $null) }
  • if ($prop == album) { hadd Prov TALB $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TALB) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TALB) + 10), $hget(Prov, TALB))), $null) }
  • if ($prop == year) { hadd Prov TYER $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TYER) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TYER) + 10), $hget(Prov, TYER))), $null) }
  • if ($prop == genre) { hadd Prov TCON $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TCON) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TCON) + 10), $hget(Prov, TCON))), $null) }
  • if ($prop == time) { return $remove($sound($1).length,$right($sound($1).length,3)) }
  • if ($prop == kbps) { return $sound($1).bitrate }
  • if ($prop == version) { return $base($bvar(&idtag_1,4,1),10,16) $+ $chr(46) $+ $base($bvar(&idtag_1,5,1),10,16) }
  • }
  • else {
  • if ($prop == title) { return $iif($sound($1).title == $false, $null, $sound($1).title) }
  • if ($prop == artist) { return $iif($sound($1).artist == $false, $null, $sound($1).artist) }
  • if ($prop == album) { return $iif($sound($1).album == $false, $null, $sound($1).album) }
  • if ($prop == year) { return $iif($sound($1).album == $false, $null, $sound($1).year) }
  • if ($prop == genre) { return $iif($sound($1).album == $false, $null, $sound($1).genre) }
  • if ($prop == time) { return $remove($sound($1).length,$right($sound($1).length,3)) }
  • if ($prop == kbps) { return $sound($1).bitrate }
  • if ($prop == version) { return 1.0 }
  • }
  • }
  • }
  • dialog player_options {
  • title "Mp3 Player - Options"
  • size -1 -1 267 94
  • option pixels
  • check "Display tags info", 2, 14 26 105 20
  • box "Tags", 3, 6 4 254 56
  • combo 4, 124 26 120 100, size drop
  • check "Autoplay items in playlist", 5, 8 68 145 20
  • button "boo", 500, 800 800 10 10, ok
  • }
  • on 1:dialog:player_options:init:0: {
  • echo -j $dll(mdx.dll, SetMircVersion, $version)
  • echo -j $dll(mdx.dll, MarkDialog, $dname)
  • dll mdx.dll SetDialog $dname icon 4 icons.dll
  • if ($hget(Mp3,tags) == on) { did -c $dname 2 }
  • did -a $+ $iif($hget(Mp3,mess) == ame, c) $dname 4 On all channels
  • did -a $+ $iif($hget(Mp3,mess) == describe $eval($active,0), c) $dname 4 On active window
  • if ($hget(Mp3,autoplay) == on) { did -c $dname 5 }
  • }
  • on 1:dialog:player_options:sclick:2: { hadd Mp3 tags $iif($did(2).state == 0, off, on) }
  • on 1:dialog:player_options:sclick:5: { hadd Mp3 autoplay $iif($did(5).state == 0, off, on) }
  • on 1:dialog:player_options:sclick:4: { hadd Mp3 mess $replace($did(4), On all channels, ame, On active window, describe $eval($active,0)) }
  • dialog player_vol {
  • title "Mp3 Player - Volume Seetings"
  • size -1 -1 158 33
  • option dbu
  • list 1, 6 10 147 16, size
  • box "Volume adjusting", 2, 3 2 153 28
  • button "boo", 500, 800 800 10 10, ok
  • }
  • on 1:dialog:player_vol:init:0: {
  • echo -j $dll(mdx.dll, SetMircVersion, $version)
  • echo -j $dll(mdx.dll, MarkDialog, $dname)
  • echo -j $dll(mdx.dll, SetControlMDX, 1 TrackBar tooltips noticks > bars.mdx)
  • dll mdx.dll SetDialog $dname icon 5 icons.dll
  • did -i $dname 1 1 params $vol(mp3) 1 65000 * 1 * * *
  • }
  • on 1:dialog:player_vol:sclick:1: { tokenize 32 $did(1,1).text | if ($9-10 == end up) { vol -p $1 } }
  • dialog player_playlist {
  • title "Mp3 Player - Playlist Creator"
  • size -1 -1 316 234
  • option pixels
  • text "Name of playlist:", 1, 7 8 86 16
  • edit "", 2, 99 6 211 21, autohs
  • list 3, 12 47 294 151, size
  • box "Playlist items", 4, 6 31 306 197
  • button "Create", 5, 229 202 75 20
  • button "boo", 500, 800 800 10 10, ok
  • }
  • on 1:dialog:player_playlist:init:0: {
  • echo -j $dll(mdx.dll, SetMircVersion, $version)
  • echo -j $dll(mdx.dll, MarkDialog, $dname)
  • echo -j $dll(mdx.dll, SetControlMDX, 3 listview showsel infotip report sortascending > views.mdx)
  • dll mdx.dll SetDialog $dname icon 14 icons.dll
  • did -i $dname 3 1 headerdims 150 150 100 100 80 0
  • did -i $dname 3 1 headertext + 0 File $+ $chr(9) Title $+ $chr(9) Artist $+ $chr(9) Album $+ $chr(9) Time $+ $chr(9) rep
  • did -i $dname 3 1 seticon list 14,icons.dll
  • }
  • on 1:dialog:player_playlist:sclick:3: {
  • if ($gettok($did(3,1),1,32) == rclick) {
  • tokenize 32 $dll(popups.dll,Popup,player_playlist +R $mouse.dx $mouse.dy)
  • if ($1- == OK pl_add 1 pl_dir) {
  • %f = $sdir($mircdir, Choose a Directory, Add...)
  • %i = 1
  • hadd Prov files_pl $findfile(%f,*.mp3,0,0)
  • while (%i <= $hget(Prov,files_pl)) { %n = $findfile(%f,*.mp3,%i,0) | did -a player_playlist 3 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n) | inc %i }
  • unset %i
  • unset %f
  • unset %n
  • }
  • elseif ($1- == OK pl_add 2 pl_file) {
  • %n = $sfile($mircdir\*.mp3,Choose a Mp3 File,Add...)
  • if (%n != $null) && ($exists(%n) == $true) {
  • did -a player_playlist 3 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n)
  • unset %n
  • }
  • }
  • elseif ($1- == OK player_playlist 3 pl_with) && ($did(3).sel != $null) { did -d $dname 3 $did(3).sel }
  • elseif ($1- == OK player_playlist 4 pl_clear) { did -r $dname 3 }
  • }
  • }
  • on 1:dialog:player_playlist:sclick:5: {
  • if ($did($dname,2) == $null) { echo -j $dll(common.dll, MsgBox, You must specify a name for your playlist ! > MB_OK + MB_ICONWARNING > Error) | halt }
  • else {
  • %d = $sdir($mircdir, Save playlist in..., Save)
  • %i = 2
  • if ($exists(%d $+ $did(2) $+ .m3u) == $true) && ($dll(common.dll, MsgBox, File aleready exists: Overwrite ? > MB_YESNO + MB_ICONQUESTION > Overwriting) == IDYES) {
  • write -c " $+ %d $+ $did(2) $+ .m3u"
  • while (%i <= $did(3).lines) {
  • tokenize 9 $did(3,%i).text
  • write " $+ %d $+ $did(2) $+ .m3u" $right($6,-8) $+ $right($1,-12)
  • inc %i
  • }
  • unset %i
  • unset %d
  • echo -j $dll(common.dll, MsgBox, Done > MB_OK + MB_ICONASTERIX > Done)
  • halt
  • }
  • if ($exists(%d $+ $did(2) $+ .m3u) == $false) {
  • while (%i <= $did(3).lines) {
  • tokenize 9 $did(3,%i).text
  • write " $+ %d $+ $did(2) $+ .m3u" $right($6,-8) $+ $right($1,-12)
  • inc %i
  • }
  • unset %i
  • unset %d
  • echo -j $dll(common.dll, MsgBox, Done > MB_OK + MB_ICONASTERIX > Done)
  • halt
  • }
  • }
  • }
;This addon needs mdx.dll (with associated .mdx files) popups.dll and common.dll to work correctly
:icons.dll is the icons library, it may conatains icons wich are not used with this addon because i used this library for some others systems in my script.
;mp3.tos is the save file for mp3 hash table
;For more info about instalation, please refer to readme.txt
;Enjoy :p
;                Seregon

alias -l echo { if ($regex($1,^-j) == 1) { haltdef } | else { echo $1- } }
alias sF2 { if ($dialog(player) == $null) { dialog -md player player } }
on 1:start: { 
  hmake mp3 20 
  if ($exists(mp3.tos) == $true) { hload mp3 mp3.tos } 
  hmake prov 50 
  echo -j $dll(popups.dll, New, playlist 16 16)
  dll popups.dll LoadImg playlist 1 icon small 1,icons.dll
  dll popups.dll LoadImg playlist 2 icon small 3,icons.dll
  dll popups.dll LoadImg playlist 3 icon small 4,icons.dll
  dll popups.dll LoadImg playlist 4 icon small 5,icons.dll
  dll popups.dll LoadImg playlist 5 icon small 6,icons.dll
  dll popups.dll LoadImg playlist 6 icon small 16,icons.dll
  echo -j $dll(popups.dll, AddItem, playlist 1 +> 2 2 Control $cr control) $dll(popups.dll, AddItem, playlist 2 +> 1 1 Add... $cr addelem) $dll(popups.dll, AddItem, playlist 3) $dll(popups.dll, AddItem, playlist 4 3 3 Options $cr options) $dll(popups.dll, AddItem, playlist 5 4 4 Volume $cr volume) $dll(popups.dll, AddItem, playlist 6)
  echo -j $dll(popups.dll, AddItem, playlist 8 5 5 Withdraw selected $cr withdraw) $dll(popups.dll, AddItem, playlist 9 6 6 Clear playlist $cr clear),2),$null)
  echo -j $dll(popups.dll, New, control 16 16)
  dll popups.dll LoadImg control 1 icon small 7,icons.dll
  dll popups.dll LoadImg control 2 icon small 8,icons.dll
  dll popups.dll LoadImg control 3 icon small 9,icons.dll
  dll popups.dll LoadImg control 4 icon small 10,icons.dll
  dll popups.dll LoadImg control 5 icon small 11,icons.dll
  dll popups.dll LoadImg control 6 icon small 12,icons.dll
  dll popups.dll LoadImg control 7 icon small 13,icons.dll
  echo -j $dll(popups.dll, AddItem, control 1 1 1 Previous $cr previous) $dll(popups.dll, AddItem, control 3 3 3 Play $cr play) $dll(popups.dll, AddItem, control 4 4 4 Pause $cr pause) $dll(popups.dll, AddItem, control 5 7 7 Stop $cr stop) $dll(popups.dll, AddItem, control 7 6 6 Next $cr next)
  echo -j $dll(popups.dll, New, addelem 16 16)
  dll popups.dll LoadImg addelem 1 icon small 0,icons.dll
  dll popups.dll LoadImg addelem 2 icon small 2,icons.dll
  dll popups.dll LoadImg addelem 3 icon small 14,icons.dll
  dll popups.dll LoadImg addelem 4 icon small 15,icons.dll
  echo -j $dll(popups.dll, AddItem, addelem 1 2 2 Add File $cr file) $dll(popups.dll, AddItem, addelem 2 1 1 Add Directory $cr rep) $dll(popups.dll, AddItem, addelem 3) $dll(popups.dll, AddItem, addelem 4 4 4 Add playlist $cr rep) $dll(popups.dll, AddItem, addelem 5 3 3 Make playlist $cr make_pl)
  echo -j $dll(popups.dll, New, player_playlist 16 16)
  dll popups.dll LoadImg player_playlist 1 icon small 1,icons.dll
  dll popups.dll LoadImg player_playlist 2 icon small 6,icons.dll
  dll popups.dll LoadImg player_playlist 3 icon small 16,icons.dll
  echo -j $dll(popups.dll, AddItem,  player_playlist 1 +> 1 1 Add... $cr pl_add) $dll(popups.dll, AddItem,  player_playlist 2) $dll(popups.dll, AddItem,  player_playlist 3 2 2 Withdraw selected $cr pl_with) $dll(popups.dll, AddItem,  player_playlist 4 3 3 Clear list $cr pl_clear)
  echo -j $dll(popups.dll, New, pl_add 16 16)
  dll popups.dll LoadImg pl_add 1 icon small 0,icons.dll
  dll popups.dll LoadImg pl_add 2 icon small 2,icons.dll
  echo -j $dll(popups.dll, AddItem,  pl_add 1 2 2 File $cr pl_file) $dll(popups.dll, AddItem,  pl_add 1 1 1 Directory $cr pl_dir) 
}

on 1:exit: { hsave -o mp3 mp3.tos | hfree mp3  | hfree prov }
dialog player {
  title "Mp3 Player"
  size -1 -1 169 234
  option dbu
  edit "", 1, 4 7 162 10, read autohs center
  button "9", 2, 5 20 21 10
  button "4", 4, 74 20 21 10
  button ";", 6, 98 20 21 10
  button ":", 7, 144 20 21 10
  text "", 8, 5 33 161 8
  edit "", 9, 5 44 44 10, read autohs center
  edit "", 10, 62 44 44 10, read autohs center
  edit "", 11, 120 44 44 10, read autohs center
  box "", 12, 2 1 166 57
  list 13, 6 70 159 157, sort size extsel
  box "Playlist", 18, 3 62 165 169
  button "<", 19, 51 20 21 10
  button "7", 3, 28 20 21 10
  button "8", 5, 121 20 21 10
  menu "Mp3 Player", 14
  item "Seetings", 15, 14
  button "boo", 50, 800 800 10 10, ok
}
on 1:dialog:player:init:0: {
  did -a $dname 1 Mp3 Player
  echo -j $dll(mdx.dll, SetMircVersion, $version)
  echo -j $dll(mdx.dll, MarkDialog, $dname)
  dll mdx.dll SetDialog $dname icon 5 icons.dll
  dll mdx.dll SetFont 2,3,4,5,6,7,19 18 400 Webdings
  echo -j $dll(mdx.dll, SetControlMDX, 8 ProgressBar smooth > ctl_gen.mdx)
  did -i $dname 8 1 bgcolor $rgb(61,123,218)
  did -a $dname 8 0
  echo -j $dll(mdx.dll, SetControlMDX, 13 listview showsel infotip report sortascending > views.mdx)
  did -i $dname 13 1 headerdims 150 150 100 100 80 0
  did -i $dname 13 1 headertext + 0 File $+ $chr(9) Title $+ $chr(9) Artist $+ $chr(9) Album $+ $chr(9) Time $+ $chr(9) rep
  did -i $dname 13 1 seticon list 14,icons.dll
}
on 1:dialog:player:menu:15:{ if ($dialog(player_options) == $null) { dialog -ma player_options player_options } }
on 1:dialog:player:sclick:4: { 
  if ($hget(prov,player_pause) != $true) && ($hget(prov,player_file) != $null) { player_play $hget(prov,player_file) } 
  elseif ($hget(prov,player_pause) == $true) { hdel prov player_pause | .timerplayer_play -r | .timerplayer_end -r | splay resume }
}
on 1:dialog:player:sclick:2: { 
  if ($calc($hget(prov,player_linesel) - 1) > 1) { 
    .timerplayer_* off 
    splay stop 
    hadd prov player_linesel $calc($hget(prov,player_linesel) - 1) 
    tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9) 
    %a = $5- 
    tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
    %b = $7- 
    player_play %a $+ %b
    unset %a
    unset %b
  }
}
on 1:dialog:player:sclick:6: { splay pause | .timerplayer_end -p | .timerplayer_play -p | hadd prov player_pause $true }
on 1:dialog:player:sclick:19: { splay stop | .timerplayer_* off | did -a player 8 1 | if ($hget(prov,player_pause) == $true) { hdel prov player_pause } }
on 1:dialog:player:sclick:7: { 
  if ($calc($hget(prov,player_linesel) + 1) <= $did(player,13).lines) { 
    .timerplayer_* off 
    splay stop 
    hadd prov player_linesel $calc($hget(prov,player_linesel) + 1) 
    tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9) 
    %a = $5- 
    tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
    %b = $7- 
    player_play %a $+ %b
    unset %a
    unset %b
  }
}
on 1:dialog:player:sclick:13: { 
  if ($gettok($did(13,1),1,32) == sclick) {
    hadd prov player_linesel $did(13).sel
    tokenize 32 $gettok($did(13,$did($dname,13).sel).text,6,9) 
    %a = $5- 
    tokenize 32 $gettok($did(13,$did($dname,13).sel).text,1,9)
    %b = $7- 
    hadd prov player_file %a $+ %b
    unset %a 
    unset %b
  }
  if ($gettok($did(13,1),1,32) == rclick) { 
    tokenize 32 $dll(popups.dll,Popup,playlist +R $mouse.dx $mouse.dy) 
    if ($1- == OK addelem 1 file) { 
      %n = $sfile($mircdir\*.mp3,Choose a Mp3 File,Add...)
      if (%n != $null) && ($exists(%n) == $true) {
        did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n)
      }
      unset %n
    }
    elseif ($1- == OK addelem 2 rep) { 
      %f = $sdir($mircdir, Choose a Directory, Add...)
      %i = 1
      hadd Prov files_mp3 $findfile(%f,*.mp3,0,0)
      while (%i <= $hget(Prov,files_mp3)) { %n = $findfile(%f,*.mp3,%i,0) | did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n) | inc %i }
      unset %i
      unset %f
      unset %n
    }
    elseif ($1- == OK addelem 4 rep) { 
      %p = $sfile($mircdir\*.m3u, Select a valid playlist file, Add...)
      if ($exists(%p) == $true) {
        %i = 1
        while (%i <= $lines(%p)) {
          if ($nopath($read(%p,%i)) == $read(%p,%i)) && ($exists($nofile(%p) $+ $read(%p,%i)) == $true) { did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath($nofile(%p) $+ $read(%p,%i)) $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).title $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).artist $+ $chr(9) $idtag($nofile(%p) $+ $read(%p,%i)).album $+ $chr(9) $duration($idtag($nofile(%p) $+ $read(%p,%i)).time) $+ $chr(9) $nofile($nofile(%p) $+ $read(%p,%i)) }
          elseif ($nopath($read(%p,%i)) != $read(%p,%i)) && ($exists($read(%p,%i)) == $true) { did -a player 13 0 1 $chr(32) $+ $chr(45) $nopath($read(%p,%i)) $+ $chr(9) $idtag($read(%p,%i)).title $+ $chr(9) $idtag($read(%p,%i)).artist $+ $chr(9) $idtag($read(%p,%i)).album $+ $chr(9) $duration($idtag($read(%p,%i)).time) $+ $chr(9) $nofile($read(%p,%i)) }
          inc %i
        } 
        unset %i
      }
      unset %p
    }
    elseif ($1- == OK playlist 4 options) { if ($dialog(player_options) == $null) { dialog -mar player_options player_options } }
    elseif ($1- == OK playlist 5 volume) { if ($dialog(player_vol) == $null) { dialog -mar player_vol player_vol } }
    elseif ($1- == OK playlist 7 withdraw) && ($did(13).sel != $null) { 
      %s = 1
      while (%s <= $did(player,13,0).sel) { 
        .timer -m 1 5 did -d player 13 $did(13,%s).sel 
        inc %s 
      }
      unset %s 
    }
    elseif ($1- == OK playlist 8 clear) { did -r $dname 13 }
    elseif ($1- == OK addelem 5 make_pl) { dialog -mar player_playlist player_playlist }
    elseif ($1- == OK control 3 play) && ($hget(prov,player_pause) != $true) && ($hget(prov,player_file) != $null) { player_play $hget(prov,player_file) }
    elseif ($1- == OK control 3 play) && ($hget(prov,player_pause) == $true) { hdel prov player_pause | .timerplayer_play -r | .timerplayer_end -r | splay resume }
    elseif ($1- == OK control 1 previous) && ($calc($hget(prov,player_linesel) - 1) > 1) {  
      .timerplayer_* off 
      splay stop 
      hadd prov player_linesel $calc($hget(prov,player_linesel) - 1) 
      tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9) 
      %a = $5- 
      tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
      %b = $7- 
      player_play %a $+ %b
      unset %a
      unset %b
    }
    elseif ($1- == OK control 4 stop) { splay stop | .timerplayer_* off | did -a player 8 1 }
    elseif ($1- == OK control 3 pause) { splay pause | .timerplayer_end -p | .timerplayer_play -p | hadd prov player_pause $true }
    elseif ($1- == OK control 5 next) {
      if ($calc($hget(prov,player_linesel) + 1) <= $did(player,13).lines) { 
        .timerplayer_* off 
        splay stop 
        hadd prov player_linesel $calc($hget(prov,player_linesel) + 1) 
        tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,6,9) 
        %a = $5- 
        tokenize 32 $gettok($did(13,$hget(prov,player_linesel)).text,1,9)
        %b = $7- 
        player_play %a $+ %b
        unset %a
        unset %b
      } 
    }
  }
}
alias player_play {
  if ($exists($1-) == $true) {
    if ($insong == $true) { .timerplayer_play off | .timerplayer_end off | splay stop }
    splay -p " $+ $1- $+ "
    if ($dialog(player) != $null) && ($did(player,13).sel > 1) { did -u player 13 $did(player,13).sel }
    if ($dialog(player) != $null) && ($hget(prov,player_linesel) > 1) { .timer -m 1 5 did -c player 13 $hget(prov,player_linesel) }
    if ($dialog(player) != $null) { did -r player 1 | .timer -m 1 5 did -a player 1 $nopath($1-) - $idtag($1-).title }
    if ($dialog(player) != $null) { did -r player 9 | .timer -m 1 5 did -a player 9 $idtag($1-).kbps $+ kbps }
    if ($dialog(player) != $null) { did -r player 10 | .timer -m 1 5 did -a player 10 $duration($idtag($1-).time) }
    if ($dialog(player) != $null) { did -r player 11 | .timer -m 1 5 did -a player 11 $iif($idtag($1-).year != $null, $idtag($1-).year, $chr(160)) }
    .timerplayer_end 1 $calc($idtag($1-).time + 1) player_end
    hadd Mp3 pos 1
    .timerplayer_play $idtag($1-).time 1 player_pos $idtag($1-).time
    if ($hget(Mp3,tags) == on) { scid $activecid $eval($hget(Mp3,mess), $iif($eval($active,0) isin $hget(Mp3,mess),2,1)) 10 $+ $iif($idtag($1-).title == $null, $nopath($1-), $idtag($1-).title) $+ $iif($idtag($1-).artist != $null, $chr(160) $+ 14-2 Artist:10 $idtag($1-).artist) $+ $iif($idtag($1-).album != $null, $chr(160) $+ 14-2 Album:10 $idtag($1-).album) 14- 2Time: 10 $+ $duration($idtag($1-).time) }
    .timer -m 1 5 splay seek 250
  }
  else {
    if ($dialog(player) != $null) { did -r player 1 | .timer -m 1 5 did -a player 1 Mp3 player - An error has occuried with $nopath($1-) }
    if ($dialog(player) != $null) { did -r player 9 }
    if ($dialog(player) != $null) { did -r player 10 }
    if ($dialog(player) != $null) { did -r player 11 }
  }
}
alias player_end {
  if ($dialog(player) != $null) { did -a player 8 1 }
  if ($hget(mp3,autoplay) == on) {
    if ($dialog(player) != $null) && ($hget(prov,player_linesel) != $null) && ($did(player,13,$calc($hget(prov,player_linesel) + 1)).text != $null) { 
      tokenize 32 $gettok($did(player,13,$calc($hget(prov,player_linesel) + 1)).text,6,9) 
      %a = $5- 
      tokenize 32 $gettok($did(player,13,$calc($hget(prov,player_linesel) + 1)).text,1,9)
      %b = $7- 
      hadd prov player_linesel $calc($hget(prov,player_linesel) + 1)
      player_play %a $+ %b
      unset %a
      unset %b
    }
  }
}
alias player_pos {
  if ($dialog(player) != $null) { did -a player 8 $int($hget(Mp3,pos)) }
  hadd Mp3 pos $calc($hget(Mp3,pos) + $calc(100 / $1))
}
alias idtag {
  if ($exists($1) == $false) { return $false }
  else {
    bread " $+ $1 $+ " 0 10 &idtag_1
    if ($ascii($bvar(&idtag_1,1,3)) == ID3) {
      bread " $+ $1 $+ " 10 $base($base($bvar(&idtag_1,7,1),10,2,7) $+ $base($bvar(&idtag_1,8,1),10,2,7) $+ $base($bvar(&idtag_1,9,1),10,2,7) $+ $base($bvar(&idtag_1,10,1),10,2,7),2,10) &idtag_2
      if ($prop == title) { hadd Prov TIT2 $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TIT2).text + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TIT2).text != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TIT2).text + 10), $hget(Prov, TIT2))), $null) }
      if ($prop == artist) { hadd Prov TPE1 $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TPE1).text + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TPE1).text != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TPE1).text + 10), $hget(Prov, TPE1))), $null) }
      if ($prop == album) { hadd Prov TALB $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TALB) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TALB) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TALB) + 10), $hget(Prov, TALB))), $null) }
      if ($prop == year) { hadd Prov TYER $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TYER) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TYER) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TYER) + 10), $hget(Prov, TYER))), $null) }
      if ($prop == genre) { hadd Prov TCON $base($base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 4), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 5), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 6), 1),10,16) $+ $base($bvar(&idtag_2, $calc($bfind(&idtag_2,1,TCON) + 7), 1),10,16),16,10) | return $iif($bfind(&idtag_2,1,TCON) != 0, $ascii($bvar(&idtag_2, $calc($bfind(&idtag_2, 1, TCON) + 10), $hget(Prov, TCON))), $null) }
      if ($prop == time) { return $remove($sound($1).length,$right($sound($1).length,3)) }
      if ($prop == kbps) { return $sound($1).bitrate }
      if ($prop == version) { return $base($bvar(&idtag_1,4,1),10,16) $+ $chr(46) $+ $base($bvar(&idtag_1,5,1),10,16) }
    }
    else {
      if ($prop == title) { return $iif($sound($1).title == $false, $null, $sound($1).title) }
      if ($prop == artist) { return $iif($sound($1).artist == $false, $null, $sound($1).artist) }
      if ($prop == album) { return $iif($sound($1).album == $false, $null, $sound($1).album) }
      if ($prop == year) { return $iif($sound($1).album == $false, $null, $sound($1).year) }
      if ($prop == genre) { return $iif($sound($1).album == $false, $null, $sound($1).genre) }
      if ($prop == time) { return $remove($sound($1).length,$right($sound($1).length,3)) }
      if ($prop == kbps) { return $sound($1).bitrate }
      if ($prop == version) { return 1.0 }
    }
  }
}
dialog player_options {
  title "Mp3 Player - Options"
  size -1 -1 267 94
  option pixels
  check "Display tags info", 2, 14 26 105 20
  box "Tags", 3, 6 4 254 56
  combo 4, 124 26 120 100, size drop
  check "Autoplay items in playlist", 5, 8 68 145 20
  button "boo", 500, 800 800 10 10, ok
}
on 1:dialog:player_options:init:0: { 
  echo -j $dll(mdx.dll, SetMircVersion, $version)
  echo -j $dll(mdx.dll, MarkDialog, $dname)
  dll mdx.dll SetDialog $dname icon 4 icons.dll
  if ($hget(Mp3,tags) == on) { did -c $dname 2 }
  did -a $+ $iif($hget(Mp3,mess) == ame, c) $dname 4 On all channels
  did -a $+ $iif($hget(Mp3,mess) == describe $eval($active,0), c) $dname 4 On active window
  if ($hget(Mp3,autoplay) == on) { did -c $dname 5 }
}
on 1:dialog:player_options:sclick:2: { hadd Mp3 tags $iif($did(2).state == 0, off, on) }
on 1:dialog:player_options:sclick:5: { hadd Mp3 autoplay $iif($did(5).state == 0, off, on) }
on 1:dialog:player_options:sclick:4: { hadd Mp3 mess $replace($did(4), On all channels, ame, On active window, describe $eval($active,0)) }
dialog player_vol {
  title "Mp3 Player - Volume Seetings"
  size -1 -1 158 33
  option dbu
  list 1, 6 10 147 16, size
  box "Volume adjusting", 2, 3 2 153 28
  button "boo", 500, 800 800 10 10, ok
}
on 1:dialog:player_vol:init:0: {
  echo -j $dll(mdx.dll, SetMircVersion, $version)
  echo -j $dll(mdx.dll, MarkDialog, $dname)
  echo -j $dll(mdx.dll, SetControlMDX, 1 TrackBar tooltips noticks > bars.mdx)
  dll mdx.dll SetDialog $dname icon 5 icons.dll
  did -i $dname 1 1 params $vol(mp3) 1 65000 * 1 * * *
}
on 1:dialog:player_vol:sclick:1: { tokenize 32 $did(1,1).text | if ($9-10 == end up) { vol -p $1 } }
dialog player_playlist {
  title "Mp3 Player - Playlist Creator"
  size -1 -1 316 234
  option pixels
  text "Name of playlist:", 1, 7 8 86 16
  edit "", 2, 99 6 211 21, autohs
  list 3, 12 47 294 151, size
  box "Playlist items", 4, 6 31 306 197
  button "Create", 5, 229 202 75 20
  button "boo", 500, 800 800 10 10, ok
}
on 1:dialog:player_playlist:init:0: {
  echo -j $dll(mdx.dll, SetMircVersion, $version)
  echo -j $dll(mdx.dll, MarkDialog, $dname)
  echo -j $dll(mdx.dll, SetControlMDX, 3 listview showsel infotip report sortascending > views.mdx)
  dll mdx.dll SetDialog $dname icon 14 icons.dll
  did -i $dname 3 1 headerdims 150 150 100 100 80 0
  did -i $dname 3 1 headertext + 0 File $+ $chr(9) Title $+ $chr(9) Artist $+ $chr(9) Album $+ $chr(9) Time $+ $chr(9) rep
  did -i $dname 3 1 seticon list 14,icons.dll
}
on 1:dialog:player_playlist:sclick:3: { 
  if ($gettok($did(3,1),1,32) == rclick) { 
    tokenize 32 $dll(popups.dll,Popup,player_playlist +R $mouse.dx $mouse.dy) 
    if ($1- == OK pl_add 1 pl_dir) { 
      %f = $sdir($mircdir, Choose a Directory, Add...)
      %i = 1
      hadd Prov files_pl $findfile(%f,*.mp3,0,0)
      while (%i <= $hget(Prov,files_pl)) { %n = $findfile(%f,*.mp3,%i,0) | did -a player_playlist 3 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n) | inc %i }
      unset %i
      unset %f
      unset %n
    }
    elseif ($1- == OK pl_add 2 pl_file) { 
      %n = $sfile($mircdir\*.mp3,Choose a Mp3 File,Add...)
      if (%n != $null) && ($exists(%n) == $true) {
        did -a player_playlist 3 0 1 $chr(32) $+ $chr(45) $nopath(%n) $+ $chr(9) $idtag(%n).title $+ $chr(9) $idtag(%n).artist $+ $chr(9) $idtag(%n).album $+ $chr(9) $duration($idtag(%n).time) $+ $chr(9) $nofile(%n)
        unset %n
      }
    }
    elseif ($1- == OK player_playlist 3 pl_with) && ($did(3).sel != $null) { did -d $dname 3 $did(3).sel }
    elseif ($1- == OK player_playlist 4 pl_clear) { did -r $dname 3 }
  }
}
on 1:dialog:player_playlist:sclick:5: {
  if ($did($dname,2) == $null) { echo -j $dll(common.dll, MsgBox, You must specify a name for your playlist ! > MB_OK + MB_ICONWARNING > Error) | halt }
  else {
    %d = $sdir($mircdir, Save playlist in..., Save)
    %i = 2
    if ($exists(%d $+ $did(2) $+ .m3u) == $true) && ($dll(common.dll, MsgBox, File aleready exists: Overwrite ? > MB_YESNO + MB_ICONQUESTION > Overwriting) == IDYES) { 
      write -c " $+ %d $+ $did(2) $+ .m3u"
      while (%i <= $did(3).lines) {
        tokenize 9 $did(3,%i).text
        write " $+ %d $+ $did(2) $+ .m3u" $right($6,-8)  $+ $right($1,-12)
        inc %i
      }
      unset %i
      unset %d
      echo -j $dll(common.dll, MsgBox, Done > MB_OK + MB_ICONASTERIX > Done)
      halt
    }
    if ($exists(%d $+ $did(2) $+ .m3u) == $false) {
      while (%i <= $did(3).lines) {
        tokenize 9 $did(3,%i).text
        write " $+ %d $+ $did(2) $+ .m3u" $right($6,-8)  $+ $right($1,-12)
        inc %i
      }
      unset %i
      unset %d
      echo -j $dll(common.dll, MsgBox, Done > MB_OK + MB_ICONASTERIX > Done)
      halt
    }
  }
}

 Conclusion

Pour les infos sur le fonctionnement, j'ai mis un readme.txt dans le fichier .zip
Note: cet addon utilise le mvtr, snippest que j'ai déja publié.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
  • BARS.MDXTélécharger ce fichier [Réservé aux membres club]26 112 octets
  • common.dllTélécharger ce fichier [Réservé aux membres club]386 048 octets
  • CTL_GEN.MDXTélécharger ce fichier [Réservé aux membres club]34 304 octets
  • dialog.mdxTélécharger ce fichier [Réservé aux membres club]19 968 octets
  • icons.dllTélécharger ce fichier [Réservé aux membres club]63 752 octets
  • MDX.DLLTélécharger ce fichier [Réservé aux membres club]42 496 octets
  • mp3.tosTélécharger ce fichier [Réservé aux membres club]56 octets
  • mp3_player.mrcTélécharger ce fichier [Réservé aux membres club]Voir ce fichier22 833 octets
  • POPUPS.DLLTélécharger ce fichier [Réservé aux membres club]22 528 octets
  • readme.txtTélécharger ce fichier [Réservé aux membres club]Voir ce fichier183 octets
  • screenshot.JPGTélécharger ce fichier [Réservé aux membres club]Voir ce fichier88 167 octets
  • VIEWS.MDXTélécharger ce fichier [Réservé aux membres club]53 760 octets

Télécharger le zip


 Sources du même auteur

SNIPPET: /DRAWMIX
Source avec Zip METEOCONSULT
Source avec Zip BATNAV: JEU DE BATAILLE NAVALE POUR MIRC
SNIPPET - /DRAWTRANSP
SNIPPET: INTERCONNECTION SYSTEM

 Sources de la même categorie

BLACKLIST PSEUDOS/MASKS par usurpateur
Source avec une capture [XCHAT] ANTI KICK / AWAY C++ par GeroXXXX
JEU DU CODE par alanpersonproject
SERVEUR FTP par hisoka2501
BANNIR LES AGES, LES HOMMES, LES FEMMES ET PSEUDO AVEC CHIFF... par cougar_du_havre

 Sources en rapport avec celle ci

MP3 SIMPLE EN MOINS DE 100 LIGNES MEME SI C'EST DU DEJA VUE par archeloga
Source avec une capture (MP3 PLAYER) par Mc_AbBeR
LECTEUR MP3 BY MC_ABBER par Abber
Source avec Zip Source avec une capture MP3 PLAYER par Dark-Dragoon
Source avec Zip -MP3 PLAYER- par EXoDi4

Commentaires et avis

Commentaire de jhd le 03/08/2003 18:45:43

vi po mal

Commentaire de lemec le 04/08/2003 10:26:24

Heu , il est bien mais j'ai une kestion , ki ne porte pas sur le lecteur mp3 , j'aimeré savoir ou tu as trouver tes themes windows stp :/
merci

Commentaire de Seregon le 04/08/2003 11:14:58

www.themexp.org tu dl le programme Theme XP et le theme luminair et tu install le theme a partir du programme ^^

Commentaire de b0uH le 05/08/2003 07:42:00

wow bravo :)

Commentaire de vorador25 le 05/08/2003 14:47:52

moi aussi g une kestion portan sur e theme windows , jen est telecharger sur le site ke ta dit mais j'arrive pas a les faire marcher . si tu pour m'expliker ou me donner une adreesse de site en francai

Commentaire de b0uH le 05/08/2003 16:28:13

vorador25&gt; www.astuces-win.com :)

Commentaire de coca95 le 06/08/2003 10:24:48

vous avez reussi a utilisé le théme parce ke moi j'y arrive pa LoL!
si quelqu'un pouvai m'aider se serai bien !

Commentaire de Seregon le 06/08/2003 16:00:55

Bon pour instaler le theme vous DLez le zip sur www.themexp.org
Ensuite sur ce meme site vous allez ds la rubrike "How to install"
Vous DLez TGsoft Theme XP et vous l'installez
Vous lancez Theme XP vous allez ds visual Style &gt; Add a new style &gt; et vous seectionnez le .zip
Ensuite vous faites apply theme et c bon ^^

Commentaire de BlackFantasy le 08/12/2003 14:43:50

Beacoup de dlls tu dis, lol ( à par MsgBox.. )
Mdx: listview, trackbar & toolbar
C'est tout ;)

Crois-moi, tu n'a pas utilisé beacoup de dlls par raport à certain ;)
Sinon ben, c'est du bon coding :)

Bonne continuation seregon

PS: à la place de tes edit, preferes les text, c'est plus estetique

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Un mp3 et dcc auto [ par romeomd ] VincentBonjour, je suis a la recher d'un addons, quand qqun va dans mon pv, il fait !Musiquealors la, une liste de musique s'affiche, et il fais son c Pour ceux qui aiment écouter la musique en tchattant [ par Bestdoud ] Cela fait quelque temps que je réalise un lecteur mp3 en picwin. venez le découvrir à l'adresse suivante: http://amigagaamp.free.fr voici ces caract Lecteur MP3 capable de lire des fichiers sons distants [ par cyclopdev ] Voilà un défi :est-il possible de faire un lecteur MP3 capable de lire des fichiers hébergés sur une page web, le tout pas trop lourd et entièrement m Lecteur Mp3 [ par titeuf28310 ] Bonjour,A chaque lecteur mp3 trouver sur le site, meme les mieux noté, fait planter mon script. je comprend pas pourquoi (mon mirc est le 6.16).Il a t probleme avec un remote pr mp3 !!!!!!!! [ par wizord ] alrs voila le pb .... g un remote pr lire les fichier mp3 par input ... je tape par exemple : !mp3 blable et mon remote est chargé de me trouve la mu je voudrai faire un lecteur MP3 et MIDI (si possible) [ par bibi_81 ] Voila jai deja tout di je voudrais faire un lecteur MP &gt;ET&lt; MIDI siouplait ... Deja me demanderez vous le formtat MIDI est peu repandu NON !!moi musique de démarage [ par killersbrothers ] killersbrothersslt!!je pourait savoir comment on met un musique au démarage du script jai completement oublié Probléme fichier mp3 [ par Raziell ] Bonjour à tous,J'ai créé un lecteur mp3, mais je n'arrive pas a faire " lire " mIRC les fichier .mp3 un par un !Si quelqu'un sais comment il faut fair musique de debut pr un script :D [ par bibi_81 ] Je voudrais savoir comment faire pour que au lancement de mon script il y ai une musique qui se joue ...? Merci ce serait sympa de repondre tres vite Remote mp3 et commande play fichier.txt [ par PALOMETTE ] BonjourJ'ai install&#233; un lecteur mp3 en remote qui fonctionne correctement.Le probl&#232;me, c 'est que je ne peux plus utiliser la commande /play


Nos sponsors


Sondage...

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,686 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales