Add audio lineout controls (play, pause, volume control)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.am,v 1.22 2005/02/13 00:20:04 rocky Exp $
|
||||
# $Id: Makefile.am,v 1.23 2005/03/01 00:41:34 rocky Exp $
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
#
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
libcdioincludedir=$(includedir)/cdio
|
||||
libcdioinclude_HEADERS = \
|
||||
audio.h \
|
||||
bytesex.h \
|
||||
bytesex_asm.h \
|
||||
paranoia.h \
|
||||
|
||||
129
include/cdio/audio.h
Normal file
129
include/cdio/audio.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/* -*- c -*-
|
||||
$Id: audio.h,v 1.1 2005/03/01 00:41:34 rocky Exp $
|
||||
|
||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file audio.h
|
||||
*
|
||||
* \brief The top-level header for CD audio-related libcdio
|
||||
* calls. These control playing of the CD-ROM through its
|
||||
* line-out jack.
|
||||
*/
|
||||
#ifndef __CDIO_AUDIO_H__
|
||||
#define __CDIO_AUDIO_H__
|
||||
|
||||
#include <cdio/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*! This struct is used by the cdio_audio_read_subchannel */
|
||||
typedef struct cdio_subchannel_s
|
||||
{
|
||||
uint8_t cdsc_format;
|
||||
uint8_t cdsc_audiostatus;
|
||||
uint8_t cdsc_adr: 4;
|
||||
uint8_t cdsc_ctrl: 4;
|
||||
uint8_t cdsc_trk;
|
||||
uint8_t cdsc_ind;
|
||||
union cdio_cdrom_addr cdsc_absaddr;
|
||||
union cdio_cdrom_addr cdsc_reladdr;
|
||||
} cdio_subchannel_t;
|
||||
|
||||
/*! This struct is used by cdio_audio_get_volume and cdio_audio_set_volume */
|
||||
typedef struct cdio_audio_volume_s
|
||||
{
|
||||
uint8_t channel0;
|
||||
uint8_t channel1;
|
||||
uint8_t channel2;
|
||||
uint8_t channel3;
|
||||
} cdio_audio_volume_t;
|
||||
|
||||
|
||||
/* This struct is used by the CDROMPLAYTRKIND ioctl */
|
||||
typedef struct cdio_track_index_s
|
||||
{
|
||||
uint8_t i_start_track; /* start track */
|
||||
uint8_t i_start_index; /* start index */
|
||||
uint8_t i_end_track; /* end track */
|
||||
uint8_t i_end_index; /* end index */
|
||||
} cdio_track_index_t;
|
||||
|
||||
/*!
|
||||
Get volume of an audio CD.
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
|
||||
*/
|
||||
driver_return_code_t cdio_audio_get_volume (CdIo_t *p_cdio, /*out*/
|
||||
cdio_audio_volume_t *p_volume);
|
||||
|
||||
/*!
|
||||
Pause playing CD through analog output
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
*/
|
||||
driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio);
|
||||
|
||||
/*!
|
||||
Playing CD through analog output at the given MSF.
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
*/
|
||||
driver_return_code_t cdio_audio_play_msf (CdIo_t *p_cdio, msf_t *p_msf);
|
||||
|
||||
/*!
|
||||
Playing CD through analog output at the desired track and index
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
@param p_track_index location to start/end.
|
||||
*/
|
||||
driver_return_code_t cdio_audio_play_track_index
|
||||
( CdIo_t *p_cdio, cdio_track_index_t *p_track_index);
|
||||
|
||||
/*!
|
||||
Get subchannel information.
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
*/
|
||||
driver_return_code_t cdio_audio_read_subchannel (CdIo_t *p_cdio,
|
||||
cdio_subchannel_t *p_subchannel);
|
||||
|
||||
/*!
|
||||
Resume playing an audio CD.
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
|
||||
*/
|
||||
driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio);
|
||||
|
||||
/*!
|
||||
Set volume of an audio CD.
|
||||
|
||||
@param p_cdio the CD object to be acted upon.
|
||||
|
||||
*/
|
||||
driver_return_code_t cdio_audio_set_volume (CdIo_t *p_cdio, const
|
||||
cdio_audio_volume_t *p_volume);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __CDIO_AUDIO_H__ */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: mmc.h,v 1.12 2005/02/19 11:45:03 rocky Exp $
|
||||
$Id: mmc.h,v 1.13 2005/03/01 00:41:34 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -146,6 +146,20 @@ typedef enum {
|
||||
} cdio_mmc_gpcmd_t;
|
||||
|
||||
|
||||
/** Read Subchannel states */
|
||||
typedef enum {
|
||||
CDIO_MMC_READ_SUB_ST_INVALID = 0x00, /**< audio status not supported */
|
||||
CDIO_MMC_READ_SUB_ST_PLAY = 0x11, /**< audio play operation in
|
||||
progress */
|
||||
CDIO_MMC_READ_SUB_ST_PAUSED = 0x12, /**< audio play operation paused */
|
||||
CDIO_MMC_READ_SUB_ST_COMPLETED = 0x13, /**< audio play successfully
|
||||
completed */
|
||||
CDIO_MMC_READ_SUB_ST_ERROR = 0x14, /**< audio play stopped due to
|
||||
error */
|
||||
CDIO_MMC_READ_SUB_ST_NO_STATUS = 0x15, /**< no current audio status to
|
||||
return */
|
||||
} cdio_mmc_read_sub_state_t;
|
||||
|
||||
/*! Level values that can go into READ_CD */
|
||||
#define CDIO_MMC_READ_TYPE_ANY 0 /**< All types */
|
||||
#define CDIO_MMC_READ_TYPE_CDDA 1 /**< Only CD-DA sectors */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: types.h,v 1.26 2005/02/10 01:59:06 rocky Exp $
|
||||
$Id: types.h,v 1.27 2005/03/01 00:41:34 rocky Exp $
|
||||
|
||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -183,12 +183,12 @@ extern "C" {
|
||||
@see lba_t
|
||||
*/
|
||||
PRAGMA_BEGIN_PACKED
|
||||
struct msf_rec {
|
||||
struct msf_s {
|
||||
uint8_t m, s, f;
|
||||
} GNUC_PACKED;
|
||||
PRAGMA_END_PACKED
|
||||
|
||||
typedef struct msf_rec msf_t;
|
||||
typedef struct msf_s msf_t;
|
||||
|
||||
#define msf_t_SIZEOF 3
|
||||
|
||||
@@ -217,13 +217,20 @@ extern "C" {
|
||||
*/
|
||||
typedef int32_t lba_t;
|
||||
|
||||
/*! The type of a Logical Sector Number. Note that an lba lsn be negative
|
||||
and the MMC3 specs allow for a conversion of a negative lba
|
||||
/*! The type of a Logical Sector Number. Note that an lba can be negative
|
||||
and the MMC3 specs allow for a conversion of a negative lba.
|
||||
|
||||
@see msf_t
|
||||
*/
|
||||
typedef int32_t lsn_t;
|
||||
|
||||
/* Address in either MSF or logical format */
|
||||
union cdio_cdrom_addr
|
||||
{
|
||||
msf_t msf;
|
||||
lba_t lba;
|
||||
};
|
||||
|
||||
/*! The type of a track number 0..99. */
|
||||
typedef uint8_t track_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user