]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/equalizer.m
macosx: Use a toolbar to display controls. (Doesn't look like a toolbar though)
[vlc] / modules / gui / macosx / equalizer.m
index d570baf6bc08fee3f87443de658c9be8d5aa6b4b..02f1ba71902e9399987748adf4b98e6be0f8cc32 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_aout.h>
 
 #include "intf.h"
@@ -41,7 +45,7 @@
 @implementation VLCEqualizer
 
 static void ChangeFiltersString( intf_thread_t *p_intf,
-                                 char *psz_name, vlc_bool_t b_add )
+                                 char *psz_name, bool b_add )
 {
     char *psz_parser, *psz_string;
     int i;
@@ -49,8 +53,7 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
                                 VLC_OBJECT_AOUT, FIND_ANYWHERE );
     aout_instance_t *p_aout = (aout_instance_t *)p_object;
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                 VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -99,7 +102,7 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
     {
         for( i = 0; i < p_aout->i_nb_inputs; i++ )
         {
-            p_aout->pp_inputs[i]->b_restart = VLC_TRUE;
+            p_aout->pp_inputs[i]->b_restart = true;
         }
     }
     
@@ -116,17 +119,16 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
     vlc_object_release( p_object );
 }
 
-static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
+static bool GetFiltersStatus( intf_thread_t *p_intf,
                                  char *psz_name )
 {
     char *psz_parser, *psz_string;
     vlc_object_t *p_object = vlc_object_find( p_intf,
                                 VLC_OBJECT_AOUT, FIND_ANYWHERE );
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                 VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
-        return VLC_FALSE;
+        return false;
 
     if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
         psz_string = config_GetPsz( p_intf, "audio-filter" );
@@ -136,16 +138,16 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
 
     vlc_object_release( p_object );
 
-    if( !psz_string ) return VLC_FALSE;
+    if( !psz_string ) return false;
 
     psz_parser = strstr( psz_string, psz_name );
 
     free( psz_string );
 
     if ( psz_parser )
-        return VLC_TRUE;
+        return true;
     else
-        return VLC_FALSE;
+        return false;
 }
 
 - (void)initStrings
@@ -175,15 +177,14 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     intf_thread_t *p_intf = VLCIntf;
     float f_preamp, f_band[10];
     char *psz_bands, *psz_bands_init, *p_next;
-    vlc_bool_t b_2p;
+    bool b_2p;
     int i;
-    vlc_bool_t b_enabled = GetFiltersStatus( p_intf, (char *)"equalizer" );
+    bool b_enabled = GetFiltersStatus( p_intf, (char *)"equalizer" );
     vlc_object_t *p_object = vlc_object_find( p_intf,
                                               VLC_OBJECT_AOUT, FIND_ANYWHERE );
 
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -245,8 +246,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
                                               VLC_OBJECT_AOUT, FIND_ANYWHERE );
 
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -288,8 +288,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     vlc_object_t *p_object= vlc_object_find( p_intf,
                                              VLC_OBJECT_AOUT, FIND_ANYWHERE );
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -334,8 +333,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     vlc_object_t *p_object = vlc_object_find( p_intf,
                                               VLC_OBJECT_AOUT, FIND_ANYWHERE );
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -370,13 +368,12 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
 - (IBAction)twopass:(id)sender
 {
     intf_thread_t *p_intf = VLCIntf;
-    vlc_bool_t b_2p = [sender state] ? VLC_TRUE : VLC_FALSE;
+    bool b_2p = [sender state] ? true : false;
     vlc_object_t *p_object= vlc_object_find( p_intf,
                                              VLC_OBJECT_AOUT, FIND_ANYWHERE );
     aout_instance_t *p_aout = (aout_instance_t *)p_object;
     if( p_object == NULL )
-        p_object = vlc_object_find( p_intf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( p_intf );
     if( p_object == NULL )
         return;
 
@@ -386,7 +383,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
         int i;
         for( i = 0; i < p_aout->i_nb_inputs; i++ )
         {
-            p_aout->pp_inputs[i]->b_restart = VLC_TRUE;
+            p_aout->pp_inputs[i]->b_restart = true;
         }
     }
 
@@ -413,8 +410,7 @@ static vlc_bool_t GetFiltersStatus( intf_thread_t *p_intf,
     vlc_object_t *p_object= vlc_object_find( VLCIntf,
                                              VLC_OBJECT_AOUT, FIND_ANYWHERE );
     if( p_object == NULL )
-        p_object = vlc_object_find( VLCIntf,
-                                    VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        p_object = pl_Yield( VLCIntf );
 
     [o_window setExcludedFromWindowsMenu: TRUE];