mp3 player

By bizkwet on May 18, 2006

just type in '/mp3player' ..please notify me if there are any errors, or if you have suggestions and/or comments

;My Audio Player
dialog mp3 {
  title "My Audio Player"
  size -1 -1 200 110

  list 1, -1 -1 200 100, vsbar hsbar extsel

  menu "&File", 11
  item "&Add file", 6, 11
  item "&Del file", 7, 11
  item break, 15, 11
  item "&Exit", 16, 11, ok

  menu "&Options", 10
  item "&Back", 2, 10
  item "&Play", 3, 10
  item "&Stop", 4, 10
  item "&Next", 5, 10

  menu "&Spam", 12
  item "Set action", 13, 12
  item break, 14, 12
  item "About", 17, 12

  check "repeat", 8, 150 85 50 25, right
  check "shuffle", 9, 95 85 50 25, right

}
on 1:dialog:mp3:menu:17:{
  msg $active 7This is Bizkwet's Audio Player
  msg $active 7Enjoy!!
}
on 1:dialog:mp3:menu:13:{
  set %msg $$?="Enter your message: (e.g. is currently listening to)"
}
on 1:dialog:mp3:sclick:9:{
  if (%shuffle == 1) set %shuffle 0
  else set %shuffle 1
}
on 1:dialog:mp3:sclick:8:{
  if (%repeat == 1) set %repeat 0
  else set %repeat 1
}
on 1:dialog:mp3:menu:2:{
  if (%i <= 1) echo -a * Error: First item in playlist
  else { 
    dec %i
    splay -p $read(listsong.txt,%i)
    spam
  }
}
on 1:dialog:mp3:menu:5:{
  if (%i >= $lines(listsong.txt)) echo -a * Error: End of playlist
  else {
    inc %i  
    splay -p $read(listsong.txt,%i)
    spam
  }
}
on 1:dialog:mp3:init:0:{
  if (%shuffle == 1) did -c mp3 9
  if (%repeat == 1) did -c mp3 8
  set %list 1
  while (%list <= $lines(listsong.txt)) {
    did -a mp3 1 $sound($read(listsong.txt,%list)).artist - $sound($read(listsong.txt,%list)).title
    inc %list 1
  }
}
on 1:dialog:mp3:menu:7:{
  write -dl [ $+ [ $did(mp3,1).sel ] ] listsong.txt
  did -d mp3 1 $did(mp3,1).sel
}
on 1:dialog:mp3:menu:4:{
  unset %i
  splay stop
}
on 1:dialog:mp3:menu:6:{
  set %song $sfile(/)
  write -a listsong.txt %song
  did -a mp3 1 $sound(%song).artist - $sound(%song).title
}
on 1:dialog:mp3:menu:3:{
  set %i $did(mp3,1).sel
  splay -p $read(listsong.txt,%i)
  spam
}
on 1:mp3end:{
  if (%shuffle == 1) {
    set %i $rand(1,$lines(listsong.txt))
    splay -p $read(listsong.txt,%i)
    spam
  }
  else {
    if (%i < $lines(listsong.txt)) {
      inc %i
      splay -p $read(listsong.txt,%i)
      spam
    } 
    else {
      if (%repeat == 1) {
        set %i 1
        splay -p $read(listsong.txt,%i)
        spam
      }
    }
  }
}
on 1:dialog:mp3:dclick:1:{
  set %i $did(mp3,1).sel
  splay -p $read(listsong.txt,%i)
  spam
}
alias spam {
  ame %msg 4 $sound($read(listsong.txt,%i)).artist - $sound($read(listsong.txt,%i)).title [ $duration($calc(($sound($read(listsong.txt,%i)).length)/1000)) ]  [ $sound($read(listsong.txt,%i)).bitrate $+ kbit ]   
}

alias mp3player { dialog -md mp3 mp3 }

Comments

Sign in to comment.
hawkshaw   -  Aug 31, 2006

care_taker: ive done /load stuff, but the add song doesnt work.. im a newbie at this, did i miss anything?

 Respond  
corax   -  Aug 30, 2006

Bizkwet- Not any error\'s I\'ve noticed so it\'s big +:).. but!
-U should make something which may mass add file\'s not only per once.
-U may also add some more info in advertising stuff.
For sure it\'s good code and job Regard\'s :)

 Respond  
drumkid007   -  Jul 29, 2006

I had the same problem as above when i opened a song it said * /splay: invalid parameters (line 223, script.ini) but after a added another song and played the 2nd added it works fine my question is can another person here the music other than me?

 Respond  
bizkwet   -  May 23, 2006

hmmm.. vampslim, i haven\'t encountered that problem yet.. anyway, about the player not showing the song name, maybe your mp3 file (ill nino) doesn\'t contain a song name and artist, cause i use tags in viewing the song..

 Respond  
vampslim   -  May 21, 2006

Well. I\'ve run through all my songs and it\'s done it to all of them expect one. Which was the first song i played on the mp3. Ill Nino - How Can I Live

 Respond  
vampslim   -  May 21, 2006

But..Some of the songs on the list do this: ( 12:38:27am ) <~Ecstasy> :(Mp3): - - [ 4mins 38secs ] [ 192kbit ] <-- Does not show the song name

 Respond  
vampslim   -  May 21, 2006

I like it. Very short and too the point. Good job bizkwet.

ps: I love the shuffle and repeat function.

 Respond  
NoFx   -  May 19, 2006

an alias can\'t be /mp3 , because that alias excist , it\'s created by Khaled , so.. yo have to put another name to it.. for ex.. /mp3d ..

See You!

 Respond  
CaRe_Taker   -  May 19, 2006

Author\'s Notes:

type in \'/load -rs mp3player.mrc\' then \'/dialog -md mp3 mp3\' ..please notify me if there are any errors, or if you have suggestions and/or comments all that info
you can edit all that info lol

 Respond  
bizkwet   -  May 19, 2006

there you go.. just type \'/mp3\' =P what do you mean by \'edit all that info\' CaRe_Taker?

 Respond  
Jared   -  May 19, 2006

bizkwet where\'s the alias to open the mp3 dialog? Something like:
alias mp3 { dialog -m mp3 mp3 }

 Respond  
CaRe_Taker   -  May 18, 2006

bizkwet you can edit all that info bud

 Respond  
bizkwet   -  May 18, 2006

wwwoooppsss.. don\'t load the script.. just paste it in the \'script editor\'.. sorry for the wrong info.. ;)

 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.