MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
LinkBack Thread Tools Display Modes
Old 2008-05-29, 19:37   #1 (permalink)
Portal Member
 
Join Date: Apr 2006
Location: London
Posts: 320
Thanks: 2
Thanked 4 Times in 4 Posts

Country:

My System

Send a message via MSN to cheetah05
Default Process Plugin

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.
cheetah05 is offline   Reply With Quote
Old 2008-05-29, 22:48   #2 (permalink)
Portal Member
 
Join Date: Apr 2006
Location: London
Posts: 320
Thanks: 2
Thanked 4 Times in 4 Posts

Country:

My System

Send a message via MSN to cheetah05
Default

Specifically, the bit i am after, is which method actually starts the plugin?
cheetah05 is offline   Reply With Quote
Old 2008-05-30, 10:44   #3 (permalink)
Portal Member
 
framug's Avatar
 
Join Date: Apr 2006
Location: France
Posts: 161
Thanks: 0
Thanked 2 Times in 2 Posts

Country:

My System

Default

Hello,

It is the same code as GUI plugin.

Only change :

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

Regards.
framug is offline   Reply With Quote
Old 2008-05-30, 12:30   #4 (permalink)
Portal Member
 
Join Date: Apr 2006
Location: London
Posts: 320
Thanks: 2
Thanked 4 Times in 4 Posts

Country:

My System

Send a message via MSN to cheetah05
Default

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.
cheetah05 is offline   Reply With Quote
Old 2008-05-30, 12:56   #5 (permalink)
Portal Member
 
framug's Avatar
 
Join Date: Apr 2006
Location: France
Posts: 161
Thanks: 0
Thanked 2 Times in 2 Posts

Country:

My System

Default

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
            }
        }

Last edited by framug; 2008-05-30 at 13:37. Reason: add source code
framug is offline   Reply With Quote
Reply

Bookmarks

Tags
plugin, process

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WindowsMediaPlayerOSD process plugin. nshvydky Plugins 18 2008-07-22 13:47
FileSystemWatcher in a process plugin? MoPhat General Development (no feature request here!) 2 2008-05-31 20:37
Window plugin showing up as process Hesse Plugins 8 2006-08-31 04:34
WinLIRC process plugin will not load with RC3 z3gator Codecs, External Players 4 2006-04-01 03:44
WindowsProgressDialog in process plugin STSC Plugins 3 2005-02-28 14:59


All times are GMT +1. The time now is 07:07.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress