please see this thred for history
http://nolanparty.com/mediaportal.sourceforge.net/phpBB2/viewtopic.php?t=10250
I solved this problem using a GUIMessage
I created a new message and added the following code to PlayListPlayer.cs:
in the OnMessage EventHandler:
this allows me to circumvent the newly created instance of playlistplayer, and lets me execute the Play Method in the main thread.
I can use the following code in my MPBlue plugin:
How do I submit this modification?
http://nolanparty.com/mediaportal.sourceforge.net/phpBB2/viewtopic.php?t=10250
I solved this problem using a GUIMessage
I created a new message and added the following code to PlayListPlayer.cs:
in the OnMessage EventHandler:
Code:
case GUIMessage.MessageType.GUI_MSG_PLAYLIST_START:
{
Play(1);
}
break;
this allows me to circumvent the newly created instance of playlistplayer, and lets me execute the Play Method in the main thread.
I can use the following code in my MPBlue plugin:
Code:
public int PlayAlbum(int AlbumID)
{
try
{
//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);
GUIMessage msg=new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYLIST_START,0,0,0,0,0,null);
GUIWindowManager.SendThreadMessage(msg);
return 1;
}
catch(Exception e)
{
string caption = e.ToString();
return 1;
}
}
How do I submit this modification?