Hawk's mp3 player

By haewk on Sep 05, 2004

This is an mp3 player with a playlist, and "now" function. just type /player for the mp3 player, and /setup for "now playing" setup.

dialog mp3 {
  title "hawks mp3 player"
  size -1 -1 264 170
  option pixel

  button "<<", 2, 1 110 50 30 ok tab 11
  button "||", 3, 52 110 50 30
  button "", 4, 104 110 50 30 
  button "|>", 5, 156 110 50 30 
  button ">>", 6, 208 110 50 30
  button "close", 10, 1 140 260 30, ok

  list 7, 1 0 208 120, hsbar vsbar extel
  button "add file" 8, 210 1 50 50
  button "del file" 9, 210 50 50 50
}
on 1:dialog:mp3:sclick:8: {
  set %song1 $sfile(/)
  write playlist.txt %song1
  did -a mp3 7 $nopath(%song1)
}
on 1:dialog:mp3:sclick:9: {
  set %del1 $did(mp3, 9).seltext
  set %del2 $did(mp3, 7).sel
  write -dw [ $+ [ * [ $+ [ %del1 [ $+ [ * ] ] ] ] ] ]  playlist.txt
  did -d mp3 7 %del2
}
on 1:dialog:mp3:init:0: {
  set %number 1
  :next
  set %song2 $read(playlist.txt, %number )
  did -a mp3 7 $nopath(%song2)
  inc %number 1
  if ( %song2 != $null ) { goto next }
}
on 1:dialog:mp3:sclick:5: {
  if ( %pause == on ) {
    set %pause off
    splay -p resume
  }
  else {
    unset %play1
    unset %play3
    set %play1 $did(mp3, 7).seltext
    set %play2 $did(mp3, 7).sel
    set %play3 $read(playlist.txt, w, * [ $+ [ %play1 ] ] [ $+ [ * ] ] )
    splay %play3
    set %listening $nopath(%play3)
    inc %play2 1
  }
}
on 1:MP3END: {
  set %play3 $read(playlist.txt, %play2)
  splay %play3
  set %listening $nopath(%play3)
  inc %play2 1
}
on 1:dialog:mp3:sclick:4: {
  splay stop
}
on 1:dialog:mp3:sclick:6: {
  splay $read(playlist.txt, %play2)
  set %path $read(playlist.txt, %play2)
  set %listening $nopath(%path)
  inc %play2 1
}
on 1:dialog:mp3:sclick:2: {
  dec %play2 1
  splay $read(playlist.txt, %play2)
  set %path $read(playlist.txt, %play2)
  set %listening $nopath(%path)
}
on 1:dialog:mp3:sclick:3: {
  set %pause on
  splay -p pause
}
alias song {
  if ( %islist == me ) {
    describe $chan %text %listening
  }
  else {
    msg $chan %text %listening
  }
}
alias setup {
  set %islist $$?="When you say what you're listening to, shall it be in /me or /say. (me for /me and say for /say)"
  set %text $$?="And what do you want to say? Example: Now playing: or is listening to"
  echo ok, type /song to show what song you're listening to
}
alias player {
  dialog -md mp3 mp3
}

Comments

Sign in to comment.
a careful warchild   -  Oct 01, 2008

lmfao @ gummo

 Respond  
Gummo   -  Oct 01, 2008

No, AdrianF, your mp3 player's theme is the worst ever.. O_o

 Respond  
AdrianF   -  Oct 01, 2008

WORST EVER!!!!

 Respond  
corax   -  Aug 30, 2006

W3ll. Firstly wanna tell U that U made good player. /player command work\'s, nice simple menu but!
-U should mass add files becouse it\'s only work per once.
-U should add also advertising this, becouse any possible to see this by public or echoing..
Anyway good job!

 Respond  
brottor   -  Jul 20, 2005

love the script haewk thx for the awesome mp3 player

 Respond  
Lucifer1   -  Dec 24, 2004

scriub that the songs aren\'t playing!

 Respond  
Lucifer1   -  Dec 24, 2004

the /setup command isn\'t working. do i have to type /player first?

 Respond  
Lucifer1   -  Dec 24, 2004

how do i add songs to it?

 Respond  
astro   -  Sep 07, 2004

ok, interesting coding, but 1) why submit it as a snippet and not upload it as an addon 2) for you buttons why not use MDX.dll and set the font for each button to WEBDINGS etc? Coding looks very sound tho, good job

 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.