Skip to content

Commit

Permalink
add safe mode with audio
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Oct 16, 2023
1 parent a06c38d commit 1cf519c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ bool cmdOutBinary=false;
bool vgmOutDirect=false;

bool safeMode=false;
bool safeModeWithAudio=false;

std::vector<TAParam> params;

Expand Down Expand Up @@ -134,6 +135,12 @@ TAParamResult pSafeMode(String val) {
return TA_PARAM_SUCCESS;
}

TAParamResult pSafeModeAudio(String val) {
safeMode=true;
safeModeWithAudio=true;
return TA_PARAM_SUCCESS;
}

TAParamResult pBinary(String val) {
cmdOutBinary=true;
return TA_PARAM_SUCCESS;
Expand Down Expand Up @@ -353,6 +360,7 @@ void initParams() {
params.push_back(TAParam("s","subsong",true,pSubSong,"<number>","set sub-song"));
params.push_back(TAParam("o","outmode",true,pOutMode,"one|persys|perchan","set file output mode"));
params.push_back(TAParam("S","safemode",false,pSafeMode,"","enable safe mode (software rendering and no audio)"));
params.push_back(TAParam("A","safeaudio",false,pSafeModeAudio,"","enable safe mode (with audio"));

params.push_back(TAParam("B","benchmark",true,pBenchmark,"render|seek","run performance test"));

Expand Down Expand Up @@ -509,7 +517,7 @@ int main(int argc, char** argv) {

e.preInit();

if (safeMode) {
if (safeMode && !safeModeWithAudio) {
e.setAudio(DIV_AUDIO_DUMMY);
}

Expand Down

0 comments on commit 1cf519c

Please sign in to comment.