You may have seen me hinting that i’m developing an application framework using Juce, and it’s almost ready to share. It may seem a little superfluous at first, but i think it should help in the creation of applications that are more complex than a simple Component based app will allow.
It’s called the ‘DocAppGui Model’, and is based around three main bases.
This is the most significant class, providing a structured means of managing user data for your app. It has a unit base class called DocumentDataElement, which provides a standard interface; each element is able to export itself as an Xml tag, and the master document class uses this ability to store the whole structure to a file - as well as recreate it from a file. A kind of smart pointer is provided too which allows GUI components to safely refer to elements in the structure, as well as recieve change notifications from them.
App and Gui
This allows you to wrap the main app functionality and GUI component structure in two separate linked objects. The App maintains any Documents the program is using (currently it just uses one, but I will be expanding this to support multiple Documents), and has ApplicationCommand stuff implemented for easy use, as well as providing a MenuBarModel. It will also automatically refresh the Gui object whenever a Document changes. The reason for this abstraction/separation is to make it very easy to develop an app that will work as both standalone and plugin; using this model, you create an App subclass and a Gui subclass, which then will translate smoothly into a JuceAudioPlugin system (the filter inherits your App subclass, the editor inherits the Gui subclass).
I’ve also made a ‘GenericMidiOutput’, which can be used for most simple MIDI purposes acting on a single assigned port; if your program only needs one port, you can use a GenericMidiOutput* in the App subclass and call its simple sending functions (sendCcMessage(…) etc). When building a standalone application, the instance of this output would be a subclass called JuceSingleMidiOutput, which wraps the MidiOutput stuff; when making a plugin, the instance is a special JuceAudioPlugin-friendly alternative which puts your messages into a buffer to be sent to the plugin’s output- thus you have one interface that works seamlessly between platforms.
As usual, just posting this information to see how people feel about it, and if anyone’s interested or has any suggestions/criticisms.