Commit f14ca312 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove "saved-volume" and "volume-change". Use "volume".

parent 70042746
......@@ -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;
}
......
......@@ -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 );
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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);
......
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment