Ok, I have created a playlist for my programe. But I don't know of the best way to use it. Like how to creat a randum num generator and then make it choose that song..
Any suggestions?
Printable View
Ok, I have created a playlist for my programe. But I don't know of the best way to use it. Like how to creat a randum num generator and then make it choose that song..
Any suggestions?
This will generate a random number. You can then use it to select a track number on a CD, or a certain file in a playlist etc
VB Code:
Dim UpperBound As Long Dim LowerBound As Long UpperBound = 100 LowerBound = 10 Randomize MsgBox Int((UpperBound - LowerBound + 1) * Rnd + LowerBound)
That Should help me..
Another question. Would it be a good idea to parse the playlist as it is loaded into and array containing all the songs, and then using that generater to pick random songs?
As opposed to...? :confused:
Yes, I would do it that way
I didn't know how everyone else did it.. I didn't know if they just opened the file, and pciked a random line or something else..
To pick a random line, you'd still have to go through the whole file. :cool:
Yea, but I would only have to do it once. Then save it as a variable..
I guess the array is the best idea..
I'm inclined to agree. BTW, we are talking about a playlist in the WiMP/Winamp sense, right?
Yes, except for my Incar mp3 player, LCD driver..
*drool* Give me that code/hardware when you're done. :D
If I can ever get it done. I seem to be having brain lapses today.. Why is THIS code not working..
VB Code:
Public Sub FileSort(Path As String, Filename As String) Dim mp3 As String mp3 = mp3 If InStr(0, Filename, mp3, 0) > 0 Then NAAAS.lstScand.AddItem Path & Filename 'Add db code here Else NAAAS.cmbChoose.AddItem Filename End If End Sub
I want to search the filename for mp3, and if it finds it, then to send it thelstScand, else to cmbChoose. But no matter what it is sending to cmbChoose..
Could that interesting little tidbit be the problem?VB Code:
mp3 = mp3
With that code it adds the mp3's to noth list.. Strange..
What is this constant Turtle ? :DQuote:
mp3 = mp3
What about Turtles? Must be an insider joke..Quote:
Originally posted by DaoK
What is this constant Turtle ? :D
yeah, not very inside though
Turtle = filburt = charcter on Rocko's Modern Life (apparantly)
Oh, I thought you were drunk for a second.
Anyway, switching the keyword from mp3 to m3u seemed to work. A bug in VB maybe? Using the InStr with a number ending the search string? Thanks for all the help though.