NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 60 61 62 63 64 … 93 Next »
IEventNofitication Stopped going

 
  • 0 Vote(s) - 0 Average
IEventNofitication Stopped going
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#1
2006-02-03, 05:24 AM
Just figured out that I'm not getting events from IEventNotification.

I've tried blowing away my code and re-implementing the IEvent part but to no avail.

Anywhere special it should be, I.e. in an IMenuTask.

And is there anything other than the Interface need to be done, no calls to start it somewhere??
alibert
Offline

Posting Freak

Posts: 974
Threads: 83
Joined: Apr 2005
#2
2006-02-03, 10:23 AM
psycik,

I think the problem is that a class that implements IEventNotification is instantiated by GBPVR, if there is a public constructor.

This instantiated object receives the events by gbpvr.

If you have another instance of your event-receiving-class in your plugin, those won't receive anything by gbpvr, as gbpvr doesn't no about their existance.

A appropiate solution would be a singleton, something like this (I'll paste some code from my music plugin):

Code:
    public class Playlist : IEventNotification
    {
        // singleton implementation
        private static Playlist instance;
        public static Playlist Instance
        {
            get
            {
                if (null == instance) instance = new Playlist();
                return instance;
            }

        }

        // constructor needs to be public, so that gbpvr can instantiate it
        public Playlist()
        {
            instance = this;

    
        }

-alibert
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#3
2006-02-03, 07:37 PM
Ok that would make sense.

Even though I managed to get around the problem another way, I should be albe to give that a go.

Cheers
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Detecting when Music Playlist is stopped (Ctrl-S) ACTCMS 6 2,985 2011-06-19, 07:52 PM
Last Post: sub
  Plugin notification of stopped media mvallevand 7 2,411 2009-08-19, 11:16 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode