tags: gui, editor, vst, c++, cpp, windows, .net framework
Bitwise Gui Editor
A "basic" Vector Graphics drawing tool for:
- Drawing Vst controls skins
- Creating and exporting Vst gui layouts (bitmaps and source code for the wisegui library)
Note
This software is, currently, an "alpha" release and has not been extensively tested.
Save frequently and backup a project file before opening it again.
Examples:
One Fine Day
A basic "demo" vst whose layout was developed using Bitwise Gui Editor.
It renders the layout using the Wisegui Library.
Example
Wisegui library's usage example. It shows how to use the Wisegui Library.
Canvas Roles:
- None: simply exported as a bitmap
- View: exported as bitmap and source code
- Control: exported as bitmap and included in the view's code
Workflow:
- Draw controls skins on control canvases.
- Draw the view layout on a view canvas.
- Add the controls defined above to the view canvas.
- Set the controls properties.
- Save the project.
- Export the project.
- Copy the exported files into your C++ project folder and add them to it.
Files created by the exporter
*.png | view and controls skins |
bge.h | bitmaps identifiers |
bgeres.rc2 | "bitmap to identifier" mappings |
ids.h | definitions for controls id and parameters id |
*.h and *.cpp files | header and source code for each canvas of type: View |
Note: The class headers should not be modified if you plan to update the skins and/or the layout. You may modify the source code files, but you don't have to replace them if exporting again.
The exporter will create a subfolder in the same folder that
contains the project file. Its name is: [project name]_files,
where [project-name] is the name (without extension) you gave
to the project when you saved it .
Post-export feature
You can automate the copy of the exported files by creating a
batch file. The batch file must be located in the same folder
as the project file. Its name is [project name]_post-export.bat.
If the exporter finds this file, it runs it.
Example
set SRCDIR= ... Path To editor's project files ...
set DSTDIR= ... Path to cpp project ...
set file1=MainView.cpp
set file2=OtherView.cpp
copy %SRCDIR%\*.png %DSTDIR%\img
copy %SRCDIR%\*.rc2 %DSTDIR%
copy %SRCDIR%\*.h %DSTDIR%
cd /D %DSTDIR%
if exist %file1% goto noe
copy %SRCDIR%\%file1% %DSTDIR%
echo %file1% copied
:noe
if exist %file2% goto noe2
copy %SRCDIR%\%file2% %DSTDIR%
echo %file2% copied
:noe2
cd /D %SRCDIR%
Toolbar description
Shortcuts
ALT + Q |
Sets the selection tool's and gradient tool's colors. |
ALT + B |
Sets the main window's background color. |
ALT + C |
Shows the current canvas property list. |
CTRL + S |
Save |
CTRL + C |
Copy |
CTRL + V |
Paste |
DELETE |
Deletes the selected shape |
How To Draw
Select a layer in the canvas properties, select a shape in the toolbar, click on the canvas and drag to select a
rectangular area. When you release the mouse, the shape is inserted in the area you selected. A Control (used for exporting source code) is initially blank, the Template property gives it its image.
Animations
A canvas has 8 layers. Each layer has its own animation. Before opening the animation editor, select the number of frames that the canvas will contain. Once the animation editor is open, select the layer you want to animate. Then set its properties according to the animation you want.
Skins design references:
- Each control added to a view, has an Id property which is
used in the source code to
identify the parameter it
refers to.
- When you add a Control to a view, it is blank (independently
of the type of Control.).
- To assign a skin (a "Control" canvas that you have already
designed):
set the Template property by choosing the Control canvas in the
list.
- A slider control has an additional template that is used for
the slider handle.
- Note: Buttons and Labels don't provide a value and they are
not handled by the vst host.
These special cases "must" be identified by an Id whose last
character is @.
For example: kButton1@, kVolumeLabel@.
- Also, if you don't need that a parameter is managed by the
host,
append a @ to its Id property, for example: kKnobVolume@.
|
Knob Control |
A knob image contains all the frames required to show its animation. If the frame size is W x H, the size of the image is W x (H * Frames). |
|
|
HSlider |
The Handle is drawn separately. |
|
|
VSlider |
The Handle is drawn separately. |
|
|
HSwitch |
The HSwitch image contains as many sub-images as the options are. The OptionsCount property is the number of options. |
|
|
VSwitch |
The VSwitch image contains as many sub-images as the options are. The OptionsCount property is the number of options. |
|
|
DropDownList |
FontSize sets the size of the fonts. Items is the list of items to insert in the list. The items cannot be inserted/removed at runtime. |
|
Button |
The Button image contains two stacked images, one for the Normal state and one for the Pressed state. |
Checkbox |
The Checkbox image contains two stacked images, one for the Off state and one for the On state. |
StateButton |
The StateButton image contains four stacked images, one for the Normal Off state and one for the Pressed Off state, one for the Normal On state and one for the Pressed On state. |
Label |
FontSize sets the size of the fonts |
Wisegui Library
The Wisegui Library is a graphic framework for rendering
(testing) gui layouts created by the Bitwise Gui Editor.
Implementing a Vst gui using Wisegui library
(VST is a trademark of Steinberg Media Technologies GmbH)
class Gui : public AEffEditor, public Window
The Window class hosts a View derived object. The derived View
is provided by the code exported by the Gui Editor and contains
the code to create the controls. A Vst creates the gui in the
following way:
View *view = new MyView(this);
_gui = new Gui(this, GUI_WIDTH, GUI_HEIGHT);
_gui->SetView(view);
setEditor(_gui);
The View has also two methods whose use is optional:
OnLoad | called when the view is being initialized |
OnUpdate | called to update all its control values. |
Implementing a Vst using Wisegui library
The View sends and receive information from the vst through
the ControlListener interface:
class Example : public AudioEffectX, public ControlListener
The vst implements its three methods:
- void ParamChanged(int, double);
The View informs the vst that a control has changed its value.
- double GetParamValue(int index, bool normal = true);
The View needs the parameter value whose identifier is index.
- ParamInfo *GetParamInfo(int index);
The View needs info about the control whose identifier is index.
Wrapping the Vst Parameters
The ParamInfo class is used to describe a single vst parameter.
You describe the parameter in the constructor:
ParamInfo(kKnobVolume, CTYPE_DOUBLE, 0, 100, v, "Volume", "")
The arguments are:
- Parameter id
- Parameter type
- Min, Max values
- Default value
- Name
- Label
Note: The file ids.h defines parameters ids and macros for
the constructor of each parameter defined:
#define P0(v) ParamInfo(kKnobVol, CTYPE_DOUBLE, 0, 100, v, "Volume", "")
ParamInfo Methods:
Init | Called to initialize a parameter, after a program change. |
GetNormalValue / SetNormalValue | Get and set the normalized parameter value. Useful to talk to the host |
GetValue / SetValue | Get and set the raw parameter values. |
Movie Control
read
Painter Control
read
Download: