fix audio export not aborting in per-channel mode
This commit is contained in:
parent
cc1933dcbb
commit
9795bca2ca
|
@ -402,6 +402,8 @@ void DivEngine::runExportThread() {
|
||||||
}
|
}
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stopExport) break;
|
||||||
}
|
}
|
||||||
exporting=false;
|
exporting=false;
|
||||||
|
|
||||||
|
@ -429,12 +431,25 @@ void DivEngine::runExportThread() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stopExport=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::saveAudio(const char* path, int loops, DivAudioExportModes mode) {
|
bool DivEngine::saveAudio(const char* path, int loops, DivAudioExportModes mode) {
|
||||||
exportPath=path;
|
exportPath=path;
|
||||||
exportMode=mode;
|
exportMode=mode;
|
||||||
|
if (exportMode!=DIV_EXPORT_MODE_ONE) {
|
||||||
|
// remove extension
|
||||||
|
String lowerCase=exportPath;
|
||||||
|
for (char& i: lowerCase) {
|
||||||
|
if (i>='A' && i<='Z') i+='a'-'A';
|
||||||
|
}
|
||||||
|
size_t extPos=lowerCase.rfind(".wav");
|
||||||
|
if (extPos!=String::npos) {
|
||||||
|
exportPath=exportPath.substr(0,extPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
exporting=true;
|
exporting=true;
|
||||||
|
stopExport=false;
|
||||||
stop();
|
stop();
|
||||||
repeatPattern=false;
|
repeatPattern=false;
|
||||||
setOrder(0);
|
setOrder(0);
|
||||||
|
@ -450,6 +465,7 @@ void DivEngine::waitAudioFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::haltAudioFile() {
|
bool DivEngine::haltAudioFile() {
|
||||||
|
stopExport=true;
|
||||||
stop();
|
stop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,6 +194,7 @@ class DivEngine {
|
||||||
bool repeatPattern;
|
bool repeatPattern;
|
||||||
bool metronome;
|
bool metronome;
|
||||||
bool exporting;
|
bool exporting;
|
||||||
|
bool stopExport;
|
||||||
bool halted;
|
bool halted;
|
||||||
bool forceMono;
|
bool forceMono;
|
||||||
bool cmdStreamEnabled;
|
bool cmdStreamEnabled;
|
||||||
|
@ -736,6 +737,7 @@ class DivEngine {
|
||||||
repeatPattern(false),
|
repeatPattern(false),
|
||||||
metronome(false),
|
metronome(false),
|
||||||
exporting(false),
|
exporting(false),
|
||||||
|
stopExport(false),
|
||||||
halted(false),
|
halted(false),
|
||||||
forceMono(false),
|
forceMono(false),
|
||||||
cmdStreamEnabled(false),
|
cmdStreamEnabled(false),
|
||||||
|
|
Loading…
Reference in a new issue