prepare to add file out - does not compile!
This commit is contained in:
parent
7d24b10da4
commit
45b202b85b
7 changed files with 196 additions and 12 deletions
25
src/main.cpp
25
src/main.cpp
|
|
@ -1,4 +1,6 @@
|
|||
#include <exception>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include "ta-log.h"
|
||||
#include "engine/engine.h"
|
||||
|
||||
|
|
@ -98,6 +100,26 @@ bool pWarranty(String) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool pLoops(String val) {
|
||||
try {
|
||||
int count=std::stoi(val);
|
||||
if (count<0) {
|
||||
e.setLoops(-1);
|
||||
} else {
|
||||
e.setLoops(count+1);
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
logE("loop count shall be a number.\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pOutput(String val) {
|
||||
e.setAudio(DIV_AUDIO_FILE);
|
||||
return e.openAudioOut(val);
|
||||
}
|
||||
|
||||
bool needsValue(String param) {
|
||||
for (size_t i=0; i<params.size(); i++) {
|
||||
if (params[i].name==param) {
|
||||
|
|
@ -111,9 +133,12 @@ void initParams() {
|
|||
params.push_back(TAParam("h","help",false,pHelp,"","display this help"));
|
||||
|
||||
params.push_back(TAParam("a","audio",true,pAudio,"jack|sdl","set audio engine (SDL by default)"));
|
||||
params.push_back(TAParam("o","output",true,pOutput,"<filename>","output audio to file"));
|
||||
params.push_back(TAParam("L","loglevel",true,pLogLevel,"debug|info|warning|error","set the log level (info by default)"));
|
||||
params.push_back(TAParam("v","view",true,pView,"pattern|commands|nothing","set visualization (pattern by default)"));
|
||||
|
||||
params.push_back(TAParam("l","loops",true,pLoops,"<count>","set number of loops (-1 means loop forever)"));
|
||||
|
||||
params.push_back(TAParam("V","version",false,pVersion,"","view information about Furnace."));
|
||||
params.push_back(TAParam("W","warranty",false,pWarranty,"","view warranty disclaimer."));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue