I managed to create the SongData object but the program behaves strange. I'm attaching the code that does the following:
1. reads lines (from a M3U file) with paths to MP3 music files
2. creates a new song object
3. connects the song object with the path
4. runs the ReadRags method
5. adds the song object to a playlist (created previously in the code)
The first round of the loop works good but in the second round, the song object gets stuck with the same first music so I end up with only one music in the playlist.
Code: Select all
System.IO.StreamReader reader = new System.IO.StreamReader(playlistDisk_path);
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
if (line[0] != '#')
{
SongsDB.SDBSongData song = new SongsDB.SDBSongData();
song.Path=line;
song.ReadTags();
playlistDB_actualLevel.AddTrack(song);
}
}
I managed to create the SongData object but the program behaves strange. I'm attaching the code that does the following:
1. reads lines (from a M3U file) with paths to MP3 music files
2. creates a new song object
3. connects the song object with the path
4. runs the ReadRags method
5. adds the song object to a playlist (created previously in the code)
The first round of the loop works good but in the second round, the song object gets stuck with the same first music so I end up with only one music in the playlist.
[code]
System.IO.StreamReader reader = new System.IO.StreamReader(playlistDisk_path);
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
if (line[0] != '#')
{
SongsDB.SDBSongData song = new SongsDB.SDBSongData();
song.Path=line;
song.ReadTags();
playlistDB_actualLevel.AddTrack(song);
}
}[/code]