RubixCube commented on a Page, media player  -  Sep 30, 2007

Really nice media player token good work. There is just a minute bug that I found. In your aud.load alias, it doesn\'t check if the playlist.txt is already made. As a result, it adds on to the playlist.txt when changing your directory. Here is the fixed code:

alias aud.load { 
  if ($isfile(playlist.txt)) write -c playlist.txt
  var %tmpdir $sdir(C:,Music Files)
  if ($dialog(mplay)) did -r mplay 11
  var %x 1 
  :start
  if (%getnum|mp3 = 1) { inc %getnum|mp3 }
  while ($findfile(%tmpdir,*.mp3,%x)) {
    if ($dialog(mplay)) { did -a mplay 11 $nopath($findfile(%tmpdir,*.mp3,%x)) }
    write playlist.txt $findfile(%tmpdir,*.mp3,%x)
    inc %x
  }
  var %x 1  
  while ($findfile(%tmpdir,*.wav,%x)) {
    if ($dialog(mplay)) { did -a mplay 11 $nopath($findfile(%tmpdir,*.wav,%x)) }
    write playlist.txt $findfile(%tmpdir,*.wav,%x)
    inc %x
  }
  var %x 1 
  while ($findfile(%tmpdir,*.midi,%x)) {
    if ($dialog(mplay)) { did -a mplay 11 $nopath($findfile(%tmpdir,*.midi,%x)) }
    write playlist.txt  $findfile(%tmpdir,*.midi,%x)
    inc %x
  }
  halt
  if ($1 = destroydir) { 
    remove playlist.txt
    unset %getnum|mp3
    goto start
  }
  if ($1 = remfile) { 
    if ($2-) {
      if ($read(playlist.txt,$nopath($1)) { write -dl $v1 }
    }
  }
}
  • Really simple edit.

It would be great if you can add an add file feature as well. I have a large directory of songs. Perhaps a:

var %s = $sfile(C:\\,Choose a song to add)
write playlist.txt %s
 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.