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,057
    2,132
    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,057
    2,132
    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

    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
    997
    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
    808
    Thanks CyberSimian, that's fixed it (y) and also thanks to AJS for including the change in the next release.
    Thanks CyberSimian, that's fixed it (y) and also thanks to AJS for including the change in the next release.
    When using the List Layout for Argus TV Recorded TV the page count is above the bottom information bar, refer to attached...
    Replies
    4
    Views
    655
    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work. Spotify desktop app installed on same computer as you are going to use with MediaPortal Getting ready Create an app at spotify, use this link: Dashboard | Spotify for Developers, you have to login. Click...
    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work...
    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work...
    Replies
    0
    Views
    2K
    Well, currently the plugin shows the sun/moon times in user's local time. As you said, It would require to add time zone parameter to the profile. I'll try to add this option in the next version. PS: please use official thread
    Well, currently the plugin shows the sun/moon times in user's local time. As you said, It would require to add time zone parameter...
    I have the current (1.0.2.0 level) World Weather Lite plugins installed on x86 and x64 different MP1 copies. When Location is...
    Replies
    7
    Views
    2K
    Top Bottom