new feature: custom command execution on song change
This commit is contained in:
@@ -533,6 +533,11 @@ void ReadConfiguration(ncmpcpp_config &conf)
|
||||
if (!v.empty())
|
||||
conf.system_encoding = v + "//TRANSLIT";
|
||||
}
|
||||
else if (cl.find("execute_on_song_change") != string::npos)
|
||||
{
|
||||
if (!v.empty())
|
||||
conf.execute_on_song_change = v;
|
||||
}
|
||||
else if (cl.find("browser_playlist_prefix") != string::npos)
|
||||
{
|
||||
if (!v.empty())
|
||||
|
||||
@@ -119,6 +119,7 @@ struct ncmpcpp_config
|
||||
std::string tag_editor_album_format;
|
||||
std::string external_editor;
|
||||
std::string system_encoding;
|
||||
std::string execute_on_song_change;
|
||||
|
||||
std::string pattern;
|
||||
|
||||
|
||||
@@ -343,6 +343,8 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
|
||||
if (myPlaylist->isPlaying())
|
||||
{
|
||||
np = Mpd->GetCurrentSong();
|
||||
if (!Config.execute_on_song_change.empty())
|
||||
system(np.toString(Config.execute_on_song_change).c_str());
|
||||
if (Mpd->GetState() > psStop)
|
||||
WindowTitle(utf_to_locale_cpy(np.toString(Config.song_window_title_format)));
|
||||
if (Config.autocenter_mode && !myPlaylist->Main()->isFiltered())
|
||||
|
||||
Reference in New Issue
Block a user