Here's my current #1 wish for TTD: Functions
also known as "methods" in the programming world.
How I think this could be implemented into the current, drag and drop TTD:
On a processor we currently have system macros. These macros are numbered, but referenced by name. A system macro can run additional macros. A remote/keypad/tp can also "run" these macros using a System Macro Trigger command.
OK.
Now, what I'd do is add a second set of "macros" called functions.
The functions would be named, as are the system macros.
Essentially, they would be the same as system macros with one major difference: Each "function" would have access to a number of "variables".
When you add a function (like adding a new system macro). The software will allow you to define how many variables ("arguments") are used in the function. These variables could be named and/or numbered (ie: variable1, variable2 or sourceID, tvOn).
Inside the function (essentially a system macro), the programmer could reference the variables. As a rudimentary example, without changing the CURRENT applications of system macros, a function could look like this:
Function Name: mediaRoomControl
Variables: sourceID, tvOn
Function:
RS232 > Denon receiver > PWON\r (turn on receiver)
delay 2 seconds
if (sourceID="TV") then RS232>Denon Receiver> SITV\r (set receiver to TV input)
if (sourceID="DVD") then RS232>Denon Receiver> SIDVD\r (set rec to DVD input)
if (tvON="true") then IR>Sony TV> Power On (turn on TV)
....else IR>Sony TV> Power Off (turn off TV).
Now lets look at the remote.
On a button (set to standalone), you can currently "trigger" a system macro on a processor.
Similarily, we would now be able to "trigger" a function. The only difference would be, that when we put the "Trigger Function" command on a button, the software would ask for the VALUE of the variables used by the function.
So when I assign the "mediaRoomControl" function to my "Watch TV" button, the software would ask me for the values of the sourceID and TVon variables. In this case, I would set the sourceID variable as "TV" and the TVon variable as "true".
On my Listen to CD button, I would use the SAME function trigger, but this time I would set sourceID as "CD" and the TVon variable as "false"
---
This is a VERY basic example. If RTI were to implement this type of possibility, I would hope that they would expand on this.
First, I would allow for the processor and/or remote to store "global" variables. These would be identical to Flags, except they could contain a number or "string" of characters.
Basic math options (ie ability to ADD two numbers) and string options (ie ability to "join" two strings) would be important.
---
This desire stems from my recent programming of B&K multiroom equipment.
I have 6 zones and 9 sources (plus tuners and local source inputs!)
Basically, every time I program one of these, I create 9 macros for every zone.
Macro 1: Zone A, input 1
Macro 2: Zone A, input 2
etc etc
---
With a decent implementation of functions, I could have ONE function.
I could "pass" two variables to the function: zoneID ("A-F") and sourceID (1-9).
Then using string addition, I could create my RS232 commands from these variables, and send them to the B&K controller.
---
There are MANY MANY MANY possible uses for this type of system.
Obviously Crestron/AMX etc have this possibility and so much more.
But, I think a fairly basic implementation of variables and functions could be worked into the current TTD software without much trouble. They could keep the "drag and drop" simplicity of the software. It wouldn't require the programmer to write "code". Basically variables could be set, cleared, and tested just like flags, except they could have more than 2 states.
Functions would be just like system macros, except with access to these variables.
Very basic addition/subtraction and string manipulation would be the icing on this cake.
----
Dear RTI,
If you are listening, please please please consider adding this functionality.
I have thought this out in great depth... but its hard to explain it here. I would be very happy to chat with your software designers and give better examples of how I think this could be added to the current software, without major upheaval of the current system... and without making the software more difficult for the average basic programmer who has no need for these options.
Thanks,
FD
Last edited by fluid-druid
on September 24, 2007 02:19.