!j development We have seen the article 1 "Designing VST
plugins completely 'visual' with Borland C++Builder®" and
learned, how easy it can be to build VST plugins with C++Builder®. Introduction Macromedia Flash is a very popular technology for displaying interactive content on websites. But can we also use Flash for advanced things, i.e. for GUIs inside VST plugins? The answer seems to be yes, because Flash is basically an ActiveX plugin
(at least on the Windows platform®). ActiveX plugins can be hosted
by any Windows application and thus integrated seamlessly inside other
applications. Flash offers far more than only simple frame based loop
animations. Flash has its own inbuilt high level programming language,
which makes enormous complex application programming possible. Flash is
also an open standard and enables great new possibilities for interchangeable
user interfaces. Knobs, sliders, popups, list views and all thinkable
other UI controls can be easily created with Flash. Finally we synchronize our plugins code to the Flash movie step by step to make our plugin fully functional (automate able).
Step 1: Adding the Flash ActiveX interface to C++Builder as a
VCL component Step 2: Synchronizing the Flash movie with our VST plugin To send data from the Flash movie to our VST plugin we use the FSCommand.
This command will be sent by the ActionScript inside a movie. The interface
of the Flash ActiveX provides an corresponding event "OnFSCommand",
so we can very easy access this mechanism to receive commands from the
movie. Those commands are in string (wide string) format, so we can theoretically
send unlimited variables and messages with this feature to our plugin.
The only thing to do, is to write a little command parser inside the OnFSCommand
event closure. Whatever, the sending of commands back to a Flash movie from our plugin
is not as easy as one may expect. There is no such command, which sends
strings to the movie. We can only set/modify some previously defined variables
inside a Flash movie with the interface function "SetVariable()". A Flash movie has a definable "frame rate", this means, we can define a continuous triggered clock event inside the movie, which checks for changes of some variables. Usually the frame rate lies between 12 and 48 ticks per second. So we can set some variables with the SetVariable() function and then check for a change inside the movie and the execute some code to update our movie with the actual data. In this way we have the expected bidirectional connection, necessary
for a VST plugin. But we have to take some attention to this process,
because it is very easy to occupy most of the processors capacity by a
flash movie. This would be dangerous for our real time audio processing
tasks. So we have to code our ActionScript very careful. There is an very basic example plugin provided for download to demonstrate the interaction between a VST plugin with flash GUI. The example uses an flash movie from the "demo" files of Flash MX. There is no useful functionality inside this example...
|