Merge branch '0.7.x'
This commit is contained in:
6
NEWS
6
NEWS
@@ -1,6 +1,12 @@
|
|||||||
ncmpcpp-0.8 (????-??-??)
|
ncmpcpp-0.8 (????-??-??)
|
||||||
* Configuration variable 'execute_on_player_state_change' was added.
|
* Configuration variable 'execute_on_player_state_change' was added.
|
||||||
|
|
||||||
|
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).
|
||||||
|
* Fixed crash occuring when searching backward in an empty list.
|
||||||
|
|
||||||
ncmpcpp 0.7.4 (2016-04-17)
|
ncmpcpp 0.7.4 (2016-04-17)
|
||||||
* Fetching lyrics from lyricwiki.org was fixed.
|
* Fetching lyrics from lyricwiki.org was fixed.
|
||||||
* Configure script now continues without errors if ICU library was not found.
|
* Configure script now continues without errors if ICU library was not found.
|
||||||
|
|||||||
@@ -437,7 +437,7 @@
|
|||||||
#
|
#
|
||||||
## Available values: none, basic, extended, perl.
|
## Available values: none, basic, extended, perl.
|
||||||
##
|
##
|
||||||
#regular_expressions = basic
|
#regular_expressions = perl
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
## Note: If below is enabled, ncmpcpp will ignore leading
|
## Note: If below is enabled, ncmpcpp will ignore leading
|
||||||
|
|||||||
@@ -2830,9 +2830,34 @@ void seek()
|
|||||||
int old_timeout = wFooter->getTimeout();
|
int old_timeout = wFooter->getTimeout();
|
||||||
wFooter->setTimeout(BaseScreen::defaultWindowTimeout);
|
wFooter->setTimeout(BaseScreen::defaultWindowTimeout);
|
||||||
|
|
||||||
auto seekForward = &Actions::get(Actions::Type::SeekForward);
|
// Accept single action of a given type or action chain for which all actions
|
||||||
auto seekBackward = &Actions::get(Actions::Type::SeekBackward);
|
// 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;
|
SeekingInProgress = true;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@@ -2843,16 +2868,14 @@ void seek()
|
|||||||
: Config.seek_time;
|
: Config.seek_time;
|
||||||
|
|
||||||
NC::Key::Type input = readKey(*wFooter);
|
NC::Key::Type input = readKey(*wFooter);
|
||||||
|
|
||||||
auto k = Bindings.get(input);
|
auto k = Bindings.get(input);
|
||||||
if (k.first == k.second || !k.first->isSingle()) // no single action?
|
if (hasRunnableAction(k, Actions::Type::SeekForward))
|
||||||
break;
|
|
||||||
auto a = k.first->action();
|
|
||||||
if (a == seekForward)
|
|
||||||
{
|
{
|
||||||
if (songpos < Status::State::totalTime())
|
if (songpos < Status::State::totalTime())
|
||||||
songpos = std::min(songpos + howmuch, 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)
|
if (songpos > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -196,8 +196,8 @@ bool configure(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
auto format = Format::parse(vm["current-song"].as<std::string>(), Format::Flags::Tag);
|
auto format = Format::parse(vm["current-song"].as<std::string>(), Format::Flags::Tag);
|
||||||
std::cout << Format::stringify<char>(format, &s);
|
std::cout << Format::stringify<char>(format, &s);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// custom startup screen
|
// custom startup screen
|
||||||
|
|||||||
@@ -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_WRITEDATA, &data);
|
||||||
curl_easy_setopt(c, CURLOPT_CONNECTTIMEOUT, timeout);
|
curl_easy_setopt(c, CURLOPT_CONNECTTIMEOUT, timeout);
|
||||||
curl_easy_setopt(c, CURLOPT_NOSIGNAL, 1);
|
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);
|
curl_easy_setopt(c, CURLOPT_USERAGENT, "ncmpcpp " VERSION);
|
||||||
if (follow_redirect)
|
if (follow_redirect)
|
||||||
curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L);
|
curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ template <typename Iterator, typename PredicateT>
|
|||||||
Iterator wrappedSearch(Iterator begin, Iterator current, Iterator end,
|
Iterator wrappedSearch(Iterator begin, Iterator current, Iterator end,
|
||||||
const PredicateT &pred, bool wrap, bool skip_current)
|
const PredicateT &pred, bool wrap, bool skip_current)
|
||||||
{
|
{
|
||||||
|
if (begin == end)
|
||||||
|
{
|
||||||
|
assert(current == end);
|
||||||
|
return begin;
|
||||||
|
}
|
||||||
if (skip_current)
|
if (skip_current)
|
||||||
++current;
|
++current;
|
||||||
auto it = std::find_if(current, end, pred);
|
auto it = std::find_if(current, end, pred);
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ bool Configuration::read(const std::vector<std::string> &config_paths, bool igno
|
|||||||
else
|
else
|
||||||
throw std::runtime_error("invalid argument: " + v);
|
throw std::runtime_error("invalid argument: " + v);
|
||||||
regex_type |= boost::regex::icase;
|
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(
|
p.add("ignore_leading_the", yes_no(
|
||||||
ignore_leading_the, false
|
ignore_leading_the, false
|
||||||
|
|||||||
Reference in New Issue
Block a user