]> git.sesse.net Git - vlc/blob - modules/access/cdda/cdda.h
2nd attempt to get libcdio cdda working.
[vlc] / modules / access / cdda / cdda.h
1 /*****************************************************************************
2  * cdda.h : CD-DA input module header for vlc
3  *          using libcdio, libvcd and libvcdinfo
4  *****************************************************************************
5  * Copyright (C) 2003 VideoLAN
6  * $Id$
7  *
8  * Author: Rocky Bernstein <rocky@panix.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #include <cdio/cdio.h>
26 #include "vlc_meta.h"
27
28 #ifdef HAVE_LIBCDDB
29 #include <cddb/cddb.h>
30 #endif
31
32 /*****************************************************************************
33  * Debugging
34  *****************************************************************************/
35 #define INPUT_DBG_META        1 /* Meta information */
36 #define INPUT_DBG_EVENT       2 /* Trace keyboard events */
37 #define INPUT_DBG_MRL         4 /* MRL debugging */
38 #define INPUT_DBG_EXT         8 /* Calls from external routines */
39 #define INPUT_DBG_CALL       16 /* all calls */
40 #define INPUT_DBG_LSN        32 /* LSN changes */
41 #define INPUT_DBG_SEEK       64 /* Seeks to set location */
42 #define INPUT_DBG_CDIO      128 /* Debugging from CDIO */
43 #define INPUT_DBG_CDDB      256 /* CDDB debugging  */
44
45 #define INPUT_DEBUG 1
46 #if INPUT_DEBUG
47 #define dbg_print(mask, s, args...) \
48    if (p_cdda->i_debug & mask) \
49      msg_Dbg(p_access, "%s: "s, __func__ , ##args)
50 #else
51 #define dbg_print(mask, s, args...)
52 #endif
53
54 /*****************************************************************************
55  * cdda_data_t: CD audio information
56  *****************************************************************************/
57 typedef struct cdda_data_s
58 {
59     CdIo       *p_cdio;                   /* libcdio CD device */
60     int         i_tracks;                 /* # of tracks (titles) */
61     int         i_first_track;            /* # of first track */
62
63     /* Current position */
64     int         i_track;                  /* Current track */
65     lsn_t       i_lsn;                    /* Current Logical Sector Number */
66     lsn_t *     p_lsns;                   /* Track LSNs */
67
68     int         i_debug;                  /* Debugging mask */
69     char *      psz_mcn;                  /* Media Catalog Number            */
70     vlc_meta_t  *p_meta;
71
72     input_title_t *p_title[CDIO_CD_MAX_TRACKS]; 
73
74
75 #ifdef HAVE_LIBCDDB
76     int         i_cddb_enabled;
77   struct  {
78     bool             have_info;      /* True if we have any info */
79     cddb_disc_t     *disc;           /* libcdio uses this to get disc info */
80     int              disc_length;    /* Length in frames of cd. Used in
81                                         CDDB lookups */
82   } cddb;
83 #endif
84
85     WAVEHEADER  waveheader;               /* Wave header for the output data */
86     vlc_bool_t  b_header;
87
88 } cdda_data_t;
89
90 /*****************************************************************************
91  * CDDAPlay: Arrange things so we play the specified track.
92  * VLC_TRUE is returned if there was no error.
93  *****************************************************************************/
94 vlc_bool_t  CDDAPlay         ( input_thread_t *, int );