Et encore un mp3 player ;p

Description

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 / Exemple :


;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é.

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.