fix audio backend not changing on switchMaster
This commit is contained in:
parent
2f0e97f6d9
commit
29f1be3b36
|
@ -3453,7 +3453,8 @@ void DivEngine::setConsoleMode(bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::switchMaster() {
|
bool DivEngine::switchMaster() {
|
||||||
deinitAudioBackend();
|
logI("switching output...");
|
||||||
|
deinitAudioBackend(true);
|
||||||
quitDispatch();
|
quitDispatch();
|
||||||
initDispatch();
|
initDispatch();
|
||||||
if (initAudioBackend()) {
|
if (initAudioBackend()) {
|
||||||
|
@ -3599,6 +3600,7 @@ void DivEngine::quitDispatch() {
|
||||||
|
|
||||||
bool DivEngine::initAudioBackend() {
|
bool DivEngine::initAudioBackend() {
|
||||||
// load values
|
// load values
|
||||||
|
logI("initializing audio.");
|
||||||
if (audioEngine==DIV_AUDIO_NULL) {
|
if (audioEngine==DIV_AUDIO_NULL) {
|
||||||
if (getConfString("audioEngine","SDL")=="JACK") {
|
if (getConfString("audioEngine","SDL")=="JACK") {
|
||||||
audioEngine=DIV_AUDIO_JACK;
|
audioEngine=DIV_AUDIO_JACK;
|
||||||
|
@ -3704,8 +3706,9 @@ bool DivEngine::initAudioBackend() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::deinitAudioBackend() {
|
bool DivEngine::deinitAudioBackend(bool dueToSwitchMaster) {
|
||||||
if (output!=NULL) {
|
if (output!=NULL) {
|
||||||
|
logI("closing audio output.");
|
||||||
output->quit();
|
output->quit();
|
||||||
if (output->midiIn) {
|
if (output->midiIn) {
|
||||||
if (output->midiIn->isDeviceOpen()) {
|
if (output->midiIn->isDeviceOpen()) {
|
||||||
|
@ -3722,7 +3725,9 @@ bool DivEngine::deinitAudioBackend() {
|
||||||
output->quitMidi();
|
output->quitMidi();
|
||||||
delete output;
|
delete output;
|
||||||
output=NULL;
|
output=NULL;
|
||||||
//audioEngine=DIV_AUDIO_NULL;
|
if (dueToSwitchMaster) {
|
||||||
|
audioEngine=DIV_AUDIO_NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,7 +452,7 @@ class DivEngine {
|
||||||
int loadSampleROM(String path, ssize_t expectedSize, unsigned char*& ret);
|
int loadSampleROM(String path, ssize_t expectedSize, unsigned char*& ret);
|
||||||
|
|
||||||
bool initAudioBackend();
|
bool initAudioBackend();
|
||||||
bool deinitAudioBackend();
|
bool deinitAudioBackend(bool dueToSwitchMaster=false);
|
||||||
|
|
||||||
void registerSystems();
|
void registerSystems();
|
||||||
void initSongWithDesc(const int* description);
|
void initSongWithDesc(const int* description);
|
||||||
|
|
Loading…
Reference in a new issue