Commit b68c1a2b authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* macosx: simplify volume update method for scrollfield usage.

parent dfab7288
...@@ -254,20 +254,14 @@ ...@@ -254,20 +254,14 @@
- (void)updateVolumeSlider - (void)updateVolumeSlider
{ {
NSString * o_text; NSString * o_text;
char * psz_text;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
audio_volume_t i_volume; audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume ); aout_VolumeGet( p_intf, &i_volume );
psz_text = malloc( 32 * sizeof( char ) );
/*FIXME: do we really need to work with a char * before NSString ? */ o_text = [NSString stringWithFormat: @"Volume: %d", i_volume * 200 / AOUT_VOLUME_MAX];
if( psz_text ) [o_main setScrollField:o_text stopAfter:1000000];
{
sprintf( psz_text, "Volume: %d", i_volume * 200 / AOUT_VOLUME_MAX );
o_text = [[NSString alloc] initWithCString:psz_text];
[o_main setScrollField:o_text stopAfter:1000000];
free( psz_text );
}
[o_volumeslider setFloatValue: (float)(i_volume / AOUT_VOLUME_STEP)]; [o_volumeslider setFloatValue: (float)(i_volume / AOUT_VOLUME_STEP)];
} }
......
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