How do you send commands to Media Portal? (1 Viewer)

jadz

Portal Pro
August 30, 2004
150
0
Canada
Could someone point me in the right direction for sending commands to Media Portal (is there an API?).

An example of a plugin that would use this is a remote control plugin, or a web interface plugin. The remote control plugin knows that it wants to change the channel up, but how does this get sent to Media Portal? Do I have to emulate keystrokes?

I am not yet familiar with all the code in Media Portal so if there is a particular place I should look I would appreciate the guidance.f
 
A

Anonymous

Guest
I'm not an expert on this as I've been looking at other areas, however your plugin will have to inherit from the GUIWindow class, which will allow you to override the OnMessage method for receiving messages.
There's also an GUIWindow method you can override called OnAction, which passes an Action object.
The GUIWindowManager class then has a SendMessage method for (guess what!) sending messages, however I get a bit hazy here about the implementation of this.

Look at existing plugin code to try to get some info (or to get some real info as I may be wrong!)
 

Frodo

Retired Team Member
  • Premium Supporter
  • April 22, 2004
    1,518
    121
    51
    The Netherlands
    Home Country
    Netherlands Netherlands
    i would map the remote key codes -> keyboard codes
    so the play button on your remote to the 'p' character
    why? because there are many more Actions then physical keys on your remote. Mediaportal maps the keyboard codes ->actions based on the current window.
    So for example in
    my music F7/f8 = play previous/next song
    DVD f7/f8 = previous/next chapter
    TV f7/f8 = previous/next tv channel
    videos f7/f8 = previous/next movie

    these are all different actions, but are all controlled by those 2 keys (f7 & f8)
    therefore you can better map your remote keys -> keycodes


    Frodo
     

    Users who are viewing this thread

    Top Bottom