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,6 +1,9 @@
#ifndef _ENGINE_H
#define _ENGINE_H
#include "song.h"
#include "dispatch.h"
#include "../audio/taAudio.h"
#include "blip_buf.h"
struct DivChannelState {
std::vector<DivDelayedCommand> delayed;
@ -18,10 +21,19 @@ class DivEngine {
int chans;
bool playing;
bool speedAB;
int ticks, curRow, curOrder;
int ticks, cycles, curRow, curOrder;
std::vector<DivChannelState> chan;
blip_buffer_t* bb[2];
short temp[2], prevSample[2];
short* bbOut[2];
void nextOrder();
void nextRow();
void nextTick();
public:
void nextBuf(float** in, float** out, int inChans, int outChans, unsigned int size);
// load a .dmf.
bool load(void* f, size_t length);
// save as .dmf.
@ -31,5 +43,17 @@ class DivEngine {
void play();
// initialize the engine.
bool init();
bool init();
DivEngine():
chans(0),
playing(false),
speedAB(false),
ticks(0),
cycles(0),
curRow(-1),
curOrder(0),
temp{0,0},
prevSample{0,0} {}
};
#endif