[vlc-commits] Remove "saved-volume" and "volume-change". Use "volume".
Rémi Denis-Courmont
git at videolan.org
Thu Apr 7 22:21:33 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 7 23:14:20 2011 +0300| [f14ca312e095c3f256ee0181d722e6d6b245559a] | committer: Rémi Denis-Courmont
Remove "saved-volume" and "volume-change". Use "volume".
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f14ca312e095c3f256ee0181d722e6d6b245559a
---
modules/control/rc.c | 7 +++----
modules/gui/qt4/input_manager.cpp | 4 ++--
modules/gui/skins2/src/vlcproc.cpp | 6 +++---
src/audio_output/intf.c | 12 ++++--------
src/control/media_player.c | 3 +--
src/playlist/engine.c | 3 +--
6 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/modules/control/rc.c b/modules/control/rc.c
index 9798d5f..8cae2a3 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -462,7 +462,7 @@ static void Run( intf_thread_t *p_intf )
/* status callbacks */
/* Listen to audio volume updates */
- var_AddCallback( p_playlist, "volume-change", VolumeChanged, p_intf );
+ var_AddCallback( p_playlist, "volume", VolumeChanged, p_intf );
#ifdef WIN32
/* Get the file descriptor of the console input */
@@ -792,7 +792,7 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release( p_input );
}
- var_DelCallback( p_playlist, "volume-change", VolumeChanged, p_intf );
+ var_DelCallback( p_playlist, "volume", VolumeChanged, p_intf );
vlc_restorecancel( canc );
}
@@ -903,8 +903,7 @@ static int VolumeChanged( vlc_object_t *p_this, char const *psz_cmd,
intf_thread_t *p_intf = (intf_thread_t*)p_data;
vlc_mutex_lock( &p_intf->p_sys->status_lock );
- msg_rc( STATUS_CHANGE "( audio volume: %d )",
- (int)config_GetInt( p_this, "volume") );
+ msg_rc( STATUS_CHANGE "( audio volume: %d )", newval.i_int );
vlc_mutex_unlock( &p_intf->p_sys->status_lock );
return VLC_SUCCESS;
}
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index e297885..e9ee7c7 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -956,7 +956,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback( THEPL, "repeat", RepeatChanged, this );
var_AddCallback( THEPL, "loop", LoopChanged, this );
- var_AddCallback( THEPL, "volume-change", VolumeChanged, this );
+ var_AddCallback( THEPL, "volume", VolumeChanged, this );
var_AddCallback( THEPL, "mute", SoundMuteChanged, this );
/* Warn our embedded IM about input changes */
@@ -987,7 +987,7 @@ MainInputManager::~MainInputManager()
vlc_object_release( p_input );
}
- var_DelCallback( THEPL, "volume-change", VolumeChanged, this );
+ var_DelCallback( THEPL, "volume", VolumeChanged, this );
var_DelCallback( THEPL, "mute", SoundMuteChanged, this );
var_DelCallback( THEPL, "activity", PLItemChanged, this );
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index d448412..5528fd7 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -151,7 +151,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
#define ADD_CALLBACK( p_object, var ) \
var_AddCallback( p_object, var, onGenericCallback, this );
- ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume-change" )
+ ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume" )
ADD_CALLBACK( pIntf->p_libvlc, "intf-show" )
ADD_CALLBACK( pIntf->p_sys->p_playlist, "item-current" )
@@ -203,7 +203,7 @@ VlcProc::~VlcProc()
interaction_Unregister( getIntf() );
- var_DelCallback( getIntf()->p_sys->p_playlist, "volume-change",
+ var_DelCallback( getIntf()->p_sys->p_playlist, "volume",
onGenericCallback, this );
var_DelCallback( getIntf()->p_libvlc, "intf-show",
onGenericCallback, this );
@@ -385,7 +385,7 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
}
ADD_CALLBACK_ENTRY( "item-current", on_item_current_changed, false )
- ADD_CALLBACK_ENTRY( "volume-change", on_volume_changed, true )
+ ADD_CALLBACK_ENTRY( "volume", on_volume_changed, true )
ADD_CALLBACK_ENTRY( "bit-rate", on_bit_rate_changed, false )
ADD_CALLBACK_ENTRY( "sample-rate", on_sample_rate_changed, false )
diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
index f3c6e20..8ff261e 100644
--- a/src/audio_output/intf.c
+++ b/src/audio_output/intf.c
@@ -69,7 +69,7 @@ static void prepareVolume (vlc_object_t *obj, aout_instance_t **aoutp,
if (aout != NULL)
aout_lock_volume (aout);
if (volp != NULL)
- *volp = config_GetInt (obj, "volume");
+ *volp = var_GetInteger (obj, "volume");
if (mutep != NULL)
*mutep = var_GetBool (obj, "mute");
}
@@ -80,7 +80,7 @@ static int commitVolume (vlc_object_t *obj, aout_instance_t *aout,
{
int ret = 0;
- config_PutInt (obj, "volume", volume);
+ var_SetInteger (obj, "volume", volume);
if (mute)
volume = AOUT_VOLUME_MIN;
var_SetBool (obj, "mute", mute);
@@ -99,10 +99,6 @@ static int commitVolume (vlc_object_t *obj, aout_instance_t *aout,
aout_unlock_volume (aout);
vlc_object_release (aout);
}
-
- /* trigger callbacks */
- var_TriggerCallback (obj, "volume-change");
-
return ret;
}
@@ -133,7 +129,7 @@ audio_volume_t aout_VolumeGet (vlc_object_t *obj)
cancelVolume (obj, aout);
return 0;
#else
- return config_GetInt (obj, "volume");
+ return var_GetInteger (obj, "volume");
#endif
}
@@ -245,7 +241,7 @@ void aout_VolumeSoftInit( aout_instance_t * p_aout )
p_aout->output.pf_volume_set = aout_VolumeSoftSet;
- i_volume = config_GetInt( p_aout, "volume" );
+ i_volume = var_InheritInteger( p_aout, "volume" );
if ( i_volume < AOUT_VOLUME_MIN )
{
i_volume = AOUT_VOLUME_DEFAULT;
diff --git a/src/control/media_player.c b/src/control/media_player.c
index d7d5a7f..efea8ab 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -455,8 +455,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
/* Audio */
var_Create (mp, "aout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_Create (mp, "mute", VLC_VAR_BOOL);
- var_Create (mp, "saved-volume", VLC_VAR_INTEGER);
- var_Create (mp, "volume-change", VLC_VAR_VOID);
+ var_Create (mp, "volume", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
var_Create (mp, "find-input-callback", VLC_VAR_ADDRESS);
var_SetAddress (mp, "find-input-callback", find_input);
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index a040bd6..8e10a2b 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -433,8 +433,7 @@ static void VariablesInit( playlist_t *p_playlist )
/* Audio output parameters */
var_Create( p_playlist, "mute", VLC_VAR_BOOL );
- var_Create( p_playlist, "saved-volume", VLC_VAR_INTEGER );
- var_Create( p_playlist, "volume-change", VLC_VAR_VOID );
+ var_Create( p_playlist, "volume", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
/* FIXME: horrible hack for audio output interface code */
var_Create( p_playlist, "find-input-callback", VLC_VAR_ADDRESS );
var_SetAddress( p_playlist, "find-input-callback", playlist_FindInput );
More information about the vlc-commits
mailing list