add autocenter mode
This commit is contained in:
@@ -69,6 +69,8 @@
|
|||||||
#
|
#
|
||||||
##### interface settings #####
|
##### interface settings #####
|
||||||
#
|
#
|
||||||
|
#autocenter_mode = "no"
|
||||||
|
#
|
||||||
#header_visibility = "yes"
|
#header_visibility = "yes"
|
||||||
#
|
#
|
||||||
#statusbar_visibility = "yes"
|
#statusbar_visibility = "yes"
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ int main(int argc, char *argv[])
|
|||||||
sHelp->Add("\to : Go to currently playing position\n\n\n");
|
sHelp->Add("\to : Go to currently playing position\n\n\n");
|
||||||
|
|
||||||
sHelp->Add(" [b]Keys - Browse screen\n -----------------------------------------[/b]\n");
|
sHelp->Add(" [b]Keys - Browse screen\n -----------------------------------------[/b]\n");
|
||||||
sHelp->Add("\tEnter : Enter directory/Add to playlist and play song\n");
|
sHelp->Add("\tEnter : Enter directory/Add item to playlist and play\n");
|
||||||
sHelp->Add("\tSpace : Add song to playlist\n");
|
sHelp->Add("\tSpace : Add item to playlist\n");
|
||||||
sHelp->Add("\tBackspace : Go to parent directory\n");
|
sHelp->Add("\tBackspace : Go to parent directory\n");
|
||||||
sHelp->Add("\tDelete : Delete playlist\n\n\n");
|
sHelp->Add("\tDelete : Delete playlist\n\n\n");
|
||||||
|
|
||||||
@@ -1392,6 +1392,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'U': // toggle autocenter mode
|
||||||
|
{
|
||||||
|
Config.autocenter_mode = !Config.autocenter_mode;
|
||||||
|
ShowMessage("Auto center mode: " + string(Config.autocenter_mode ? "On" : "Off"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'u': // update database
|
case 'u': // update database
|
||||||
{
|
{
|
||||||
if (current_screen == csBrowser)
|
if (current_screen == csBrowser)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
|
|||||||
conf.colors_enabled = true;
|
conf.colors_enabled = true;
|
||||||
conf.header_visibility = true;
|
conf.header_visibility = true;
|
||||||
conf.statusbar_visibility = true;
|
conf.statusbar_visibility = true;
|
||||||
|
conf.autocenter_mode = false;
|
||||||
conf.set_window_title = true;
|
conf.set_window_title = true;
|
||||||
conf.mpd_connection_timeout = 15;
|
conf.mpd_connection_timeout = 15;
|
||||||
conf.crossfade_time = 5;
|
conf.crossfade_time = 5;
|
||||||
@@ -185,6 +186,9 @@ void ReadConfiguration(ncmpcpp_config &conf)
|
|||||||
if (it->find("statusbar_visibility") != string::npos)
|
if (it->find("statusbar_visibility") != string::npos)
|
||||||
conf.statusbar_visibility = v == "yes";
|
conf.statusbar_visibility = v == "yes";
|
||||||
|
|
||||||
|
if (it->find("autocenter_mode") != string::npos)
|
||||||
|
conf.autocenter_mode = v == "yes";
|
||||||
|
|
||||||
if (it->find("enable_window_title") != string::npos)
|
if (it->find("enable_window_title") != string::npos)
|
||||||
conf.set_window_title = v == "yes";
|
conf.set_window_title = v == "yes";
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ struct ncmpcpp_config
|
|||||||
bool set_window_title;
|
bool set_window_title;
|
||||||
bool header_visibility;
|
bool header_visibility;
|
||||||
bool statusbar_visibility;
|
bool statusbar_visibility;
|
||||||
|
bool autocenter_mode;
|
||||||
|
|
||||||
int mpd_connection_timeout;
|
int mpd_connection_timeout;
|
||||||
int crossfade_time;
|
int crossfade_time;
|
||||||
|
|||||||
@@ -320,6 +320,8 @@ void NcmpcppStatusChanged(MPDConnection *Mpd, MPDStatusChanges changed, void *da
|
|||||||
if (old_playing >= 0)
|
if (old_playing >= 0)
|
||||||
mPlaylist->BoldOption(old_playing+1, 0);
|
mPlaylist->BoldOption(old_playing+1, 0);
|
||||||
mPlaylist->BoldOption(now_playing+1, 1);
|
mPlaylist->BoldOption(now_playing+1, 1);
|
||||||
|
if (Config.autocenter_mode)
|
||||||
|
mPlaylist->Highlight(now_playing+1);
|
||||||
}
|
}
|
||||||
if (!Mpd->GetElapsedTime())
|
if (!Mpd->GetElapsedTime())
|
||||||
mvwhline(wFooter->RawWin(), 0, 0, 0, wFooter->GetWidth());
|
mvwhline(wFooter->RawWin(), 0, 0, 0, wFooter->GetWidth());
|
||||||
|
|||||||
Reference in New Issue
Block a user