Exemple #1
0
/*
=================
MPD_Stop - stop playback
=================
*/
void MPD_Stop(void)
{
	if(!MP3_Status())
		return;

	mpd_sendStopCommand(conn);
	mpd_finishCommand(conn);

	MPD_Status();
}
static void
_mpdule_cb_stop (void *data, Evas_Object * obj, const char *emission,
		 const char *source)
{
  Instance *inst;
  mpd_Connection *mpd;

  inst = data;
  mpd = inst->mpd;
  mpd_sendStopCommand (mpd);
}
int mpd_player_stop(MpdObj * mi)
{
	if (!mpd_check_connected(mi)) {
		debug_printf(DEBUG_WARNING, "not connected\n");
		return MPD_NOT_CONNECTED;
	}
	if (mpd_lock_conn(mi)) {
		debug_printf(DEBUG_WARNING, "lock failed\n");
		return MPD_LOCK_FAILED;
	}

	mpd_sendStopCommand(mi->connection);
	mpd_finishCommand(mi->connection);


	mpd_unlock_conn(mi);
	if (mpd_status_update(mi)) {
		return MPD_STATUS_FAILED;
	}
	return MPD_OK;
}