mp3

By Kobra on Nov 25, 2004

just type /mp3 select the directory and there you go. I recomend cdex (search on google) converts cds to mp3

alias mp3 {
  if (!$isdir(%mp3.dir)) { %mp3.dir = $$sdir($mircdir,Select Mp3 Directory) }
  write -c mp3list.txt
  var %i = $ticks
  .fopen mp3list mp3list.txt
  echo -qa * Listing mp3s..
    var %x = $findfile($+(",%mp3.dir,"),*.mp3,0,.fwrite -n mp3list $1-)
  .fclose mp3list
  echo -qa $calc(($ticks - %i) /1000) second(s)
  dialog -m mp3 mp3
}

dialog mp3 {
  title "Mp3 Player"
  size -1 -1 119 136
  option dbu
  list 1, 1 1 117 120, size
  text "", 2, 2 123 50 8
  button "Close/Stop", 3, 81 123 37 12, cancel
}
on *:dialog:mp3:*:*:{
  var %x,%i
  if ($devent == init) {
      .fopen mp3list mp3list.txt
    while !$feof {
            inc %i
          %x = $fread(mp3list)
      if (%x) did -a mp3 1 $remove($nopath(%x),.mp3)
    }
    did -a mp3 2 %i mp3s
  }
  if ($devent == dclick) && ($did == 1) {

    .fseek -l mp3list $did(1).sel
    .splay $fread(mp3list)
  }
  if ($devent == close) {
    splay stop
    .fclose mp3list
  }
}

Comments

Sign in to comment.
Yoinx   -  Dec 13, 2004

you could also add an editbox to your dialog with for the path and just set it through there.

 Respond  
Kobra   -  Dec 02, 2004

to change the directory press alt r and you will see it in the variables, just delete it. Im working on a more advanced one anyway

 Respond  
Marius_Craciunoiu   -  Dec 02, 2004

well, too simple, cant even change the directort after i set it the first time :), but its the only one that actualy works so far...

 Respond  
KuTsuM   -  Nov 27, 2004

uhm..... its too manual... why make a dialog if you have to do that much yourself?

 Respond  
Kobra   -  Nov 26, 2004

i got the idea from yours m8, but i wanted something more simpler :)

 Respond  
DarthReven   -  Nov 25, 2004

its alittle short for my liking but nice

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.