Reply to thread

The idea is allow both the MP core and plugins sendind and receiving generic string command, simply by adding a

virtual method to IPlugin interface, to allow plugins receiving command, like


[code]virtual IPlugin::onConsole(CommandInfo i)[/code]


(CommandInfo is an helper that contains a string command, and offer methods for parsing/extract info)


and adding a method to send command, like


[code]void IPlugin::Send(CommandInfo i)[/code]


This allow:


- To write plugins that interacts with other plugins,

  for example people can write a simple process plugin "MyTalk" that process command like "Speak 'Bye Bye!'", so other plugins

  can send this type of command, without need to know if "MyTalk" is installed or not, and can be exists many plugins that do the same

  things, allow users to choose the best for us...


- To write a plugins called "MyConsole" that allow advanced command at runtime, not possible via gui, like the console in many FPS games


- To write a plugins called "MyRemoteConsole", that create a socket in listening on a port, and receive/send command to connected client,

  for example to allow interaction between many MP on lan, or a useful front-end for external display or peripherical connected via lan,

  and people can write application that talk with MP without need to write a specific plugin for MP. 

  For example, we can write a plugin for Girder that, in response of an event, send a command to MP, or viceversa

  when receive an event from MP that match, launch an action in Girder.

  Potentially, is possible to use the Girder scripting language, lua, for control MP.

 

Second step, allow the users to write a script, without re-compile the source, for advanced and very custom MP personalization, for example:

[code]

function onConsole(CommandInfo i)

{

    if (i.sender=="Core") && (i.command=="Starting")

    {

        Send("Core","GoTo MyTv");

        Send("MyTV","SwitchChannel /Name:MTV");


        // To do that, the core need to implement a call like

        // Send("All","Starting") when the initialization is ended and the home menu is on screen...

    }


    if (i.sender=="MyVideo") && (i.command=="SchedulerRecordingEnded")

    {

        // a user-custom notifications

        Send("MyOSD","Show /Message:End recording of "+i.command.param["Title"]);


        // To do that, MyVideo need to implement a call like

        // Send("All","SchedulerRecordingEnded /Title:ABC")

        // and exists a plugins called "MyOSD" that process this type of command.

    }


    if (i.sender=="MyAlarm") && (i.command=="Alarm")

    {

        if (Receive("MyVideo","Status")=="Playing")

        {

            Send("MyVideo","Play /File:Alarm.avi /PipMode");   // Only when PipMode can be avaible!!

        }

        else

        {

            Send("MyOSD","Show /Message:Alarm!");

        }

    }   

}

[/code]

( To allow scripting in MP (i don't understand if there is already a work about it), i think that this article

can be interesting:

http://www.codeproject.com/csharp/cs-script_for_CP.asp

,the idea is writing a C# script like the above, and MP directly compile it (like a process plugin) in a temp assembly and run)



For limit the cpu use,

- Send must accept a parameters that indicate the components/plugin that can receive the command, like the sample above,

or

- Every plugins or script can receive the command only after a "subscribe" command versus other plugins/script, like the open-source project EIBControl

(http://eibcontrol.sourceforge.net/).

This project is the origin of my idea, because i have an EIB installation in my house, and i want that MP interact with my house, for example

showing an osd message on all my MP when the doorbell is pressed...


Also, a dump of the console output can be useful to check the sequence of actions that cause a problem.


All the actual Action.ActionType command can be send with a Send("ACTION_VOLUME_MUTE"), received by the core.



I think it's not a difficult implementation, but need to be done in core MP, and also many plugins developer must support this architecture,

so what we think about this???


Thanks!


Top Bottom