Add audio lineout controls (play, pause, volume control)

This commit is contained in:
rocky
2005-03-01 00:41:34 +00:00
parent 53916b41bf
commit 47a5589e61
7 changed files with 240 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_linux.c,v 1.28 2005/02/28 04:05:17 rocky Exp $
$Id: _cdio_linux.c,v 1.29 2005/03/01 00:41:34 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.28 2005/02/28 04:05:17 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.29 2005/03/01 00:41:34 rocky Exp $";
#include <string.h>
@@ -648,42 +648,6 @@ read_audio_sectors_linux (void *p_user_data, void *p_buf, lsn_t i_lsn,
CDIO_MMC_READ_TYPE_CDDA, i_blocks);
}
#if 0
/* MMC driver to read audio sectors.
Can read only up to 25 blocks.
*/
static driver_return_code_t
read_data_sectors_linux (void *p_user_data, void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize, uint32_t i_blocks)
{
_img_private_t *p_env = p_user_data;
if (ISO_BLOCKSIZE == i_blocksize) {
msf_t msf;
struct cdrom_msf0 linux_msf;
int i_rc;
cdio_lsn_to_msf(i_lsn, &msf);
linux_msf.minute = msf.m;
linux_msf.second = msf.s;
linux_msf.frame = msf.f;
i_rc = ioctl(p_env->gen.fd, CDROMSEEK, &linux_msf);
// cdio_warn("%s: %s\n",
// "error in ioctl CDROMREADTOCHDR", strerror(errno));
if (0 == i_rc) {
unsigned int j = 0;
for (j=0; j<i_blocks; j++) {
void *p_buf2 = ((char *)p_buf ) + (j * ISO_BLOCKSIZE);
if (0 != ioctl(p_env->gen.fd, CDROMREADCOOKED, p_buf2))
break;
}
if (j==i_blocks) return DRIVER_OP_SUCCESS;
}
}
return read_data_sectors_mmc( p_env->gen.cdio, p_buf, i_lsn, i_blocksize,
i_blocks );
}
#endif
/* Packet driver to read mode2 sectors.
Can read only up to 25 blocks.
*/
@@ -1318,8 +1282,8 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode)
.lseek = cdio_generic_lseek,
.read = cdio_generic_read,
.read_audio_sectors = read_audio_sectors_linux,
#if 0
.read_data_sectors = read_data_sectors_linux,
#if 1
.read_data_sectors = read_data_sectors_generic,
#else
.read_data_sectors = read_data_sectors_mmc,
#endif