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,155
    2,227
    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,155
    2,227
    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

    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
    224
    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
    726
    The UseSSL trick made MediaPortal great again, thanks.
    The UseSSL trick made MediaPortal great again, thanks.
    Hi, Trakt has work perfectly for me for over 10 years, but for some reason this week it will not Authorize my account. I can log...
    Replies
    10
    Views
    1K
    I saw there is a plugin section, can be moved there?
    I saw there is a plugin section, can be moved there?
    Hello, for a few days I get an error within Mediaportal when I put the RSS link to trakt calendar. If I insert this link into...
    Replies
    1
    Views
    604
    I've updated dlls in first post. Fixes: Summary / Overview was always empty Collections were not filtered to official ones Studios were not populated Fallback to english tagline didn't work Score / Popularity now empty instead of dummy rating and unknown popularity numbers Also I've tried to compile plugin against MP 1.34 x64 and...
    I've updated dlls in first post. Fixes: Summary / Overview was always empty Collections were not filtered to official ones Studios...
    Hi! TheTVDB.com has movies in their API now. API itself looks ok now so I decided to add TVDB to Moving Pictures. Check it if you...
    Replies
    2
    Views
    934
    Top Bottom