In this chapter the SOLOIST 2 driver is enhanced with a couple of more complex commands. These commands need one or more parameters. In the chapter before, we used the Device Parameter 1 (DP1) to address the SOLOIST (DP1 contain the name of the SOLOIST). The following four commands use more then one parameter. Additionally the three types of input fields (Text Field, Spin Button and Drop Down Box) are introduced.
The first new complex command is the “SetName” command. With this command we can change the SOLOIST's ID. Start the Device Editor again (menu Configure → Edit Device…) and select the device GenericDevice_1.
The creation of a complex command is very similar to the simple commands described in the chapter before. The difference is that we use one more parameter (P1). The field P1Name shows the parameters name. Because the command shall change the name we call the parameter “New Name”. P1 GUI stays at Text, because it makes sense to use a text field to enter a new name. In difference to DP1 we don't use a default value.
Crucially again is the line
ScriptResult = DP1 + “ NAME ” + P1 + Chr(13). As before, DP1 contains the current ID (name) of the SOLOIST player. Then the command string “ NAME ”, with leading and succeeding space character is added. P1 contains the new name for the SOLOIST and Chr(13) is for the carriage return (ASCII code 13) termination character. To save the new command click Add Cmd or Update Cmd (if the command was edited) followed by Compile.
The next command is SetErrorLimit, which determines how often the player try to read from hard disk, before playing interrupts. Valid parameter is a number between 0 and 1000. To enter this parameter we want to use a Spin Button. The Device Editor now looks like this:
P1 Name contains the designation of the parameter as usual (“Error Limit”), but P1 GUI is set to Spin Button. P1 MinMax contain, separated by semicolon, the minimum and maximum numeric value that P1 might have. As default value 0 is selected, because usually there should be nor reading error. Comparing to the previous command, the script is the same except that we replace “ NAME ” by “ ERRORLIMIT ”. Don't forget to click Add Cmd or Update Cmd followed by Compile.
The second last command in this chapter is the StartUp command. It determines how the SOLOIST player behaves on Power On. If StartUp = On, the player starts playing after power on, if StartUp = Off the player do nothing. There are only two possible values as parameter, “On” and “Off”, so we use a Drop Down Box as input field.
P1 Name contains the designation of the parameter as usual (“Startup”), but P1 GUI is set to Drop Down. P1 MinMax contain, separated by semicolon, the possible values, that P1 might have. Comparing to the previous command, the script is the same except that we replace “ ERRORLIMIT ” by “ STARTUP ”. Don't forget to click Add Cmd or Update Cmd followed by Compile.
The last command is the CueUp command. This command lets the SOLOIST jump to a position in the currently loaded clip. The position is entered as timecode (HH-MM-SS-FF) which addresses an absolute position in the clip. But the SOLOIST also knows relative positions. E.g. “+ 00-02-01-00” jumps forward one minute and two seconds from the current position. “- 00-01-02-00” jumps one minute and two seconds back. So we need three parameters (Soloist Name, absolute or relative position and the position as time code.
The parameter P1 determines the mode (absolute, relative +, relative -), and is implemented as Drop Down Box. The default value is “Absolute”, because this is the most often wanted mode. P2 is the parameter for the time code and implemented as text field. P2 Mask set the input mask for this parameter. In this case, only numeric values are accepted, separated by “-” character. We can not use the “:” as separator in a mask, because it is used for time formats (HH:MM:SS) and not for Time code (HH-MM-FF-SS).
This time, the script is a little more complex:
//Replace all "-" characters In Parameter2 With ":" P2 = ReplaceAll(P2,"-",":") If P1 = "Absolute" Then ScriptResult = DP1 + " INDEX " + P2 + Chr(13) If P1 = "+" Then ScriptResult = DP1 + " INDEX + " + P2 + Chr(13) If P1 = "-" Then ScriptResult = DP1 + " INDEX - " + P2 + Chr(13)
The SOLOIST expects the time code in the format “HH:MM:SS:FF”, with “:” as separator and not “-”. P2 uses “-” as separator, so we have to replace any “-” sign by a “:”. This is what
P2 = ReplaceAll(P2,“-”,“:”) does. Then we compare the value of P1 with “Absolute”. It true (p1 = “Absolute”) then no “+” or “-” sign is leading the time code and for the SOLOIST this is an absolute value.
Don't forget to click Add Cmd or Update Cmd followed by Compile.