]> git.sesse.net Git - vlc/blob - modules/access/vcdx/vcdplayer.h
Put track information in Media Info. If we have SVD information, show
[vlc] / modules / access / vcdx / vcdplayer.h
1 /*****************************************************************************
2  * Copyright (C) 2003 Rocky Bernstein (for VideoLAN)
3  * $Id: vcdplayer.h,v 1.5 2004/01/03 20:43:24 rocky Exp $
4  *
5  * Authors: Rocky Bernstein <rocky@panix.com> 
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
20  *****************************************************************************/
21
22 /* VCD Player header. More or less media-player independent */
23
24 #ifndef _VCDPLAYER_H_
25 #define _VCDPLAYER_H_
26
27 #include <libvcd/info.h>
28
29 #define INPUT_DBG_META        1 /* Meta information */
30 #define INPUT_DBG_EVENT       2 /* input (keyboard/mouse) events */
31 #define INPUT_DBG_MRL         4 /* MRL parsing */
32 #define INPUT_DBG_EXT         8 /* Calls from external routines */
33 #define INPUT_DBG_CALL       16 /* all calls */
34 #define INPUT_DBG_LSN        32 /* LSN changes */
35 #define INPUT_DBG_PBC        64 /* Playback control */
36 #define INPUT_DBG_CDIO      128 /* Debugging from CDIO */
37 #define INPUT_DBG_SEEK      256 /* Seeks to set location */
38 #define INPUT_DBG_SEEK_CUR  512 /* Seeks to find current location */
39 #define INPUT_DBG_STILL    1024 /* Still-frame */
40 #define INPUT_DBG_VCDINFO  2048 /* Debugging from VCDINFO */
41
42 #define INPUT_DEBUG 1
43 #if INPUT_DEBUG
44 #define dbg_print(mask, s, args...) \
45    if (p_vcd && p_vcd->i_debug & mask) \
46      msg_Dbg(p_input, "%s: "s, __func__ , ##args)
47 #else
48 #define dbg_print(mask, s, args...) 
49 #endif
50
51 #define LOG_ERR(args...)  msg_Err( p_input, args )
52 #define LOG_WARN(args...) msg_Warn( p_input, args )
53
54 /* vcdplayer_read return status */
55 typedef enum {
56   READ_BLOCK,
57   READ_STILL_FRAME,
58   READ_ERROR,
59   READ_END,
60 } vcdplayer_read_status_t;
61
62 /*****************************************************************************
63  * thread_vcd_data_t: VCD information
64  *****************************************************************************/
65 typedef struct thread_vcd_data_s
66 {
67   vcdinfo_obj_t *vcd;                   /* CD device descriptor */
68   bool           in_still;              /*  true if in still */
69   bool           b_svd;                 /*  true if we have SVD info */
70   unsigned int num_tracks;              /* Nb of tracks (titles) */
71   unsigned int num_segments;            /* Nb of segments */
72   unsigned int num_entries;             /* Nb of entries */
73   unsigned int num_lids;                /* Nb of List IDs */
74   vcdinfo_itemid_t play_item;           /* play-item, VCDPLAYER_BAD_ENTRY 
75                                            if none */
76   int          cur_lid;                 /* LID that play item is in. Implies 
77                                            PBC is on. VCDPLAYER_BAD_ENTRY if 
78                                            not none or not in PBC */
79   PsdListDescriptor pxd;                /* If PBC is on, the relevant 
80                                            PSD/PLD */
81   int          pdi;                     /* current pld index of pxd. -1 if 
82                                            no index*/
83   vcdinfo_itemid_t loop_item;           /* Where do we loop back to? 
84                                            Meaningful only in a selection 
85                                            list */
86   int          loop_count;              /* # of times play-item has been 
87                                            played. Meaningful only in a 
88                                            selection list.              */
89   track_t      cur_track;               /* Current track number */
90   lsn_t        cur_lsn;                 /* Current logical sector number */
91   lsn_t        end_lsn;                 /* LSN of end of current 
92                                            entry/segment/track. */
93   lsn_t        origin_lsn;              /* LSN of start of seek/slider */
94   lsn_t *      p_sectors;               /* Track sectors */
95   lsn_t *      p_entries;               /* Entry points */
96   lsn_t *      p_segments;              /* Segments */
97   bool         b_valid_ep;              /* Valid entry points flag */
98   vlc_bool_t   b_end_of_track;          /* If the end of track was reached */
99   int          i_debug;                 /* Debugging mask */
100
101   /* Probably gets moved into another structure...*/
102   intf_thread_t *         p_intf;
103   int                     i_audio_nb;
104   int                     i_still_time;
105   vlc_bool_t              b_end_of_cell;
106   
107 } thread_vcd_data_t;
108
109 /*!
110   Get the next play-item in the list given in the LIDs. Note play-item
111   here refers to list of play-items for a single LID It shouldn't be
112   confused with a user's list of favorite things to play or the 
113   "next" field of a LID which moves us to a different LID.
114  */
115 bool vcdplayer_inc_play_item( input_thread_t *p_input );
116
117 /*!
118   Return true if playback control (PBC) is on
119 */
120 bool vcdplayer_pbc_is_on(const thread_vcd_data_t *p_this);
121
122 /*!
123   Play item assocated with the "default" selection.
124
125   Return false if there was some problem.
126 */
127 bool vcdplayer_play_default( input_thread_t * p_input );
128
129 /*!
130   Play item assocated with the "next" selection.
131
132   Return false if there was some problem.
133 */
134 bool vcdplayer_play_next( input_thread_t * p_input );
135
136 /*!
137   Play item assocated with the "prev" selection.
138
139   Return false if there was some problem.
140 */
141 bool vcdplayer_play_prev( input_thread_t * p_input );
142
143 /*!
144   Play item assocated with the "return" selection.
145
146   Return false if there was some problem.
147 */
148 bool
149 vcdplayer_play_return( input_thread_t * p_input );
150
151 vcdplayer_read_status_t vcdplayer_pbc_nav ( input_thread_t * p_input );
152 vcdplayer_read_status_t vcdplayer_non_pbc_nav ( input_thread_t * p_input );
153 lid_t vcdplayer_selection2lid ( input_thread_t *p_input, int entry_num ) ;
154
155 #endif /* _VCDPLAYER_H_ */
156 /* 
157  * Local variables:
158  *  c-file-style: "gnu"
159  *  tab-width: 8
160  *  indent-tabs-mode: nil
161  * End:
162  */