summaryrefslogtreecommitdiff
path: root/drumgizmo/drumgizmoc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/drumgizmoc.cc')
-rw-r--r--drumgizmo/drumgizmoc.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index 708528c..8983aa3 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -34,10 +34,6 @@
#include <hugin.hpp>
-#ifndef HUG_FLAG_OUTPUT_TO_STDOUT
-#define HUG_FLAG_OUTPUT_TO_STDOUT 0
-#endif
-
#include "drumgizmo.h"
#include "drumgizmoc.h"
@@ -122,9 +118,10 @@ int CliMain::run(int argc, char *argv[])
{
int c;
+ std::string hugin_filter;
+ unsigned int hugin_flags = 0;
#ifndef DISABLE_HUGIN
- const char *hugin_filter = "+all";
- unsigned int hugin_flags = HUG_FLAG_OUTPUT_TO_STDOUT;
+ hugin_flags = HUG_FLAG_DEFAULT;
#endif/*DISABLE_HUGIN*/
std::string outputengine;
@@ -150,7 +147,7 @@ int CliMain::run(int argc, char *argv[])
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-
+
c = getopt_long(argc, argv, "hvpo:O:i:I:e:a"
#ifndef DISABLE_HUGIN
"D:"
@@ -217,13 +214,15 @@ int CliMain::run(int argc, char *argv[])
}
hug_status_t status = hug_init(hugin_flags,
- HUG_OPTION_FILTER, hugin_filter,
+ HUG_OPTION_FILTER, hugin_filter.c_str(),
HUG_OPTION_END);
if(status != HUG_STATUS_OK) {
printf("Error: %d\n", status);
return 1;
}
+ DEBUG(drumgizmo, "Debug enabled.");
+
if(inputengine == "") {
printf("Missing input engine\n");
return 1;
@@ -265,6 +264,7 @@ int CliMain::run(int argc, char *argv[])
if(outputengine == "") {
printf("Missing output engine\n");
+ delete ie;
return 1;
}
@@ -309,6 +309,8 @@ 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++];
@@ -317,6 +319,8 @@ int CliMain::run(int argc, char *argv[])
} else {
printf("Missing kitfile.\n");
printf(usage_str, argv[0]);
+ delete ie;
+ delete oe;
return 1;
}
@@ -352,6 +356,8 @@ int CliMain::run(int argc, char *argv[])
if(!gizmo.init()) {
printf("Failed init engine.\n");
+ delete ie;
+ delete oe;
return 1;
}