please take a look at the following code snippet..
this method is exposed in a remoting interface, but somehow it keeps failing.
it probably has to to with the fact that a singleton is being called (PlayListPlayer).
when I execute the method within the assembly itself, everithing works fine.
when I try to execute it using remoting, strange things happen.
sometimes it just works, most f the times a Syste.remoting exception occurs and sometimes the song plays, but it seems that it is running not in the Mediaportal context..
some programmers at work said somethng about PlaylistPlayer not being threadsafe.. but that is not really my cup of tea..
many thanks in advance.
(BTW, as soon as I get this stable, We can release a first version of MPBlue 8) )
Code:
public int PlayAlbum(int AlbumID)
{
//Get all tracks from the album and initialize the playlistplayer?
PlayListPlayer.GetPlaylist(PlayListPlayer.PlayListType.PLAYLIST_MUSIC).Clear();
PlayListPlayer.CurrentPlaylist = PlayListPlayer.PlayListType.PLAYLIST_MUSIC;
PlayList.PlayListItem playlistItem = new PlayList.PlayListItem();
playlistItem.Type = PlayList.PlayListItem.PlayListItemType.Audio;
playlistItem.FileName = @"M:\my Albums\Bjork - Homogenic\04 Bachelorette.mp3";
playlistItem.Description = "testing, testin 123";
playlistItem.Duration = 23;
PlayListPlayer.GetPlaylist(PlayListPlayer.PlayListType.PLAYLIST_MUSIC).Add(playlistItem);
PlayListPlayer.Play(0);
return 1;
}
it probably has to to with the fact that a singleton is being called (PlayListPlayer).
when I execute the method within the assembly itself, everithing works fine.
when I try to execute it using remoting, strange things happen.
sometimes it just works, most f the times a Syste.remoting exception occurs and sometimes the song plays, but it seems that it is running not in the Mediaportal context..
some programmers at work said somethng about PlaylistPlayer not being threadsafe.. but that is not really my cup of tea..
many thanks in advance.
(BTW, as soon as I get this stable, We can release a first version of MPBlue 8) )