- Moderator
- #1
Hi,
I have opened a Jira to try to do something to let plugin to be in sync when working with GUI :
https://issues.team-mediaportal.com/browse/MP1-4720
Trying to add a public method that plugin dev can use to loadskin in main thread.
public static readonly SynchronizationContext _mainThreadContext = SynchronizationContext.Current;
_mainThreadContext will be init on MP main thread, like this plugin can use it to be in sync for ex :
if (!_playbackStopped)
{
_mainThreadContext.Send(delegate
{
g_Player.ShowFullScreenWindow();
}, null);
}
Like this g_Player.ShowFullScreenWindow(); will be executed in sync with MP main thread.
Plugin dev need to ref to core.dll and in plugin when thing need to be sync with MP main thread, it should use like this :
I have opened a Jira to try to do something to let plugin to be in sync when working with GUI :
https://issues.team-mediaportal.com/browse/MP1-4720
Trying to add a public method that plugin dev can use to loadskin in main thread.
public static readonly SynchronizationContext _mainThreadContext = SynchronizationContext.Current;
_mainThreadContext will be init on MP main thread, like this plugin can use it to be in sync for ex :
if (!_playbackStopped)
{
_mainThreadContext.Send(delegate
{
g_Player.ShowFullScreenWindow();
}, null);
}
Like this g_Player.ShowFullScreenWindow(); will be executed in sync with MP main thread.
Plugin dev need to ref to core.dll and in plugin when thing need to be sync with MP main thread, it should use like this :
Code:
GUIWindow._mainThreadContext.Send(delegate {
// code
// code
// etc;
}, null);