earliest playback

no sound, just terminal output
This commit is contained in:
tildearrow 2021-05-12 03:58:55 -05:00
parent 9d17655836
commit f810fc0c3c
15 changed files with 901 additions and 22 deletions

View file

@ -1,3 +1,6 @@
#ifndef _DISPATCH_H
#define _DISPATCH_H
enum DivDispatchCmds {
DIV_CMD_NOTE_ON=0,
DIV_CMD_NOTE_OFF,
@ -17,15 +20,27 @@ struct DivDelayedCommand {
DivCommand cmd;
};
class DivEngine;
class DivDispatch {
protected:
DivEngine* parent;
public:
virtual void acquire(float& l, float& r);
/**
* the rate the samples are provided.
* the engine shall resample to the output rate.
*/
int rate;
virtual void acquire(short& l, short& r);
virtual int dispatch(DivCommand c);
/**
* initialize this DivDispatch.
* @param parent the parent DivEngine.
* @param channels the number of channels to acquire.
* @param sugRate the suggested rate. this may change, so don't rely on it.
* @return the number of channels allocated.
*/
virtual int init(int channels);
virtual int init(DivEngine* parent, int channels, int sugRate);
};
#endif