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
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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++ )
{
/* Read dB -20/20 */
f_band[i] = strtof( psz_bands, &p_next );
if( !p_next || p_next == psz_bands ) break; /* strtof() failed */
if( !*psz_bands ) break; /* end of line */
psz_bands = p_next+1;
}
free( psz_bands_init );
[self setBandSlidersValues:f_band];
/* Set the the checkboxes */
[o_eq_enable_ckb setState: b_enabled];
[o_eq_twopass_ckb setState: b_2p];
}
- (id)sliderByIndex:(int)index
{
switch(index)
{
case 0 : return o_eq_band1_sld;
case 1 : return o_eq_band2_sld;
case 2 : return o_eq_band3_sld;
case 3 : return o_eq_band4_sld;
case 4 : return o_eq_band5_sld;
case 5 : return o_eq_band6_sld;
case 6 : return o_eq_band7_sld;
case 7 : return o_eq_band8_sld;
case 8 : return o_eq_band9_sld;
case 9 : return o_eq_band10_sld;
default : return nil;
}
}
- (void)setBandSlidersValues:(float *)values
{
for (int i = 0 ; i<= 9 ; i++)
[self setValue:values[i] forSlider:i];
}
- (void)initBandSliders
{
for (int i = 0 ; i< 9 ; i++)
[self setValue:0.0 forSlider:i];
}
- (void)setValue:(float)value forSlider:(int)index
{
id slider = [self sliderByIndex:index];
if (slider != nil)
[slider setFloatValue:value];
}
- (IBAction)eq_enable:(id)sender
{
aout_EnableFilter( pl_Get( VLCIntf ), (char *)"equalizer", [sender state]);
}
- (IBAction)eq_bandSliderUpdated:(id)sender
{
intf_thread_t *p_intf = VLCIntf;
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
const char *psz_values;
NSString *preset = [NSString stringWithFormat:@"%.1f ", [o_eq_band1_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band2_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band3_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band4_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band5_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band6_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band7_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band8_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band9_sld floatValue] ];
preset = [preset stringByAppendingFormat:@"%.1f", [o_eq_band10_sld floatValue] ];
psz_values = [preset UTF8String];
var_SetString( p_object, "equalizer-bands", psz_values );
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
{
/* save changed to config */
config_PutPsz( p_intf, "equalizer-bands", psz_values );
/* save to vlcrc */
config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
}
- (IBAction)eq_changePreset:(id)sender
{
intf_thread_t *p_intf = VLCIntf;
int i;
vlc_object_t *p_object= VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
var_SetString( p_object , "equalizer-preset" , preset_list[[sender indexOfSelectedItem]] );
NSString *preset = @"";
const char *psz_values;
for( i = 0; i < 10; i++ )
{
preset = [preset stringByAppendingFormat:@"%.1f ", eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[i] ];
}
psz_values = [preset UTF8String];
var_SetString( p_object, "equalizer-bands", psz_values );
var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp);
[o_eq_preamp_sld setFloatValue: eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp];
[self setBandSlidersValues:(float *)eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp];
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
{
/* save changed to config */
config_PutPsz( p_intf, "equalizer-bands", psz_values );
config_PutFloat( p_intf, "equalizer-preamp", eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp );
config_PutPsz( p_intf, "equalizer-preset", preset_list[[sender indexOfSelectedItem]] );
/* save to vlcrc */
config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
}
- (IBAction)eq_preampSliderUpdated:(id)sender
{
intf_thread_t *p_intf = VLCIntf;
float f_preamp = [sender floatValue] ;
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
var_SetFloat( p_object, "equalizer-preamp", f_preamp );
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
{
/* save changed to config */
config_PutFloat( p_intf, "equalizer-preamp", f_preamp );
/* save to vlcrc */
config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
}
- (IBAction)eq_twopass:(id)sender
{
intf_thread_t *p_intf = VLCIntf;
bool b_2p = [sender state] ? true : false;
aout_instance_t *p_aout = getAout();
vlc_object_t *p_object= VLC_OBJECT(p_aout);
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf ));
var_SetBool( p_object, "equalizer-2pass", b_2p );
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
{
/* save changed to config */
config_PutInt( p_intf, "equalizer-2pass", (int)b_2p );
/* save to vlcrc */
config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
}
#pragma mark -
#pragma mark Compressor
#pragma mark -
#pragma mark Spatializer
#pragma mark -
#pragma mark Filter
@end
......@@ -43,6 +43,8 @@ SOURCES_macosx = \
wizard.m \
extended.h \
extended.m \
AudioEffects.h \
AudioEffects.m \
bookmarks.h \
bookmarks.m \
embeddedwindow.h \
......
......@@ -415,6 +415,7 @@ static VLCExtended *_o_sharedInstance = nil;
val.f_float = [o_sld_opaque floatValue] / 100;
#if 0
if( p_vout != NULL )
{
p_real_vout = [VLCVoutView realVout: p_vout];
......@@ -432,6 +433,7 @@ static VLCExtended *_o_sharedInstance = nil;
}
vlc_object_release( p_vout );
}
#endif
/* store to prefs */
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
......
......@@ -111,6 +111,7 @@ struct intf_sys_t
id o_coredialogs; /* VLCCoreDialogProvider */
VLCInformation * o_info; /* VLCInformation */
id o_eyetv; /* VLCEyeTVController */
id o_audioeffects; /* VLCAudioEffects */
BOOL nib_main_loaded; /* main nibfile */
BOOL nib_open_loaded; /* open nibfile */
BOOL nib_about_loaded; /* about nibfile */
......@@ -120,6 +121,7 @@ struct intf_sys_t
BOOL nib_prefs_loaded; /* preferences nibfile */
BOOL nib_info_loaded; /* information panel nibfile */
BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
BOOL nib_audioeffects_loaded; /* audio effects panel */
IBOutlet VLCControllerWindow * o_window; /* main window */
IBOutlet NSView * o_playlist_view; /* playlist view */
......@@ -143,7 +145,7 @@ struct intf_sys_t
IBOutlet NSButton * o_btn_next; /* btn next */
IBOutlet NSButton * o_btn_fullscreen;/* btn fullscreen (embedded vout window) */
IBOutlet NSButton * o_btn_playlist; /* btn playlist */
IBOutlet NSButton * o_btn_equalizer; /* eq btn */
IBOutlet NSButton * o_btn_audioEffects; /* AudioEffects btn */
NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */
......@@ -278,7 +280,7 @@ struct intf_sys_t
IBOutlet NSMenuItem * o_mi_close_window;
IBOutlet NSMenuItem * o_mi_player;
IBOutlet NSMenuItem * o_mi_controller;
IBOutlet NSMenuItem * o_mi_equalizer;
IBOutlet NSMenuItem * o_mi_audioeffects;
IBOutlet NSMenuItem * o_mi_extended;
IBOutlet NSMenuItem * o_mi_bookmarks;
IBOutlet NSMenuItem * o_mi_playlist;
......@@ -403,6 +405,7 @@ struct intf_sys_t
- (IBAction)showWizard:(id)sender;
- (IBAction)showExtended:(id)sender;
- (IBAction)showAudioEffects:(id)sender;
- (IBAction)showBookmarks:(id)sender;
- (IBAction)viewAbout:(id)sender;
......
......@@ -54,6 +54,7 @@
#import "AppleRemote.h"
#import "eyetv.h"
#import "simple_prefs.h"
#import "AudioEffects.h"
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <Sparkle/Sparkle.h> /* we're the update delegate */
......@@ -350,7 +351,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_wizard = [[VLCWizard alloc] init];
o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init];
//o_embedded_list = [[VLCEmbeddedList alloc] init];
o_coredialogs = [[VLCCoreDialogProvider alloc] init];
o_info = [[VLCInfo alloc] init];
......@@ -717,7 +718,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mi_close_window setTitle: _NS("Close Window")];
[o_mi_player setTitle: _NS("Player...")];
[o_mi_controller setTitle: _NS("Controller...")];
[o_mi_equalizer setTitle: _NS("Equalizer...")];
[o_mi_audioeffects setTitle: _NS("Audio Effects...")];
[o_mi_extended setTitle: _NS("Extended Controls...")];
[o_mi_bookmarks setTitle: _NS("Bookmarks...")];
[o_mi_playlist setTitle: _NS("Playlist...")];
......@@ -819,9 +820,7 @@ static VLCMain *_o_sharedMainInstance = nil;
/* save the prefs if they were changed in the extended panel */
if(o_extended && [o_extended configChanged])
{
[o_extended savePrefs];
}
/* unsubscribe from the interactive dialogues */
dialog_Unregister( p_intf );
......@@ -849,9 +848,10 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_open release];
if( nib_extended_loaded )
{
[o_extended release];
}
if (nib_audioeffects_loaded)
[o_audioeffects release];
if( nib_bookmarks_loaded )
[o_bookmarks release];
......@@ -2254,6 +2254,17 @@ end:
[o_extended showPanel];
}
- (IBAction)showAudioEffects:(id)sender
{
if (!o_audioeffects)
o_audioeffects = [[VLCAudioEffects alloc] init];
if (!nib_audioeffects_loaded)
nib_audioeffects_loaded = [NSBundle loadNibNamed:@"AudioEffects" owner:NSApp];
[o_audioeffects toggleWindow:sender];
}
- (IBAction)showBookmarks:(id)sender
{
/* we need the wizard-nib for the bookmarks's extract functionality */
......
......@@ -121,7 +121,7 @@ vlc_module_begin ()
set_capability( "opengl provider", 100 )
set_category( CAT_VIDEO)
set_subcategory( SUBCAT_VIDEO_VOUT )
set_callbacks( OpenVideoGL, CloseVideoGL )
// set_callbacks( OpenVideoGL, CloseVideoGL )
add_integer( "macosx-vdev", 0, VDEV_TEXT, VDEV_LONGTEXT,
false )
......
......@@ -255,7 +255,7 @@ static NSMutableArray *blackoutWindows = NULL;
}
invoc = [NSInvocation invocationWithMethodSignature:[super methodSignatureForSelector:@selector(close)]];
[invoc setTarget: (id)super];
[invoc setTarget: self];
if (![self isVisible] || [self alphaValue] == 0.0)
{
......@@ -269,7 +269,7 @@ static NSMutableArray *blackoutWindows = NULL;
- (void)orderOut: (id)sender animate: (BOOL)animate
{
NSInvocation *invoc = [NSInvocation invocationWithMethodSignature:[super methodSignatureForSelector:@selector(orderOut:)]];
[invoc setTarget: (id)super];
[invoc setTarget: self];
[invoc setArgument: sender atIndex: 0];
[self orderOut: sender animate: animate callback: invoc];
}
......
......@@ -577,7 +577,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSString *o_filename = [o_file_path stringValue];
if ( o_filename && [o_filename > 0] )
if ( o_filename && [o_filename length] > 0 )
{
bool b_stream = [o_file_stream state];
BOOL b_dir = NO;
......
......@@ -55,6 +55,8 @@
#include <vlc_vout_display.h>
#include <vlc_keys.h>
#if 0
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
*****************************************************************************/
......@@ -1146,3 +1148,5 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
@end
#endif
......@@ -43,6 +43,8 @@
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#if 0
/*****************************************************************************
* VLCGLView interface
*****************************************************************************/
......@@ -413,4 +415,5 @@ static void Unlock( vout_thread_t * p_vout )
[super renewGState];
}
@end
\ No newline at end of file
@end
#endif
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