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,234
    2,388
    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,234
    2,388
    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

    Hi. I was probably being a bit fast and loose with my terminology. I meant "somewhere within the files that MP2 uses in its database". Anyway, I found a way to do this which was far from automated but relatively low effort. I found what looked like all the images (CD covers, DVD covers, backgrounds etc all lumped together in...
    Hi. I was probably being a bit fast and loose with my terminology. I meant "somewhere within the files that MP2 uses in its...
    I am in the process of setting up a legacy media player (Mede8er) which I happened to have laying around into my home cinema setup...
    Replies
    2
    Views
    471
    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
    922
    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
    8K
    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
    Top Bottom