CSL
6.0
|
CSL Observer/Dependent/Monitor class – instances receive update() messages from "models" and handle some argument, which may be the model's "this" pointer, or any other data. More...
#include <CGestalt.h>
Public Member Functions | |
Observer () | |
virtual | ~Observer () |
constructor More... | |
virtual void | update (void *arg)=0 |
this will be implemented in subclasses. More... | |
Public Attributes | |
float | mPeriod |
virtual destructor (don't notify or delete observers in this version) More... | |
int | mKey |
key selector (e.g., MIDI chan) I receive update() mesages from my model; More... | |
CSL Observer/Dependent/Monitor class – instances receive update() messages from "models" and handle some argument, which may be the model's "this" pointer, or any other data.
Subclasses must override the update() method to do their stuff – grabbing a data buffer, operating on their model, or displaying something.
The mPeriod is the requested period for updates. The mKey is an int value for the model's evaluate() function to filter updates i.e., if the model implements evaluate(void*), and its return value is non-zero and matches the observer's key, then an update will be sent. An example of using this is a MIDI IO object's channel filtering for MIDI listeners (observers).
Definition at line 296 of file CGestalt.h.
|
inline |
Definition at line 298 of file CGestalt.h.
|
inlinevirtual |
constructor
Definition at line 299 of file CGestalt.h.
|
pure virtual |
this will be implemented in subclasses.
Implemented in CSLMIDIComponent, CSLMIDIComponent, csl::Spatializer, and csl::SpatialPanner.
float csl::Observer::mPeriod |
virtual destructor (don't notify or delete observers in this version)
max update rate
Definition at line 299 of file CGestalt.h.
Referenced by csl::Model::attachObserver(), and Observer().
int csl::Observer::mKey |
key selector (e.g., MIDI chan) I receive update() mesages from my model;
Definition at line 302 of file CGestalt.h.
Referenced by csl::Model::attachObserver(), and Observer().