automatically get current song info on song change in empdd

This commit is contained in:
zmike 2014-10-08 00:14:55 -04:00
parent b1ac61d4a2
commit 679a20d229
1 changed files with 7 additions and 0 deletions

View File

@ -154,6 +154,7 @@ static Eldbus_Service_Interface *empd_iface = NULL;
static Eina_Bool fetching_queue = EINA_FALSE;
static unsigned int empd_queue_version = 0;
static int empd_songid = -1;
static inline void
fdh_update(void)
@ -516,6 +517,12 @@ fdh_func(void *d EINA_UNUSED, Ecore_Fd_Handler *fdh EINA_UNUSED)
mpd_settings_get_port(empd->settings));
}
//fprintf(stderr, "[%s]|SENT\n", cmd_txt[cmd_get()]);
if (empd_songid != mpd_status_get_song_id(st))
{
cmd_append(EMPD_COMMAND_CURRENT_SONG);
mpd_async_send_command(empd->async, "currentsong", NULL);
}
empd_songid = mpd_status_get_song_id(st);
eldbus_service_signal_emit(empd_iface, EMPD_SIGNAL_STATUS,
mpd_status_get_volume(st), mpd_status_get_repeat(st), mpd_status_get_random(st),
mpd_status_get_single(st), mpd_status_get_consume(st), mpd_status_get_queue_version(st), mpd_status_get_queue_length(st),