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

master
Andrzej Rybczak 17 years ago
parent a1376e8a4e
commit 57cab87a36
  1. 2
      configure.in
  2. 5
      src/status.cpp

@ -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)

@ -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();

Loading…
Cancel
Save