diff options
author | Christian Glöckner <cgloeckner@freenet.de> | 2016-01-20 17:46:50 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-02-09 09:02:18 +0100 |
commit | a0a16d9cdb9d0522053c2e830b7440e9e96231a9 (patch) | |
tree | 87649e77b49cf0f3c22d115f666f49f88f6ed541 /drumgizmo/drumgizmoc.cc | |
parent | 9646045b130b39b24e1f8f526bbcb6e1fe04459b (diff) |
[incomplete] added MidifileInputEngine and WavfileOutputEngine
Diffstat (limited to 'drumgizmo/drumgizmoc.cc')
-rw-r--r-- | drumgizmo/drumgizmoc.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc index 10dcda5..978b0cc 100644 --- a/drumgizmo/drumgizmoc.cc +++ b/drumgizmo/drumgizmoc.cc @@ -36,9 +36,7 @@ #include "drumgizmo.h" #include "drumgizmoc.h" - -#include "audiooutputenginedl.h" -#include "audioinputenginedl.h" +#include "enginefactory.h" #include "event.h" @@ -228,7 +226,7 @@ int CliMain::run(int argc, char *argv[]) return 1; } - AudioInputEngine *ie = new AudioInputEngineDL(inputengine); + auto ie = createInputEngine(inputengine); if(ie == NULL) { printf("Invalid input engine: %s\n", inputengine.c_str()); @@ -264,11 +262,10 @@ int CliMain::run(int argc, char *argv[]) if(outputengine == "") { printf("Missing output engine\n"); - delete ie; return 1; } - AudioOutputEngineDL *oe = new AudioOutputEngineDL(outputengine); + auto oe = createOutputEngine(outputengine); if(oe == NULL) { printf("Invalid output engine: %s\n", outputengine.c_str()); @@ -309,8 +306,6 @@ int CliMain::run(int argc, char *argv[]) if(kitfile != "") { printf("Can only handle a single kitfile.\n"); printf(usage_str, argv[0]); - delete ie; - delete oe; return 1; } kitfile = argv[optind++]; @@ -319,14 +314,12 @@ int CliMain::run(int argc, char *argv[]) } else { printf("Missing kitfile.\n"); printf(usage_str, argv[0]); - delete ie; - delete oe; return 1; } printf("Using kitfile: %s\n", kitfile.c_str()); - DrumGizmo gizmo(oe, ie); + DrumGizmo gizmo(oe.get(), ie.get()); gizmo.setFrameSize(oe->getBufferSize()); @@ -354,8 +347,6 @@ int CliMain::run(int argc, char *argv[]) if(!gizmo.init()) { printf("Failed init engine.\n"); - delete ie; - delete oe; return 1; } @@ -363,9 +354,6 @@ int CliMain::run(int argc, char *argv[]) printf("Quit.\n"); fflush(stdout); - delete oe; - delete ie; - hug_close(); return 0; |