diff --git a/src/contrib/waveout/WaveOut.cpp b/src/contrib/waveout/WaveOut.cpp index 5b38a67c1..71bbfec92 100644 --- a/src/contrib/waveout/WaveOut.cpp +++ b/src/contrib/waveout/WaveOut.cpp @@ -35,7 +35,7 @@ #include "WaveOut.h" #define MAX_VOLUME 0xFFFF -#define MAX_BUFFERS_PER_OUTPUT 8 +#define MAX_BUFFERS_PER_OUTPUT 16 static void notifyBufferProcessed(WaveOutBuffer *buffer) { /* let the provider know the output device is done with the buffer; the diff --git a/src/musikbox/app/layout/ConsoleLayout.cpp b/src/musikbox/app/layout/ConsoleLayout.cpp index 97d05dd63..489d1cdf7 100755 --- a/src/musikbox/app/layout/ConsoleLayout.cpp +++ b/src/musikbox/app/layout/ConsoleLayout.cpp @@ -132,14 +132,14 @@ void ConsoleLayout::OnEnterPressed(TextInput *input) { std::string command = this->commands->GetText(); this->commands->SetText(""); - output->WriteLine("> " + command + "\n", COLOR_PAIR(CURSESPP_BLACK_ON_GREY)); + output->WriteLine("> " + command + "\n", COLOR_PAIR(CURSESPP_TEXT_DEFAULT)); if (!this->ProcessCommand(command)) { if (command.size()) { output->WriteLine( "illegal command: '" + command + - "'\n", COLOR_PAIR(CURSESPP_RED_ON_GREY)); + "'\n", COLOR_PAIR(CURSESPP_TEXT_ERROR)); } } } @@ -212,6 +212,18 @@ bool ConsoleLayout::ProcessCommand(const std::string& cmd) { std::vector args; boost::algorithm::split(args, cmd, boost::is_any_of(" ")); + auto it = args.begin(); + while (it != args.end()) { + std::string trimmed = boost::algorithm::trim_copy(*it); + if (trimmed.size()) { + *it = trimmed; + ++it; + } + else { + it = args.erase(it); + } + } + std::string name = args.size() > 0 ? args[0] : ""; args.erase(args.begin()); @@ -247,10 +259,10 @@ bool ConsoleLayout::ProcessCommand(const std::string& cmd) { else if (name == "h" || name == "help") { this->Help(); } - else if (cmd == "pa" || cmd == "pause") { + else if (name == "pa" || name == "pause") { this->Pause(); } - else if (cmd == "s" || cmd =="stop") { + else if (name == "s" || name =="stop") { this->Stop(); } else if (name == "sk" || name == "seek") { @@ -310,6 +322,6 @@ void ConsoleLayout::ListPlugins() const { "v" + std::string((*it)->Version()) + "\n" " by " + std::string((*it)->Author()) + "\n"; - this->output->WriteLine(format, CURSESPP_RED_ON_BLUE); + this->output->WriteLine(format, COLOR_PAIR(CURSESPP_TEXT_DEFAULT)); } } diff --git a/src/musikbox/app/window/LogWindow.cpp b/src/musikbox/app/window/LogWindow.cpp index fefe0943e..47b66af94 100755 --- a/src/musikbox/app/window/LogWindow.cpp +++ b/src/musikbox/app/window/LogWindow.cpp @@ -82,12 +82,12 @@ void LogWindow::Update() { switch (entry->level) { case musik::debug::level_error: { - attrs = COLOR_PAIR(CURSESPP_TEXT_ERROR) | A_BOLD; + attrs = COLOR_PAIR(CURSESPP_TEXT_ERROR); break; } case musik::debug::level_warning: { - attrs = COLOR_PAIR(CURSESPP_TEXT_WARNING) | A_BOLD; + attrs = COLOR_PAIR(CURSESPP_TEXT_WARNING); break; } } diff --git a/src/musikbox/app/window/TransportWindow.cpp b/src/musikbox/app/window/TransportWindow.cpp index ba86116de..e7c506f6e 100755 --- a/src/musikbox/app/window/TransportWindow.cpp +++ b/src/musikbox/app/window/TransportWindow.cpp @@ -338,7 +338,7 @@ void TransportWindow::Update() { system_clock::now().time_since_epoch()).count(); if (now % 2 == 0) { - timerAttrs = COLOR_PAIR(CURSESPP_BLACK_ON_TRANSPARENT); + timerAttrs = COLOR_PAIR(CURSESPP_TEXT_HIDDEN); } } diff --git a/src/musikbox/cursespp/Colors.cpp b/src/musikbox/cursespp/Colors.cpp index ac992bdd9..940510d7f 100755 --- a/src/musikbox/cursespp/Colors.cpp +++ b/src/musikbox/cursespp/Colors.cpp @@ -98,11 +98,6 @@ void Colors::Init() { grey = initColor(COLOR_CUSTOM_GREY, 128, 128, 128); } - init_pair(CURSESPP_BLACK_ON_TRANSPARENT, black, background); - init_pair(CURSESPP_RED_ON_BLUE, red, blue); - init_pair(CURSESPP_BLACK_ON_GREY, black, white); - init_pair(CURSESPP_RED_ON_GREY, red, white); - init_pair(CURSESPP_SELECTED_LIST_ITEM, yellow, selected); init_pair(CURSESPP_HIGHLIGHTED_LIST_ITEM, black, green); init_pair(CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM, black, yellow); @@ -118,4 +113,5 @@ void Colors::Init() { init_pair(CURSESPP_TEXT_ACTIVE, green, background); init_pair(CURSESPP_TEXT_WARNING, yellow, background); init_pair(CURSESPP_TEXT_ERROR, red, background); + init_pair(CURSESPP_TEXT_HIDDEN, black, background); } diff --git a/src/musikbox/cursespp/Colors.h b/src/musikbox/cursespp/Colors.h index ec1d8186e..14fc2a5f2 100755 --- a/src/musikbox/cursespp/Colors.h +++ b/src/musikbox/cursespp/Colors.h @@ -36,26 +36,22 @@ #include "curses_config.h" -#define CURSESPP_BLACK_ON_TRANSPARENT 1 -#define CURSESPP_RED_ON_BLUE 2 -#define CURSESPP_BLACK_ON_GREY 3 -#define CURSESPP_RED_ON_GREY 4 +#define CURSESPP_SELECTED_LIST_ITEM 1 +#define CURSESPP_HIGHLIGHTED_LIST_ITEM 2 +#define CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM 3 +#define CURSESPP_LIST_ITEM_HEADER 4 -#define CURSESPP_SELECTED_LIST_ITEM 5 -#define CURSESPP_HIGHLIGHTED_LIST_ITEM 6 -#define CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM 7 -#define CURSESPP_LIST_ITEM_HEADER 8 +#define CURSESPP_DEFAULT_CONTENT_COLOR 5 +#define CURSESPP_DEFAULT_FRAME_COLOR 6 +#define CURSESPP_FOCUSED_FRAME_COLOR 7 -#define CURSESPP_DEFAULT_CONTENT_COLOR 9 -#define CURSESPP_DEFAULT_FRAME_COLOR 10 -#define CURSESPP_FOCUSED_FRAME_COLOR 11 - -#define CURSESPP_TEXT_DEFAULT 12 -#define CURSESPP_TEXT_DISABLED 13 -#define CURSESPP_TEXT_FOCUSED 14 -#define CURSESPP_TEXT_ACTIVE 15 -#define CURSESPP_TEXT_WARNING 16 -#define CURSESPP_TEXT_ERROR 17 +#define CURSESPP_TEXT_DEFAULT 8 +#define CURSESPP_TEXT_DISABLED 9 +#define CURSESPP_TEXT_FOCUSED 10 +#define CURSESPP_TEXT_ACTIVE 11 +#define CURSESPP_TEXT_WARNING 12 +#define CURSESPP_TEXT_ERROR 13 +#define CURSESPP_TEXT_HIDDEN 14 namespace cursespp { class Colors {