/*****************************************************************************
- * cdda.h : CD-DA input module header for vlc
- * using libcdio, libvcd and libvcdinfo
+ * cdda.h : CD-DA input module header for vlc using libcdio.
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: cdda.h,v 1.5 2004/02/11 18:08:05 gbazin Exp $
+ * $Id$
*
* Author: Rocky Bernstein <rocky@panix.com>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#include "../vcdx/cdrom.h"
+#include <vlc/input.h>
+#include <cdio/cdio.h>
+#include <cdio/cdtext.h>
+#include "vlc_meta.h"
+#include "codecs.h"
#ifdef HAVE_LIBCDDB
#include <cddb/cddb.h>
#if INPUT_DEBUG
#define dbg_print(mask, s, args...) \
if (p_cdda->i_debug & mask) \
- msg_Dbg(p_input, "%s: "s, __func__ , ##args)
+ msg_Dbg(p_access, "%s: "s, __func__ , ##args)
#else
#define dbg_print(mask, s, args...)
#endif
-/*****************************************************************************
- * Wave header structure definition
- *****************************************************************************/
-typedef struct WAVEHEADER
-{
- uint32_t MainChunkID; // it will be 'RIFF'
- uint32_t Length;
- uint32_t ChunkTypeID; // it will be 'WAVE'
- uint32_t SubChunkID; // it will be 'fmt '
- uint32_t SubChunkLength;
- uint16_t Format;
- uint16_t Modus;
- uint32_t SampleFreq;
- uint32_t BytesPerSec;
- uint16_t BytesPerSample;
- uint16_t BitsPerSample;
- uint32_t DataChunkID; // it will be 'data'
- uint32_t DataLength;
-} WAVEHEADER;
-
/*****************************************************************************
* cdda_data_t: CD audio information
*****************************************************************************/
typedef struct cdda_data_s
{
- cddev_t *p_cddev; /* CD device descriptor */
- int i_nb_tracks; /* Nb of tracks (titles) */
- int i_track; /* Current track */
- lsn_t i_sector; /* Current Sector */
- lsn_t * p_sectors; /* Track sectors */
- vlc_bool_t b_end_of_track; /* If the end of track was reached */
- int i_debug; /* Debugging mask */
- char * mcn; /* Media Catalog Number */
- intf_thread_t *p_intf;
+ CdIo *p_cdio; /* libcdio CD device */
+ track_t i_tracks; /* # of tracks (titles) */
+ track_t i_first_track; /* # of first track */
+
+ /* Current position */
+ track_t i_track; /* Current track */
+ lsn_t i_lsn; /* Current Logical Sector Number */
+ lsn_t * p_lsns; /* Track LSNs */
+
+ int i_blocks_per_read; /* # blocks to get in a read */
+ int i_debug; /* Debugging mask */
+ /* Information about CD */
+ vlc_meta_t *p_meta;
+ char * psz_mcn; /* Media Catalog Number */
+ cdtext_t *cdtext; /* CD-Text info */
+ input_title_t *p_title[CDIO_CD_MAX_TRACKS];
+
+
#ifdef HAVE_LIBCDDB
- int i_cddb_enabled;
+ int i_cddb_enabled;
struct {
- bool have_info; /* True if we have any info */
- cddb_disc_t *disc; /* libcdio uses this to get disc info */
- int disc_length; /* Length in frames of cd. Used in
- CDDB lookups */
+ vlc_bool_t have_info; /* True if we have any info */
+ cddb_disc_t *disc; /* libcdio uses this to get disc
+ info */
+ int disc_length; /* Length in frames of cd. Used
+ in CDDB lookups */
} cddb;
#endif
- WAVEHEADER waveheader; /* Wave header for the output data */
- int i_header_pos;
+ WAVEHEADER waveheader; /* Wave header for the output data */
+ vlc_bool_t b_header;
} cdda_data_t;
-/*****************************************************************************
- * CDDAPlay: Arrange things so we play the specified track.
- * VLC_TRUE is returned if there was no error.
- *****************************************************************************/
-vlc_bool_t CDDAPlay ( input_thread_t *, int );
+/* FIXME: This variable is a hack. Would be nice to eliminate. */
+extern access_t *p_cdda_input;