#include "mcdp.h"

/**
 * Copyright (C) 2001-2006 Tino Reichardt
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License Version 2, as
 * published by the Free Software Foundation.
 *
 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/* PAUSE/RESUME COMMAND (10)
 *
 * 0 = op code (0x4b)
 * 1 = reserved
 * 2 = reserved
 * 3 = reserved
 * 4 = reserved
 * 5 = reserved
 * 6 = reserved
 * 7 = reserved
 * 8 = reserved, 0=resume
 * 9 = control
 */

void scmd_pauseresume(void)
{
	scmd_ready(10, 0);
#if DEBUG_CDB
	if (!stralloc_copys(&cdb.name, "PAUSE/RESUME COMMAND (10)")) die_nomem();
#endif
	cdb.cmd.s[0]=0x4b;
	cdb.flags=D_NONE;

	switch (cd->as) {
	case AS_PLAY:
		cd->cmd(&cdb); /* switch to pause */
		break;
	case AS_PAUSE:
		cdb.cmd.s[8]=0x01; /* set resume */
		cd->cmd(&cdb);
		break;
	}

	return;
}

