I'm trying to use g_player to play music files. This is working fine until I need to stop the file from playing. This works fine when done by clicking a control. The problem, however, comes from when I try to stop it via a timer. From what I can tell, that occurs on a different thread than the user stopping it himself. Is that right and if so, is there some other way for me to go about it? This is the error I'm getting:
2007-08-31 14:32:26.781000 [ERROR][12]: Exception ystem.NullReferenceException: Object reference not set to an instance of an object.
at MediaPortal.Player.g_Player.CachePlayer()
at MediaPortal.Player.g_Player.doStop(Boolean keepTimeShifting)
at MediaPortal.Playlists.PlayListPlayer.FakePlayer.Stop()
2007-08-31 14:32:26.781000 [ERROR][12]: Exception :Object reference not set to an instance of an object.
2007-08-31 14:32:26.782000 [ERROR][12]: site :Void CachePlayer()
2007-08-31 14:32:26.783000 [ERROR][12]: source :Core
2007-08-31 14:32:26.783000 [ERROR][12]: stacktrace: at MediaPortal.Player.g_Player.CachePlayer()
It all seems to relate to "cacheplayer". I've tried via a playlistplayer and by directly casting and accessing g_player. Any help would be greatly appreciated.
Edit: Sorry, a little bit of forum searching goes a long way. I was using a system timer and not a form timer. Found the answer here: https://forum.team-mediaportal.com/calling_g_player_play_timer_elapsed_event-t504.html
2007-08-31 14:32:26.781000 [ERROR][12]: Exception ystem.NullReferenceException: Object reference not set to an instance of an object.
at MediaPortal.Player.g_Player.CachePlayer()
at MediaPortal.Player.g_Player.doStop(Boolean keepTimeShifting)
at MediaPortal.Playlists.PlayListPlayer.FakePlayer.Stop()
2007-08-31 14:32:26.781000 [ERROR][12]: Exception :Object reference not set to an instance of an object.
2007-08-31 14:32:26.782000 [ERROR][12]: site :Void CachePlayer()
2007-08-31 14:32:26.783000 [ERROR][12]: source :Core
2007-08-31 14:32:26.783000 [ERROR][12]: stacktrace: at MediaPortal.Player.g_Player.CachePlayer()
It all seems to relate to "cacheplayer". I've tried via a playlistplayer and by directly casting and accessing g_player. Any help would be greatly appreciated.
Edit: Sorry, a little bit of forum searching goes a long way. I was using a system timer and not a form timer. Found the answer here: https://forum.team-mediaportal.com/calling_g_player_play_timer_elapsed_event-t504.html