Commit cff6fc15 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: removed tabs and fixed whitespacing errors

parent 58052ea4
...@@ -251,7 +251,8 @@ static void Close( vlc_object_t *p_this ) ...@@ -251,7 +251,8 @@ static void Close( vlc_object_t *p_this )
msg_Dbg( p_access, "plugin notified" ); msg_Dbg( p_access, "plugin notified" );
close(p_sys->eyetvSock);
close(p_sys->eyetvSock);
msg_Dbg( p_access, "msg port closed and freed" ); msg_Dbg( p_access, "msg port closed and freed" );
...@@ -316,7 +317,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -316,7 +317,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
*pi_64 = *pi_64 =
INT64_C(1000) * var_InheritInteger( p_access, "live-caching" ); INT64_C(1000) * var_InheritInteger( p_access, "live-caching" );
break; break;
case ACCESS_SET_PAUSE_STATE: case ACCESS_SET_PAUSE_STATE:
case ACCESS_GET_TITLE_INFO: case ACCESS_GET_TITLE_INFO:
case ACCESS_SET_TITLE: case ACCESS_SET_TITLE:
......
...@@ -141,7 +141,8 @@ vlc_module_end () ...@@ -141,7 +141,8 @@ vlc_module_end ()
{ {
CVImageBufferRef imageBuffer; CVImageBufferRef imageBuffer;
mtime_t pts; mtime_t pts;
void * pixels;
void * pixels;
if(!currentImageBuffer || currentPts == previousPts ) if(!currentImageBuffer || currentPts == previousPts )
return 0; return 0;
...@@ -157,14 +158,14 @@ vlc_module_end () ...@@ -157,14 +158,14 @@ vlc_module_end ()
memcpy( buffer, pixels, CVPixelBufferGetBytesPerRow(imageBuffer) * CVPixelBufferGetHeight(imageBuffer)); memcpy( buffer, pixels, CVPixelBufferGetBytesPerRow(imageBuffer) * CVPixelBufferGetHeight(imageBuffer));
CVPixelBufferUnlockBaseAddress(imageBuffer, 0); CVPixelBufferUnlockBaseAddress(imageBuffer, 0);
} }
} }
CVBufferRelease(imageBuffer); CVBufferRelease(imageBuffer);
if(pixels) if(pixels)
return currentPts; return currentPts;
else else
return 0; return 0;
} }
@end @end
......
...@@ -74,8 +74,11 @@ enum AppleRemoteEventIdentifier ...@@ -74,8 +74,11 @@ enum AppleRemoteEventIdentifier
kRemoteControl_Switched =1<<11, kRemoteControl_Switched =1<<11,
kRemoteButtonVolume_Plus_Hold =1<<12, kRemoteButtonVolume_Plus_Hold =1<<12,
kRemoteButtonVolume_Minus_Hold =1<<13, kRemoteButtonVolume_Minus_Hold =1<<13,
k2009RemoteButtonPlay =1<<14, k2009RemoteButtonPlay
k2009RemoteButtonFullscreen =1<<15
=1<<14,
k2009RemoteButtonFullscreen
=1<<15
}; };
typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier; typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
......
...@@ -116,7 +116,7 @@ static AppleRemote *_o_sharedInstance = nil; ...@@ -116,7 +116,7 @@ static AppleRemote *_o_sharedInstance = nil;
[cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep] forKey:@"37_33_21_20_2_37_33_21_20_2_"]; [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep] forKey:@"37_33_21_20_2_37_33_21_20_2_"];
[cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"42_33_23_21_20_2_33_23_21_20_2_"]; [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
[cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay] forKey:@"33_21_20_8_2_33_21_20_8_2_"]; [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay] forKey:@"33_21_20_8_2_33_21_20_8_2_"];
[cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"]; [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
} }
else else
{ {
...@@ -480,7 +480,7 @@ static AppleRemote* sharedInstance=nil; ...@@ -480,7 +480,7 @@ static AppleRemote* sharedInstance=nil;
cookieString = [previousRemainingCookieString stringByAppendingString: cookieString]; cookieString = [previousRemainingCookieString stringByAppendingString: cookieString];
NSLog(@"New cookie string is %@", cookieString); NSLog(@"New cookie string is %@", cookieString);
[previousRemainingCookieString release], previousRemainingCookieString=nil; [previousRemainingCookieString release], previousRemainingCookieString=nil;
}*/ }*/
if (cookieString == nil || [cookieString length] == 0) return; if (cookieString == nil || [cookieString length] == 0) return;
NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString]; NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
if (buttonId != nil) { if (buttonId != nil) {
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
IBOutlet id o_comp_band7_sld; IBOutlet id o_comp_band7_sld;
IBOutlet id o_comp_band7_fld; IBOutlet id o_comp_band7_fld;
IBOutlet id o_comp_band7_lbl; IBOutlet id o_comp_band7_lbl;
/* Spatializer */ /* Spatializer */
IBOutlet id o_spat_enable_ckb; IBOutlet id o_spat_enable_ckb;
IBOutlet id o_spat_reset_btn; IBOutlet id o_spat_reset_btn;
......
...@@ -55,7 +55,7 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -55,7 +55,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
p_intf = VLCIntf; p_intf = VLCIntf;
_o_sharedInstance = [super init]; _o_sharedInstance = [super init];
} }
return _o_sharedInstance; return _o_sharedInstance;
} }
...@@ -83,7 +83,7 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -83,7 +83,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[o_comp_band5_lbl setStringValue:_NS("Ratio")]; [o_comp_band5_lbl setStringValue:_NS("Ratio")];
[o_comp_band6_lbl setStringValue:_NS("Knee radius")]; [o_comp_band6_lbl setStringValue:_NS("Knee radius")];
[o_comp_band7_lbl setStringValue:_NS("Makeup gain")]; [o_comp_band7_lbl setStringValue:_NS("Makeup gain")];
/* Spatializer */ /* Spatializer */
[o_spat_enable_ckb setTitle:_NS("Enable Spatializer")]; [o_spat_enable_ckb setTitle:_NS("Enable Spatializer")];
[o_spat_reset_btn setTitle:_NS("Reset")]; [o_spat_reset_btn setTitle:_NS("Reset")];
...@@ -92,12 +92,12 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -92,12 +92,12 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[o_spat_band3_lbl setStringValue:_NS("Wet")]; [o_spat_band3_lbl setStringValue:_NS("Wet")];
[o_spat_band4_lbl setStringValue:_NS("Dry")]; [o_spat_band4_lbl setStringValue:_NS("Dry")];
[o_spat_band5_lbl setStringValue:_NS("Dump")]; [o_spat_band5_lbl setStringValue:_NS("Dump")];
/* Filter */ /* Filter */
[o_filter_headPhone_ckb setTitle:_NS("Headphone virtualization")]; [o_filter_headPhone_ckb setTitle:_NS("Headphone virtualization")];
[o_filter_normLevel_ckb setTitle:_NS("Volume normalization")]; [o_filter_normLevel_ckb setTitle:_NS("Volume normalization")];
[o_filter_normLevel_lbl setStringValue:_NS("Maximum level")]; [o_filter_normLevel_lbl setStringValue:_NS("Maximum level")];
/* generic */ /* generic */
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"equalizer"]] setLabel:_NS("Equalizer")]; [[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:@"compressor"]] setLabel:_NS("Compressor")];
...@@ -129,8 +129,8 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -129,8 +129,8 @@ static VLCAudioEffects *_o_sharedInstance = nil;
if( p_aout ) if( p_aout )
psz_tmp = var_GetNonEmptyString( p_aout, "audio-filter" ); psz_tmp = var_GetNonEmptyString( p_aout, "audio-filter" );
else else
psz_tmp = config_GetPsz( p_intf, "audio-filter" ); psz_tmp = config_GetPsz( p_intf, "audio-filter" );
if( b_on ) if( b_on )
{ {
if(! psz_tmp) if(! psz_tmp)
...@@ -165,20 +165,20 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -165,20 +165,20 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
vlc_object_t *p_object = VLC_OBJECT(getAout()); vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL ) if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_custom_intf )); p_object = vlc_object_hold(pl_Get( p_custom_intf ));
psz_string = config_GetPsz( p_custom_intf, "audio-filter" ); psz_string = config_GetPsz( p_custom_intf, "audio-filter" );
if(! psz_string ) if(! psz_string )
psz_string = var_GetNonEmptyString( p_object, "audio-filter" ); psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
vlc_object_release( p_object ); vlc_object_release( p_object );
if( !psz_string ) return false; if( !psz_string ) return false;
psz_parser = strstr( psz_string, psz_name ); psz_parser = strstr( psz_string, psz_name );
free( psz_string ); free( psz_string );
if ( psz_parser ) if ( psz_parser )
return true; return true;
else else
...@@ -225,7 +225,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -225,7 +225,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
eqz_preset_10b[i].f_amp[7], eqz_preset_10b[i].f_amp[7],
eqz_preset_10b[i].f_amp[8], eqz_preset_10b[i].f_amp[8],
eqz_preset_10b[i].f_amp[9] ); eqz_preset_10b[i].f_amp[9] );
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT ); 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_Create( p_object, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp ); var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp );
...@@ -245,17 +245,17 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -245,17 +245,17 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
bool b_2p; bool b_2p;
bool b_enabled = GetEqualizerStatus( p_intf, (char *)"equalizer" ); bool b_enabled = GetEqualizerStatus( p_intf, (char *)"equalizer" );
vlc_object_t *p_object = VLC_OBJECT(getAout()); vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL ) if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf )); p_object = vlc_object_hold(pl_Get( p_intf ));
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
VLC_VAR_DOINHERIT ); VLC_VAR_DOINHERIT );
var_Create( p_object, "equalizer-bands", VLC_VAR_STRING | var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
VLC_VAR_DOINHERIT ); VLC_VAR_DOINHERIT );
psz_bands = var_GetNonEmptyString( p_object, "equalizer-bands" ); psz_bands = var_GetNonEmptyString( p_object, "equalizer-bands" );
if( psz_bands == NULL ) if( psz_bands == NULL )
psz_bands = strdup( "0 0 0 0 0 0 0 0 0 0" ); psz_bands = strdup( "0 0 0 0 0 0 0 0 0 0" );
...@@ -263,25 +263,25 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -263,25 +263,25 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
f_preamp = config_GetFloat( p_object, "equalizer-preamp" ); f_preamp = config_GetFloat( p_object, "equalizer-preamp" );
vlc_object_release( p_object ); vlc_object_release( p_object );
/* Set the preamp slider */ /* Set the preamp slider */
[o_eq_preamp_sld setFloatValue: f_preamp]; [o_eq_preamp_sld setFloatValue: f_preamp];
/* Set the bands slider */ /* Set the bands slider */
psz_bands_init = psz_bands; psz_bands_init = psz_bands;
for( int i = 0; i < 10; i++ ) for( int i = 0; i < 10; i++ )
{ {
/* Read dB -20/20 */ /* Read dB -20/20 */
f_band[i] = strtof( psz_bands, &p_next ); f_band[i] = strtof( psz_bands, &p_next );
if( !p_next || p_next == psz_bands ) break; /* strtof() failed */ if( !p_next || p_next == psz_bands ) break; /* strtof() failed */
if( !*psz_bands ) break; /* end of line */ if( !*psz_bands ) break; /* end of line */
psz_bands = p_next+1; psz_bands = p_next+1;
} }
free( psz_bands_init ); free( psz_bands_init );
[self setBandSlidersValues:f_band]; [self setBandSlidersValues:f_band];
/* Set the the checkboxes */ /* Set the the checkboxes */
[o_eq_enable_ckb setState: b_enabled]; [o_eq_enable_ckb setState: b_enabled];
[o_eq_twopass_ckb setState: b_2p]; [o_eq_twopass_ckb setState: b_2p];
...@@ -320,7 +320,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -320,7 +320,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (void)setValue:(float)value forSlider:(int)index - (void)setValue:(float)value forSlider:(int)index
{ {
id slider = [self sliderByIndex:index]; id slider = [self sliderByIndex:index];
if (slider != nil) if (slider != nil)
[slider setFloatValue:value]; [slider setFloatValue:value];
} }
...@@ -333,10 +333,10 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -333,10 +333,10 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)eq_bandSliderUpdated:(id)sender - (IBAction)eq_bandSliderUpdated:(id)sender
{ {
vlc_object_t *p_object = VLC_OBJECT(getAout()); vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL ) if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_intf )); p_object = vlc_object_hold(pl_Get( p_intf ));
const char *psz_values; const char *psz_values;
NSString *preset = [NSString stringWithFormat:@"%.1f ", [o_eq_band1_sld floatValue] ]; 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_band2_sld floatValue] ];
...@@ -529,7 +529,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -529,7 +529,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
} }
else else
[o_spat_enable_ckb setState: NSOffState]; [o_spat_enable_ckb setState: NSOffState];
[o_spat_band1_sld setFloatValue: config_GetFloat( p_intf, "spatializer-roomsize" )]; [o_spat_band1_sld setFloatValue: config_GetFloat( p_intf, "spatializer-roomsize" )];
[o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band1_sld floatValue]]]; [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band1_sld floatValue]]];
[o_spat_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )]; [o_spat_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )];
...@@ -564,7 +564,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -564,7 +564,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)spat_enable:(id)sender - (IBAction)spat_enable:(id)sender
{ {
[self setAudioFilter:"spatializer" on:[sender state]]; [self setAudioFilter:"spatializer" on:[sender state]];
} }
- (IBAction)spat_sliderUpdated:(id)sender - (IBAction)spat_sliderUpdated:(id)sender
...@@ -581,13 +581,13 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -581,13 +581,13 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
value = "spatializer-dry"; value = "spatializer-dry";
else if( sender == o_spat_band5_sld ) else if( sender == o_spat_band5_sld )
value = "spatializer-damp"; value = "spatializer-damp";
if( p_aout ) { if( p_aout ) {
var_SetFloat( p_aout, value, [sender floatValue] ); var_SetFloat( p_aout, value, [sender floatValue] );
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
config_PutFloat( p_intf, value, [sender floatValue] ); config_PutFloat( p_intf, value, [sender floatValue] );
if( sender == o_spat_band1_sld ) if( sender == o_spat_band1_sld )
[o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]]; [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
else if( sender == o_spat_band2_sld ) else if( sender == o_spat_band2_sld )
...@@ -625,7 +625,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -625,7 +625,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)filter_enableVolumeNorm:(id)sender - (IBAction)filter_enableVolumeNorm:(id)sender
{ {
[self setAudioFilter: "normvol" on:[sender state]]; [self setAudioFilter: "normvol" on:[sender state]];
} }
- (IBAction)filter_volNormSliderUpdated:(id)sender - (IBAction)filter_volNormSliderUpdated:(id)sender
......
...@@ -55,7 +55,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -55,7 +55,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
_o_sharedInstance = [super init]; _o_sharedInstance = [super init];
b_lockAspectRatio = YES; b_lockAspectRatio = YES;
} }
return _o_sharedInstance; return _o_sharedInstance;
} }
...@@ -80,14 +80,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -80,14 +80,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
{ {
playlist_t * p_playlist = pl_Get( VLCIntf ); playlist_t * p_playlist = pl_Get( VLCIntf );
bool empty; bool empty;
PL_LOCK; PL_LOCK;
empty = playlist_IsEmpty( p_playlist ); empty = playlist_IsEmpty( p_playlist );
PL_UNLOCK; PL_UNLOCK;
if( empty ) if( empty )
[[[VLCMain sharedInstance] open] openFileGeneric]; [[[VLCMain sharedInstance] open] openFileGeneric];
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE ); var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
} }
......
...@@ -71,7 +71,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -71,7 +71,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self]; [[NSNotificationCenter defaultCenter] removeObserver: self];
if (b_nib_about_loaded) if (b_nib_about_loaded)
[o_about release]; [o_about release];
...@@ -384,7 +384,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -384,7 +384,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (void)releaseRepresentedObjects:(NSMenu *)the_menu - (void)releaseRepresentedObjects:(NSMenu *)the_menu
{ {
if( !p_intf ) return; if( !p_intf ) return;
NSArray *menuitems_array = [the_menu itemArray]; NSArray *menuitems_array = [the_menu itemArray];
NSUInteger menuItemCount = [menuitems_array count]; NSUInteger menuItemCount = [menuitems_array count];
for( NSUInteger i=0; i < menuItemCount; i++ ) for( NSUInteger i=0; i < menuItemCount; i++ )
...@@ -878,7 +878,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -878,7 +878,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
bool b_value; bool b_value;
playlist_t *p_playlist = pl_Get( VLCIntf ); playlist_t *p_playlist = pl_Get( VLCIntf );
b_value = var_GetBool( p_playlist, "random" ); b_value = var_GetBool( p_playlist, "random" );
[o_mi_random setState: b_value];
[o_mi_random setState: b_value];
} }
#pragma mark - #pragma mark -
...@@ -921,10 +922,10 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -921,10 +922,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
if( i_type & VLC_VAR_HASCHOICE ) if( i_type & VLC_VAR_HASCHOICE )
{ {
NSMenu *o_menu = [o_mi submenu]; NSMenu *o_menu = [o_mi submenu];
[self setupVarMenu: o_menu forMenuItem: o_mi target:p_object [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
var:psz_variable selector:pf_callback]; var:psz_variable selector:pf_callback];
free( text.psz_string ); free( text.psz_string );
return; return;
} }
...@@ -1242,7 +1243,9 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1242,7 +1243,9 @@ static VLCMainMenu *_o_sharedInstance = nil;
if( [o_title isEqualToString: _NS("Normal Size")] ) if( [o_title isEqualToString: _NS("Normal Size")] )
{ {
NSMenuItem *item = [[o_mi menu] itemWithTitle:_NS("Teletext")]; NSMenuItem *item = [[o_mi menu] itemWithTitle:_NS("Teletext")];
bool b_telx = p_input && var_GetInteger( p_input, "teletext-es" ) >= 0;
bool b_telx = p_input && var_GetInteger( p_input, "teletext-es" ) >= 0;
[[item submenu] setAutoenablesItems:NO]; [[item submenu] setAutoenablesItems:NO];
for( int k=0; k < [[item submenu] numberOfItems]; k++ ) for( int k=0; k < [[item submenu] numberOfItems]; k++ )
......
...@@ -228,7 +228,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -228,7 +228,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
else else
{ {
[o_effects_btn setImage: [NSImage imageNamed:@"effects-double-buttons_dark"]]; [o_effects_btn setImage: [NSImage imageNamed:@"effects-double-buttons_dark"]];
[o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-double-buttons-pressed_dark"]]; [o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-double-buttons-pressed_dark"]];
} }
[o_fullscreen_btn setImage: [NSImage imageNamed:@"fullscreen-double-buttons_dark"]]; [o_fullscreen_btn setImage: [NSImage imageNamed:@"fullscreen-double-buttons_dark"]];
[o_fullscreen_btn setAlternateImage: [NSImage imageNamed:@"fullscreen-double-buttons-pressed_dark"]]; [o_fullscreen_btn setAlternateImage: [NSImage imageNamed:@"fullscreen-double-buttons-pressed_dark"]];
...@@ -682,7 +682,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -682,7 +682,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
bool b_value; bool b_value;
playlist_t *p_playlist = pl_Get( VLCIntf ); playlist_t *p_playlist = pl_Get( VLCIntf );
b_value = var_GetBool( p_playlist, "random" ); b_value = var_GetBool( p_playlist, "random" );
if(b_value) {
if(b_value) {
[o_shuffle_btn setImage: o_shuffle_on_img]; [o_shuffle_btn setImage: o_shuffle_on_img];
[o_shuffle_btn setAlternateImage: o_shuffle_on_pressed_img]; [o_shuffle_btn setAlternateImage: o_shuffle_on_pressed_img];
} }
...@@ -779,16 +780,18 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -779,16 +780,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{ {
SEL s_menuAction = [menuItem action]; SEL s_menuAction = [menuItem action];
if ((s_menuAction == @selector(performClose:)) || (s_menuAction == @selector(performMiniaturize:)) || (s_menuAction == @selector(performZoom:)))
return YES;
return [super validateMenuItem:menuItem]; if ((s_menuAction == @selector(performClose:)) || (s_menuAction == @selector(performMiniaturize:)) || (s_menuAction == @selector(performZoom:)))
return YES;
return [super validateMenuItem:menuItem];
} }
- (BOOL)isMainWindow - (BOOL)isMainWindow
{ {
return YES;
return YES;
} }
- (void)setTitle:(NSString *)title - (void)setTitle:(NSString *)title
...@@ -1531,7 +1534,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1531,7 +1534,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_nonembedded_window orderOut: self]; [o_nonembedded_window orderOut: self];
else else
[super orderOut: self]; [super orderOut: self];
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
return; return;
} }
...@@ -1934,11 +1937,11 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1934,11 +1937,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
NSRect winrect; NSRect winrect;
CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height; CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
winrect = [self frame]; winrect = [self frame];
[o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - f_titleBarHeight, [o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - f_titleBarHeight,
winrect.size.width, f_titleBarHeight )]; winrect.size.width, f_titleBarHeight )];
[[self contentView] addSubview: o_titlebar_view]; [[self contentView] addSubview: o_titlebar_view];
winrect.size.height = winrect.size.height + f_titleBarHeight; winrect.size.height = winrect.size.height + f_titleBarHeight;
[self setFrame: winrect display:NO animate:NO]; [self setFrame: winrect display:NO animate:NO];
winrect = [o_split_view frame]; winrect = [o_split_view frame];
...@@ -1974,41 +1977,37 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1974,41 +1977,37 @@ static VLCMainWindow *_o_sharedInstance = nil;
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */ /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
- (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item - (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item
{ {
//Works the same way as the NSOutlineView data source: `nil` means a parent item //Works the same way as the NSOutlineView data source: `nil` means a parent item
if(item==nil) { if(item==nil)
return [o_sidebaritems count]; return [o_sidebaritems count];
} else
else { return [[item children] count];
return [[item children] count];
}
} }
- (id)sourceList:(PXSourceList*)aSourceList child:(NSUInteger)index ofItem:(id)item - (id)sourceList:(PXSourceList*)aSourceList child:(NSUInteger)index ofItem:(id)item
{ {
//Works the same way as the NSOutlineView data source: `nil` means a parent item //Works the same way as the NSOutlineView data source: `nil` means a parent item
if(item==nil) { if(item==nil)
return [o_sidebaritems objectAtIndex:index]; return [o_sidebaritems objectAtIndex:index];
} else
else { return [[item children] objectAtIndex:index];
return [[item children] objectAtIndex:index];
}
} }
- (id)sourceList:(PXSourceList*)aSourceList objectValueForItem:(id)item - (id)sourceList:(PXSourceList*)aSourceList objectValueForItem:(id)item
{ {
return [item title]; return [item title];
} }
- (void)sourceList:(PXSourceList*)aSourceList setObjectValue:(id)object forItem:(id)item - (void)sourceList:(PXSourceList*)aSourceList setObjectValue:(id)object forItem:(id)item
{ {
[item setTitle:object]; [item setTitle:object];
} }
- (BOOL)sourceList:(PXSourceList*)aSourceList isItemExpandable:(id)item - (BOOL)sourceList:(PXSourceList*)aSourceList isItemExpandable:(id)item
{ {
return [item hasChildren]; return [item hasChildren];
} }
...@@ -2017,7 +2016,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -2017,7 +2016,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([[item identifier] isEqualToString: @"playlist"] || [[item identifier] isEqualToString: @"medialibrary"]) if ([[item identifier] isEqualToString: @"playlist"] || [[item identifier] isEqualToString: @"medialibrary"])
return YES; return YES;
return [item hasBadge]; return [item hasBadge];
} }