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,179
    2,251
    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,179
    2,251
    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


    Write your reply...

    Similar threads

    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
    652
    • Sticky
    MP 1.37 Final (Willow) Bugfix II released, download links updated...
    MP 1.37 Final (Willow) Bugfix II released, download links updated...
    We have just released MediaPortal 1.37 - Willow x86 and x64 version. Highlights of this release Bugfixes: [MP1-5232] - GPU...
    Replies
    4
    Views
    580
    Before you create this bug report: Make sure that your system (Windows, codecs and drivers) is up to date, matching the Requirements and you've filled in your System Specs. Have a look at our MediaPortal Wiki! Maybe the solution is already there. Have a look at our Jira (Bug and Issue Tracker)and the threads in this section, maybe...
    Before you create this bug report: Make sure that your system (Windows, codecs and drivers) is up to date, matching the...
    Before you create this bug report: Make sure that your system (Windows, codecs and drivers) is up to date, matching the...
    Replies
    0
    Views
    288
    For music you may use --> https://www.team-mediaportal.de/erweiterungen/musik/global-search With GlobalSearch you can search for any entry in your music database: Artist, Album, Title, Lyrics... I'm afraid there is no such plugin :unsure:
    For music you may use --> https://www.team-mediaportal.de/erweiterungen/musik/global-search With GlobalSearch you can search for...
    HI, I'm new to MediaPortal and have a question about searching for data. I have an extensive collection of music, films, and TV...
    Replies
    1
    Views
    888
    • Sticky
    Upgrade install on MP 1.36 x64 proceeded without issue, everything I have tried so far is working and looking very good. Many Thanks(y):)
    Upgrade install on MP 1.36 x64 proceeded without issue, everything I have tried so far is working and looking very good. Many...
    Pre Releases are provided as a way for the community to test and give feedback on all the exciting things we have lined up for the...
    Replies
    1
    Views
    499
    Top Bottom