2007-06-23, 04:34 AM
Hi
Trying to make my music player a bit better. Loading playlists were a place where the UI would stop while a large playlist was loaded. So I'd like to make it load in background.
I've managed to make it start a new thread to load the playlist files inthe background ok. But the problem comes when trying to play them.
If I try to play a track while it loading, and call a PluginHelperFactory.AddAudioFileToQueue() both within the playlist class (that's currently loading - i.e. so in the new thread) or an event that fires when each track is loaded I get
Any pointers to how I should be doing this?? I'm pretty new to multi-threading...
Trying to make my music player a bit better. Loading playlists were a place where the UI would stop while a large playlist was loaded. So I'd like to make it load in background.
I've managed to make it start a new thread to load the playlist files inthe background ok. But the problem comes when trying to play them.
If I try to play a track while it loading, and call a PluginHelperFactory.AddAudioFileToQueue() both within the playlist class (that's currently loading - i.e. so in the new thread) or an event that fires when each track is loaded I get
Code:
Cross-thread operation not valid: Control 'HomeMenu' accessed from a thread other than the thread it was created on.
Any pointers to how I should be doing this?? I'm pretty new to multi-threading...