Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

callback.c

00001 /*****************************************************************************
00002  * callback.c : Callbacks for CD digital audio input module
00003  *****************************************************************************
00004  * Copyright (C) 2004 the VideoLAN team
00005  * $Id: callback.c 8606 2004-08-31 18:32:54Z rocky $
00006  *
00007  * Authors: Rocky Bernstein <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #include "callback.h"
00025 #include "cdda.h"
00026 
00027 int
00028 CDDADebugCB   ( vlc_object_t *p_this, const char *psz_name,
00029                     vlc_value_t oldval, vlc_value_t val, void *p_data )
00030 {
00031     cdda_data_t *p_cdda;
00032 
00033     if (NULL == p_cdda_input) return VLC_EGENERIC;
00034 
00035     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00036 
00037     if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) 
00038     {
00039         msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d",
00040                  p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int);
00041     }
00042     p_cdda->i_debug = val.i_int;
00043     return VLC_SUCCESS;
00044 }
00045 
00046 /* FIXME: could probably shorten some of the below boilerplate code...
00047 */
00048 int
00049 CDDBEnabledCB   ( vlc_object_t *p_this, const char *psz_name,
00050                       vlc_value_t oldval, vlc_value_t val, void *p_data )
00051 {
00052     cdda_data_t *p_cdda;
00053 
00054     if (NULL == p_cdda_input) return VLC_EGENERIC;
00055 
00056     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00057 
00058 #ifdef HAVE_LIBCDDB
00059     if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) 
00060     {
00061         msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d",
00062                  p_cdda->b_cddb_enabled, p_cdda->b_cddb_enabled,
00063                  val.b_bool, val.b_bool);
00064     }
00065     p_cdda->b_cddb_enabled = val.b_bool;
00066 #endif
00067     return VLC_SUCCESS;
00068 }
00069 
00070 int
00071 CDTextEnabledCB   ( vlc_object_t *p_this, const char *psz_name,
00072                         vlc_value_t oldval, vlc_value_t val, void *p_data )
00073 {
00074     cdda_data_t *p_cdda;
00075 
00076     if (NULL == p_cdda_input) return VLC_EGENERIC;
00077 
00078     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00079 
00080     if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
00081     {
00082         msg_Dbg( p_cdda_input, "Old CDText Enabled %d, new %d",
00083                  p_cdda->b_cdtext, val.b_bool);
00084     }
00085     p_cdda->b_cdtext = val.b_bool;
00086     return VLC_SUCCESS;
00087 }
00088 
00089 int
00090 CDDANavModeCB( vlc_object_t *p_this, const char *psz_name,
00091                         vlc_value_t oldval, vlc_value_t val, void *p_data )
00092 {
00093     cdda_data_t *p_cdda;
00094 
00095     if (NULL == p_cdda_input) return VLC_EGENERIC;
00096 
00097     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00098 
00099     if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
00100     {
00101         msg_Dbg( p_cdda_input, 
00102                  "Old Navigation Mode Enabled %d, new %d",
00103                  p_cdda->b_nav_mode, val.b_bool);
00104     }
00105     p_cdda->b_nav_mode = val.b_bool;
00106     return VLC_SUCCESS;
00107 }
00108 
00109 int
00110 CDTextPreferCB   ( vlc_object_t *p_this, const char *psz_name,
00111                        vlc_value_t oldval, vlc_value_t val, void *p_data )
00112 {
00113     cdda_data_t *p_cdda;
00114 
00115     if (NULL == p_cdda_input) return VLC_EGENERIC;
00116 
00117     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00118 
00119 #ifdef HAVE_LIBCDDB
00120     if ( p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) 
00121     {
00122         msg_Dbg( p_cdda_input, "Old CDText Prefer (x%0x) %d, new (x%0x) %d",
00123                  p_cdda->b_cdtext_prefer, p_cdda->b_cdtext_prefer,
00124                  val.b_bool, val.b_bool);
00125     }
00126     p_cdda->b_cdtext_prefer = val.b_bool;
00127 #endif
00128     return VLC_SUCCESS;
00129 }
00130 
00131 int
00132 CDDABlocksPerReadCB ( vlc_object_t *p_this, const char *psz_name,
00133                           vlc_value_t oldval, vlc_value_t val, void *p_data )
00134 {
00135     cdda_data_t *p_cdda;
00136 
00137     if (NULL == p_cdda_input) return VLC_EGENERIC;
00138 
00139     p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
00140 
00141     if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) 
00142     {
00143         msg_Dbg( p_cdda_input, "Old blocks per read: %d, new %d",
00144                  p_cdda->i_blocks_per_read, val.i_int);
00145     }
00146 
00147     if (0 == val.i_int) val.i_int = DEFAULT_BLOCKS_PER_READ;
00148     if ( val.i_int >= MIN_BLOCKS_PER_READ && val.i_int <= MAX_BLOCKS_PER_READ )
00149          p_cdda->i_blocks_per_read = val.i_int;
00150     else
00151     {
00152         msg_Warn( p_cdda_input,
00153              "Number of blocks (%d) has to be between %d and %d. No change.",
00154               val.i_int, MIN_BLOCKS_PER_READ, MAX_BLOCKS_PER_READ );
00155     }
00156     return VLC_SUCCESS;
00157 }

Generated on Tue Dec 20 10:14:23 2005 for vlc-0.8.4a by  doxygen 1.4.2