Commit 1ee2573c authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added Audio Effects panel to demonstrate BGHUDAppKit

(effects other than the equalizer to be implemented)

fixed compilation of the intf
parent 60e9829d
......@@ -50,39 +50,6 @@
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="219887951">
<reference key="NSNextResponder" ref="797893075"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{249, 19}, {25, 25}}</string>
<reference key="NSSuperview" ref="797893075"/>
<string key="NSReuseIdentifierKey">_NS:43</string>
<bool key="NSEnabled">YES</bool>
<object class="BGHUDButtonCell" key="NSCell" id="542178481">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport" id="1000471835">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1040</int>
</object>
<string key="NSCellIdentifier">_NS:43</string>
<reference key="NSControlView" ref="219887951"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">33</int>
<object class="NSFont" key="NSAlternateImage" id="480675396">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
<string key="themeKey">gradientTheme</string>
<int key="BGButtonType">7</int>
</object>
</object>
<object class="NSButton" id="398613381">
<reference key="NSNextResponder" ref="797893075"/>
<int key="NSvFlags">268</int>
......@@ -336,11 +303,19 @@
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="1000471835"/>
<object class="NSFont" key="NSSupport" id="1000471835">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1040</int>
</object>
<reference key="NSControlView" ref="534234935"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">33</int>
<reference key="NSAlternateImage" ref="480675396"/>
<object class="NSFont" key="NSAlternateImage">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
<string key="NSAlternateContents"/>
<object class="NSMutableString" key="NSKeyEquivalent">
<characters key="NS.bytes"/>
......@@ -404,7 +379,7 @@
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSCustomView" id="852238455">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -413,7 +388,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 52}, {335, 32}}</string>
<reference key="NSSuperview" ref="852238455"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:43</string>
<bool key="NSEnabled">YES</bool>
<object class="BGHUDButtonCell" key="NSCell" id="251927990">
......@@ -440,7 +414,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 32}, {335, 32}}</string>
<reference key="NSSuperview" ref="852238455"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:43</string>
<bool key="NSEnabled">YES</bool>
<object class="BGHUDButtonCell" key="NSCell" id="696402423">
......@@ -467,7 +440,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{121, 18}, {229, 15}}</string>
<reference key="NSSuperview" ref="852238455"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:209</string>
<bool key="NSEnabled">YES</bool>
<object class="BGHUDSliderCell" key="NSCell" id="206012777">
......@@ -492,7 +464,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{17, 20}, {99, 14}}</string>
<reference key="NSSuperview" ref="852238455"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="451552230">
<int key="NSCellFlags">67239424</int>
......@@ -514,8 +485,6 @@
</object>
</object>
<string key="NSFrameSize">{370, 78}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSMutableString" key="NSClassName">
<characters key="NS.bytes">NSView</characters>
</object>
......@@ -1539,7 +1508,6 @@
<reference ref="352486184"/>
<reference ref="195057499"/>
<reference ref="11170069"/>
<reference ref="219887951"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">VideoFilters</string>
......@@ -1967,20 +1935,6 @@
<reference key="object" ref="949223258"/>
<reference key="parent" ref="11170069"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">312</int>
<reference key="object" ref="219887951"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="542178481"/>
</object>
<reference key="parent" ref="797893075"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">313</int>
<reference key="object" ref="542178481"/>
<reference key="parent" ref="219887951"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">314</int>
<reference key="object" ref="194843708"/>
......@@ -2193,8 +2147,6 @@
<string>307.IBPluginDependency</string>
<string>307.IBViewBoundsToFrameTransform</string>
<string>308.IBPluginDependency</string>
<string>312.IBPluginDependency</string>
<string>313.IBPluginDependency</string>
<string>314.IBPluginDependency</string>
<string>314.IBViewBoundsToFrameTransform</string>
<string>315.IBPluginDependency</string>
......@@ -2352,8 +2304,6 @@
</object>
<string>com.binarymethod.BGHUDAppKitPlugin</string>
<string>com.binarymethod.BGHUDAppKitPlugin</string>
<string>com.binarymethod.BGHUDAppKitPlugin</string>
<string>com.binarymethod.BGHUDAppKitPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDLQAAwdAAAA</bytes>
</object>
......
......@@ -117,6 +117,7 @@
CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC962E2C0CC7992800A56695 /* WebKit.framework */; };
CC426FD11020D44F00A32659 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC426FD01020D44F00A32659 /* Sparkle.framework */; };
CC426FD71020D47100A32659 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CC426FD01020D44F00A32659 /* Sparkle.framework */; };
CC5560281365CE4800D54038 /* AudioEffects.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC5560261365CE4800D54038 /* AudioEffects.nib */; };
CC62B8D00FC5787D0077BB8C /* aiff.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C50FC5787D0077BB8C /* aiff.icns */; };
CC62B8D10FC5787D0077BB8C /* audio.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C60FC5787D0077BB8C /* audio.icns */; };
CC62B8D20FC5787D0077BB8C /* flv.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC62B8C70FC5787D0077BB8C /* flv.icns */; };
......@@ -275,6 +276,9 @@
CC4ED9AD0ABE07C800CA4CC5 /* add_embedded.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = add_embedded.png; path = Resources/add_embedded.png; sourceTree = "<group>"; };
CC4ED9AF0ABE07C800CA4CC5 /* repeat_embedded.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeat_embedded.png; path = Resources/repeat_embedded.png; sourceTree = "<group>"; };
CC4ED9B20ABE07C800CA4CC5 /* shuffle_embedded.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = shuffle_embedded.png; path = Resources/shuffle_embedded.png; sourceTree = "<group>"; };
CC5560231365CDC700D54038 /* AudioEffects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AudioEffects.h; path = ../../../modules/gui/macosx/AudioEffects.h; sourceTree = "<group>"; };
CC5560241365CDC800D54038 /* AudioEffects.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AudioEffects.m; path = ../../../modules/gui/macosx/AudioEffects.m; sourceTree = "<group>"; };
CC5560271365CE4800D54038 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/AudioEffects.nib; sourceTree = "<group>"; };
CC62B8C50FC5787D0077BB8C /* aiff.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = aiff.icns; path = Resources/aiff.icns; sourceTree = "<group>"; };
CC62B8C60FC5787D0077BB8C /* audio.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = audio.icns; path = Resources/audio.icns; sourceTree = "<group>"; };
CC62B8C70FC5787D0077BB8C /* flv.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = flv.icns; path = Resources/flv.icns; sourceTree = "<group>"; };
......@@ -518,6 +522,8 @@
CCF0777A13659A8000AF19FD /* SPInvocationGrabbing.m */,
CCF0777B13659A8000AF19FD /* SPMediaKeyTap.h */,
CCF0777C13659A8000AF19FD /* SPMediaKeyTap.m */,
CC5560231365CDC700D54038 /* AudioEffects.h */,
CC5560241365CDC800D54038 /* AudioEffects.m */,
);
name = Classes;
sourceTree = "<group>";
......@@ -791,6 +797,7 @@
DCFCCDB7085CE18F001E36AF /* Wizard.nib */,
DC7F46EB08A183FC0027DB24 /* Extended.nib */,
DCE7BD0308A56C8B007B10AE /* Bookmarks.nib */,
CC5560261365CE4800D54038 /* AudioEffects.nib */,
);
name = nibs;
sourceTree = "<group>";
......@@ -821,6 +828,9 @@
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
};
buildConfigurationList = C2F2A6EA09588F1B00018C74 /* Build configuration list for PBXProject "vlc" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
......@@ -983,6 +993,7 @@
CC402F3F0E00ABBB006A4BA4 /* display_right.png in Resources */,
CC0FB34C0F8BED1100F057F7 /* CoreDialogs.nib in Resources */,
CCF11B540F8BFB520088542D /* ErrorPanel.nib in Resources */,
CC5560281365CE4800D54038 /* AudioEffects.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -997,6 +1008,14 @@
name = CoreDialogs.nib;
sourceTree = "<group>";
};
CC5560261365CE4800D54038 /* AudioEffects.nib */ = {
isa = PBXVariantGroup;
children = (
CC5560271365CE4800D54038 /* English */,
);
name = AudioEffects.nib;
sourceTree = "<group>";
};
CCC896B80D9AA9E8005AE59C /* MediaInfo.nib */ = {
isa = PBXVariantGroup;
children = (
......
/*****************************************************************************
* AudioEffects.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2004-2011 the VideoLAN team
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
* Jérôme Decoodt <djc@videolan.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCAudioEffects : NSObject {
/* generic */
IBOutlet id o_tableView;
IBOutlet id o_window;
/* Equalizer */
IBOutlet id o_eq_enable_ckb;
IBOutlet id o_eq_twopass_ckb;
IBOutlet id o_eq_preamp_lbl;
IBOutlet id o_eq_presets_popup;
IBOutlet id o_eq_band1_sld;
IBOutlet id o_eq_band2_sld;
IBOutlet id o_eq_band3_sld;
IBOutlet id o_eq_band4_sld;
IBOutlet id o_eq_band5_sld;
IBOutlet id o_eq_band6_sld;
IBOutlet id o_eq_band7_sld;
IBOutlet id o_eq_band8_sld;
IBOutlet id o_eq_band9_sld;
IBOutlet id o_eq_band10_sld;
IBOutlet id o_eq_preamp_sld;
/* Compressor */
IBOutlet id o_comp_enable_ckb;
IBOutlet id o_comp_band1_sld;
IBOutlet id o_comp_band1_fld;
IBOutlet id o_comp_band1_lbl;
IBOutlet id o_comp_band2_sld;
IBOutlet id o_comp_band2_fld;
IBOutlet id o_comp_band2_lbl;
IBOutlet id o_comp_band3_sld;
IBOutlet id o_comp_band3_fld;
IBOutlet id o_comp_band3_lbl;
IBOutlet id o_comp_band4_sld;
IBOutlet id o_comp_band4_fld;
IBOutlet id o_comp_band4_lbl;
IBOutlet id o_comp_band5_sld;
IBOutlet id o_comp_band5_fld;
IBOutlet id o_comp_band5_lbl;
IBOutlet id o_comp_band6_sld;
IBOutlet id o_comp_band6_fld;
IBOutlet id o_comp_band6_lbl;
IBOutlet id o_comp_band7_sld;
IBOutlet id o_comp_band7_fld;
IBOutlet id o_comp_band7_lbl;
/* Spatializer */
IBOutlet id o_spat_enable_ckb;
IBOutlet id o_spat_band1_sld;
IBOutlet id o_spat_band1_fld;
IBOutlet id o_spat_band1_lbl;
IBOutlet id o_spat_band2_sld;
IBOutlet id o_spat_band2_fld;
IBOutlet id o_spat_band2_lbl;
IBOutlet id o_spat_band3_sld;
IBOutlet id o_spat_band3_fld;
IBOutlet id o_spat_band3_lbl;
IBOutlet id o_spat_band4_sld;
IBOutlet id o_spat_band4_fld;
IBOutlet id o_spat_band4_lbl;
IBOutlet id o_spat_band5_sld;
IBOutlet id o_spat_band5_fld;
IBOutlet id o_spat_band5_lbl;
/* Filter */
IBOutlet id o_filter_headPhone_ckb;
IBOutlet id o_filter_normLevel_ckb;
IBOutlet id o_filter_normLevel_sld;
IBOutlet id o_filter_normLevel_lbl;
}
/* generic */
+ (VLCAudioEffects *)sharedInstance;
- (IBAction)toggleWindow:(id)sender;
/* Equalizer */
- (void)setupEqualizer;
- (void)equalizerUpdated;
- (void)setBandSlidersValues:(float *)values;
- (void)initBandSliders;
- (void)setValue:(float)value forSlider:(int)index;
- (IBAction)eq_bandSliderUpdated:(id)sender;
- (IBAction)eq_changePreset:(id)sender;
- (IBAction)eq_enable:(id)sender;
- (IBAction)eq_preampSliderUpdated:(id)sender;
- (IBAction)eq_twopass:(id)sender;
@end
/*****************************************************************************
* AudioEffects.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2004-2011 the VideoLAN team
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
* Jérôme Decoodt <djc@videolan.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# import "config.h"
#endif
#import "AudioEffects.h"
#import "intf.h"
#import "../../audio_filter/equalizer_presets.h"
#import <vlc_common.h>
#import <vlc_aout.h>
#import <math.h>
#pragma mark -
#pragma mark Initialization & Generic code
@implementation VLCAudioEffects
static VLCAudioEffects *_o_sharedInstance = nil;
+ (VLCAudioEffects *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
- (void)awakeFromNib
{
/* setup the user's language */
/* Equalizer */
[o_eq_enable_ckb setTitle:_NS("Enable")];
[o_eq_twopass_ckb setTitle:_NS("2 Pass")];
[o_eq_preamp_lbl setStringValue:_NS("Preamp")];
[o_eq_presets_popup removeAllItems];
for( int i = 0; i < 18 ; i++ )
[o_eq_presets_popup insertItemWithTitle: _NS(preset_list_text[i]) atIndex: i];
/* Compressor */
[o_comp_enable_ckb setTitle:_NS("Enable dynamic range compressor")];
[o_comp_band1_lbl setStringValue:_NS("RMS/peak")];;
[o_comp_band2_lbl setStringValue:_NS("Attack")];
[o_comp_band3_lbl setStringValue:_NS("Release")];
[o_comp_band4_lbl setStringValue:_NS("Threshold")];
[o_comp_band5_lbl setStringValue:_NS("Ratio")];
[o_comp_band6_lbl setStringValue:_NS("Knee radius")];
[o_comp_band7_lbl setStringValue:_NS("Makeup gain")];
/* Spatializer */
[o_spat_enable_ckb setTitle:_NS("Enable Spatializer")];
[o_spat_band1_lbl setStringValue:_NS("Size")];
[o_spat_band2_lbl setStringValue:_NS("Width")];
[o_spat_band3_lbl setStringValue:_NS("Wet")];
[o_spat_band4_lbl setStringValue:_NS("Dry")];
[o_spat_band5_lbl setStringValue:_NS("Dump")];
/* Filter */
[o_filter_headPhone_ckb setTitle:_NS("Headphone virtualization")];
[o_filter_normLevel_ckb setTitle:_NS("Volume normalization")];
[o_filter_normLevel_lbl setStringValue:_NS("Maximum level")];
/* generic */
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"equalizer"]] setLabel:_NS("Equalizer")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"compressor"]] setLabel:_NS("Compressor")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"spatializer"]] setLabel:_NS("Spatializer")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"filter"]] setLabel:_NS("Filter")];
[o_window setTitle:_NS("Audio Effects")];
[o_window setExcludedFromWindowsMenu:YES];
[self setupEqualizer];
}
- (IBAction)toggleWindow:(id)sender
{
if( [o_window isVisible] )
[o_window orderOut:sender];
else
[o_window makeKeyAndOrderFront:sender];
}
#pragma mark -
#pragma mark Equalizer
static bool GetFiltersStatus( intf_thread_t *p_intf,
char *psz_name )
{
char *psz_parser, *psz_string = NULL;
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
psz_string = config_GetPsz( p_intf, "audio-filter" );
if(! psz_string )
psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
vlc_object_release( p_object );
if( !psz_string ) return false;
psz_parser = strstr( psz_string, psz_name );
free( psz_string );
if ( psz_parser )
return true;
else
return false;
}
- (void)setupEqualizer
{
int i;
vlc_object_t *p_object= VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( VLCIntf ));
if( p_object )
{
char *psz_preset;
var_Create( p_object, "equalizer-preset", VLC_VAR_STRING |
VLC_VAR_DOINHERIT );
psz_preset = var_GetNonEmptyString( p_object, "equalizer-preset" );
for( i = 0 ; (psz_preset != NULL) && (i < 18) ; i++ )
{
if( strcmp( preset_list[i], psz_preset ) )
continue;
[o_eq_presets_popup selectItemAtIndex: i];
[o_eq_preamp_sld setFloatValue: eqz_preset_10b[i]->f_preamp];
[self setBandSlidersValues: (float *)eqz_preset_10b[i]->f_amp];
if( strcmp( psz_preset, "flat" ) )
{
char psz_bands[100];
snprintf( psz_bands, sizeof( psz_bands ),
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f "
"%.1f %.1f %.1f",
eqz_preset_10b[i]->f_amp[0],
eqz_preset_10b[i]->f_amp[1],
eqz_preset_10b[i]->f_amp[2],
eqz_preset_10b[i]->f_amp[3],
eqz_preset_10b[i]->f_amp[4],
eqz_preset_10b[i]->f_amp[5],
eqz_preset_10b[i]->f_amp[6],
eqz_preset_10b[i]->f_amp[7],
eqz_preset_10b[i]->f_amp[8],
eqz_preset_10b[i]->f_amp[9] );
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
VLC_VAR_DOINHERIT );
var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
VLC_VAR_DOINHERIT );
var_SetFloat( p_object, "equalizer-preamp",
eqz_preset_10b[i]->f_preamp );
var_SetString( p_object, "equalizer-bands", psz_bands );
}
}
free( psz_preset );
vlc_object_release( p_object );
}
[self equalizerUpdated];
}
- (void)equalizerUpdated
{
intf_thread_t *p_intf = VLCIntf;
float f_preamp, f_band[10];
char *psz_bands, *psz_bands_init, *p_next;
bool b_2p;
int i;
bool b_enabled = GetFiltersStatus( p_intf, (char *)"equalizer" );
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
VLC_VAR_DOINHERIT );
var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
VLC_VAR_DOINHERIT );
psz_bands = var_GetNonEmptyString( p_object, "equalizer-bands" );
if( psz_bands == NULL )
psz_bands = strdup( "0 0 0 0 0 0 0 0 0 0" );
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
{
b_2p = (BOOL)config_GetInt( p_object, "equalizer-2pass" );
f_preamp = config_GetFloat( p_object, "equalizer-preamp" );
}
else
{
b_2p = var_GetBool( p_object, "equalizer-2pass" );
f_preamp = var_GetFloat( p_object, "equalizer-preamp" );
}
vlc_object_release( p_object );
/* Set the preamp slider */
[o_eq_preamp_sld setFloatValue: f_preamp];
/* Set the bands slider */
psz_bands_init = psz_bands;
for( i = 0; i < 10; i++ )