add pipe audio output

also add ability to disable CLI control/status completely
This commit is contained in:
tildearrow 2024-04-23 04:38:08 -05:00
parent d41eeb02be
commit c9309834ce
12 changed files with 261 additions and 16 deletions

View file

@ -36,6 +36,7 @@
#ifdef HAVE_PA
#include "../audio/pa.h"
#endif
#include "../audio/pipe.h"
#include <math.h>
#include <float.h>
#include <fmt/printf.h>
@ -3522,8 +3523,9 @@ void DivEngine::setSamplePreviewVol(float vol) {
previewVol=vol;
}
void DivEngine::setConsoleMode(bool enable) {
void DivEngine::setConsoleMode(bool enable, bool statusOut) {
consoleMode=enable;
disableStatusOut=!statusOut;
}
bool DivEngine::switchMaster(bool full) {
@ -3800,6 +3802,9 @@ bool DivEngine::initAudioBackend() {
output=new TAAudio;
#endif
break;
case DIV_AUDIO_PIPE:
output=new TAAudioPipe;
break;
case DIV_AUDIO_DUMMY:
output=new TAAudio;
break;

View file

@ -72,6 +72,7 @@ enum DivAudioEngines {
DIV_AUDIO_JACK=0,
DIV_AUDIO_SDL=1,
DIV_AUDIO_PORTAUDIO=2,
DIV_AUDIO_PIPE=3,
DIV_AUDIO_NULL=126,
DIV_AUDIO_DUMMY=127
@ -405,6 +406,7 @@ class DivEngine {
bool shallStop, shallStopSched;
bool endOfSong;
bool consoleMode;
bool disableStatusOut;
bool extValuePresent;
bool repeatPattern;
bool metronome;
@ -1099,7 +1101,7 @@ class DivEngine {
void rescanMidiDevices();
// set the console mode.
void setConsoleMode(bool enable);
void setConsoleMode(bool enable, bool statusOut=true);
// get metronome
bool getMetronome();
@ -1282,6 +1284,7 @@ class DivEngine {
shallStopSched(false),
endOfSong(false),
consoleMode(false),
disableStatusOut(false),
extValuePresent(false),
repeatPattern(false),
metronome(false),

View file

@ -1722,7 +1722,7 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
}
}
if (consoleMode && subticks<=1 && !skipping) fprintf(stderr,"\x1b[2K> %d:%.2d:%.2d.%.2d %.2x/%.2x:%.3d/%.3d %4dcmd/s\x1b[G",totalSeconds/3600,(totalSeconds/60)%60,totalSeconds%60,totalTicks/10000,curOrder,curSubSong->ordersLen,curRow,curSubSong->patLen,cmdsPerSecond);
if (consoleMode && !disableStatusOut && subticks<=1 && !skipping) fprintf(stderr,"\x1b[2K> %d:%.2d:%.2d.%.2d %.2x/%.2x:%.3d/%.3d %4dcmd/s\x1b[G",totalSeconds/3600,(totalSeconds/60)%60,totalSeconds%60,totalTicks/10000,curOrder,curSubSong->ordersLen,curRow,curSubSong->patLen,cmdsPerSecond);
}
if (haltOn==DIV_HALT_TICK) halted=true;