+/*
+ * mpc-car2pc: Interface between Music Player Dæmon and Car2PC adapter
+ *
+ * http://www.musicpd.org/
+ * http://www.car2pc.com/
+ *
+ * Copyright © 2009 David Woodhouse <dwmw2@infradead.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#define _BSD_SOURCE
#include <stdio.h>
if (sts->playlist != plid) {
save_disc();
track = -1;
+ plid = sts->playlist;
}
if (sts->state == MPD_STATUS_STATE_PLAY) {
- if (sts->song != track ||
- sts->playlist != plid) {
+ if (sts->song != track) {
track = sts->song;
send_car2pc_command("TR%03d", track + 1);
send_song_info();
- plid = sts->playlist;
track = sts->song;
}
if (sts->elapsedTime != last_time) {