1 /*****************************************************************************
2 * callback.c : Callbacks for CD digital audio input module
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
7 * Authors: Rocky Bernstein <rocky@panix.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
28 CDDADebugCB ( vlc_object_t *p_this, const char *psz_name,
29 vlc_value_t oldval, vlc_value_t val, void *p_data )
37 if (NULL == p_cdda_input) return VLC_EGENERIC;
39 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
41 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
43 msg_Dbg( p_cdda_input, "old debug (x%0x) %d, new debug (x%0x) %d",
44 p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int);
46 p_cdda->i_debug = val.i_int;
50 /* FIXME: could probably shorten some of the below boilerplate code...
53 CDDBEnabledCB ( vlc_object_t *p_this, const char *psz_name,
54 vlc_value_t oldval, vlc_value_t val, void *p_data )
63 if (NULL == p_cdda_input) return VLC_EGENERIC;
65 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
68 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
70 msg_Dbg( p_cdda_input, "old CDDB Enabled (x%0x) %d, new (x%0x) %d",
71 p_cdda->b_cddb_enabled, p_cdda->b_cddb_enabled,
72 val.b_bool, val.b_bool);
74 p_cdda->b_cddb_enabled = val.b_bool;
80 CDTextEnabledCB ( vlc_object_t *p_this, const char *psz_name,
81 vlc_value_t oldval, vlc_value_t val, void *p_data )
90 if (NULL == p_cdda_input) return VLC_EGENERIC;
92 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
94 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
96 msg_Dbg( p_cdda_input, "old CDText Enabled %d, new %d",
97 p_cdda->b_cdtext, val.b_bool);
99 p_cdda->b_cdtext = val.b_bool;
104 CDDANavModeCB( vlc_object_t *p_this, const char *psz_name,
105 vlc_value_t oldval, vlc_value_t val, void *p_data )
108 VLC_UNUSED(psz_name);
114 if (NULL == p_cdda_input) return VLC_EGENERIC;
116 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
118 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
120 msg_Dbg( p_cdda_input,
121 "old Navigation Mode Enabled %d, new %d",
122 p_cdda->b_nav_mode, val.b_bool);
124 p_cdda->b_nav_mode = val.b_bool;
129 CDTextPreferCB ( vlc_object_t *p_this, const char *psz_name,
130 vlc_value_t oldval, vlc_value_t val, void *p_data )
133 VLC_UNUSED(psz_name);
139 if (NULL == p_cdda_input) return VLC_EGENERIC;
141 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
144 if ( p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
146 msg_Dbg( p_cdda_input, "old CDText Prefer (x%0x) %d, new (x%0x) %d",
147 p_cdda->b_cdtext_prefer, p_cdda->b_cdtext_prefer,
148 val.b_bool, val.b_bool);
150 p_cdda->b_cdtext_prefer = val.b_bool;
156 CDDABlocksPerReadCB ( vlc_object_t *p_this, const char *psz_name,
157 vlc_value_t oldval, vlc_value_t val, void *p_data )
160 VLC_UNUSED(psz_name);
166 if (NULL == p_cdda_input) return VLC_EGENERIC;
168 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
170 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
172 msg_Dbg( p_cdda_input, "old blocks per read: %d, new %d",
173 p_cdda->i_blocks_per_read, val.i_int);
176 if (0 == val.i_int) val.i_int = DEFAULT_BLOCKS_PER_READ;
177 if ( val.i_int >= MIN_BLOCKS_PER_READ && val.i_int <= MAX_BLOCKS_PER_READ )
178 p_cdda->i_blocks_per_read = val.i_int;
181 msg_Warn( p_cdda_input,
182 "number of blocks (%d) has to be between %d and %d. No change.",
183 val.i_int, MIN_BLOCKS_PER_READ, MAX_BLOCKS_PER_READ );