Commit 6bfa684a authored by Jean-Paul Saman's avatar Jean-Paul Saman

Added dynamic variable volume-change to notify upon a volume change. The...

Added dynamic variable volume-change to notify upon a volume change. The rc-interface listens to it and prints some feedback on its output.
parent 9b0fed98
......@@ -135,7 +135,7 @@ void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
if( p_intf->p_sys->i_socket == -1 )
{
vprintf( psz_fmt, args );
printf( "\n" );
printf( "\r\n" );
}
else
{
......@@ -531,7 +531,7 @@ static void Run( intf_thread_t *p_intf )
/* status callbacks */
/* Listen to audio volume updates */
var_AddCallback( p_intf->p_vlc, "volume", VolumeChanged, p_intf );
var_AddCallback( p_intf->p_vlc, "volume-change", VolumeChanged, p_intf );
#ifdef WIN32
/* Get the file descriptor of the console input */
......@@ -865,7 +865,7 @@ static void Run( intf_thread_t *p_intf )
p_playlist = NULL;
}
var_DelCallback( p_intf->p_vlc, "volume", VolumeChanged, p_intf );
var_DelCallback( p_intf->p_vlc, "volume-change", VolumeChanged, p_intf );
}
static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
......@@ -979,7 +979,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 )", newval.i_int );
msg_rc( STATUS_CHANGE "( audio volume: %d )", config_GetInt( p_this, "volume") );
vlc_mutex_unlock( &p_intf->p_sys->status_lock );
return VLC_SUCCESS;
}
......@@ -1699,7 +1699,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
{
intf_thread_t *p_intf = (intf_thread_t*)p_this;
input_thread_t *p_input = NULL;
int i_error;
int i_error = VLC_EGENERIC;
p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( !p_input )
......
......@@ -87,8 +87,7 @@ int __aout_VolumeGet( vlc_object_t * p_object, audio_volume_t * pi_volume )
int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
{
vlc_value_t val;
aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
aout_instance_t *p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT, FIND_ANYWHERE );
int i_result = 0;
config_PutInt( p_object, "volume", i_volume );
......@@ -104,6 +103,7 @@ int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
val.b_bool = VLC_TRUE;
var_Set( p_aout, "intf-change", val );
var_Set( p_aout->p_vlc, "volume-change", val );
vlc_object_release( p_aout );
return i_result;
}
......
......@@ -779,6 +779,9 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
var_Create( p_vlc, "drawableportx", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableporty", VLC_VAR_INTEGER );
/* Create volume callback system. */
var_Create( p_vlc, "volume-change", VLC_VAR_BOOL );
/*
* Get input filenames given as commandline arguments
*/
......
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