|
CSL
5.2
|
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>
Inheritance diagram for csl::Observer:Public Member Functions | |
| Observer () | |
| virtual | ~Observer () |
| constructor | |
| virtual void | update (void *arg)=0 |
| this will be implemented in subclasses. | |
Public Attributes | |
| float | mPeriod |
| virtual destructor (don't notify or delete observers in this version) | |
| int | mKey |
| key selector (e.g., MIDI chan) I receive update() mesages from my model; | |
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 283 of file CGestalt.h.
|
inline |
Definition at line 285 of file CGestalt.h.
|
inlinevirtual |
constructor
Definition at line 286 of file CGestalt.h.
|
pure virtual |
this will be implemented in subclasses.
Implemented in 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 286 of file CGestalt.h.
Referenced by csl::Model::attachObserver().
| int csl::Observer::mKey |
key selector (e.g., MIDI chan) I receive update() mesages from my model;
Definition at line 289 of file CGestalt.h.
Referenced by csl::Model::attachObserver().