1 /*****************************************************************************
2 * callback.c : Callbacks for CD digital audio input module
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
5 * $Id: callback.c 8606 2004-08-31 18:32:54Z rocky $
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., 59 Temple Place - Suite 330, Boston, MA 02111, 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 )
33 if (NULL == p_cdda_input) return VLC_EGENERIC;
35 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
37 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
39 msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d",
40 p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int);
42 p_cdda->i_debug = val.i_int;
46 /* FIXME: could probably shorten some of the below boilerplate code...
49 CDDBEnabledCB ( vlc_object_t *p_this, const char *psz_name,
50 vlc_value_t oldval, vlc_value_t val, void *p_data )
54 if (NULL == p_cdda_input) return VLC_EGENERIC;
56 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
59 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
61 msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d",
62 p_cdda->b_cddb_enabled, p_cdda->b_cddb_enabled,
63 val.b_bool, val.b_bool);
65 p_cdda->b_cddb_enabled = val.b_bool;
71 CDTextEnabledCB ( vlc_object_t *p_this, const char *psz_name,
72 vlc_value_t oldval, vlc_value_t val, void *p_data )
76 if (NULL == p_cdda_input) return VLC_EGENERIC;
78 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
80 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
82 msg_Dbg( p_cdda_input, "Old CDText Enabled %d, new %d",
83 p_cdda->b_cdtext, val.b_bool);
85 p_cdda->b_cdtext = val.b_bool;
90 CDDANavModeCB( vlc_object_t *p_this, const char *psz_name,
91 vlc_value_t oldval, vlc_value_t val, void *p_data )
95 if (NULL == p_cdda_input) return VLC_EGENERIC;
97 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
99 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
101 msg_Dbg( p_cdda_input,
102 "Old Navigation Mode Enabled %d, new %d",
103 p_cdda->b_nav_mode, val.b_bool);
105 p_cdda->b_nav_mode = val.b_bool;
110 CDTextPreferCB ( vlc_object_t *p_this, const char *psz_name,
111 vlc_value_t oldval, vlc_value_t val, void *p_data )
115 if (NULL == p_cdda_input) return VLC_EGENERIC;
117 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
120 if ( p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
122 msg_Dbg( p_cdda_input, "Old CDText Prefer (x%0x) %d, new (x%0x) %d",
123 p_cdda->b_cdtext_prefer, p_cdda->b_cdtext_prefer,
124 val.b_bool, val.b_bool);
126 p_cdda->b_cdtext_prefer = val.b_bool;
132 CDDABlocksPerReadCB ( vlc_object_t *p_this, const char *psz_name,
133 vlc_value_t oldval, vlc_value_t val, void *p_data )
137 if (NULL == p_cdda_input) return VLC_EGENERIC;
139 p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
141 if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
143 msg_Dbg( p_cdda_input, "Old blocks per read: %d, new %d",
144 p_cdda->i_blocks_per_read, val.i_int);
147 if (0 == val.i_int) val.i_int = DEFAULT_BLOCKS_PER_READ;
148 if ( val.i_int >= MIN_BLOCKS_PER_READ && val.i_int <= MAX_BLOCKS_PER_READ )
149 p_cdda->i_blocks_per_read = val.i_int;
152 msg_Warn( p_cdda_input,
153 "Number of blocks (%d) has to be between %d and %d. No change.",
154 val.i_int, MIN_BLOCKS_PER_READ, MAX_BLOCKS_PER_READ );