pcc
Well-known Member
- Joined
- Jan 21, 2003
- Messages
- 1,353
I have created an Excel "jukebox" for playing mp3 files. I also have a database of lyrics for (some of) the songs, with timings in seconds - see sample below. Timings are seconds into the song when the relevant lyric begins. (I don't time them to multiple decimal places, it's done programmatically!)
When the song plays, the lyrics are retrieved from the database, and populate a userform with a listbox. When the time in column 5 is reached, then the corresponding item in the list is highlighted (bit like a karaoke, but that's not what it is..).
If the number of lyrics in the song is greater than that which can be shown in the listbox (say 30), then eventually the bottom item in the listbox is highlighted, and the listbox then scrolls as more lines are achieved and highlighted, the last visible item always being the current and hence highlighted lyric. This means that it's not possible to see upcoming lines until the relevant time is reached, once the current lyric is 30 or more. I would like to always see the next (say) 5 lines.
In essence, I need therefore:
Listbox visible items: 30
If lyric number <= 25 Then
lyrics 1 to 30 are visible so do nothing
Else
scroll listbox by one line to show lyrics 2 to 31 (when current lyric is 26)
scroll listbox by one line to show lyrics 3 to 32 (when current lyric is 27)
etc etc
End If
I can't see how to do this, and wonder if any of you might be able to help. All suggestion welcomed!
Thanks for reading.
Regards
PS second image is what I need..
1 | Eagles | New kid in town | There's talk on the street it sounds so familiar | 20.66796875 |
2 | Eagles | New kid in town | Great expectations everybody's watching you | 29.0859375 |
3 | Eagles | New kid in town | People you meet they all seem to know you | 38.83984375 |
4 | Eagles | New kid in town | Even your old friends treat you like you're something new | 47.875 |
If the number of lyrics in the song is greater than that which can be shown in the listbox (say 30), then eventually the bottom item in the listbox is highlighted, and the listbox then scrolls as more lines are achieved and highlighted, the last visible item always being the current and hence highlighted lyric. This means that it's not possible to see upcoming lines until the relevant time is reached, once the current lyric is 30 or more. I would like to always see the next (say) 5 lines.
In essence, I need therefore:
Listbox visible items: 30
If lyric number <= 25 Then
lyrics 1 to 30 are visible so do nothing
Else
scroll listbox by one line to show lyrics 2 to 31 (when current lyric is 26)
scroll listbox by one line to show lyrics 3 to 32 (when current lyric is 27)
etc etc
End If
I can't see how to do this, and wonder if any of you might be able to help. All suggestion welcomed!
Thanks for reading.
Regards
PS second image is what I need..