From 82ea8bf8088e5fa48a9563da2e925a2d6991e57e Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 10 Jun 2016 14:28:11 +0200 Subject: [PATCH 1/7] change version to 0.7.5_dev --- NEWS | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index bf407d4c..8d02b83b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ncmpcpp-0.7.5 (????-??-??) + ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. * Configure script now continues without errors if ICU library was not found. diff --git a/configure.ac b/configure.ac index 1f638af2..fe91c97c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT(configure.ac) AC_CONFIG_HEADERS(config.h) -AM_INIT_AUTOMAKE(ncmpcpp, 0.7.4) +AM_INIT_AUTOMAKE(ncmpcpp, 0.7.5_dev) m4_include([m4/ax_lib_readline.m4]) From a0b662886555be36037222e541e84c2dc5787658 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 10 Jun 2016 15:00:32 +0200 Subject: [PATCH 2/7] actions: allow action chains to be used for seeking --- NEWS | 1 + src/actions.cpp | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 8d02b83b..4d663706 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ncmpcpp-0.7.5 (????-??-??) +* Action chains can be now used for seeking. ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. diff --git a/src/actions.cpp b/src/actions.cpp index d63215c2..e14cbcad 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -2830,9 +2830,34 @@ void seek() int old_timeout = wFooter->getTimeout(); wFooter->setTimeout(BaseScreen::defaultWindowTimeout); - auto seekForward = &Actions::get(Actions::Type::SeekForward); - auto seekBackward = &Actions::get(Actions::Type::SeekBackward); - + // Accept single action of a given type or action chain for which all actions + // can be run and one of them is of the given type. This will still not work + // in some contrived cases, but allows for more flexibility than accepting + // single actions only. + auto hasRunnableAction = [](BindingsConfiguration::BindingIteratorPair &bindings, Actions::Type type) { + bool success = false; + for (auto binding = bindings.first; binding != bindings.second; ++binding) + { + auto &actions = binding->actions(); + for (const auto &action : actions) + { + if (action->canBeRun()) + { + if (action->type() == type) + success = true; + } + else + { + success = false; + break; + } + } + if (success) + break; + } + return success; + }; + SeekingInProgress = true; while (true) { @@ -2843,16 +2868,14 @@ void seek() : Config.seek_time; NC::Key::Type input = readKey(*wFooter); + auto k = Bindings.get(input); - if (k.first == k.second || !k.first->isSingle()) // no single action? - break; - auto a = k.first->action(); - if (a == seekForward) + if (hasRunnableAction(k, Actions::Type::SeekForward)) { if (songpos < Status::State::totalTime()) songpos = std::min(songpos + howmuch, Status::State::totalTime()); } - else if (a == seekBackward) + else if (hasRunnableAction(k, Actions::Type::SeekBackward)) { if (songpos > 0) { From 68fbbfae43610d1d4c49830fba3e45f5acdf1f14 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 30 Jul 2016 20:35:29 +0200 Subject: [PATCH 3/7] curl: fix fetching artist info from last.fm --- NEWS | 1 + src/curl_handle.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 4d663706..dbe73870 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ncmpcpp-0.7.5 (????-??-??) * Action chains can be now used for seeking. +* Fixed fetching artist info from last.fm. ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. diff --git a/src/curl_handle.cpp b/src/curl_handle.cpp index 7c64308f..cdd90344 100644 --- a/src/curl_handle.cpp +++ b/src/curl_handle.cpp @@ -44,6 +44,8 @@ CURLcode Curl::perform(std::string &data, const std::string &URL, const std::str curl_easy_setopt(c, CURLOPT_WRITEDATA, &data); curl_easy_setopt(c, CURLOPT_CONNECTTIMEOUT, timeout); curl_easy_setopt(c, CURLOPT_NOSIGNAL, 1); + // Workaround last.fm SSL certificate problems. + curl_easy_setopt(c, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(c, CURLOPT_USERAGENT, "ncmpcpp " VERSION); if (follow_redirect) curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L); From 0465962409588d9fa5ada922beef40cb1b195b1d Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 17 Aug 2016 15:56:14 +0200 Subject: [PATCH 4/7] settings: change fault value of regular_expressions to 'perl' --- NEWS | 1 + doc/config | 2 +- src/settings.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index dbe73870..d132ef1b 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ncmpcpp-0.7.5 (????-??-??) * Action chains can be now used for seeking. * Fixed fetching artist info from last.fm. +* Default value of regular_expressions was changed from 'basic' to 'perl' to work around boost issue (#12222). ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. diff --git a/doc/config b/doc/config index 29d4d642..38a0e98c 100644 --- a/doc/config +++ b/doc/config @@ -428,7 +428,7 @@ # ## Available values: none, basic, extended, perl. ## -#regular_expressions = basic +#regular_expressions = perl # ## ## Note: If below is enabled, ncmpcpp will ignore leading diff --git a/src/settings.cpp b/src/settings.cpp index 6f3daf52..79646e5f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -593,7 +593,7 @@ bool Configuration::read(const std::vector &config_paths, bool igno else throw std::runtime_error("invalid argument: " + v); regex_type |= boost::regex::icase; - }, defaults_to(regex_type, boost::regex::basic | boost::regex::icase) + }, defaults_to(regex_type, boost::regex::perl | boost::regex::icase) )); p.add("ignore_leading_the", yes_no( ignore_leading_the, false From e657089b30742f395f4e07db73e2ddd24384c5cc Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 17 Aug 2016 17:27:16 +0200 Subject: [PATCH 5/7] Fix crash occuring when searching backward in an empty list --- NEWS | 1 + src/helpers.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index d132ef1b..28a4b439 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ncmpcpp-0.7.5 (????-??-??) * Action chains can be now used for seeking. * Fixed fetching artist info from last.fm. * Default value of regular_expressions was changed from 'basic' to 'perl' to work around boost issue (#12222). +* Fixed crash occuring when searching backward in an empty list. ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. diff --git a/src/helpers.h b/src/helpers.h index 19d66b53..c4e5123e 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -35,6 +35,11 @@ template Iterator wrappedSearch(Iterator begin, Iterator current, Iterator end, const PredicateT &pred, bool wrap, bool skip_current) { + if (begin == end) + { + assert(current == end); + return begin; + } if (skip_current) ++current; auto it = std::find_if(current, end, pred); From 92b90b754df2682987450ea989ce0c4baaf78692 Mon Sep 17 00:00:00 2001 From: sphaugh Date: Wed, 27 Apr 2016 20:16:16 -0500 Subject: [PATCH 6/7] configuration: do not continue after handling --current-song --- src/configuration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.cpp b/src/configuration.cpp index c8fa609e..5b42aa70 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -196,8 +196,8 @@ bool configure(int argc, char **argv) { auto format = Format::parse(vm["current-song"].as(), Format::Flags::Tag); std::cout << Format::stringify(format, &s); - return false; } + return false; } // custom startup screen From 16197126827339b2cb35fe7aefb176dc0643d266 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Wed, 17 Aug 2016 17:39:03 +0200 Subject: [PATCH 7/7] Change version to 0.7.5 --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 28a4b439..4bb28297 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ncmpcpp-0.7.5 (????-??-??) +ncmpcpp-0.7.5 (2016-08-17) * Action chains can be now used for seeking. * Fixed fetching artist info from last.fm. * Default value of regular_expressions was changed from 'basic' to 'perl' to work around boost issue (#12222). diff --git a/configure.ac b/configure.ac index fe91c97c..8f52723c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT(configure.ac) AC_CONFIG_HEADERS(config.h) -AM_INIT_AUTOMAKE(ncmpcpp, 0.7.5_dev) +AM_INIT_AUTOMAKE(ncmpcpp, 0.7.5) m4_include([m4/ax_lib_readline.m4])