Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
Looping audio files in tree view with windows media player COM
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="anon, post: 131826, member: 33244"] I am attempting to play a set of audio files continuously using a tree view. I am having troubles looping through an array to play one song after another in the selected parent node. It seems to work if I only use one song in the array but it doesn't want to actually loop through and keep playing; it goes through the loop but once the first song is over it stops. I am unsure if looping through an array in the AfterSelect sub routine is the best way of doing this, any other suggestions are greatly appreciated. Here is the entire Sub routine for the AfterSelect on the tree view. trvMain is the name of the entire tree view. wmpMain is the Windows Media Player COM. trvJazzHancock is the parent node for the two audio files I'm attempting to loop. [CODE] Private Sub trvMain_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles trvMain.AfterSelect ' When parent node is selected, the node expands to display child nodes. If trvMain.SelectedNode.Name.ToLower.StartsWith("trv") Then trvMain.SelectedNode.Expand() Else ' Sets URL to the path of the audio files. wmpMain.URL = IO.Path.GetFullPath("..\..\music\" & trvMain.SelectedNode.Name.ToString) Exit Sub End If ' Case containing a loop to play Maiden Voyage followed by Dolphin Dance. Select Case trvMain.SelectedNode.Name Case "trvJazzHancock" ' loop method begins and plays song (0) and then song (1) Dim arMusic(2) As String arMusic(0) = IO.Path.GetFullPath("..\..\music\MaidenVoyage.wma") arMusic(1) = IO.Path.GetFullPath("..\..\music\05 Dolphin Dance.wma") For i = 0 To arMusic.Count - 1 wmpMain.URL = arMusic(0) Next i End Select End Sub [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
Looping audio files in tree view with windows media player COM
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom