47 } |
47 } |
48 |
48 |
49 public: |
49 public: |
50 |
50 |
51 static const relpipe::common::type::StringX OPTION_JACK_CLIENT_NAME; |
51 static const relpipe::common::type::StringX OPTION_JACK_CLIENT_NAME; |
|
52 static const relpipe::common::type::StringX OPTION_JACK_CONNECT_TO_PORT; |
52 static const relpipe::common::type::StringX OPTION_REQUIRED_JACK_CONNECTIONS; |
53 static const relpipe::common::type::StringX OPTION_REQUIRED_JACK_CONNECTIONS; |
53 |
54 |
54 Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) { |
55 Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) { |
55 Configuration c; |
56 Configuration c; |
56 |
57 |
57 for (int i = 0; i < arguments.size();) { |
58 for (int i = 0; i < arguments.size();) { |
58 relpipe::common::type::StringX option = readNext(arguments, i); |
59 relpipe::common::type::StringX option = readNext(arguments, i); |
59 |
60 |
60 if (option == OPTION_JACK_CLIENT_NAME) { |
61 if (option == OPTION_JACK_CLIENT_NAME) { |
61 c.jackClientName = readNext(arguments, i); |
62 c.jackClientName = readNext(arguments, i); |
|
63 } else if (option == OPTION_JACK_CONNECT_TO_PORT) { |
|
64 c.portsToConnect.push_back(readNext(arguments, i)); |
62 } else if (option == OPTION_REQUIRED_JACK_CONNECTIONS) { |
65 } else if (option == OPTION_REQUIRED_JACK_CONNECTIONS) { |
63 c.requiredJackConnections = std::stoi(readNext(arguments, i)); |
66 c.requiredJackConnections = std::stoi(readNext(arguments, i)); |
64 } else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS); |
67 } else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS); |
65 } |
68 } |
66 |
69 |