Ok, MDX now has the ability to control programs through their COM interface as well as be controlled by other programs through the MDX COM interface.
New FCC here: <EDIT> Built into MDX now </EDIT>
<EDIT> See post #13 for more syntax details</EDIT>
There are still some little things I need to clean up for a full update through the updater, but it should be stable.
So changes to the com section of the xml file. There are now 2 sections like below:
Notice the bold section. This is what has been added. Also I am hoping that the xml structure being fully outlined will be easier for people to see what's going on and where this code is in relation to the root.
<?xml version="1.0" encoding="utf-8" ?>
<command id="RoadRunnerCommand" minimum_delta_vote_time="100">
<do function="trigger output" functionTargetID="Digital Output 0" vote_opinion="on" vote_priority="medium"></do>
<do function="trigger output" functionTargetID="Digital Output 1" vote_opinion="on" vote_priority="medium"></do>
<command internal_id="RoadRunnerCommand_PLAY" external_command="Execute">
<parameter order="0" external_command_parameter="PLAY" />
Every external_COM_id is a different program. You could have multiple external_COM_id pointing to the same program, but that could cause instance problems, and would take more memory and defeat the purpose.
In the external_COM_id the id is what the external program needs to be referenced as. In the case of RoadRunner, it is "RoadRunner.SDK". I havent experimented with it enough to know if RR needs it to be case sensitive, but MDX will honour case for everything in this section.
Child nodes of external_COM_id are the commands that MDX will send. Each command has an internal and external command name.
Internal is what is used by MDX to find this specific command pointing to this specific program and with these specific parameters.
The external is what is required by the external program. With RoadRunner, it is "Execute" as far as I know and it works with the build I have.
The parameters are each child node of command labelled parameter. The order they are based off of is the number in the order attribute, NOT the order in which they appear in the file to allow for greater expandability.
Now to call this code and have the command send to the program (in this case Execute("PLAY") being sent to RoadRunner), you need to raise a vote with the function of "external command" and the functionTargetID of "RoadRunnerCommand_PLAY". The rest of the vote options need to be filled with filler such as below where a button will call the command to run causing RR to intercept a "PLAY" command.
That should do it.
<button id="BUTTON_COM_TEST" enabled="yes" function="external command" functionTargetID="roadrunnercommand_play" vote="filler" vote_opinion="filler" vote_priority="Medium">
<images imagePrimary="content\images\button_images\button_down.png" imageSecondary="content\images\button_images\button.png" imageDisabled="content\images\button_images\button.png" imagePushed="content\images\button_images\button_down.png"></images>
<display size="230,70" location="37,119" page="0" z_order="0.9"></display>
<vote_options minimum_delta_vote_time_down="20" ></vote_options>
<text font="verdana" font_size="25"></text>
<text colourPrimaryARGB="255,255,255,255" textPrimary="COM_Test"></text>
<text colourSecondaryARGB="255,255,255,255" textSecondary="COM_Test"></text>
And odd yet not unpleasant side effect of the new code is that if you have RoadRunner being the object getting commands passed to like above, RR will start with MDX if it is not already running. Sort of spiffy and unexpected.
If you have questions, ask.