NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 53 54 55 56 57 … 93 Next »
Plugin clean-shutdown

 
  • 0 Vote(s) - 0 Average
Plugin clean-shutdown
madcat
Offline

Senior Member

Posts: 634
Threads: 104
Joined: Apr 2006
#11
2006-06-19, 08:45 PM
sub Wrote:Tons of other plugins are doing this without any problems. I'd have to guess your plugin is generating an exception in the constructor.
Hey - dont get defensive :p, I wasn't doubting the mechanism, I just need some help getting on my feet here...

Ok, I remarked most of the class, now no excpetion. However, all I have in the C'Tor is Logger lines, and... well, they appear twice in the log file:
Code:
public RemotePlugin()
        {
            Logger.Verbose("RemotePlugin: entering CTOR");
            Logger.Verbose("RemotePlugin: leaving CTOR");
        }

Log file:
Code:
19/06/2006 16:42:00.849    VERBOSE    [1]    getValue: /settings/PluginsEnabled : true
19/06/2006 16:42:00.849    VERBOSE    [1]    RemotePlugin: entering CTOR
19/06/2006 16:42:00.849    VERBOSE    [1]    RemotePlugin: leaving CTOR
19/06/2006 16:42:00.849    VERBOSE    [1]    RemotePlugin: entering CTOR
19/06/2006 16:42:00.849    VERBOSE    [1]    RemotePlugin: leaving CTOR
19/06/2006 16:42:00.869    VERBOSE    [1]    GuideMenuTask created
:confused::confused::confused:
* Rogers Analog Cable [Canada]
* Hauppauge WintTV PVR USB2
* IBM Thinkpad T42 / 1GB Mem / Centrino 1.6Ghz / 60GB HD / ATI Mobility Radeon 7500 + VGA/DVI out
* MCE Remote + Keyboard
* Win XP SP2 / GBPVR [Latest version. always]
* Pioneer HDTV via VGA (1360x768)
* MS Remote Keyboard
* Logitech Harmony 880 [via MS Remote Control Reciever]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,724
Threads: 767
Joined: Nov 2003
#12
2006-06-19, 08:49 PM
A separate instance is created for the class implementing IMenuTask and the class implementing IEventNotification.
madcat
Offline

Senior Member

Posts: 634
Threads: 104
Joined: Apr 2006
#13
2006-06-19, 09:14 PM
sub Wrote:A separate instance is created for the class implementing IMenuTask and the class implementing IEventNotification.
AHA!
That explains it (why is that? never mind...).
So, now I have to decide whether to combine or not. Got it.

Once again - thanks for the (unreal) swift support!
* Rogers Analog Cable [Canada]
* Hauppauge WintTV PVR USB2
* IBM Thinkpad T42 / 1GB Mem / Centrino 1.6Ghz / 60GB HD / ATI Mobility Radeon 7500 + VGA/DVI out
* MCE Remote + Keyboard
* Win XP SP2 / GBPVR [Latest version. always]
* Pioneer HDTV via VGA (1360x768)
* MS Remote Keyboard
* Logitech Harmony 880 [via MS Remote Control Reciever]
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#14
2006-07-01, 02:03 AM
If you're still trying to decide, I've had good results with using the "proxy" design pattern (with a twist of "singleton").

There's a proxy class that implements IMenuTask and IEventNotification, and gets instantiated twice. But both instances just turn everything over to the "real" object, a different class that only gets instantiated once (our pseudo-singleton).

Like so:

Code:
public class PluginProxy : IMenuTask, IEventNotification
{
private static PluginBackend theRealPlugin;

public PluginProxy()
{
  if(theRealPlugin==null)
   theRealPlugin = new PluginBackend();
}

public void Activate()
{
   theRealPlugin.Activate();
}

// etc.
}

class PluginBackend
{

public void Activate()
{
  // ...
}

// etc.
}
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,899 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,396 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,493 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,922 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,790 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,152 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,967 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 5,029 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,262 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,449 2012-01-15, 08:33 PM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode