equal
deleted
inserted
replaced
19 |
19 |
20 #include <relpipe/writer/RelpipeWriterException.h> |
20 #include <relpipe/writer/RelpipeWriterException.h> |
21 #include <relpipe/writer/Factory.h> |
21 #include <relpipe/writer/Factory.h> |
22 #include <relpipe/cli/CLI.h> |
22 #include <relpipe/cli/CLI.h> |
23 |
23 |
|
24 #include "Configuration.h" |
|
25 #include "CLIParser.h" |
24 #include "JackException.h" |
26 #include "JackException.h" |
25 #include "JackCommand.h" |
27 #include "JackCommand.h" |
26 |
28 |
27 using namespace relpipe::cli; |
29 using namespace relpipe::cli; |
28 using namespace relpipe::writer; |
30 using namespace relpipe::writer; |
42 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
44 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
43 |
45 |
44 try { |
46 try { |
45 signal(SIGHUP, finish); |
47 signal(SIGHUP, finish); |
46 signal(SIGINT, finish); |
48 signal(SIGINT, finish); |
47 jackCommand.reset(new JackCommand()); |
49 CLIParser cliParser; |
|
50 Configuration configuration = cliParser.parse(cli.arguments()); |
|
51 jackCommand.reset(new JackCommand(configuration)); |
48 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
52 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
49 jackCommand->processJackStream(writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
53 jackCommand->processJackStream(writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
50 resultCode = CLI::EXIT_CODE_SUCCESS; |
54 resultCode = CLI::EXIT_CODE_SUCCESS; |
51 } catch (JackException e) { |
55 } catch (JackException e) { |
52 fwprintf(stderr, L"Caught JACK exception: %ls\n", e.getMessge().c_str()); |
56 fwprintf(stderr, L"Caught JACK exception: %ls\n", e.getMessge().c_str()); |