mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-31 20:11:29 +00:00
add "force mono audio" option and fix flags not be
ing set after a dispatch reset
This commit is contained in:
parent
16f497fcf1
commit
a93a9c19f3
6 changed files with 22 additions and 3 deletions
|
@ -88,7 +88,7 @@ void DivDispatchContainer::clear() {
|
|||
prevSample[1]=temp[1];*/
|
||||
}
|
||||
|
||||
void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, bool pal) {
|
||||
void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, unsigned int flags) {
|
||||
if (dispatch!=NULL) return;
|
||||
|
||||
bb[0]=blip_new(32768);
|
||||
|
@ -170,7 +170,7 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
|
|||
dispatch=new DivPlatformDummy;
|
||||
break;
|
||||
}
|
||||
dispatch->init(eng,chanCount,gotRate,pal);
|
||||
dispatch->init(eng,chanCount,gotRate,flags);
|
||||
}
|
||||
|
||||
void DivDispatchContainer::quit() {
|
||||
|
|
|
@ -5993,6 +5993,7 @@ bool DivEngine::initAudioBackend() {
|
|||
}
|
||||
|
||||
lowQuality=getConfInt("audioQuality",0);
|
||||
forceMono=getConfInt("forceMono",0);
|
||||
|
||||
switch (audioEngine) {
|
||||
case DIV_AUDIO_JACK:
|
||||
|
|
|
@ -116,7 +116,7 @@ struct DivDispatchContainer {
|
|||
void acquire(size_t offset, size_t count);
|
||||
void fillBuf(size_t runtotal, size_t size);
|
||||
void clear();
|
||||
void init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, bool pal);
|
||||
void init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, unsigned int flags);
|
||||
void quit();
|
||||
DivDispatchContainer():
|
||||
dispatch(NULL),
|
||||
|
@ -148,6 +148,7 @@ class DivEngine {
|
|||
bool metronome;
|
||||
bool exporting;
|
||||
bool halted;
|
||||
bool forceMono;
|
||||
int ticks, curRow, curOrder, remainingLoops, nextSpeed, divider;
|
||||
int cycles, clockDrift;
|
||||
int changeOrd, changePos, totalSeconds, totalTicks, totalTicksR, totalCmds, lastCmds, cmdsPerSecond, globalPitch;
|
||||
|
@ -568,6 +569,7 @@ class DivEngine {
|
|||
metronome(false),
|
||||
exporting(false),
|
||||
halted(false),
|
||||
forceMono(false),
|
||||
ticks(0),
|
||||
curRow(0),
|
||||
curOrder(0),
|
||||
|
|
|
@ -1192,5 +1192,12 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
|
|||
memcpy(oscBuf[0],out[0],size*sizeof(float));
|
||||
memcpy(oscBuf[1],out[1],size*sizeof(float));
|
||||
oscSize=size;
|
||||
|
||||
if (forceMono) {
|
||||
for (size_t i=0; i<size; i++) {
|
||||
out[0][i]=(out[0][i]+out[1][i])*0.5;
|
||||
out[1][i]=out[0][i];
|
||||
}
|
||||
}
|
||||
isBusy.unlock();
|
||||
}
|
||||
|
|
|
@ -2968,6 +2968,11 @@ void FurnaceGUI::drawSettings() {
|
|||
ImGui::SameLine();
|
||||
ImGui::Combo("##Quality",&settings.audioQuality,audioQualities,2);
|
||||
|
||||
bool forceMonoB=settings.forceMono;
|
||||
if (ImGui::Checkbox("Force mono audio",&forceMonoB)) {
|
||||
settings.forceMono=forceMonoB;
|
||||
}
|
||||
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (ImGui::BeginTabItem("Emulation")) {
|
||||
|
@ -3193,6 +3198,7 @@ void FurnaceGUI::syncSettings() {
|
|||
settings.stepOnDelete=e->getConfInt("stepOnDelete",0);
|
||||
settings.scrollStep=e->getConfInt("scrollStep",0);
|
||||
settings.sysSeparators=e->getConfInt("sysSeparators",1);
|
||||
settings.forceMono=e->getConfInt("forceMono",0);
|
||||
}
|
||||
|
||||
#define PUT_UI_COLOR(source) e->setConf(#source,(int)ImGui::GetColorU32(uiColors[source]));
|
||||
|
@ -3227,6 +3233,7 @@ void FurnaceGUI::commitSettings() {
|
|||
e->setConf("stepOnDelete",settings.stepOnDelete);
|
||||
e->setConf("scrollStep",settings.scrollStep);
|
||||
e->setConf("sysSeparators",settings.sysSeparators);
|
||||
e->setConf("forceMono",settings.forceMono);
|
||||
|
||||
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
|
||||
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
|
||||
|
|
|
@ -217,6 +217,7 @@ class FurnaceGUI {
|
|||
int stepOnDelete;
|
||||
int scrollStep;
|
||||
int sysSeparators;
|
||||
int forceMono;
|
||||
unsigned int maxUndoSteps;
|
||||
String mainFontPath;
|
||||
String patFontPath;
|
||||
|
@ -249,6 +250,7 @@ class FurnaceGUI {
|
|||
stepOnDelete(0),
|
||||
scrollStep(0),
|
||||
sysSeparators(1),
|
||||
forceMono(0),
|
||||
maxUndoSteps(100),
|
||||
mainFontPath(""),
|
||||
patFontPath("") {}
|
||||
|
|
Loading…
Reference in a new issue