ASPiK SDK
Loading...
Searching...
No Matches
Modifier Keys & GUI Scaling

Modifier Keys
The PluginGUI object is already setup to implement the various modifier key and mouse click combinations used to fine tune the GUI and reset its controls to their default values. Modifier keys include the command (Mac), control, and alt (or option) keys. Pro-Tools defines its own API-specific set of modifier. This code is already written for you so there is nothing to implement however you will need to document these modifier combinations for your users. The modifier keys are listed below. Each involves clicking on a control with the left mouse button while holding a modifier key down.

Fine Adjustment: hold modifier key while clicking / dragging mouse over knob or slider
Pro-Tools MacOS: CMD
Pro-Tools Windows: CTRL
All others (Mac & Win): SHIFT

Go to Default Value: hold modifier key while clicking mouse over knob, slider, button
Pro-Tools MacOS: OPTION
Pro-Tools Windows: ALT
AU: OPTION
VST MacOS: CMD
VST Windows: CTRL
RackAFX: CTRL

Pro-Tools: Enable Automation CTRL + ALT + CMD while clicking on a GUI control


GUI Scaling
VSTGUI has a built-in GUI scaling mechanism that allows you to easily expand or shrink the entire GUI window. Sometimes this is required for high-resolution displays (shrinking) or for visually impaired users (expanding). There is a more accurate method for dealing with the Hi-DPI displays that you can also use (see the ASPiK website for more information). However, we can use the built-in scaling to made moderate adjustments to the GUI size. There is already a preset GUI control reserved for this operation and your PluginGUI object implements the GUI scaling, which VSTGUI calls “zooming.” The PluginGUI object can scale down to 65% or up to 150% of the normal GUI size. Values outside this range generally do not give acceptable results, however as with everything else, all the code is there for you to see and modify if you wish. We have already set up a GUI control that you can implement as a drop-list control to allow the user to scale the GUI. To add this control, add the following parameter instantiation after the rest of your GUI parameter declarations in the plugincore.cpp file. Notice the special control ID value "SCALE_GUI_SIZE" here:

 // — SCALE_GUI_SIZE
piParam = new PluginParameter(SCALE_GUI_SIZE, "Scale GUI", "tiny,small,medium,normal,large,giant", "normal");
piParam->setIsDiscreteSwitch(true);
addPluginParameter(piParam);

There are a few more reserved ID values:

RESERVED PARAMETER ID VALUES
const unsigned int PLUGIN_SIDE_BYPASS = 131072; // VST3 only
const unsigned int XY_TRACKPAD = 131073;
const unsigned int VECTOR_JOYSTICK = 131074;
const unsigned int PRESET_NAME = 131075;
const unsigned int WRITE_PRESET_FILE = 131076;
const unsigned int SCALE_GUI_SIZE = 131077;

You can also see the reserved control ID value named WRITE_PRESET_FILE; this is for a helper control to let you easily assemble your presets. We will discuss that helper control later in the tutorial.