diff --git a/doc/config b/doc/config index faffcda7..d054c84d 100644 --- a/doc/config +++ b/doc/config @@ -90,12 +90,14 @@ ## you need to compile ncmpcpp with fftw3 support. ## # -## Available values: spectrum, wave. +## Available values: spectrum, wave, wave_filled, ellipse. ## #visualizer_type = wave # #visualizer_look = ●▮ # +#visualizer_color = blue, cyan, green, yellow, magenta, red +# ##### system encoding ##### ## ## ncmpcpp should detect your charset encoding @@ -503,8 +505,6 @@ # #active_column_color = red # -#visualizer_color = yellow -# #window_border_color = green # #active_window_border = red diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index 1872485c..a674a788 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -82,6 +82,9 @@ Defines default visualizer type (spectrum is available only if ncmpcpp was compi .B visualizer_look = STRING Defines visualizer's look (string has to be exactly 2 characters long: first one is for wave whereas second for frequency spectrum). .TP +.B visualizer_color = COLORS +Comma separated list of colors to be used in music visualization. +.TP .B system_encoding = ENCODING If you use encoding other than utf8, set it in order to handle utf8 encoded strings properly. .TP @@ -361,9 +364,6 @@ Color of separators used in alternative user interface. .B active_column_color = COLOR Color of active column's highlight. .TP -.B visualizer_color = COLOR -Color of visualization. -.TP .B active_window_border = COLOR Color of active window's border. .TP diff --git a/src/settings.cpp b/src/settings.cpp index bd805ef4..1bdeae22 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -241,6 +241,16 @@ bool Configuration::read(const std::string &config_path) boundsCheck(result.size(), size_type(2), size_type(2)); return result; })); + p.add("visualizer_color", option_parser::worker([this](std::string &&v) { + boost::sregex_token_iterator i(v.begin(), v.end(), boost::regex("\\w+")), j; + for (; i != j; ++i) + { + auto color = stringToColor(*i); + visualizer_colors.push_back(color); + } + }, [this] { + visualizer_colors = { NC::Color::Blue, NC::Color::Cyan, NC::Color::Green, NC::Color::Yellow, NC::Color::Magenta, NC::Color::Red }; + })); p.add("system_encoding", assign_default( system_encoding, "", [](std::string &&enc) { # ifdef HAVE_LANGINFO_H @@ -624,16 +634,6 @@ bool Configuration::read(const std::string &config_path) p.add("active_column_color", assign_default( active_column_color, NC::Color::Red )); - p.add("visualizer_colors", option_parser::worker([this](std::string &&v) { - boost::sregex_token_iterator i(v.begin(), v.end(), boost::regex("\\w+")), j; - for (; i != j; ++i) - { - auto color = stringToColor(*i); - visualizer_colors.push_back(color); - } - }, [this] { - visualizer_colors = { NC::Color::Blue, NC::Color::Cyan, NC::Color::Green, NC::Color::Yellow, NC::Color::Red }; - })); p.add("window_border_color", assign_default( window_border, NC::Border::Green )); diff --git a/src/visualizer.cpp b/src/visualizer.cpp index 3caa1e2a..b516dd4d 100644 --- a/src/visualizer.cpp +++ b/src/visualizer.cpp @@ -246,7 +246,7 @@ void Visualizer::DrawSoundEllipseStereo(int16_t *buf_left, int16_t *buf_right, s // The arguments to the toColor function roughly follow a circle equation where // the center is not centered around (0,0). For example (x - w)^2 + (y-h)+2 = r^2 - // centers the circle around the point (w,h) Because fonts are not all the same + // centers the circle around the point (w,h). Because fonts are not all the same // size, this will not always generate a perfect circle. w << toColor(pow((x - width)*1, 2) + pow((y - ((long)height)) * 2,2), scaledRadius) << NC::XY(x, y)