]> git.sesse.net Git - vlc/commitdiff
* patch to the Equalizer-GUI by Jean-Baptiste le Stand <jp.lestang@lestang.org>
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 23 Jul 2005 15:08:46 +0000 (15:08 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 23 Jul 2005 15:08:46 +0000 (15:08 +0000)
THANKS
modules/gui/macosx/equalizer.h
modules/gui/macosx/equalizer.m

diff --git a/THANKS b/THANKS
index 420c77a181024e3ab437e9b4f21627e2b098b4a0..90951649e906134e361cf3b7442c2a1849656c7a 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -38,7 +38,6 @@ DirektX <direktx at freemail.hu> - Hungarian translation
 Emmanuel Blindauer <manu at agat.net> - aRts audio output
 Espen Skoglund <esk at ira.uka.de> - FreeBSD autoconf and Makefile patches
 Ethan C. Baldridge <BaldridgeE at cadmus.com> - directory browsing code
-Felix Kühne <fkuehne at users.sf.net> - German translation
 Frank Chao <frank0624 at gmail.com> - Chinese Traditional translation
 Fumio Nakayama <endymion at ca2.so-net.ne.jp> - Japanese translation
 Gregory Hazel <ghazel et gmail dot com> - wxWidgets fixes and improvements
@@ -49,6 +48,7 @@ Jan Gerber <j at v2v dot org> - patch theora decoding aspect ratio
 Jan Van Boghout <vlc at macrabbit.com> - iTunes like slider for OSX intf
 Javier Varela <tonxabar at hotmail.com> - Spanish translation
 Jean-Alexis Montignies <ja at sente.ch> - coreaudio multiple streams fix
+Jean-Baptiste le Stang <jp.lestand at lestang.org> - Equalizer-GUI-fixes (OSX)
 Jean-Philippe Grimaldi <jeanphi at via.ecp.fr> - bug fixes
 Jean-Pierre Kuypers <Kuypers at sri.ucl.ac.be> - French translation
 Jeffrey Baker <jwbaker at acm.org> - port of the ALSA plugin to the ALSA 1.0 API
index 11b8d5c9d9d2ff6a61b89973b0bd5854b08ee364..6579a265dfd2ae3810fd58acdafa36b28b0c41fe 100644 (file)
 - (IBAction)twopass:(id)sender;
 - (void)windowWillClose:(NSNotification *)aNotification;
 - (void)awakeFromNib;
+
+- (void)setValue:(float)value forSlider:(int)index;
+- (id)getSliderByIndex:(int)index;
+- (void)setBandSlidersValues:(float *)values;
+- (void)initBandSliders;
+
+
 @end
index 1a217006b2604036c02b4d11cff018df93547ed9..63273e767ce11e635deec33910fa3eab545dd21b 100644 (file)
@@ -153,6 +153,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     }
     [o_window setTitle: _NS("Equalizer")];
 
+       /*
     [o_slider_band1 setFloatValue: 0];
     [o_slider_band2 setFloatValue: 0];
     [o_slider_band3 setFloatValue: 0];
@@ -163,7 +164,8 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     [o_slider_band8 setFloatValue: 0];
     [o_slider_band9 setFloatValue: 0];
     [o_slider_band10 setFloatValue: 0];
-
+       */
+       [self initBandSliders];
     [o_ckb_enable setState: NSOffState];
     [o_ckb_2pass setState: NSOffState];
 }
@@ -220,7 +222,9 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
         psz_bands = p_next+1;
     }
     free( psz_bands_init );
+       [self setBandSlidersValues:f_band];
 
+       /*
     [o_slider_band1 setFloatValue: f_band[0]];
     [o_slider_band2 setFloatValue: f_band[1]];
     [o_slider_band3 setFloatValue: f_band[2]];
@@ -231,7 +235,8 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     [o_slider_band8 setFloatValue: f_band[7]];
     [o_slider_band9 setFloatValue: f_band[8]];
     [o_slider_band10 setFloatValue: f_band[9]];
-
+       */
+       
 /* Set the the checkboxes */
     if( b_enabled == VLC_TRUE )
         [o_ckb_enable setState:NSOnState];
@@ -296,6 +301,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp);
 
     [o_slider_preamp setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp];
+       /*
     [o_slider_band1 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[0]];
     [o_slider_band2 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[1]];
     [o_slider_band3 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[2]];
@@ -306,7 +312,9 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     [o_slider_band8 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[7]];
     [o_slider_band9 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[8]];
     [o_slider_band10 setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[9]];
-
+       */
+       [self setBandSlidersValues:(float *)eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp];
+       
     vlc_object_release( p_object );
 }
 
@@ -406,6 +414,9 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
                 [o_popup_presets selectItemAtIndex: i];
 
                 [o_slider_preamp setFloatValue: eqz_preset_10b[i]->f_preamp];
+                               [self setBandSlidersValues: (float *)eqz_preset_10b[i]->f_amp];
+                               
+                               /*
                 [o_slider_band1 setFloatValue: eqz_preset_10b[i]->f_amp[0]];
                 [o_slider_band2 setFloatValue: eqz_preset_10b[i]->f_amp[1]];
                 [o_slider_band3 setFloatValue: eqz_preset_10b[i]->f_amp[2]];
@@ -416,7 +427,8 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
                 [o_slider_band8 setFloatValue: eqz_preset_10b[i]->f_amp[7]];
                 [o_slider_band9 setFloatValue: eqz_preset_10b[i]->f_amp[8]];
                 [o_slider_band10 setFloatValue: eqz_preset_10b[i]->f_amp[9]];
-
+                               */
+                               
                 if( strcmp( psz_preset, "flat" ) )
                 {
                     char psz_bands[100];
@@ -453,4 +465,51 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
 
 }
 
+
+- (id)getSliderByIndex:(int)index
+{
+       switch(index)
+       {
+               case 0 : return o_slider_band1;
+               case 1 : return o_slider_band2;
+               case 2 : return o_slider_band3;
+               case 3 : return o_slider_band4;
+               case 4 : return o_slider_band5;
+               case 5 : return o_slider_band6;
+               case 6 : return o_slider_band7;
+               case 7 : return o_slider_band8;
+               case 8 : return o_slider_band9;
+               case 9 : return o_slider_band10;
+               default : return nil;
+       }
+}
+
+- (void)setBandSlidersValues:(float *)values
+{
+       int i = 0;
+       for (i = 0 ; i<= 9 ; i++)
+       {
+               [self setValue:values[i] forSlider:i];
+       }
+}
+
+- (void)initBandSliders
+{
+       int i = 0;
+       for (i = 0 ; i< 9 ; i++)
+       {
+               [self setValue:0.0 forSlider:i];
+       }
+}
+
+- (void)setValue:(float)value forSlider:(int)index
+{
+       id slider = [self getSliderByIndex:index];
+       
+       if (slider != nil)
+       {
+               [slider setFloatValue:value];
+       }
+}
+
 @end