--- a/bash-completion.sh Tue Sep 29 20:41:10 2020 +0200
+++ b/bash-completion.sh Tue Sep 29 20:49:04 2020 +0200
@@ -27,10 +27,11 @@
"false"
)
- if [[ "$w1" == "--TODO" ]]; then COMPREPLY=($(compgen -W "${BOOLEAN[*]}" -- "$w0"))
+ if [[ "$w1" == "--TODO" ]]; then COMPREPLY=($(compgen -W "${BOOLEAN[*]}" -- "$w0"))
+ elif [[ "$w1" == "--jack-client-name" && "x$w0" == "x" ]]; then COMPREPLY=("'relpipe-out-jack'")
else
OPTIONS=(
- "--TODO"
+ "--jack-client-name"
)
COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
fi
--- a/src/CLIParser.h Tue Sep 29 20:41:10 2020 +0200
+++ b/src/CLIParser.h Tue Sep 29 20:49:04 2020 +0200
@@ -48,7 +48,7 @@
public:
- static const relpipe::common::type::StringX OPTION_TODO;
+ static const relpipe::common::type::StringX OPTION_JACK_CLIENT_NAME;
Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
Configuration c;
@@ -56,8 +56,8 @@
for (int i = 0; i < arguments.size();) {
relpipe::common::type::StringX option = readNext(arguments, i);
- if (option == OPTION_TODO) {
- c.todo = parseBoolean(readNext(arguments, i));
+ if (option == OPTION_JACK_CLIENT_NAME) {
+ c.jackClientName = readNext(arguments, i);
} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
}
@@ -68,7 +68,7 @@
}
};
-const relpipe::common::type::StringX CLIParser::OPTION_TODO = L"--todo";
+const relpipe::common::type::StringX CLIParser::OPTION_JACK_CLIENT_NAME = L"--jack-client-name";
}
}
--- a/src/Configuration.h Tue Sep 29 20:41:10 2020 +0200
+++ b/src/Configuration.h Tue Sep 29 20:49:04 2020 +0200
@@ -28,7 +28,7 @@
class Configuration {
public:
- relpipe::common::type::Boolean todo = true;
+ relpipe::common::type::StringX jackClientName = L"relpipe-out-jack";
virtual ~Configuration() {
}
--- a/src/JackHandler.h Tue Sep 29 20:41:10 2020 +0200
+++ b/src/JackHandler.h Tue Sep 29 20:49:04 2020 +0200
@@ -53,7 +53,7 @@
JackHandler(Configuration& configuration) : configuration(configuration) {
// Initialize JACK connection:
- std::string clientName = "relpipe-out-jack";
+ std::string clientName = convertor.to_bytes(configuration.jackClientName);
jackClient = jack_client_open(clientName.c_str(), JackNullOption, nullptr);
if (jackClient == nullptr) throw JackException(L"Could not create JACK client.");