From 011b543f526839f41d3ab20d017ac89e358477fd Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 13 Jun 2015 20:16:38 +0200 Subject: [PATCH 1/9] bump version to 0.6.5_pre --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 697322e3..00fce39b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_INIT(configure.ac) AC_CONFIG_HEADERS(config.h) -AM_INIT_AUTOMAKE(ncmpcpp, 0.6.4) +AM_INIT_AUTOMAKE(ncmpcpp, 0.6.5_pre) AC_PREREQ(2.59) From 8a5a0078e9a08f1d792299521da7482a99aba8b6 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 9 May 2015 21:42:03 +0200 Subject: [PATCH 2/9] help: correct a typo --- NEWS | 4 ++++ src/help.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e803dc97..1998772f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +ncmpcpp-0.6.5 (????-??-??) + +* Description of mouse wheel usage on volume is now correct. + ncmpcpp-0.6.4 (2015-05-02) * Fix title of a pop-up which shows during adding selected items to the current playlist. diff --git a/src/help.cpp b/src/help.cpp index 78fbfc5b..83ca7f66 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -381,7 +381,7 @@ void write_bindings(NC::Scrollpad &w) mouse(w, "Left click on \"Playing/Paused\"", "Play/pause"); mouse(w, "Left click on progressbar", "Jump to pointed position in playing song"); w << '\n'; - mouse(w, "Mouse wheel on \"Volume: xx\"", "Play/pause"); + mouse(w, "Mouse wheel on \"Volume: xx\"", "Adjust volume"); mouse(w, "Mouse wheel on main window", "Scroll"); mouse_section(w, "Playlist"); From c06d6ac4a25765fc5b434d3fc421c3ed643466ea Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 14 May 2015 23:09:36 +0200 Subject: [PATCH 3/9] configure: require readline/readline.h and pthread.h headers --- NEWS | 1 + configure.ac | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 1998772f..b94048ae 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ncmpcpp-0.6.5 (????-??-??) * Description of mouse wheel usage on volume is now correct. +* Configure script now fails if either readline or pthread specific headers are not present. ncmpcpp-0.6.4 (2015-05-02) diff --git a/configure.ac b/configure.ac index 00fce39b..7915bed8 100644 --- a/configure.ac +++ b/configure.ac @@ -211,6 +211,7 @@ AC_CHECK_HEADERS([readline/readline.h readline/history.h], AC_CHECK_LIB(readline, rl_initialize, LDFLAGS="$LDFLAGS -lreadline", AC_MSG_ERROR([readline headers found but there is no readline library to make use of]) ), + AC_MSG_ERROR([no readline/readline.h header file found]) ) @@ -221,6 +222,7 @@ AC_CHECK_HEADERS([pthread.h], AC_CHECK_LIB(pthread, pthread_create, LDFLAGS="$LDFLAGS -lpthread", AC_MSG_ERROR([pthread.h found but there is no pthread library to make use of]) ), + AC_MSG_ERROR([no pthread.h header header file found]) ) dnl ======================== From aa8c47d5782664b7d9786e1195f7950e29ee9a21 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 17 May 2015 16:30:11 +0200 Subject: [PATCH 4/9] actions: respect regular expression config when searching in text fields --- NEWS | 1 + src/actions.cpp | 4 ++-- src/scrollpad.cpp | 8 ++++---- src/scrollpad.h | 5 ++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index b94048ae..cfd52505 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ncmpcpp-0.6.5 (????-??-??) * Description of mouse wheel usage on volume is now correct. * Configure script now fails if either readline or pthread specific headers are not present. +* Searching in text fields now respects regular expression configuration. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/actions.cpp b/src/actions.cpp index 16a10448..34e7964f 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1932,8 +1932,8 @@ void Find::run() Statusbar::print("Searching..."); auto s = static_cast *>(myScreen); s->main().removeProperties(); - if (findme.empty() || s->main().setProperties(NC::Format::Reverse, findme, NC::Format::NoReverse)) - Statusbar::print("Done"); + if (findme.empty() || s->main().setProperties(NC::Format::Reverse, findme, NC::Format::NoReverse, Config.regex_type)) + Statusbar::print("Done"); else Statusbar::print("No matching patterns found"); s->main().flush(); diff --git a/src/scrollpad.cpp b/src/scrollpad.cpp index 064b03fa..3f25dba1 100644 --- a/src/scrollpad.cpp +++ b/src/scrollpad.cpp @@ -27,7 +27,7 @@ namespace {// template -bool regexSearch(NC::Buffer &buf, PropT begin, const std::string &ws, PropT end, size_t id, boost::regex::flag_type flags) +bool regexSearch(NC::Buffer &buf, PropT begin, const std::string &ws, PropT end, boost::regex::flag_type flags, size_t id) { try { boost::regex rx(ws, flags); @@ -274,14 +274,14 @@ void Scrollpad::reset() m_beginning = 0; } -bool Scrollpad::setProperties(Color begin, const std::string &s, Color end, size_t id, boost::regex::flag_type flags) +bool Scrollpad::setProperties(Color begin, const std::string &s, Color end, size_t flags, size_t id) { return regexSearch(m_buffer, begin, s, end, id, flags); } -bool Scrollpad::setProperties(Format begin, const std::string &s, Format end, size_t id, boost::regex::flag_type flags) +bool Scrollpad::setProperties(Format begin, const std::string &s, Format end, size_t flags, size_t id) { - return regexSearch(m_buffer, begin, s, end, id, flags); + return regexSearch(m_buffer, begin, s, end, flags, id); } void Scrollpad::removeProperties(size_t id) diff --git a/src/scrollpad.h b/src/scrollpad.h index c281dd2a..a9816d08 100644 --- a/src/scrollpad.h +++ b/src/scrollpad.h @@ -21,7 +21,6 @@ #ifndef NCMPCPP_SCROLLPAD_H #define NCMPCPP_SCROLLPAD_H -#include #include "window.h" #include "strbuffer.h" @@ -47,8 +46,8 @@ struct Scrollpad: public Window void flush(); void reset(); - bool setProperties(Color begin, const std::string &s, Color end, size_t id = -2, boost::regex::flag_type flags = boost::regex::icase); - bool setProperties(Format begin, const std::string &s, Format end, size_t id = -2, boost::regex::flag_type flags = boost::regex::icase); + bool setProperties(Color begin, const std::string &s, Color end, size_t flags, size_t id = -2); + bool setProperties(Format begin, const std::string &s, Format end, size_t flags, size_t id = -2); void removeProperties(size_t id = -2); template From 4d4b7c542fed615cf8699e093fa8b31eacc9f7ce Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 13 Jun 2015 20:28:28 +0200 Subject: [PATCH 5/9] tag editor: when numbering tracks, discard other track tags if present --- NEWS | 1 + src/tag_editor.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index cfd52505..ee8800e3 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ncmpcpp-0.6.5 (????-??-??) * Description of mouse wheel usage on volume is now correct. * Configure script now fails if either readline or pthread specific headers are not present. * Searching in text fields now respects regular expression configuration. +* When numbering tracks in tag editor all the other track tags are discarded. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp index 2532d647..355e80ed 100644 --- a/src/tag_editor.cpp +++ b/src/tag_editor.cpp @@ -479,6 +479,8 @@ void TagEditor::enterPressed() (*it)->setTrack(boost::lexical_cast(i) + "/" + boost::lexical_cast(EditedSongs.size())); else (*it)->setTrack(boost::lexical_cast(i)); + // discard other track number tags + (*it)->setTrack("", 1); } Statusbar::print("Tracks numbered"); } From d54de65990dbe852762e5292c5b27186d16fcc02 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 18 May 2015 00:05:49 +0200 Subject: [PATCH 6/9] tags: remove xiph tag DESCRIPTION as it's parsed as COMMENT by MPD --- NEWS | 1 + src/tags.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index ee8800e3..1e7a8389 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ncmpcpp-0.6.5 (????-??-??) * Configure script now fails if either readline or pthread specific headers are not present. * Searching in text fields now respects regular expression configuration. * When numbering tracks in tag editor all the other track tags are discarded. +* Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/tags.cpp b/src/tags.cpp index 832351e4..ff11ab17 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -184,6 +184,8 @@ void writeXiphComments(const MPD::MutableSong &s, TagLib::Ogg::XiphComment *tag) tag->removeField("TRACK"); // remove field DISC, some taggers use it as DISCNUMBER tag->removeField("DISC"); + // remove field DESCRIPTION, it's displayed as COMMENT + tag->removeField("DESCRIPTION"); writeXiph("TITLE", tagList(s, &MPD::Song::getTitle)); writeXiph("ARTIST", tagList(s, &MPD::Song::getArtist)); writeXiph("ALBUMARTIST", tagList(s, &MPD::Song::getAlbumArtist)); From 20a4e486cc36e40afc202e3794772e402b1d3c0f Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 23 May 2015 19:33:20 +0200 Subject: [PATCH 7/9] lastfm: use sink argument and fix possible usage of m_service after delete --- NEWS | 1 + src/actions.cpp | 2 +- src/lastfm.h | 20 +++++++++----------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 1e7a8389..caca51d0 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ncmpcpp-0.6.5 (????-??-??) * Searching in text fields now respects regular expression configuration. * When numbering tracks in tag editor all the other track tags are discarded. * Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags. +* Possible access of already freed memory when downloading artist info is fixed. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/actions.cpp b/src/actions.cpp index 34e7964f..6e84b5ec 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -2314,7 +2314,7 @@ void ShowArtistInfo::run() if (!artist.empty()) { - myLastfm->queueJob(LastFm::ArtistInfo(artist, Config.lastfm_preferred_language)); + myLastfm->queueJob(new LastFm::ArtistInfo(artist, Config.lastfm_preferred_language)); myLastfm->switchTo(); } # endif // HAVE_CURL_CURL_H diff --git a/src/lastfm.h b/src/lastfm.h index 051dc8aa..f2407fa5 100644 --- a/src/lastfm.h +++ b/src/lastfm.h @@ -51,27 +51,25 @@ struct Lastfm: Screen, Tabbable virtual bool isMergable() OVERRIDE { return true; } template - void queueJob(ServiceT &&service) + void queueJob(ServiceT *service) { - typedef typename std::remove_reference::type ServiceNoRef; - - auto old_service = dynamic_cast(m_service.get()); + auto old_service = dynamic_cast(m_service.get()); // if the same service and arguments were used, leave old info - if (old_service != nullptr && *old_service == service) + if (old_service != nullptr && *old_service == *service) return; - - m_service = std::make_shared(std::forward(service)); - m_worker = boost::async(boost::launch::async, boost::bind(&LastFm::Service::fetch, m_service.get())); - + + m_service = std::shared_ptr(service); + m_worker = boost::async(boost::launch::async, std::bind(&LastFm::Service::fetch, m_service)); + w.clear(); w << "Fetching information..."; w.flush(); m_title = ToWString(m_service->name()); } - + protected: virtual bool isLockable() OVERRIDE { return false; } - + private: void getResult(); From a3d536b4228637067df9697c11bcf3434883a943 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 13 Jun 2015 20:43:36 +0200 Subject: [PATCH 8/9] song: show name if it's available --- NEWS | 1 + src/song.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index caca51d0..f4a8ded4 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ ncmpcpp-0.6.5 (????-??-??) * When numbering tracks in tag editor all the other track tags are discarded. * Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags. * Possible access of already freed memory when downloading artist info is fixed. +* Name of an item is now displayed correctly if present. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/song.cpp b/src/song.cpp index c7d07ba7..3498e37f 100644 --- a/src/song.cpp +++ b/src/song.cpp @@ -74,7 +74,9 @@ std::string Song::getName(unsigned idx) const assert(m_song); mpd_song *s = m_song.get(); const char *res = mpd_song_get_tag(s, MPD_TAG_NAME, idx); - if (!res && idx > 0) + if (res) + return res; + else if (idx > 0) return ""; const char *uri = mpd_song_get_uri(s); const char *name = strrchr(uri, '/'); From 310d280cef4cc93738412efbd80ada4322df9d17 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 13 Jun 2015 20:55:09 +0200 Subject: [PATCH 9/9] status: fix assertion failure on window resize without active mpd connection --- NEWS | 1 + src/status.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f4a8ded4..8806c0bc 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ ncmpcpp-0.6.5 (????-??-??) * Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags. * Possible access of already freed memory when downloading artist info is fixed. * Name of an item is now displayed correctly if present. +* Assertion failure when resizing terminal window with no active MPD connection is fixed. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/status.cpp b/src/status.cpp index a6170e2b..cd41c90b 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -557,7 +557,7 @@ void Status::Changes::elapsedTime(bool update_elapsed) m_kbps = st.kbps(); } - if (m_player_state == MPD::psStop) + if (m_player_state == MPD::psUnknown || m_player_state == MPD::psStop) { if (Statusbar::isUnlocked() && Config.statusbar_visibility) *wFooter << NC::XY(0, 1) << wclrtoeol; @@ -565,6 +565,7 @@ void Status::Changes::elapsedTime(bool update_elapsed) } std::string ps = playerStateToString(m_player_state); + MPD::Song np = myPlaylist->nowPlayingSong(); drawTitle(np);