reference player prototype

poor performance
no playback sync yet
This commit is contained in:
tildearrow 2025-10-27 05:15:47 -05:00
parent 9bbfdc6f43
commit f77aafb44d
13 changed files with 336 additions and 15 deletions

View file

@ -28,6 +28,7 @@
#include "dataErrors.h"
#include "safeWriter.h"
#include "cmdStream.h"
#include "filePlayer.h"
#include "../audio/taAudio.h"
#include "blip_buf.h"
#include <functional>
@ -54,8 +55,8 @@ class DivWorkPool;
#define DIV_UNSTABLE
#define DIV_VERSION "dev237"
#define DIV_ENGINE_VERSION 237
#define DIV_VERSION "dev238"
#define DIV_ENGINE_VERSION 238
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02
@ -587,6 +588,7 @@ class DivEngine {
int samp_temp, samp_prevSample;
short* samp_bbIn;
short* samp_bbOut;
unsigned char* metroTick;
size_t metroTickLen;
float* metroBuf;
@ -596,6 +598,10 @@ class DivEngine {
float metroVol;
float previewVol;
float* filePlayerBuf[DIV_MAX_OUTPUTS];
size_t filePlayerBufLen;
DivFilePlayer* curFilePlayer;
size_t totalProcessed;
unsigned int renderPoolThreads;
@ -738,12 +744,17 @@ class DivEngine {
void createNewFromDefaults();
// load a file.
bool load(unsigned char* f, size_t length, const char* nameHint=NULL);
// play a binary command stream.
bool playStream(unsigned char* f, size_t length);
// get the playing stream.
DivCSPlayer* getStreamPlayer();
// destroy command stream player.
bool killStream();
// get the audio file player.
DivFilePlayer* getFilePlayer();
// save as .dmf.
SafeWriter* saveDMF(unsigned char version);
// save as .fur.
@ -1552,6 +1563,8 @@ class DivEngine {
metroAmp(0.0f),
metroVol(1.0f),
previewVol(1.0f),
filePlayerBufLen(0),
curFilePlayer(NULL),
totalProcessed(0),
renderPoolThreads(0),
renderPool(NULL),
@ -1584,6 +1597,7 @@ class DivEngine {
memset(oscBuf,0,DIV_MAX_OUTPUTS*(sizeof(float*)));
memset(exportChannelMask,1,DIV_MAX_CHANS*sizeof(bool));
memset(chipPeak,0,DIV_MAX_CHIPS*DIV_MAX_OUTPUTS*sizeof(float));
memset(filePlayerBuf,0,DIV_MAX_OUTPUTS*sizeof(float));
for (int i=0; i<DIV_MAX_CHIP_DEFS; i++) {
sysFileMapFur[i]=DIV_SYSTEM_NULL;