|
-
Sep 27th, 2001, 03:04 PM
#1
Thread Starter
Addicted Member
best way to work with playlist
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?
-
Sep 27th, 2001, 03:17 PM
#2
PowerPoster
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)
-
Sep 27th, 2001, 03:25 PM
#3
Thread Starter
Addicted Member
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?
-
Sep 27th, 2001, 03:25 PM
#4
-
Sep 27th, 2001, 03:32 PM
#5
PowerPoster
Yes, I would do it that way
-
Sep 27th, 2001, 03:34 PM
#6
Thread Starter
Addicted Member
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..
-
Sep 27th, 2001, 03:38 PM
#7
Member
To pick a random line, you'd still have to go through the whole file.
-
Sep 27th, 2001, 03:53 PM
#8
Thread Starter
Addicted Member
Yea, but I would only have to do it once. Then save it as a variable..
I guess the array is the best idea..
-
Sep 27th, 2001, 03:54 PM
#9
Member
I'm inclined to agree. BTW, we are talking about a playlist in the WiMP/Winamp sense, right?
-
Sep 27th, 2001, 07:23 PM
#10
Thread Starter
Addicted Member
Yes, except for my Incar mp3 player, LCD driver..
-
Sep 27th, 2001, 07:30 PM
#11
Member
*drool* Give me that code/hardware when you're done.
-
Sep 27th, 2001, 08:03 PM
#12
Thread Starter
Addicted Member
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..
-
Sep 27th, 2001, 08:06 PM
#13
Member
Could that interesting little tidbit be the problem?
-
Sep 27th, 2001, 08:20 PM
#14
Thread Starter
Addicted Member
With that code it adds the mp3's to noth list.. Strange..
-
Sep 27th, 2001, 08:21 PM
#15
What is this constant Turtle ?
-
Sep 27th, 2001, 08:26 PM
#16
Thread Starter
Addicted Member
Originally posted by DaoK
What is this constant Turtle ?
What about Turtles? Must be an insider joke..
-
Sep 27th, 2001, 08:30 PM
#17
PowerPoster
yeah, not very inside though
Turtle = filburt = charcter on Rocko's Modern Life (apparantly)
-
Sep 27th, 2001, 08:35 PM
#18
Thread Starter
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|