From: <lk...@us...> - 2008-02-01 10:20:18
|
Revision: 1332 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1332&view=rev Author: lkuech Date: 2008-02-01 02:20:13 -0800 (Fri, 01 Feb 2008) Log Message: ----------- ViewModeSwitcher: Let the reflection function start from outside of the background worker thread. Hopefully that fixes the last tve3 issue regarding the current channel detection. Modified Paths: -------------- trunk/plugins/ViewModeSwitcher/TVPluginReflection.cs trunk/plugins/ViewModeSwitcher/TVstatusWrapper.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs Modified: trunk/plugins/ViewModeSwitcher/TVPluginReflection.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/TVPluginReflection.cs 2008-01-31 07:17:31 UTC (rev 1331) +++ trunk/plugins/ViewModeSwitcher/TVPluginReflection.cs 2008-02-01 10:20:13 UTC (rev 1332) @@ -9,7 +9,7 @@ namespace ProcessPlugins.ViewModeSwitcher { - class TVPluginReflection + public class TVPluginReflection { public enum States { Modified: trunk/plugins/ViewModeSwitcher/TVstatusWrapper.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/TVstatusWrapper.cs 2008-01-31 07:17:31 UTC (rev 1331) +++ trunk/plugins/ViewModeSwitcher/TVstatusWrapper.cs 2008-02-01 10:20:13 UTC (rev 1332) @@ -8,7 +8,7 @@ { public class TVstatusWrapper { - private TVPluginReflection TVPluginReference; + public TVPluginReflection TVPluginReference; public TVstatusWrapper() { @@ -20,18 +20,21 @@ { get { - Log.Debug("ViewModeSwitcher: TVstatusWrapper: CurrentChannelName: TVPluginReference.State = {0}", TVPluginReference.State); string tmpChannelName = string.Empty; - if (TVPluginReference.State == TVPluginReflection.States.delayed) return string.Empty; - - if (TVPluginReference.State == TVPluginReflection.States.notstarted) // make sure tvplug is searched via reflection + if (TVPluginReference.State == TVPluginReflection.States.delayed || TVPluginReference.State == TVPluginReflection.States.notstarted) { - tmpChannelName = TVPluginReference.CurrentTVChannel; // let the Reflection class do her work - Log.Debug("ViewModeSwitcher: TVstatusWrapper: CurrentChannelName: first start! Try to return the tve3 channel: {0}", tmpChannelName); - return tmpChannelName; + Log.Debug("ViewModeSwitcher: TVstatusWrapper: CurrentChannelName: TVPluginReference.State = {0}", TVPluginReference.State); + return string.Empty; } + //if (TVPluginReference.State == TVPluginReflection.States.notstarted) // make sure tvplug is searched via reflection + //{ + // tmpChannelName = TVPluginReference.CurrentTVChannel; // let the Reflection class do her work + // Log.Debug("ViewModeSwitcher: TVstatusWrapper: CurrentChannelName: first start! Try to return the tve3 channel: {0}", tmpChannelName); + // return tmpChannelName; + //} + if (TVPluginReference.State == TVPluginReflection.States.finished && TVPluginReference.TVPluginFound) { tmpChannelName = TVPluginReference.CurrentTVChannel; Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs 2008-01-31 07:17:31 UTC (rev 1331) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs 2008-02-01 10:20:13 UTC (rev 1332) @@ -106,7 +106,7 @@ //GUIGraphicsContext.OnNewAction += new OnActionHandler(OnAction); TvStatus = new TVstatusWrapper(); - Log.Debug("ViewModeSwitcher: test the channel: {0}", TvStatus.CurrentChannelName); + //Log.Debug("ViewModeSwitcher: test the channel: {0}", TvStatus.CurrentChannelName); } //public void OnAction(Action action) @@ -324,8 +324,11 @@ public void OnTVStarted(int j, TVCaptureDevice dev) { if (currentSettings.verboseLog) Log.Debug("ViewModeSwitcher: OnTVStarted"); + ResetWorkerPlaybackValues(); if (ViewModeSwitcherEnabled) workerEvent.Set(); + + TvStatus.TVPluginReference.Start(); } /// <summary> @@ -350,8 +353,9 @@ if (currentSettings.verboseLog) Log.Debug("ViewModeSwitcher: On Video Started"); ResetWorkerPlaybackValues(); - if (ViewModeSwitcherEnabled) workerEvent.Set(); + + TvStatus.TVPluginReference.Start(); } /// <summary> @@ -517,7 +521,7 @@ if (curTVChannelName != tmpChannelName) { curTVChannelName = tmpChannelName; - if (currentSettings.verboseLog) Log.Info("The TV channel is now: {0}", curTVChannelName); + if (currentSettings.verboseLog) Log.Info("ViewModeSwitchwer: The TV channel is now: {0}", curTVChannelName); LastSwitchedAspectRatio = 0f; LastLetterboxDetectionResult = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |