Public feed #723499

Untitled

public text v1 · immutable
Raw Edit
·published 2007-10-02 20:44 UTC
rendered paste body
alias my { dialog -md my my }
dialog my {
  title "Jc's MP3 Player"
  size -1 -1 197 122
  option dbu
  check "Amsg on song change", 1, 7 109 66 10
  check "Disable buttons", 2, 75 109 50 10
  check "Repeat", 3, 127 109 31 10
  check "Shuffle", 4, 159 109 36 10
  box "Options", 5, 1 103 195 19
  list 6, 8 87 179 13, size
  box "Now playing:", 7, 5 80 185 22
  list 8, 115 8 74 68, size
  box "Playlist", 9, 113 0 78 78
  button "Add Song", 10, 65 9 40 9
  button "Remove Song", 11, 65 19 40 9
  button "Remove all", 12, 65 29 40 9
  box "Playlist Settings", 13, 61 1 49 39
  button "Play/Restart", 14, 65 50 40 9
  button "Stop", 15, 65 60 40 9
  button "Pause", 16, 65 70 40 9, default
  box "Song Settings", 17, 61 41 48 40
  edit "~!~ Current song: @SONG@ ~!~", 18, 6 9 50 65, multi return autovs vsbar limit 150
  box "Current Amsg", 19, 3 1 57 78
}

on *:DIALOG:my:sclick:10: {
  set %mp3file $msfile($mircdir, Choose the MP3 to add to the playlist, Add)
  set %mp3inc 1
  while (%mp3inc <= %mp3file) {
    did -a my 8 $msfile(%mp3inc)
    write filestoplay.txt $msfile(%mp3file)
    inc %mp3inc
  }
  dec %mp3inc
}

on *:DIALOG:my:close:0:{ /remove filestoplay.txt | /splay stop | unset %mp3* }

on *:DIALOG:my:sclick:14: {
  if ($did(8).seltext) { /did -ra my 6 $did(8).seltext | /splay -p $did(8).seltext }
  if ($did(8).seltext != 1) {
    if ($did(4).state == 1) {
      /did -ra my 6 $read(filestoplay.txt)
      /splay -p $read(filestoplay.txt)
    }
    if ($did(4).state != 1) {
      if (%mp3on) { inc %mp3on
        /did -ra my 6 $read(filestoplay.txt,t, %mp3on)
        /splay -p $read(filestoplay.txt,t, %mp3on)
      }
      if (!%mp3on) { set %mp3on 1
        /did -ra my 6 $read(filestoplay.txt,t, %mp3on)
        /splay -p $read(filestoplay.txt,t, %mp3on)
      }
    }
  }
}