fetch now playing song and set window title if it's empty

This commit is contained in:
Andrzej Rybczak
2009-04-04 16:53:49 +02:00
parent a1376e8a4e
commit 57cab87a36
2 changed files with 6 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ncmpcpp, 0.3.3)
AM_INIT_AUTOMAKE(ncmpcpp, 0.3.4_pre)
AC_PREREQ(2.59)

View File

@@ -369,6 +369,11 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *)
}
if (changed.ElapsedTime)
{
if (np.Empty())
{
np = Mpd->GetCurrentSong();
WindowTitle(utf_to_locale_cpy(np.toString(Config.song_window_title_format)));
}
if (!np.Empty() && !player_state.empty())
{
int elapsed = Mpd->GetElapsedTime();