Squelette de plugin (1 Viewer)

WhyMe

Portal Member
July 26, 2008
718
12
Home Country
France France
Hello la compagnie,
le plugin AutoStart que j'ai tjs utilisé ne fonctionne plus avec la 1.1a ( çà devait bien arriver un jour ).
Je me dis : je vais le recompiler et zou çà va repartir.
Oui mais non : pas mal de chose on changé avec la 1.1a et impossible de recompiler le code.
Alors je me dis : après tout je veux juste démarrer la télé à chaque démarrage de MP, spa compliqué, je vais faire un plugin tout neuf.

J'ai donc un bout de code super compliqué qui marche pas :D

La DLL est bien chargée, mais je ne passe pas ds le Start

C'est un pb que j'avais déjà rencontré avec une version précédente de MP et un bout de code que j'avais fais pour tout autre chose, j'avais finis par débloquer le pb, mais je ne sais plus comment :(

Une idée ?

Code:
2009-07-07 22:03:33.046875 [Info.][MPMain]:   PlugInManager.Load()
[B]2009-07-07 22:03:33.046875 [Info.][MPMain]:   Load plugins from : C:\Program Files\Team MediaPortal\MediaPortal\Plugins\process\MyPlugin.dll
2009-07-07 22:03:33.062500 [Info.][MPMain]:   File Version : 1.0.0.0
[/B]2009-07-07 22:03:33.062500 [Info.][MPMain]:   Load plugins from : C:\Program Files\Team MediaPortal\MediaPortal\Plugins\process\ProcessPlugins.dll
2009-07-07 22:03:33.078125 [Info.][MPMain]:   File Version : 1.0.3.23090
2009-07-07 22:03:33.078125 [Info.][MPMain]:   PlugInManager.Start()
2009-07-07 22:03:33.890625 [Debug][MPMain]: d3dapp: ShowLastActiveModule active : False
2009-07-07 22:03:33.921875 [Info.][MPMain]: opening video database
2009-07-07 22:03:33.921875 [Info.][MPMain]: video database opened
2009-07-07 22:03:34.031250 [Info.][MPMain]: xml:C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\Skin\Blue3wide\topbar.xml image id:1 width:0 height:0 gfx:empty.png
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:0 debug
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:1 font10
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:2 font11
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:3 font12
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:4 font13
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:5 font14
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:6 font15
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:7 font16
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:8 font17
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:9 font18
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:10 dingbats
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:11 font32
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:12 font48
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:13 font60
2009-07-07 22:03:44.421875 [Debug][MPMain]: GUIFont:texture disposing:14 fontSVT
2009-07-07 22:03:44.421875 [Info.][MPMain]: TexturePacker: disposing texture:1999
2009-07-07 22:03:44.421875 [Info.][MPMain]: TexturePacker: disposing texture:1998
2009-07-07 22:03:44.437500 [Info.][MPMain]: TexturePacker: disposing texture:1996
2009-07-07 22:03:44.453125 [Debug][MPMain]: TVHome: HeartBeat Transmitter stopped.
2009-07-07 22:03:44.468750 [Debug][MPMain]: Main: SaveLastActiveModule - enabled False
2009-07-07 22:03:44.468750 [Info.][MPMain]: Main: Exiting
2009-07-07 22:03:44.468750 [Info.][MPMain]:   PlugInManager.Stop()
Code:
using System ;
using System.Text ;
using System.Collections ;

using MediaPortal.GUI.Library ;

namespace ProcessPlugins.MyPlugin
{
	/// <summary>
	/// 
	/// </summary>
    public class MyPlugin : IPlugin, ISetupForm
    {
		#region ISetupForm
		
		public string PluginName()
		{
			return "MyPlugin";
		}

		public string Description()
		{
			return "This plugin shows how-to information for the current screen and selected item";
		}

		public string Author()
		{
			return "Me";
		}

		public void ShowPlugin()
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public bool CanEnable()
		{
			return true;
		}

		public int GetWindowId()
		{
			return ( 1976 ) ;
		}

		public bool DefaultEnabled()
		{
			return true;
		}

		public bool HasSetup()
		{
			return false;
		}

		public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
		{
			LogInfo ( "GetHome" ) ;
			
			strButtonText		= string.Empty ;
			strButtonImage		= string.Empty ;
			strButtonImageFocus = string.Empty ;
			strPictureImage		= string.Empty ;
			
			return ( false ) ;
		}
		
		#endregion

    
		/// <summary>
		/// 
		/// </summary>
		public void Start()
		{
			LogInfo ( "Start" ) ;
			
			System.Threading.Thread.Sleep ( 1000 ) ;
			
			try
			{
				GUIWindowManager.ActivateWindow ( ( int )  GUIWindow.Window.WINDOW_TVFULLSCREEN ) ;
			}
			
			catch ( Exception exception )
			{
				LogInfo ( exception.Message ) ;
			}
		}

		
		/// <summary>
		/// 
		/// </summary>
		public void Stop()
		{
			LogInfo ( "Stopping" ) ;
		}
		
		/// <summary>
		/// 
		/// </summary>
		/// <param name="message"></param>
		private void LogInfo ( string message )
		{
			Log.Info ( string.Format ( "########## {0} >>> {1}", this.PluginName(), message ) ) ;
		}
    }
}
 

titof

Portal Pro
March 3, 2008
2,248
63
Home Country
France France
personne ? :(

Ben je vois pas trop, à part cette ligne : "return ( false ) ;" dans le getHome qui, pour moi, serait plutôt "return false;", mais si ça compile ...

Envoie tout le project, je vais regarder si tu veux.
 

Users who are viewing this thread

Top Bottom