new config option: jump_to_now_playing_song_at_start (enabled by default)

This commit is contained in:
Andrzej Rybczak
2009-08-24 21:16:53 +02:00
parent 3998cb80f2
commit 2d9d22281a
5 changed files with 18 additions and 0 deletions

View File

@@ -201,6 +201,8 @@
# #
#display_screens_numbers_on_start = "yes" #display_screens_numbers_on_start = "yes"
# #
#jump_to_now_playing_song_at_start = "yes"
#
#ask_before_clearing_main_playlist = "no" #ask_before_clearing_main_playlist = "no"
# #
#clock_display_seconds = "no" #clock_display_seconds = "no"

View File

@@ -186,6 +186,9 @@ If set to "playlist", Search engine will perform searching in current MPD playli
.B display_screens_numbers_on_start = yes/no .B display_screens_numbers_on_start = yes/no
If enabled, screens' names and their keybindings will be shown in header window until key is pressed, otherwise they won't be displayed at all. If enabled, screens' names and their keybindings will be shown in header window until key is pressed, otherwise they won't be displayed at all.
.TP .TP
.B jump_to_now_playing_song_at_start = yes/no
If enabled, ncmpcpp will jump at start to now playing song if mpd is playing or paused.
.TP
.B ask_before_clearing_main_playlist = yes/no .B ask_before_clearing_main_playlist = yes/no
If enabled, user will be asked if he really wants to clear the main playlist after pressing key responsible for that. If enabled, user will be asked if he really wants to clear the main playlist after pressing key responsible for that.
.TP .TP

View File

@@ -167,6 +167,13 @@ int main(int argc, char *argv[])
if (Config.mouse_support) if (Config.mouse_support)
mousemask(ALL_MOUSE_EVENTS, 0); mousemask(ALL_MOUSE_EVENTS, 0);
if (Config.jump_to_now_playing_song_at_start)
{
TraceMpdStatus();
if (myPlaylist->isPlaying())
myPlaylist->Main()->Highlight(myPlaylist->NowPlaying);
}
while (!main_exit) while (!main_exit)
{ {
if (!Mpd.Connected()) if (!Mpd.Connected())

View File

@@ -289,6 +289,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.local_browser_show_hidden_files = false; conf.local_browser_show_hidden_files = false;
conf.search_in_db = true; conf.search_in_db = true;
conf.display_screens_numbers_on_start = true; conf.display_screens_numbers_on_start = true;
conf.jump_to_now_playing_song_at_start = true;
conf.clock_display_seconds = false; conf.clock_display_seconds = false;
conf.display_bitrate = false; conf.display_bitrate = false;
conf.ignore_leading_the = false; conf.ignore_leading_the = false;
@@ -730,6 +731,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
{ {
conf.display_screens_numbers_on_start = v == "yes"; conf.display_screens_numbers_on_start = v == "yes";
} }
else if (cl.find("jump_to_now_playing_song_at_start") != std::string::npos)
{
conf.jump_to_now_playing_song_at_start = v == "yes";
}
else if (cl.find("clock_display_seconds") != std::string::npos) else if (cl.find("clock_display_seconds") != std::string::npos)
{ {
conf.clock_display_seconds = v == "yes"; conf.clock_display_seconds = v == "yes";

View File

@@ -187,6 +187,7 @@ struct ncmpcpp_config
bool local_browser_show_hidden_files; bool local_browser_show_hidden_files;
bool search_in_db; bool search_in_db;
bool display_screens_numbers_on_start; bool display_screens_numbers_on_start;
bool jump_to_now_playing_song_at_start;
bool clock_display_seconds; bool clock_display_seconds;
bool display_bitrate; bool display_bitrate;
bool ignore_leading_the; bool ignore_leading_the;