Unit synchronization observer. More...
#include <Sync.h>
Public Member Functions | |
Synced (const Synced &rhs) | |
Copy constructor. | |
double | scaleSPU () const |
Returns ratio of my SPU to my Sync's SPU. | |
double | spu () const |
Returns local samples/unit. | |
double | ups () const |
Returns local units/sample. | |
const Sync * | sync () const |
Returns reference to my Sync. | |
virtual void | onResync (double ratioSPU) |
Called by my Sync reference after it changes its value. | |
void | scaleSPU (double v) |
Scales samples/unit by factor. | |
void | scaleUPS (double v) |
Scales units/sample by factor. | |
void | spu (double v) |
Set local samples/unit. | |
void | sync (Sync &src) |
Set absolute Sync source. | |
void | ups (double v) |
Set local units/sample. | |
void | nodeInsertL (Synced &node) |
Insert myself to left of node. | |
void | nodeInsertR (Synced &node) |
Insert myself to right of node. | |
void | nodeRemove () |
Remove myself from linked list. | |
Public Attributes | |
Synced * | nodeL |
Pointer to left node. | |
Synced * | nodeR |
Pointer to right node. | |
Protected Member Functions | |
void | initSynced () |
To be called from the constructor(s) of derived classes. |
Unit synchronization observer.
A Synced will attempt to copy its local variables from the master Sync upon construction. If the master Sync has not been constructed, it will use its default values of 1. This class has a reference to a Sync and its own local scaling factors. By default, the reference Sync is Sync::master.
Copy constructor.
If the argument has a subject, then attach this as an observer to the same subject. Otherwise, attach as observer of Sync::master().
virtual void onResync | ( | double | ratioSPU | ) | [virtual] |
Called by my Sync reference after it changes its value.
Any instance state that depends on the sampling length should be updated here.
Reimplemented in Quantizer< T >, DFT, Player< T, Si, St >, DFTBase< T >, and DFTBase< float >.