diff --git a/NEWS b/NEWS index a5944a0b..8a7f3535 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ ncmpcpp-0.7 (????-??-??) * Support for 256 colors and customization of background colors has been added. * Multiple configuration files via command line arguments are now accepted. In addition, by default ncmpcpp attempts to read both $HOME/.ncmpcpp/config and $XDG_CONFIG_HOME/ncmpcpp/config (in this order). * Support for PDCurses has been removed due to the library being unmaintained and buggy. +* Current MPD host may now be shown in playlist (playlist_show_mpd_host configuration variable, disabled by default). * Random album artists can now be added to the playlist. ncmpcpp-0.6.3 (2015-03-02) diff --git a/doc/config b/doc/config index ccb23a6c..56538b7d 100644 --- a/doc/config +++ b/doc/config @@ -286,6 +286,8 @@ ## #execute_on_song_change = "" # +#playlist_show_mpd_host = no +# #playlist_show_remaining_time = no # #playlist_shorten_total_times = no diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index effeddb2..52f0aeba 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -143,8 +143,11 @@ Format for songs' list displayed in columns. .B execute_on_song_change = COMMAND Shell command to execute on song change. .TP +.B playlist_show_mpd_host = yes/no +If enabled, current MPD host will be shown in playlist. +.TP .B playlist_show_remaining_time = yes/no -If enabled, time remaining to end of playlist will be shown after playlist's statistics. +If enabled, time remaining to end of playlist will be shown after playlist statistics. .TP .B playlist_shorten_total_times = yes/no If enabled, total/remaining playlist time displayed in statusbar will be shown using shortened units' names (d:h:m:s instead of days:hours:minutes:seconds). diff --git a/src/playlist.cpp b/src/playlist.cpp index 33b4d0d8..833b4708 100644 --- a/src/playlist.cpp +++ b/src/playlist.cpp @@ -105,6 +105,12 @@ void Playlist::resize() std::wstring Playlist::title() { std::wstring result = L"Playlist "; + if (Config.playlist_show_mpd_host) + { + result += L"on "; + result += ToWString(Mpd.GetHostname()); + result += L" "; + } if (m_reload_total_length || m_reload_remaining) m_stats = getTotalLength(); result += Scroller(ToWString(m_stats), m_scroll_begin, COLS-result.length()-(Config.design == Design::Alternative ? 2 : Global::VolumeState.length())); diff --git a/src/settings.cpp b/src/settings.cpp index 77c2e31f..1574385a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -362,6 +362,9 @@ bool Configuration::read(const std::vector &config_paths) p.add("execute_on_song_change", assign_default( execute_on_song_change, "" )); + p.add("playlist_show_mpd_host", yes_no( + playlist_show_mpd_host, false + )); p.add("playlist_show_remaining_time", yes_no( playlist_show_remaining_time, false )); diff --git a/src/settings.h b/src/settings.h index dc2bc0ad..b6214d7e 100644 --- a/src/settings.h +++ b/src/settings.h @@ -124,6 +124,7 @@ struct Configuration mpd_tag_type media_lib_primary_tag; bool colors_enabled; + bool playlist_show_mpd_host; bool playlist_show_remaining_time; bool playlist_shorten_total_times; bool playlist_separate_albums;