Process Plugin (1 Viewer)

cheetah05

Portal Pro
April 9, 2006
328
5
London
Home Country
United Kingdom United Kingdom
Could someone give me the quick code layout for a process plugin (just copy a paste the start page if you are developing)

I have looked at the WIKI but it only shows the code for developing a plugin with GUI.

Thanks.
 

framug

Super Moderator
  • Team MediaPortal
  • January 31, 2005
    6,232
    2,386
    South of France
    Home Country
    France France
    Hello,

    It is the same code as GUI plugin.

    Only change :

    public int GetWindowId()
    {
    return -1; // it's a process plugin
    }

    Regards.
     

    cheetah05

    Portal Pro
    April 9, 2006
    328
    5
    London
    Home Country
    United Kingdom United Kingdom
    Thanks but it was the Start() and Stop() methods i was after - turns out i wasn't inheriting everything i needed. What you mentioned was already in the wiki i read.
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    6,232
    2,386
    South of France
    Home Country
    France France
    Sorry, I didn't read this part of wiki. ;)

    I could put code here but, I would be too long.
    Better is to look in MP code, in some process plugins, to see how it works or, taking a look in some MP plugins which already use it.
    here :
    SourceForge.net Repository - [mp-plugins] Index of /trunk/plugins

    Edit : it's a good day, today. :)
    Here is a sample code :

    Code:
    using System.Threading;
    
            bool _run;
            Thread _thread;
    
            public void Start()
            {
                _run = true;
                _thread = new Thread(new ThreadStart(Run));
                _thread.IsBackground = true;
                _thread.Name = "plugin thread";
                _thread.Priority = ThreadPriority.Lowest;
                _thread.Start();
            }
    
            public void Stop()
            {
                _run = false;
            }
    
            private void Run()
            {
                while (_run)
                {
                    // your treatment
                }
            }
     

    Users who are viewing this thread

    Similar threads

    I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For the first example, I highlighted the example text and eventually found the location in the menus where I could select the CODE macro to have the example text formatted as a code example. So far, so good...
    I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For...
    I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For...
    Replies
    0
    Views
    530
    I don't know how others run it or have acquired the zap2xml stuff but the instructions I gave apply to anything. It is one line in the zap2xml.pl script that you need to change. I run on Linux so I simply run the script itself (and once you change that on the next run it will be fine.) I do not know anything about a Windows...
    I don't know how others run it or have acquired the zap2xml stuff but the instructions I gave apply to anything. It is one line in...
    Please help, It would be a great help to me just to know if people are still getting tvlisting from gracenote.com. When zap2it...
    Replies
    8
    Views
    7K
    I used to use the grabber but a few years back it disappeared on FreeSat DVBS. That is when I changed to EPG Collector. The extra benefit is that it collects from the Sky platform so it will give EPG for all the FreeSat channels plus the unencrypted movie channels on the Sky platform. It also allows me to pick the channels dedicated...
    I used to use the grabber but a few years back it disappeared on FreeSat DVBS. That is when I changed to EPG Collector. The extra...
    Hi everyone, I hope you are all well My Mum's Mediaportal lost it's marbles thanks to Microsoft update, (even though I had update...
    Replies
    2
    Views
    2K
    As easy as that ;). Restarted HTPC and 'out of memory' errors have disappeared, thank you!
    As easy as that ;). Restarted HTPC and 'out of memory' errors have disappeared, thank you!
    Just installed the MediaPortal 1.37 Pre-Release. Client takes a long time to start up because it is looking for the...
    Replies
    4
    Views
    2K
    I do not know why this xml was in my theme folders, it must have sneaked in some time ago (years?). I simply removed the file. The Latest Media Handler plugin seems to be working as expected. I've had no lock-ups.
    I do not know why this xml was in my theme folders, it must have sneaked in some time ago (years?). I simply removed the file. The...
    Before you create this bug report: Make sure that your system (windows, codecs and drivers) is up to date, matching the...
    Replies
    13
    Views
    4K
    Top Bottom