From: <gib...@us...> - 2007-09-04 08:54:32
|
Revision: 892 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=892&view=rev Author: gibman_dk Date: 2007-09-04 01:54:30 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs Modified: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 07:32:31 UTC (rev 891) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 08:54:30 UTC (rev 892) @@ -4,6 +4,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; using System.Windows.Forms; +using MediaPortal.Player; namespace MediaPortal.GUI.SkinChanger { @@ -180,8 +181,14 @@ { newSkin = (string)_skins[_activeSkinIndex + 1]; _activeSkinIndex++; - } - + } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex++; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -205,6 +212,13 @@ newSkin = (string)_skins[_activeSkinIndex - 1]; _activeSkinIndex--; } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex--; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -212,6 +226,11 @@ private void SwitchToSkin(string newSkin) { + //we have to pause the gplayer, otherwise we might hang the app. + if (g_Player.IsVideo || g_Player.IsTV && !g_Player.Paused) + { + g_Player.Pause(); + } // Set the skin to the selected skin and reload GUI GUIGraphicsContext.Skin = newSkin; @@ -229,7 +248,16 @@ if (autosize && !GUIGraphicsContext.Fullscreen) Form.ActiveForm.Size = new System.Drawing.Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); } - GUIWindowManager.OnResize(); + GUIWindowManager.OnResize(); + + // we need to refresh the current active screen, otherwise we will see some unwanted stuff. + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GUIWindowManager.ActiveWindow, 0, 0, 0, 0, null); + GUIWindowManager.SendThreadMessage(msg); + + if (g_Player.Paused) + { + g_Player.Pause(); + } } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |