2009-07-18
+ * Update MPD elapsed/progress when stopped
+
+2009-07-18
* add compilation switch --enable-xoap to be able to use
www.weather.com as a source of weather data (this avoids adding
libxml2 as a required dependency for users that wish to use noaa
printf("error: %s\n", status->error);
} */
- switch(status->state) {
+ switch (status->state) {
case MPD_STATUS_STATE_PLAY:
mpd_info.status = "Playing";
break;
break;
}
- if (status->state == MPD_STATUS_STATE_PLAY ||
+ if (status->state == MPD_STATUS_STATE_STOP) {
+ mpd_info.progress = (float) status->elapsedTime /
+ status->totalTime;
+ mpd_info.elapsed = status->elapsedTime;
+ } else if (status->state == MPD_STATUS_STATE_PLAY ||
status->state == MPD_STATUS_STATE_PAUSE) {
mpd_info.is_playing = 1;
mpd_info.bitrate = status->bitRate;