ASPiK SDK
Loading...
Searching...
No Matches

To maximize simplicity as well as utility, the ICustomView interface is extremely simple. It is designed with the understanding that pushing audio information (samples) into the view will be a very common chore however it is not limited to just audio data. Instead, it relies on the user’s skills with the lock-free ring buffer. The ring buffer is designed to hold pointers to any type of data. This means that you can create a custom structure that has custom view message data and use that structure for messaging to and from the custom view. So, for audio data you declare a ring buffer that stores doubles (audio samples) while for passing other data, you declare a ring buffer that stores custom data structure pointers instead.

The ICustomView definition is:

{
public:
// --- function to tell the view to redraw after pushing data to it, or manipulating it
virtual void updateView() = 0;
// --- push a new double data value into the view; call this repeatedly to push multiple values
virtual void pushDataValue(double data) { }
// --- send a message into the view
virtual void sendMessage(void* data) { }
};
//
Custom View interface to allow plugin core to create safe communication channels with GUI custom view...
Definition: pluginstructures.h:1462
virtual void updateView()=0
virtual void pushDataValue(double data)
Definition: pluginstructures.h:1472
virtual void sendMessage(void *data)
Definition: pluginstructures.h:1482

You can see that the object that implements the ICustomView interface MUST override and implement the updateView( ) function that will trigger the repaint-ing of the view. It will optionally (and usually) implement one of the remaining two functions for pushing data into the view. pushDataValue( ) will send a generic double value into the custom view (which you can cast to other datatypes if you like) while sendMessage( ) pushes a pointer of some kind into the view.