Customize Command Console
From IRIDAS Online Documentation
Contents |
Overview
The command console on SpeedGrade and FrameCycler can be customized by adding or removing buttons and even whole CommandBars. This is the default arrangement of the command buttons:
The buttons and their appearance are configured with an XML text file called Main.irui which is located in the resources folder in your application installation.
Note:If you want to customize CommandBars, it is advisable to make backups (save with a different name) of the original and edited Main.irui files, since future installations will overwrite the Main.irui file.
Understanding the Main.irui File
The structure of this XML file is simple. It begins with an opening tag <IRIDASGUI> and contains one or more <Panel> sections. In each of the <Panel> sections there are one or more <CommandBar> sections which in turn contain one or more <Command> sections.
Multiple Panels will be stacked vertically: these represent rows of CommandBars. Since the default Main.irui only has one Panel, it only has one CommandBar row.
Each CommandBar represents a group of commands. In the Main.irui (displayed above), the eight buttons from Desktop to Render all belong to one CommandBar. The playback controls on the right are part of a separate CommandBar. Each button represents one Command.
The following example shows the structure of an irui file.
<IRIDASGUI> <Panel> <CommandBar> ... <Command> ... </Command> <Command> ... </Command> </CommandBar> <CommandBar> ... </CommandBar> </Panel> <Panel> ... </Panel> ... </IRIDASGUI>
The <Panel> section
The <Panel> section represents a horizontal area of the interface in which one or more CommandBars can be placed. The height of the Panel is determined by the maximum height of the CommandBars it contains. Panels automatically stretch across the full width of the interface.
The CommandBars within a Panel can be prioritized in case the width of the Panel isn’t sufficient to display all of them. When this option is applied, CommandBars with the higher priorities will display and those with lower priorities are hidden. All are displayed again when the GUI window is wide enough.
The CommandBars within a Panel are distributed horizontally.
The <CommandBar> section
Each CommandBar section contains a number of <Command> sections. It also has a number of attributes that have to be set:
<CommandBar> <Width>240</Width> <Height>25</Height> <Priority>10</Priority> <Command> ... </Command> <Command> ... </Command> </CommandBar>
The <Label> attribute defines the text that is displayed on top of the button. The optional <Tooltip> attribute defines the tooltip that displays when the pointer hovers over the button for a while. To place an image on the button (rather than text), the <Bitmap> attribute can be used to define a bitmap to be displayed. Currently only built-in bitmaps are supported by this feature so it is of limited use for toolbar customization.
The <Exec> attribute defines the command that is executed when the button is depressed. It always has the format:
Command(FunctionToExecute)
with FunctionToExecute determining the actual function that is to be called in the product. If you need to call more than one function, you can queue several commands using semicolons:
<Exec>Command(Category.Fn1);Command(Category.Fn1)</Exec>
You can pass a parameter to a command by appending it with a comma:
<Exec>Command(Property_Window.SetCurrentPage, Overall)</Exec>
Example: Creating a Custom CommandBar
Let’s say we wanted to add another Panel to display review functions that are otherwise only accessible via hotkeys.
We begin by opening up Main.irui with a text editor and adding another <Panel> containing one <CommandBar> with a <Width> of 500 and a <Height> of 25 pixels.
<IRIDASGUI> <Panel> <CommandBar> <Width>500</Width> <Height>25</Height> </CommandBar> </Panel> <Panel> ... Existing Panel left unchanged
Inside the <CommandBar> we want to add the following commands:
- Isolate Clip Left
- Toggle Isolate Clip
- Isolate Clip Right
First of all we have to find the names which the application uses for these commands. The fastest way to access all commands is to look at the Hotkeys.html file which is automatically generated in the root of your installation when you run SpeedGrade or FrameCycler. This file contains a list of every command with a hyperlink that executes the command when clicked in the F1 window of FrameCycler or SpeedGrade. The syntax of these hyperlinks contains the function name which we will need to paste into Main.irui
Open up the HTML file in a web browser, find the right function from the description and then copy the hyperlink into Main.irui (removing the “Exec:” before the function).
In our example, the syntax for the functions we want is here:
- Isolate Clip Left Timeline.NavigateLeftAndSetInOut
- Toggle Isolate Clip In_Outs.SetToSelectedClip
- Isolate Clip Right Timeline.NavigateRightAndSetInOut
Added to the Main.irui file we get the following:
<Panel> <CommandBar> <Width>500</Width> <Height>25</Height> <Command> <Label>"Isolate Left Clip"</Label> <Exec>Command(Timeline.NavigateLeftAndSetInOut)</Exec> <Tooltip>"Sets the in/outs to the previous clip in the timeline"</Tooltip> </Command> <Command> <Label>"Toggle Isolate Clip"</Label> <Exec>Command(In_Outs.SetToSelectedClip)</Exec> <Tooltip>"Sets the in/outs to the current clip in the timeline"</Tooltip> </Command> <Command> <Label>"Isolate Right Clip"</Label><Exec>Command(Timeline.NavigateRightAndSetInOut)</Exec> <Tooltip>"Sets the in/outs to the next clip in the timeline"</Tooltip></Command></CommandBar></Panel>
Now, when we run the application, we have a new CommandBar (in a new Panel):
Clicking on the buttons, these commands are executed. Of course they can still be activated via the CTRL+Left, CTRL+Space and CTRL+Right keystrokes.
Example: Creating a CommandBar with Parameter Passing
To demonstrate parameter passing, we’ll add a new CommandBar with three buttons that correspond to the three loop modes for playback (usually cycled by F6): Loop, Single Run and Ping-Pong (back and forth).
<CommandBar> <Width>200</Width> <Height>25</Height> <Command> <Label>"Loop"</Label> <Exec>Command(Playback.SetLoopMode, 0)</Exec> </Command> <Command> <Label>"Single Run"</Label> <Exec>Command(Playback.SetLoopMode, 1)</Exec> </Command> <Command> <Label>"Ping-Pong"</Label> <Exec>Command(Playback.SetLoopMode, 2)</Exec> </Command> </CommandBar>
The new CommandBar:
