how to : playlist for music player  
Author Message

PostPosted: Visual C# General, how to : playlist for music player Top

I would like to create a simple music player, and the problem is I don't know how to create a playlist so it could show whole list of songs [ from dataBase ] and if we double click on the song sth happens [ song is playing ]. please help me :)

Visual C#19  

PostPosted: Visual C# General, how to : playlist for music player Top

well there are a few things you need to make clear.

where will the files be stored so you can play them

you dont need to store a playlist into a database, infact it would be inefficient/expensive as it is expensive to work with databases. you should really ideally be storing it into say a serialized object into xml so next time your app starts up, you can deserialize your playlist. This approach also allows you to say store several playlists and open anyone you like and save them should it have been altered

the playlist class you may create could contain properties like "Name" and "Filepath" which will store the name of the track and also the reference to the file so when you double click the item in say a listbox, you can then obtain the filepath of the item you doubleclicked and start playing your music item.

There are a few ways of doing this but you need to think a bit more carefully and decide strongly how you wish to achieve this. alternatively you could just browse to a folder and view all files in it and when double clicked, it will play that file in your application