break;
}
vlc_mutex_unlock( &p_playlist->object_lock );
- } /* End of current playlist status */
+ } /* End of current playlist status */
}
}
else if( !strcmp( psz_cmd, "get_time" ) )
vlc_object_release( p_playlist );
p_playlist = NULL;
}
-
+
var_DelCallback( p_intf->p_vlc, "volume", VolumeChanged, p_intf );
}
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
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 );
vlc_mutex_unlock( &p_intf->p_sys->status_lock );
intf_thread_t *p_intf = (intf_thread_t*)p_data;
playlist_t *p_playlist = NULL;
input_thread_t *p_input = NULL;
-
+
vlc_mutex_lock( &p_intf->p_sys->status_lock );
p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( p_input )
if( p_playlist->p_input )
{
vlc_value_t val;
-
+
var_Get( p_playlist->p_input, "rate", &val );
if( val.i_int != INPUT_RATE_DEFAULT )
{
audio_volume_t i_volume;
int i_nb_steps = atoi(newval.psz_string);
int i_error = VLC_SUCCESS;
+ int i_volume_step = 0;
- if ( i_nb_steps <= 0 || i_nb_steps > (AOUT_VOLUME_MAX/AOUT_VOLUME_STEP) )
+ i_volume_step = config_GetInt( p_intf->p_vlc, "volume-step" );
+ if ( i_nb_steps <= 0 || i_nb_steps > (AOUT_VOLUME_MAX/i_volume_step) )
{
i_nb_steps = 1;
}
{
intf_thread_t * p_intf = VLCIntf;
audio_volume_t i_volume = (audio_volume_t)[sender intValue];
- aout_VolumeSet( p_intf, i_volume * AOUT_VOLUME_STEP );
+ int i_volume_step = 0;
+ i_volume_step = config_GetInt( p_intf->p_vlc, "volume-step" );
+ aout_VolumeSet( p_intf, i_volume * i_volume_step );
/* Manage volume status */
[o_main manageVolumeSlider];
}
if( p_intf->p_sys->b_volume_update )
{
NSString *o_text;
+ int i_volume_step = 0;
o_text = [NSString stringWithFormat: _NS("Volume: %d%%"), i_lastShownVolume * 400 / AOUT_VOLUME_MAX];
if( i_lastShownVolume != -1 )
[self setScrollField:o_text stopAfter:1000000];
-
- [o_volumeslider setFloatValue: (float)i_lastShownVolume / AOUT_VOLUME_STEP];
+ i_volume_step = config_GetInt( p_intf->p_vlc, "volume-step" );
+ [o_volumeslider setFloatValue: (float)i_lastShownVolume / i_volume_step];
[o_volumeslider setEnabled: TRUE];
p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
p_intf->p_sys->b_volume_update = FALSE;
{
aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
- int i_result = 0, i_volume = 0;
+ int i_result = 0, i_volume = 0, i_volume_step = 0;
+ i_volume_step = config_GetInt( p_object->p_vlc, "volume-step" );
i_volume = config_GetInt( p_object, "volume" );
- i_volume += AOUT_VOLUME_STEP * i_nb_steps;
+ i_volume += i_volume_step * i_nb_steps;
if ( i_volume > AOUT_VOLUME_MAX )
{
i_volume = AOUT_VOLUME_MAX;
{
aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
- int i_result = 0, i_volume = 0;
+ int i_result = 0, i_volume = 0, i_volume_step = 0;
+ i_volume_step = config_GetInt( p_object->p_vlc, "volume-step" );
i_volume = config_GetInt( p_object, "volume" );
- i_volume -= AOUT_VOLUME_STEP * i_nb_steps;
+ i_volume -= i_volume_step * i_nb_steps;
if ( i_volume < AOUT_VOLUME_MIN )
{
i_volume = AOUT_VOLUME_MIN;
#define VOLUME_SAVE_LONGTEXT N_( \
"This saves the audio output volume when you select mute.")
+#define VOLUME_STEP_TEXT N_("Audio output volume step")
+#define VOLUME_STEP_LONGTEXT N_( \
+ "The step size of the volume is adjustable using this option, " \
+ "in a range from 0 to 1024." )
+
#define AOUT_RATE_TEXT N_("Audio output frequency (Hz)")
#define AOUT_RATE_LONGTEXT N_( \
"You can force the audio output frequency here. Common values are " \
add_integer_with_range( "volume", AOUT_VOLUME_DEFAULT, AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX, NULL, VOLUME_TEXT,
VOLUME_LONGTEXT, VLC_FALSE );
+ add_integer_with_range( "volume-step", AOUT_VOLUME_STEP, AOUT_VOLUME_MIN,
+ AOUT_VOLUME_MAX, NULL, VOLUME_STEP_TEXT,
+ VOLUME_STEP_LONGTEXT, VLC_TRUE );
add_integer( "aout-rate", -1, NULL, AOUT_RATE_TEXT,
AOUT_RATE_LONGTEXT, VLC_TRUE );
#if !defined( SYS_DARWIN )
\r
#undef OSD_MENU_DEBUG\r
\r
-/* 3 is a magic number for 32 volume decrease steps */\r
-#define OSD_VOLUME_STEPS(i_volume,i_n) (i_volume/AOUT_VOLUME_STEP) / (AOUT_VOLUME_STEP/(i_n-1))\r
-\r
/*****************************************************************************\r
* Local prototypes\r
*****************************************************************************/\r
\r
static void osd_UpdateState( osd_menu_state_t *, int, int, int, int, picture_t * );\r
static inline osd_state_t *osd_VolumeStateChange( osd_state_t *, int );\r
+static int osd_VolumeStep( vlc_object_t *, int, int );\r
\r
+/*****************************************************************************\r
+ * OSD menu Funtions\r
+ *****************************************************************************/\r
osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )\r
{\r
osd_menu_t *p_osd = NULL;\r
\r
/* Update the volume state images to match the current volume */\r
i_volume = config_GetInt( p_this, "volume" );\r
- i_steps = OSD_VOLUME_STEPS( i_volume, p_osd->p_state->p_volume->i_ranges );\r
+ i_steps = osd_VolumeStep( p_this, i_volume, p_osd->p_state->p_volume->i_ranges );\r
p_osd->p_state->p_volume->p_current_state = osd_VolumeStateChange( p_osd->p_state->p_volume->p_states, i_steps );\r
\r
/* Initialize OSD state */\r
vlc_mutex_unlock( lockval.p_address );\r
}\r
\r
+static int osd_VolumeStep( vlc_object_t *p_this, int i_volume, int i_steps )\r
+{\r
+ int i_volume_step = 0;\r
+\r
+ i_volume_step = config_GetInt( p_this->p_vlc, "volume-step" );\r
+ return (i_volume/i_volume_step);\r
+}\r
+\r
/**\r
* Display current audio volume bitmap\r
*\r
vlc_value_t lockval;\r
int i_volume = 0;\r
int i_steps = 0;\r
- \r
+\r
if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL )\r
{\r
msg_Err( p_this, "OSD menu volume update failed" );\r
return;\r
}\r
- \r
+\r
var_Get( p_this->p_libvlc, "osd_mutex", &lockval );\r
vlc_mutex_lock( lockval.p_address );\r
\r
{\r
/* Update the volume state images to match the current volume */\r
i_volume = config_GetInt( p_this, "volume" );\r
- i_steps = OSD_VOLUME_STEPS( i_volume, p_button->i_ranges );\r
+ i_steps = osd_VolumeStep( p_this, i_volume, p_button->i_ranges );\r
+ msg_Err( p_this, "OSD steps=%d", i_steps );\r
p_button->p_current_state = osd_VolumeStateChange( p_button->p_states, i_steps );\r
\r
osd_UpdateState( p_osd->p_state,\r