Skip to content
General IRCX

Mp3 Player Playlist

A TG007 community discussion started by Rhys.

Discussion 3 posts
Page 1 of 1
Open
Topic #4123 · 3 published posts · 1,260 views

I'm currently making a playlist for my Mp3 Player. I'm stuck with 1 thing. I can't figure out how to play the next song from the one i'm currently playing.

 

eg:

 

here is a list of songs in my Playlist dialog listbox:

 

2pac - ghetto gospel

ali g - me julie

jennifer lopez - get right

mvp - rock ya body

crazy frog

 

right, i want it so if i play, for example, ali g - me julie, when that song finishes, it will play the next song in my playlist, which is jennifer lopez - get right.

 

The problem is trying to find the line of the file in playlist.txt. If i knew this, i could do it by increasing the line number of the currently playing song, which will give me the next song.

 

If this is not clear enough, please tell me and I will re-write this in more detail.

Here is an alias I made up. Just rename the dialog name to whatever you want, and change the id to whatever id number you use.

 

alias mp3check {
 if (!%mp3check) || (%mp3check == 0) || (%mp3check = $did(mp3,1).lines) { set %mp3check $calc($did(mp3,1).lines - $did(mp3,1).lines + 1) }
 else { set %mp3check2 %mp3check | set %mp3check $calc(%mp3check2 + 1) }
 if (%mp3check2) { splay $did(mp3,1,%mp3check) }
}

nevermind, i have done it. what i did was to create 3 variables, %filecount %fileline and %filesearch. %filecount was the lines of playlist.txt, %fileline was the line it was currently reading, and %filesearch was the current song name. i then did a timer to do it %filecount times for 20 millieseconds, then run an alias. in the alias, it checked if it was the first song by doing if (%filesearch isin $read(playlist.txt, 1) and if so, it was easily found the next song line would be 2. but if it wasn't 1, it would scan everyline for the song name, and then set %nextsongline the currentline it was found on, and play from the next line.