Changeset 1114ee5a01e78e259b916dc3e723b81a9347f38e
- Timestamp:
- 09/01/04 21:36:21 (5 years ago)
- git-parent:
- Files:
-
- include/variables.h (modified) (4 diffs)
- src/libvlc.c (modified) (4 diffs)
- src/misc/variables.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/variables.h
r97d84d1 r1114ee5 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: variables.h,v 1. 19 2003/12/02 12:57:35 gbazin Exp $5 * $Id: variables.h,v 1.20 2004/01/09 20:36:21 hartman Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 138 138 * \param p_val2 Unused 139 139 */ 140 #define VLC_VAR_SETMIN 0x0010140 #define VLC_VAR_SETMIN 0x0010 141 141 /** 142 142 * Set the maximum value of this variable … … 144 144 * \param p_val2 Unused 145 145 */ 146 #define VLC_VAR_SETMAX 0x0011147 #define VLC_VAR_SETSTEP 0x0012146 #define VLC_VAR_SETMAX 0x0011 147 #define VLC_VAR_SETSTEP 0x0012 148 148 149 149 /** … … 152 152 * \param p_val2 Unused 153 153 */ 154 #define VLC_VAR_SETVALUE 0x0013 155 156 #define VLC_VAR_SETTEXT 0x0014 157 #define VLC_VAR_GETTEXT 0x0015 158 159 #define VLC_VAR_ADDCHOICE 0x0020 160 #define VLC_VAR_DELCHOICE 0x0021 161 #define VLC_VAR_CLEARCHOICES 0x0022 162 #define VLC_VAR_SETDEFAULT 0x0023 163 #define VLC_VAR_GETCHOICES 0x0024 164 #define VLC_VAR_FREECHOICES 0x0025 165 #define VLC_VAR_GETLIST 0x0026 166 #define VLC_VAR_FREELIST 0x0027 167 #define VLC_VAR_CHOICESCOUNT 0x0028 168 169 #define VLC_VAR_INHERITVALUE 0x0030 154 #define VLC_VAR_SETVALUE 0x0013 155 156 #define VLC_VAR_SETTEXT 0x0014 157 #define VLC_VAR_GETTEXT 0x0015 158 159 #define VLC_VAR_ADDCHOICE 0x0020 160 #define VLC_VAR_DELCHOICE 0x0021 161 #define VLC_VAR_CLEARCHOICES 0x0022 162 #define VLC_VAR_SETDEFAULT 0x0023 163 #define VLC_VAR_GETCHOICES 0x0024 164 #define VLC_VAR_FREECHOICES 0x0025 165 #define VLC_VAR_GETLIST 0x0026 166 #define VLC_VAR_FREELIST 0x0027 167 #define VLC_VAR_CHOICESCOUNT 0x0028 168 169 #define VLC_VAR_INHERITVALUE 0x0030 170 #define VLC_VAR_TRIGGER_CALLBACKS 0x0035 170 171 /**@}*/ 171 172 src/libvlc.c
r25cd132 r1114ee5 3 3 ***************************************************************************** 4 4 * Copyright (C) 1998-2004 VideoLAN 5 * $Id: libvlc.c,v 1.1 09 2004/01/06 12:02:05 zorglubExp $5 * $Id: libvlc.c,v 1.110 2004/01/09 20:36:21 hartman Exp $ 6 6 * 7 7 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 100 100 static int ConsoleWidth ( void ); 101 101 102 static int VerboseCallback( vlc_object_t *, char const *, 103 vlc_value_t, vlc_value_t, void * ); 102 104 103 105 /***************************************************************************** … … 498 500 * Message queue options 499 501 */ 502 503 var_Create( p_vlc, "verbose", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 500 504 if( config_GetInt( p_vlc, "quiet" ) ) 501 505 { 502 libvlc.i_verbose = -1; 503 } 504 else 505 { 506 int i_tmp = config_GetInt( p_vlc, "verbose" ); 507 if( i_tmp >= 0 ) 508 { 509 libvlc.i_verbose = __MIN( i_tmp, 2 ); 510 } 511 } 506 vlc_value_t val; 507 val.i_int = -1; 508 var_Set( p_vlc, "verbose", val ); 509 } 510 var_AddCallback( p_vlc, "verbose", VerboseCallback, NULL ); 511 var_Change( p_vlc, "verbose", VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL ); 512 512 513 libvlc.b_color = libvlc.b_color && config_GetInt( p_vlc, "color" ); 513 514 … … 1631 1632 return i_width; 1632 1633 } 1634 1635 static int VerboseCallback( vlc_object_t *p_this, const char *psz_variable, 1636 vlc_value_t old_val, vlc_value_t new_val, void *param) 1637 { 1638 vlc_t *p_vlc = (vlc_t *)p_this; 1639 1640 if( new_val.i_int >= -1 ) 1641 { 1642 p_vlc->p_libvlc->i_verbose = __MIN( new_val.i_int, 2 ); 1643 } 1644 return VLC_SUCCESS; 1645 } src/misc/variables.c
r25cd132 r1114ee5 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002-2004 VideoLAN 5 * $Id: variables.c,v 1.3 5 2004/01/06 12:02:06 zorglubExp $5 * $Id: variables.c,v 1.36 2004/01/09 20:36:21 hartman Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 615 615 } 616 616 break; 617 case VLC_VAR_TRIGGER_CALLBACKS: 618 { 619 /* Deal with callbacks. Tell we're in a callback, release the lock, 620 * call stored functions, retake the lock. */ 621 if( p_var->i_entries ) 622 { 623 int i_var; 624 int i_entries = p_var->i_entries; 625 callback_entry_t *p_entries = p_var->p_entries; 626 627 p_var->b_incallback = VLC_TRUE; 628 vlc_mutex_unlock( &p_this->var_lock ); 629 630 /* The real calls */ 631 for( ; i_entries-- ; ) 632 { 633 p_entries[i_entries].pf_callback( p_this, psz_name, p_var->val, p_var->val, 634 p_entries[i_entries].p_data ); 635 } 636 637 vlc_mutex_lock( &p_this->var_lock ); 638 639 i_var = Lookup( p_this->p_vars, p_this->i_vars, psz_name ); 640 if( i_var < 0 ) 641 { 642 msg_Err( p_this, "variable %s has disappeared", psz_name ); 643 vlc_mutex_unlock( &p_this->var_lock ); 644 return VLC_ENOVAR; 645 } 646 647 p_var = &p_this->p_vars[i_var]; 648 p_var->b_incallback = VLC_FALSE; 649 } 650 } 651 break; 617 652 618 653 default:
