Commit 0d6b80ff authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: removed tabs and fixed whitespacing errors

(cherry picked from commit cff6fc15)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ff372103
......@@ -251,7 +251,8 @@ static void Close( vlc_object_t *p_this )
msg_Dbg( p_access, "plugin notified" );
close(p_sys->eyetvSock);
close(p_sys->eyetvSock);
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 )
*pi_64 =
INT64_C(1000) * var_InheritInteger( p_access, "live-caching" );
break;
case ACCESS_SET_PAUSE_STATE:
case ACCESS_GET_TITLE_INFO:
case ACCESS_SET_TITLE:
......
......@@ -141,7 +141,8 @@ vlc_module_end ()
{
CVImageBufferRef imageBuffer;
mtime_t pts;
void * pixels;
void * pixels;
if(!currentImageBuffer || currentPts == previousPts )
return 0;
......@@ -157,14 +158,14 @@ vlc_module_end ()
memcpy( buffer, pixels, CVPixelBufferGetBytesPerRow(imageBuffer) * CVPixelBufferGetHeight(imageBuffer));
CVPixelBufferUnlockBaseAddress(imageBuffer, 0);
}
}
CVBufferRelease(imageBuffer);
if(pixels)
return currentPts;
else
return 0;
if(pixels)
return currentPts;
else
return 0;
}
@end
......
......@@ -74,8 +74,11 @@ enum AppleRemoteEventIdentifier
kRemoteControl_Switched =1<<11,
kRemoteButtonVolume_Plus_Hold =1<<12,
kRemoteButtonVolume_Minus_Hold =1<<13,
k2009RemoteButtonPlay =1<<14,
k2009RemoteButtonFullscreen =1<<15
k2009RemoteButtonPlay
=1<<14,
k2009RemoteButtonFullscreen
=1<<15
};
typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
......
......@@ -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: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: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
{
......@@ -480,7 +480,7 @@ static AppleRemote* sharedInstance=nil;
cookieString = [previousRemainingCookieString stringByAppendingString: cookieString];
NSLog(@"New cookie string is %@", cookieString);
[previousRemainingCookieString release], previousRemainingCookieString=nil;
}*/
}*/
if (cookieString == nil || [cookieString length] == 0) return;
NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
if (buttonId != nil) {
......
......@@ -71,7 +71,7 @@
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_reset_btn;
......
......@@ -55,7 +55,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
p_intf = VLCIntf;
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
......@@ -83,7 +83,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[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_reset_btn setTitle:_NS("Reset")];
......@@ -92,12 +92,12 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[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")];
......@@ -129,8 +129,8 @@ static VLCAudioEffects *_o_sharedInstance = nil;
if( p_aout )
psz_tmp = var_GetNonEmptyString( p_aout, "audio-filter" );
else
psz_tmp = config_GetPsz( p_intf, "audio-filter" );
psz_tmp = config_GetPsz( p_intf, "audio-filter" );
if( b_on )
{
if(! psz_tmp)
......@@ -165,20 +165,20 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = vlc_object_hold(pl_Get( p_custom_intf ));
psz_string = config_GetPsz( p_custom_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
......@@ -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[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 );
......@@ -245,17 +245,17 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
bool b_2p;
bool b_enabled = GetEqualizerStatus( 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" );
......@@ -263,25 +263,25 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
f_preamp = config_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( int 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];
......@@ -320,7 +320,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (void)setValue:(float)value forSlider:(int)index
{
id slider = [self sliderByIndex:index];
if (slider != nil)
[slider setFloatValue:value];
}
......@@ -333,10 +333,10 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)eq_bandSliderUpdated:(id)sender
{
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] ];
......@@ -529,7 +529,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
}
else
[o_spat_enable_ckb setState: NSOffState];
[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_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )];
......@@ -564,7 +564,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)spat_enable:(id)sender
{
[self setAudioFilter:"spatializer" on:[sender state]];
[self setAudioFilter:"spatializer" on:[sender state]];
}
- (IBAction)spat_sliderUpdated:(id)sender
......@@ -581,13 +581,13 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
value = "spatializer-dry";
else if( sender == o_spat_band5_sld )
value = "spatializer-damp";
if( p_aout ) {
var_SetFloat( p_aout, value, [sender floatValue] );
vlc_object_release( p_aout );
}
config_PutFloat( p_intf, value, [sender floatValue] );
if( sender == o_spat_band1_sld )
[o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
else if( sender == o_spat_band2_sld )
......@@ -625,7 +625,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
- (IBAction)filter_enableVolumeNorm:(id)sender
{
[self setAudioFilter: "normvol" on:[sender state]];
[self setAudioFilter: "normvol" on:[sender state]];
}
- (IBAction)filter_volNormSliderUpdated:(id)sender
......
......@@ -55,7 +55,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
_o_sharedInstance = [super init];
b_lockAspectRatio = YES;
}
return _o_sharedInstance;
}
......@@ -80,14 +80,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
{
playlist_t * p_playlist = pl_Get( VLCIntf );
bool empty;
PL_LOCK;
empty = playlist_IsEmpty( p_playlist );
PL_UNLOCK;
if( empty )
[[[VLCMain sharedInstance] open] openFileGeneric];
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
}
......
......@@ -71,7 +71,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
if (b_nib_about_loaded)
[o_about release];
......@@ -384,7 +384,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
- (void)releaseRepresentedObjects:(NSMenu *)the_menu
{
if( !p_intf ) return;
NSArray *menuitems_array = [the_menu itemArray];
NSUInteger menuItemCount = [menuitems_array count];
for( NSUInteger i=0; i < menuItemCount; i++ )
......@@ -878,7 +878,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
bool b_value;
playlist_t *p_playlist = pl_Get( VLCIntf );
b_value = var_GetBool( p_playlist, "random" );
[o_mi_random setState: b_value];
[o_mi_random setState: b_value];
}
#pragma mark -
......@@ -921,10 +922,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
if( i_type & VLC_VAR_HASCHOICE )
{
NSMenu *o_menu = [o_mi submenu];
[self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
var:psz_variable selector:pf_callback];
free( text.psz_string );
return;
}
......@@ -1242,7 +1243,9 @@ static VLCMainMenu *_o_sharedInstance = nil;
if( [o_title isEqualToString: _NS("Normal Size")] )
{
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];
for( int k=0; k < [[item submenu] numberOfItems]; k++ )
......
......@@ -228,7 +228,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
else
{
[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 setAlternateImage: [NSImage imageNamed:@"fullscreen-double-buttons-pressed_dark"]];
......@@ -682,7 +682,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
bool b_value;
playlist_t *p_playlist = pl_Get( VLCIntf );
b_value = var_GetBool( p_playlist, "random" );
if(b_value) {
if(b_value) {
[o_shuffle_btn setImage: o_shuffle_on_img];
[o_shuffle_btn setAlternateImage: o_shuffle_on_pressed_img];
}
......@@ -779,16 +780,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
SEL s_menuAction = [menuItem action];
if ((s_menuAction == @selector(performClose:)) || (s_menuAction == @selector(performMiniaturize:)) || (s_menuAction == @selector(performZoom:)))
return YES;
SEL s_menuAction = [menuItem action];
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
{
return YES;
return YES;
}
- (void)setTitle:(NSString *)title
......@@ -1531,7 +1534,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_nonembedded_window orderOut: self];
else
[super orderOut: self];
[self unlockFullscreenAnimation];
return;
}
......@@ -1934,11 +1937,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
NSRect winrect;
CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
winrect = [self frame];
[o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - f_titleBarHeight,
winrect.size.width, f_titleBarHeight )];
[[self contentView] addSubview: o_titlebar_view];
winrect.size.height = winrect.size.height + f_titleBarHeight;
[self setFrame: winrect display:NO animate:NO];
winrect = [o_split_view frame];
......@@ -1974,41 +1977,37 @@ static VLCMainWindow *_o_sharedInstance = nil;
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
- (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item
{
//Works the same way as the NSOutlineView data source: `nil` means a parent item
if(item==nil) {
return [o_sidebaritems count];
}
else {
return [[item children] count];
}
//Works the same way as the NSOutlineView data source: `nil` means a parent item
if(item==nil)
return [o_sidebaritems count];
else
return [[item children] count];
}
- (id)sourceList:(PXSourceList*)aSourceList child:(NSUInteger)index ofItem:(id)item
{
//Works the same way as the NSOutlineView data source: `nil` means a parent item
if(item==nil) {
return [o_sidebaritems objectAtIndex:index];
}
else {
return [[item children] objectAtIndex:index];
}
if(item==nil)
return [o_sidebaritems objectAtIndex:index];
else
return [[item children] objectAtIndex:index];
}
- (id)sourceList:(PXSourceList*)aSourceList objectValueForItem:(id)item
{
return [item title];
return [item title];
}
- (void)sourceList:(PXSourceList*)aSourceList setObjectValue:(id)object forItem:(id)item
{
[item setTitle:object];
[item setTitle:object];
}
- (BOOL)sourceList:(PXSourceList*)aSourceList isItemExpandable:(id)item
{
return [item hasChildren];
return [item hasChildren];
}
......@@ -2017,7 +2016,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([[item identifier] isEqualToString: @"playlist"] || [[item identifier] isEqualToString: @"medialibrary"])
return YES;
return [item hasBadge];
return [item hasBadge];
}
......@@ -2042,25 +2041,27 @@ static VLCMainWindow *_o_sharedInstance = nil;
return i_playlist_size;
}
return [item badgeValue];
return [item badgeValue];
}
- (BOOL)sourceList:(PXSourceList*)aSourceList itemHasIcon:(id)item
{
return [item hasIcon];
return [item hasIcon];
}
- (NSImage*)sourceList:(PXSourceList*)aSourceList iconForItem:(id)item
{
return [item icon];
return [item icon];
}
- (NSMenu*)sourceList:(PXSourceList*)aSourceList menuForEvent:(NSEvent*)theEvent item:(id)item
{
if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask)) {
if (item != nil)
if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask))
{
if (item != nil)
{
NSMenu * m;
if ([item sdtype] > 0)
......@@ -2076,8 +2077,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
return [m autorelease];
}
}
return nil;
}
return nil;
}
- (IBAction)sdmenuhandler:(id)sender
......@@ -2109,10 +2111,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)sourceListSelectionDidChange:(NSNotification *)notification
{
playlist_t * p_playlist = pl_Get( VLCIntf );
NSIndexSet *selectedIndexes = [o_sidebar_view selectedRowIndexes];
NSIndexSet *selectedIndexes = [o_sidebar_view selectedRowIndexes];
id item = [o_sidebar_view itemAtRow:[selectedIndexes firstIndex]];
//Set the label text to represent the new selection
//Set the label text to represent the new selection
if ([item sdtype] > -1 && [[item identifier] length] > 0)
{
BOOL sd_loaded = playlist_IsServicesDiscoveryLoaded( p_playlist, [[item identifier] UTF8String] );
......
......@@ -132,7 +132,7 @@
o_yellow_on_img = [[NSImage imageNamed:@"lion-window-minimize-on-graphite"] retain];
o_green_img = [[NSImage imageNamed:@"lion-window-zoom-graphite"] retain];
o_green_over_img = [[NSImage imageNamed:@"lion-window-zoom-over-graphite"] retain];
o_green_on_img = [[NSImage imageNamed:@"lion-window-zoom-on-graphite"] retain];
o_green_on_img = [[NSImage imageNamed:@"lion-window-zoom-on-graphite"] retain];
}
} else {
if( [NSColor currentControlTint] == NSBlueControlTint )
......@@ -155,7 +155,7 @@
o_yellow_on_img = [[NSImage imageNamed:@"snowleo-window-minimize-on-graphite"] retain];
o_green_img = [[NSImage imageNamed:@"snowleo-window-zoom-graphite"] retain];
o_green_over_img = [[NSImage imageNamed:@"snowleo-window-zoom-over-graphite"] retain];
o_green_on_img = [[NSImage imageNamed:@"snowleo-window-zoom-on-graphite"] retain];
o_green_on_img = [[NSImage imageNamed:@"snowleo-window-zoom-on-graphite"] retain];
}
}
}
......@@ -262,7 +262,7 @@
- (NSArray*)accessibilityAttributeNames {
NSArray *theAttributeNames = [super accessibilityAttributeNames];
id theControlView = [self controlView];
return ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeNames:)] ? [theControlView extendedAccessibilityAttributeNames: theAttributeNames] : theAttributeNames); // ask the cell's control view (i.e., the button) for additional attribute values
return ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeNames:)] ? [theControlView extendedAccessibilityAttributeNames: theAttributeNames] : theAttributeNames); // ask the cell's control view (i.e., the button) for additional attribute values
}
- (id)accessibilityAttributeValue: (NSString*)theAttributeName {
......@@ -270,7 +270,7 @@
if ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeValue:)]) {
id theValue = [theControlView extendedAccessibilityAttributeValue: theAttributeName];
if (theValue) {
return theValue; // if this is an extended attribute value we added, return that -- otherwise, fall back to super's implementation
return theValue; // if this is an extended attribute value we added, return that -- otherwise, fall back to super's implementation
}
}
return [super accessibilityAttributeValue: theAttributeName];
......@@ -281,7 +281,7 @@
if ([theControlView respondsToSelector: @selector(extendedAccessibilityIsAttributeSettable:)]) {
NSNumber *theValue = [theControlView extendedAccessibilityIsAttributeSettable: theAttributeName];
if (theValue) {
return [theValue boolValue]; // same basic strategy we use in -accessibilityAttributeValue:
return [theValue boolValue]; // same basic strategy we use in -accessibilityAttributeValue:
}
}
return [super accessibilityIsAttributeSettable: theAttributeName];
......@@ -375,7 +375,7 @@
}
- (NSArray*)extendedAccessibilityAttributeNames: (NSArray*)theAttributeNames {
return ([theAttributeNames containsObject: NSAccessibilitySubroleAttribute] ? theAttributeNames : [theAttributeNames arrayByAddingObject: NSAccessibilitySubroleAttribute]); // run-of-the-mill button cells don't usually have a Subrole attribute, so we add that attribute
return ([theAttributeNames containsObject: NSAccessibilitySubroleAttribute] ? theAttributeNames : [theAttributeNames arrayByAddingObject: NSAccessibilitySubroleAttribute]); // run-of-the-mill button cells don't usually have a Subrole attribute, so we add that attribute
}
- (id)extendedAccessibilityAttributeValue: (NSString*)theAttributeName {
......@@ -383,7 +383,7 @@
}
- (NSNumber*)extendedAccessibilityIsAttributeSettable: (NSString*)theAttributeName {
return ([theAttributeName isEqualToString: NSAccessibilitySubroleAttribute] ? [NSNumber numberWithBool: NO] : nil); // make the Subrole attribute we added non-settable
return ([theAttributeName isEqualToString: NSAccessibilitySubroleAttribute] ? [NSNumber numberWithBool: NO] : nil); // make the Subrole attribute we added non-settable
}
- (void)accessibilityPerformAction: (NSString*)theActionName {
......
......@@ -14,23 +14,23 @@
@interface PXSourceList: NSOutlineView <NSOutlineViewDelegate, NSOutlineViewDataSource>
{
id <PXSourceListDelegate> _secondaryDelegate; //Used to store the publicly visible delegate
id <PXSourceListDataSource> _secondaryDataSource; //Used to store the publicly visible data source
NSSize _iconSize; //The size of icons in the Source List. Defaults to 16x16
id <PXSourceListDelegate> _secondaryDelegate; //Used to store the publicly visible delegate
id <PXSourceListDataSource> _secondaryDataSource; //Used to store the publicly visible data source
NSSize _iconSize; //The size of icons in the Source List. Defaults to 16x16
}
@property (nonatomic) NSSize iconSize;
@property (assign) id<PXSourceListDataSource> dataSource;
@property (assign) id<PXSourceListDelegate> delegate;
- (NSUInteger)numberOfGroups; //Returns the number of groups in the Source List
- (BOOL)isGroupItem:(id)item; //Returns whether `item` is a group
- (BOOL)isGroupAlwaysExpanded:(id)group; //Returns whether `group` is displayed as always expanded
- (NSUInteger)numberOfGroups; //Returns the number of groups in the Source List
- (BOOL)isGroupItem:(id)item; //Returns whether `item` is a group
- (BOOL)isGroupAlwaysExpanded:(id)group; //Returns whether `group` is displayed as always expanded
- (BOOL)itemHasBadge:(id)item; //Returns whether `item` has a badge
- (NSInteger)badgeValueForItem:(id)item; //Returns the badge value for `item`
- (BOOL)itemHasBadge:(id)item; //Returns whether `item` has a badge
- (NSInteger)badgeValueForItem:(id)item; //Returns the badge value for `item`
@end
This diff is collapsed.
......@@ -22,117 +22,124 @@
@implementation SPInvocationGrabber
- (id)initWithObject:(id)obj;
{
return [self initWithObject:obj stacktraceSaving:YES];
return [self initWithObject:obj stacktraceSaving:YES];
}
-(id)initWithObject:(id)obj stacktraceSaving:(BOOL)saveStack;
{
self.object = obj;
self.object = obj;
if(saveStack)
[self saveBacktrace];
if(saveStack)
[self saveBacktrace];
return self;
return self;
}
-(void)dealloc;
{
free(frameStrings);
self.object = nil;
self.invocation = nil;
[super dealloc];
free(frameStrings);
self.object = nil;
self.invocation = nil;
[super dealloc];
}
@synthesize invocation = _invocation, object = _object;
@synthesize backgroundAfterForward, onMainAfterForward, waitUntilDone;
- (void)runInBackground;
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@try {
[self invoke];
}
@finally {
[pool drain];
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@try {
[self invoke];
}
@finally {
[pool drain];
}
}
- (void)forwardInvocation:(NSInvocation *)anInvocation {
[anInvocation retainArguments];
anInvocation.target = _object;
self.invocation = anInvocation;
if(backgroundAfterForward)
[NSThread detachNewThreadSelector:@selector(runInBackground) toTarget:self withObject:nil];
else if(onMainAfterForward)
[anInvocation retainArguments];
anInvocation.target = _object;
self.invocation = anInvocation;
if(backgroundAfterForward)
[NSThread detachNewThreadSelector:@selector(runInBackground) toTarget:self withObject:nil];
else if(onMainAfterForward)
[self performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:waitUntilDone];
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)inSelector {
NSMethodSignature *signature = [super methodSignatureForSelector:inSelector];
if (signature == NULL)
signature = [_object methodSignatureForSelector:inSelector];
return signature;
NSMethodSignature *signature = [super methodSignatureForSelector:inSelector];
if (signature == NULL)
signature = [_object methodSignatureForSelector:inSelector];
return signature;
}
- (void)invoke;
{
@try {
[_invocation invoke];
}
@catch (NSException * e) {
NSLog(@"SPInvocationGrabber's target raised %@:\n\t%@\nInvocation was originally scheduled at:", e.name, e);
[self printBacktrace];
printf("\n");
[e raise];
}
self.invocation = nil;
self.object = nil;
@try {
[_invocation invoke];
}
@catch (NSException * e) {
NSLog(@"SPInvocationGrabber's target raised %@:\n\t%@\nInvocation was originally scheduled at:", e.name, e);
[self printBacktrace];
printf("\n");
[e raise];
}
self.invocation = nil;
self.object = nil;
}
-(void)saveBacktrace;
{
void *backtraceFrames[128];
frameCount = backtrace(&backtraceFrames[0], 128);
frameStrings = backtrace_symbols(&backtraceFrames[0], frameCount);
void *backtraceFrames[128];
frameCount = backtrace(&backtraceFrames[0], 128);
frameStrings = backtrace_symbols(&backtraceFrames[0], frameCount);
}
-(void)printBacktrace;
{
for(int x = 3; x < frameCount; x++) {
if(frameStrings[x] == NULL) { break; }
printf("%s\n", frameStrings[x]);
}
for(int x = 3; x < frameCount; x++) {
if(frameStrings[x] == NULL) { break; }
printf("%s\n", frameStrings[x]);
}
}
@end
@implementation NSObject (SPInvocationGrabbing)
-(id)grab;
{
return [[[SPInvocationGrabber alloc] initWithObject:self] autorelease];
return [[[SPInvocationGrabber alloc] initWithObject:self] autorelease];
}
-(id)invokeAfter:(NSTimeInterval)delta;
{
id grabber = [self grab];
[NSTimer scheduledTimerWithTimeInterval:delta target:grabber selector:@selector(invoke) userInfo:nil repeats:NO];
return grabber;
id grabber = [self grab];
[NSTimer scheduledTimerWithTimeInterval:delta target:grabber selector:@selector(invoke) userInfo:nil repeats:NO];
return grabber;
}
- (id)nextRunloop;
{
return [self invokeAfter:0];
return [self invokeAfter:0];
}
-(id)inBackground;
{
SPInvocationGrabber *grabber = [self grab];
grabber.backgroundAfterForward = YES;
return grabber;
grabber.backgroundAfterForward = YES;
return grabber;
}
-(id)onMainAsync:(BOOL)async;
{
SPInvocationGrabber *grabber = [self grab];
grabber.onMainAfterForward = YES;
grabber.onMainAfterForward = YES;
grabber.waitUntilDone = !async;
return grabber;
return grabber;
}
@end
......@@ -18,15 +18,24 @@
#define SPSystemDefinedEventMediaKeys 8
@interface SPMediaKeyTap : NSObject {
EventHandlerRef _app_switching_ref;
EventHandlerRef _app_terminating_ref;
CFMachPortRef _eventPort;
CFRunLoopSourceRef _eventPortSource;
CFRunLoopRef _tapThreadRL;
BOOL _shouldInterceptMediaKeyEvents;
id _delegate;
// The app that is frontmost in this list owns media keys
NSMutableArray *_mediaKeyAppList;
EventHandlerRef _app_switching_ref;
EventHandlerRef _app_terminating_ref;
CFMachPortRef _eventPort;
CFRunLoopSourceRef _eventPortSource;
CFRunLoopRef _tapThreadRL;
BOOL _shouldInterceptMediaKeyEvents;
id _delegate;
// The app that is frontmost in this list owns media keys
NSMutableArray *_mediaKeyAppList;
}
+ (NSArray*)defaultMediaKeyUserBundleIdentifiers;
......
This diff is collapsed.
......@@ -22,20 +22,26 @@
- SourceListItem *child1;
- SourceListItem *child2;
- SourceListItem *childOfChild2;
- SourceListItem *anotherChildOfChild2;
- SourceListItem *anotherChildOfChild2;
- SourceListItem *child3;
*/
@interface SideBarItem : NSObject {
NSString *title;
NSString *identifier;
NSString *title;
NSString *identifier;
NSString *untranslatedTitle;
NSImage *icon;
NSInteger badgeValue;
NSImage *icon;
NSInteger badgeValue;
NSInteger sdtype;
NSArray *children;
NSArray *children;
}
@property (nonatomic, copy) NSString *title;
......
......@@ -28,53 +28,54 @@
- (id)init
{
if(self=[super init])
{
badgeValue = -1; //We don't want a badge value by default
if(self=[super init])
{
badgeValue = -1; //We don't want a badge value by default
sdtype = -1; //no sd type set
}
}
return self;
return self;
}
+ (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier
{
SideBarItem *item = [SideBarItem itemWithTitle:aTitle identifier:anIdentifier icon:nil];
SideBarItem *item = [SideBarItem itemWithTitle:aTitle identifier:anIdentifier icon:nil];
return item;
return item;
}
+ (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier icon:(NSImage*)anIcon
{
SideBarItem *item = [[[SideBarItem alloc] init] autorelease];
[item setTitle:aTitle];
[item setIdentifier:anIdentifier];
[item setIcon:anIcon];
SideBarItem *item = [[[SideBarItem alloc] init] autorelease];
return item;
[item setTitle:aTitle];
[item setIdentifier:anIdentifier];
[item setIcon:anIcon];
return item;
}
- (void)dealloc
{
[title release];
[identifier release];
[icon release];
[children release];
[title release];
[identifier release];
[icon release];
[children release];
[super dealloc];
[super dealloc];
}
- (void)finalize
{
title = nil;
identifier = nil;
icon = nil;
children = nil;
title = nil;
identifier = nil;
icon = nil;
children = nil;
[super finalize];
[super finalize];
}
#pragma mark -
......@@ -82,17 +83,17 @@
- (BOOL)hasBadge
{
return badgeValue!=-1;
return badgeValue!=-1;
}
- (BOOL)hasChildren
{
return [children count]>0;
return [children count]>0;
}
- (BOOL)hasIcon
{
return icon!=nil;
return icon!=nil;
}
@end
......@@ -46,7 +46,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
p_intf = VLCIntf;
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
......
......@@ -45,7 +45,7 @@
NSTimeInterval i_start;
BOOL b_restart;
BOOL b_isSetUp;
/* generic help window */
IBOutlet id o_help_window;
IBOutlet WebView *o_help_web_view; //we may _not_ use id here because of method name collisions
......
......@@ -105,7 +105,7 @@ static VLAboutBox *_o_sharedInstance = nil;
/* Setup the nameversion field */
[o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]];
NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String: psz_authors]componentsSeparatedByString:@"\n\n"]];
NSUInteger count = [tmpArray count];
for( NSUInteger i = 0; i < count; i++ )
......@@ -196,7 +196,7 @@ static VLAboutBox *_o_sharedInstance = nil;
{
[o_gpl_window setTitle: _NS("License")];
[o_gpl_field setString: [NSString stringWithUTF8String: psz_license]];
[o_gpl_window center];
[o_gpl_window makeKeyAndOrderFront: sender];
}
......@@ -213,7 +213,7 @@ static VLAboutBox *_o_sharedInstance = nil;
[o_help_home_btn setToolTip: _NS("Index")];
[o_help_window makeKeyAndOrderFront: self];
[[o_help_web_view mainFrame] loadHTMLString: _NS(I_LONGHELP)
baseURL: [NSURL URLWithString:@"http://videolan.org"]];
}
......
......@@ -197,7 +197,7 @@
*****************************************************************************/
@implementation NSApplication(ScriptSupport)
- (BOOL) scriptFullscreenMode {
- (BOOL) scriptFullscreenMode {
vout_thread_t * p_vout = getVout();
if( !p_vout )
return NO;
......
......@@ -119,10 +119,10 @@ static VLCBookmarks *_o_sharedInstance = nil;
seekpoint_t bookmark;
if( !input_Control( p_input, INPUT_GET_BOOKMARK, &bookmark ) )
{
bookmark.psz_name = _("Untitled");
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
}
{
bookmark.psz_name = _("Untitled");
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
}
vlc_object_release( p_input );
......
......@@ -36,10 +36,10 @@
IBOutlet id o_cleanup_button;
IBOutlet id o_error_table;
IBOutlet id o_messages_btn;
NSMutableArray * o_errors;
NSMutableArray * o_icons;
BOOL b_nib_loaded;
}
- (IBAction)cleanupTable:(id)sender;
......
......@@ -51,7 +51,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
o_error_panel = [[VLCErrorPanel alloc] init];
b_progress_cancelled = NO;
}
return _o_sharedInstance;
}
......@@ -108,7 +108,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
NSAlert *o_alert;
NSString *o_yes, *o_no, *o_cancel;
NSInteger i_returnValue = 0;
if( p_dialog->yes != NULL )
o_yes = [NSString stringWithUTF8String: p_dialog->yes];
if( p_dialog->no != NULL )
......
......@@ -51,7 +51,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
object: @"VLCEyeTVSupport"
suspensionBehavior: NSNotificationSuspensionBehaviorDeliverImmediately];
}
return _o_sharedInstance;
}
......@@ -142,7 +142,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
"end tell"];
NSLog( @"telling eyetv to switch 1 channel down" );
}
descriptor = [script executeAndReturnError:&errorDict];
if( nil == descriptor )
{
......
......@@ -73,14 +73,14 @@
[self mouseExited:NULL];
[self center];
/* get a notification if VLC isn't the active app anymore */
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(setNonActive:)
name: NSApplicationDidResignActiveNotification
object: NSApp];
/* get a notification if VLC is the active app again */
[[NSNotificationCenter defaultCenter]
addObserver: self
......@@ -120,10 +120,10 @@
NSRect theScreensFrame;
NSRect theWindowsFrame;
NSScreen *screen;
/* user-defined screen */
screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];
if (!screen)
{
/* invalid preferences or none specified, using main screen */
......@@ -132,7 +132,7 @@
theScreensFrame = [screen frame];
theWindowsFrame = [self frame];
if( theScreensFrame.size.width >= 1920 ) // 17" MBP, 24"/27" iMacs, external displays
b_usingBigScreen = YES;
......@@ -178,7 +178,7 @@
{
b_nonActive = YES;
[self orderOut: self];
/* here's fadeOut, just without visibly fading */
b_displayed = NO;
[self setAlphaValue:0.0];
......@@ -280,7 +280,7 @@
return;
[self orderFront: nil];
if( [self alphaValue] < 1.0 || b_displayed != YES )
{
if (![self fadeTimer])
......@@ -310,7 +310,7 @@
{
/* this will tell the timer to start over again or to start at all */
b_keptVisible = YES;
/* get us a valid timer */
if(! b_alreadyCounting )
{
......@@ -497,7 +497,7 @@
[o_fs_volumeSlider setTarget: self];
[o_fs_volumeSlider setAction: @selector(fsVolumeSliderUpdate:)];
[self addSubview: o_fs_volumeSlider];
/* time counter and stream title output fields */
s_rc = [self frame];
s_rc.origin.x = 98;
......@@ -725,7 +725,7 @@
NSRectClip(NSZeroRect);
[super drawRect:rect];
[[NSGraphicsContext currentContext] restoreGraphicsState];
NSRect knobRect = [[self cell] knobRectFlipped:NO];
knobRect.origin.y+=7.5;
[[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
......@@ -758,7 +758,7 @@
NSRectClip(NSZeroRect);
[super drawRect:rect];
[[NSGraphicsContext currentContext] restoreGraphicsState];
NSRect knobRect = [[self cell] knobRectFlipped:NO];
knobRect.origin.y+=6;
[[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
......
......@@ -107,7 +107,7 @@ static NSMutableArray *blackoutWindows = NULL;
- (CGDirectDisplayID)displayID
{
return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
}
- (void)blackoutOtherScreens
......
......@@ -186,9 +186,11 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_capture_mode_pop removeAllItems];
[o_capture_mode_pop addItemWithTitle: _NS("Capture Device")];
// our screen capture module isn't Lion-compatible, so let's hide it from the user if needed (trac #4799)
if( NSAppKitVersionNumber < 1115.2 )
[o_capture_mode_pop addItemWithTitle: _NS("Screen")];
// our screen capture module isn't Lion-compatible, so let's hide it from the user if needed (trac #4799)
if( NSAppKitVersionNumber < 1115.2 )
[o_capture_mode_pop addItemWithTitle: _NS("Screen")];
[o_capture_mode_pop addItemWithTitle: @"EyeTV"];
[o_screen_long_lbl setStringValue: _NS("This input allows you to save, stream or display your current screen contents.")];
[o_screen_fps_lbl setStringValue: _NS("Frames per Second:")];
......@@ -212,8 +214,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
[self qtkvideoDevices];
[o_qtk_device_pop removeAllItems];
msg_Dbg( VLCIntf, "Found %lu capture devices", [qtkvideoDevices count] );
if([qtkvideoDevices count] >= 1)
{
if([qtkvideoDevices count] >= 1)
{
if (!qtk_currdevice_uid) {
qtk_currdevice_uid = [[[QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeVideo] uniqueID]
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
......@@ -228,12 +231,11 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
}
}
else
{
[o_qtk_device_pop addItemWithTitle: _NS("None")];
else
{
[o_qtk_device_pop addItemWithTitle: _NS("None")];
[qtk_currdevice_uid release];
}
}
[self setSubPanel];
......@@ -275,8 +277,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
o_specialMediaFolders = [[NSMutableArray alloc] init];
o_opticalDevices = [[NSMutableArray alloc] init];
NSWorkspace *sharedWorkspace = [NSWorkspace sharedWorkspace];
[[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
[[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
[[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
[[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
[self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:2.0];
[self performSelector:@selector(qtkChanged:) withObject:nil afterDelay:2.5];
......@@ -454,19 +457,19 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (IBAction)qtkChanged:(id)sender
{
NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem];
if (i_selectedDevice >= ([qtkvideoDevices count] - 1))
{
NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
[o_capture_width_fld setIntValue: [sizes sizeValue].width];
[o_capture_height_fld setIntValue: [sizes sizeValue].height];
[o_capture_width_stp setIntValue: [o_capture_width_fld intValue]];
[o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID]
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
}
NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem];
if (i_selectedDevice >= ([qtkvideoDevices count] - 1))
{
NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
[o_capture_width_fld setIntValue: [sizes sizeValue].width];
[o_capture_height_fld setIntValue: [sizes sizeValue].height];
[o_capture_width_stp setIntValue: [o_capture_width_fld intValue]];
[o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
}
}
- (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi
......@@ -749,8 +752,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
GetVolParmsInfoBuffer volumeParms;
err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
CFMutableDictionaryRef matchingDict;
io_service_t service;
CFMutableDictionaryRef matchingDict;
io_service_t service;
matchingDict = IOBSDNameMatching(kIOMasterPortDefault, 0, volumeParms.vMDeviceID);
service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
......@@ -806,7 +809,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
return;
unsigned int index = [n_index intValue];
id o_currentOpticalDevice = [o_opticalDevices objectAtIndex: index];
id o_currentOpticalDevice = [o_opticalDevices objectAtIndex: index];
char *diskType = [self getVolumeTypeFromMountPath:o_currentOpticalDevice];
if (diskType == kVLCMediaDVD || diskType == kVLCMediaVideoTSFolder)
......@@ -1072,7 +1076,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("Unicast")] )
{
int i_port = [o_net_udp_port intValue];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithString: @"udp://"];
else
......@@ -1088,7 +1092,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSString *o_addr = [o_net_udpm_addr stringValue];
int i_port = [o_net_udpm_port intValue];
if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
else
......@@ -1106,7 +1110,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[NSApp endSheet: o_net_udp_panel];
}
}
- (void)openFile
{
NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
......@@ -1286,7 +1290,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
msg_Dbg( VLCIntf, "eyetv was launched, no device yet" );
setEyeTVUnconnected;
}
}
}
/* little helper method, since this code needs to be run by multiple objects */
- (void)setupChannelInfo
......@@ -1361,7 +1365,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_file_sub_sheet orderOut:sender];
[NSApp endSheet: o_file_sub_sheet];
}
- (IBAction)subFileBrowse:(id)sender
{
NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
......
......@@ -128,7 +128,7 @@
[o_outline_view setAllowsEmptySelection: NO];
[o_outline_view expandItem: [o_outline_view itemAtRow:0]];
[o_outline_view_other setTarget: self];
[o_outline_view_other setTarget: self];
[o_outline_view_other setDelegate: self];
[o_outline_view_other setDataSource: self];
[o_outline_view_other setAllowsEmptySelection: NO];
......@@ -142,7 +142,7 @@
[[o_tc_author headerCell] setStringValue:_NS("Author")];
[[o_tc_duration headerCell] setStringValue:_NS("Duration")];
[[o_tc_name_other headerCell] setStringValue:_NS("Name")];
[[o_tc_name_other headerCell] setStringValue:_NS("Name")];
[[o_tc_author_other headerCell] setStringValue:_NS("Author")];
[[o_tc_duration_other headerCell] setStringValue:_NS("Duration")];
}
......@@ -161,21 +161,21 @@
- (void)swapPlaylists:(id)newList
{
if(newList != o_outline_view)
{
id o_outline_view_temp = o_outline_view;
id o_tc_author_temp = o_tc_author;
id o_tc_duration_temp = o_tc_duration;
id o_tc_name_temp = o_tc_name;
o_outline_view = o_outline_view_other;
o_tc_author = o_tc_author_other;
o_tc_duration = o_tc_duration_other;
o_tc_name = o_tc_name_other;
o_outline_view_other = o_outline_view_temp;
o_tc_author_other = o_tc_author_temp;
o_tc_duration_other = o_tc_duration_temp;
o_tc_name_other = o_tc_name_temp;
}
if(newList != o_outline_view)
{
id o_outline_view_temp = o_outline_view;
id o_tc_author_temp = o_tc_author;
id o_tc_duration_temp = o_tc_duration;
id o_tc_name_temp = o_tc_name;
o_outline_view = o_outline_view_other;
o_tc_author = o_tc_author_other;
o_tc_duration = o_tc_duration_other;
o_tc_name = o_tc_name_other;
o_outline_view_other = o_outline_view_temp;
o_tc_author_other = o_tc_author_temp;
o_tc_duration_other = o_tc_duration_temp;
o_tc_name_other = o_tc_name_temp;
}
}
- (NSOutlineView *)outlineView
......@@ -510,14 +510,14 @@
- (void)swapPlaylists:(id)newList
{
if(newList != o_outline_view)
{
id o_search_field_temp = o_search_field;
o_search_field = o_search_field_other;
o_search_field_other = o_search_field_temp;
[super swapPlaylists:newList];
[self playlistUpdated];
}
if(newList != o_outline_view)
{
id o_search_field_temp = o_search_field;
o_search_field = o_search_field_other;
o_search_field_other = o_search_field_temp;
[super swapPlaylists:newList];
[self playlistUpdated];
}
}
- (void)playlistUpdated
......@@ -1285,7 +1285,7 @@
}
if( i_row > -1 )
{
[o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_row] byExtendingSelection:NO];
[o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_row] byExtendingSelection:NO];
[o_outline_view scrollRowToVisible: i_row];
}
}
......
......@@ -54,7 +54,7 @@ static VLCInfo *_o_sharedInstance = nil;
else
{
_o_sharedInstance = [super init];
if( _o_sharedInstance != nil )
{
p_item = NULL;
......@@ -156,7 +156,7 @@ static VLCInfo *_o_sharedInstance = nil;
[o_input_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
[o_demux_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f KiB", (float)0]];
[o_demux_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
//Initializing Video Variables
[o_video_decoded_txt setIntValue:0];
[o_displayed_txt setIntValue:0];
......
......@@ -184,7 +184,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
[o_prefs_view setHasVerticalScroller: YES];
[o_prefs_view setDrawsBackground: NO];
[o_prefs_view setDocumentView: o_empty_view];
[o_tree selectRowIndexes: [NSIndexSet indexSetWithIndex: 0] byExtendingSelection: NO];
[o_tree selectRowIndexes: [NSIndexSet indexSetWithIndex: 0] byExtendingSelection: NO];
}
- (void)setTitle: (NSString *) o_title_name
......@@ -383,7 +383,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
}
}
}
if( module_is_main( p_module) && CONFIG_ITEM(configType) )
{
if( categoryItem && [self isSubCategoryGeneral:lastsubcat] )
......@@ -600,7 +600,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
}
assert(view);
int i_lastItem = 0;
int i_yPos = -2;
int i_max_label = 0;
......
......@@ -1557,7 +1557,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
int i_index;
i_view_type = CONFIG_ITEM_STRING_LIST;
o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */
if( p_item->psz_text )
......@@ -1866,7 +1866,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{
i_view_type = CONFIG_ITEM_RANGED_INTEGER;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */
if( p_item->psz_text )
......@@ -2110,13 +2110,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
//TODO....
return nil;
//Fill our array to know how may items we have...
module_t *p_parser, **p_list;
size_t i_module_index;
NSRect mainFrame = [o_parent_view frame];
NSString *o_labelString, *o_textfieldString, *o_tooltip;
o_modulearray = [[NSMutableArray alloc] initWithCapacity:10];
/* build a list of available modules */
p_list = module_list_get( NULL );
......@@ -2124,20 +2124,20 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{
int i;
p_parser = p_list[i_module_index];
if( module_is_main( p_parser ) )
continue;
unsigned int confsize;
module_config_t *p_configlist = module_config_get( p_parser, &confsize );
for ( i = 0; i < confsize; i++ )
{
unsigned int unused;
module_config_t *p_config = &p_configlist[i];
NSString *o_modulelongname, *o_modulename;
NSNumber *o_moduleenabled = nil;
/* Hack: required subcategory is stored in i_min */
if( p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == _p_item->min.i )
......@@ -2146,13 +2146,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
module_get_name( p_parser, TRUE )];
o_modulename = [NSString stringWithUTF8String:
module_get_object( p_parser )];
if( _p_item->value.psz &&
strstr( _p_item->value.psz, module_get_object( p_parser ) ) )
o_moduleenabled = [NSNumber numberWithBool:YES];
else
o_moduleenabled = [NSNumber numberWithBool:NO];
[o_modulearray addObject:[NSMutableArray
arrayWithObjects: o_modulename, o_modulelongname,
o_moduleenabled, nil]];
......@@ -2161,7 +2161,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
module_config_free( p_configlist );
}
module_list_free( p_list );
mainFrame.size.height = 30 + 20 * [o_modulearray count];
mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
mainFrame.origin.x = LEFTMARGIN;
......@@ -2169,9 +2169,9 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
if( [super initWithFrame: mainFrame item: _p_item] != nil )
{
i_view_type = CONFIG_ITEM_MODULE_LIST;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */
if( p_item->psz_text )
o_labelString = _NS((char *)p_item->psz_text);
......@@ -2180,7 +2180,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
[o_label setAutoresizingMask:NSViewNotSizable ];
[self addSubview: o_label];
/* build the textfield */
if( p_item->value.psz )
o_textfieldString = _NS((char *)p_item->value.psz);
......@@ -2191,8 +2191,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_label frame].size.width - 2, o_tooltip, o_textfieldString )
[o_textfield setAutoresizingMask:NSViewWidthSizable ];
[self addSubview: o_textfield];
{
NSRect s_rc = mainFrame;
s_rc.size.height = mainFrame.size.height - 30;
......@@ -2203,7 +2203,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_scrollview setDrawsBackground: NO];
[o_scrollview setBorderType: NSBezelBorder];
[o_scrollview setAutohidesScrollers:YES];
NSTableView *o_tableview;
o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
[o_tableview setUsesAlternatingRowBackgroundColors:YES];
......@@ -2211,7 +2211,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
/* TODO: find a good way to fix the row height and text size*/
/* FIXME: support for multiple selection... */
// [o_tableview setAllowsMultipleSelection:YES];
NSCell *o_headerCell = [[NSCell alloc] initTextCell:@"Enabled"];
NSCell *o_dataCell = [[NSButtonCell alloc] init];
[(NSButtonCell*)o_dataCell setButtonType:NSSwitchButton];
......@@ -2223,7 +2223,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_tableColumn setDataCell: o_dataCell];
[o_tableColumn setWidth:17];
[o_tableview addTableColumn: o_tableColumn];
o_headerCell = [[NSCell alloc] initTextCell:@"Module Name"];
o_dataCell = [[NSTextFieldCell alloc] init];
[o_dataCell setFont:[NSFont systemFontOfSize:12]];
......@@ -2235,7 +2235,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_tableview addTableColumn: o_tableColumn];
[o_tableview registerForDraggedTypes:[NSArray arrayWithObjects:
@"VLC media player module", nil]];
[o_tableview setDataSource:self];
[o_tableview setTarget: self];
[o_tableview setAction: @selector(tableChanged:)];
......
......@@ -92,8 +92,10 @@
IBOutlet id o_intf_art_txt;
IBOutlet id o_intf_embedded_ckb;
IBOutlet id o_intf_fspanel_ckb;
IBOutlet id o_intf_appleremote_ckb;
IBOutlet id o_intf_mediakeys_ckb;
IBOutlet id o_intf_appleremote_ckb;
IBOutlet id o_intf_mediakeys_ckb;
IBOutlet id o_intf_lang_pop;
IBOutlet id o_intf_lang_txt;
IBOutlet id o_intf_network_box;
......
......@@ -271,8 +271,10 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_intf_fspanel_ckb setTitle: _NS("Show Fullscreen Controller")];
[o_intf_lang_txt setStringValue: _NS("Language")];
[o_intf_network_box setTitle: _NS("Privacy / Network Interaction")];
[o_intf_appleremote_ckb setTitle: _NS("Control playback with the Apple Remote")];
[o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
[o_intf_appleremote_ckb setTitle: _NS("Control playback with the Apple Remote")];
[o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
[o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
[o_intf_last_update_lbl setStringValue: @""];
[o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
......@@ -463,8 +465,10 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[self setupButton: o_intf_fspanel_ckb forBoolValue: "macosx-fspanel"];
[self setupButton: o_intf_nativefullscreen_ckb forBoolValue: "macosx-nativefullscreenmode"];
[self setupButton: o_intf_embedded_ckb forBoolValue: "embedded-video"];
[self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
[self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
if( [[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL )
[o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
else
......@@ -661,9 +665,9 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
assert( p_main );
unsigned confsize;
module_config_t *p_config;
p_config = module_config_get (p_main, &confsize);
for (size_t i = 0; i < confsize; i++)
{
module_config_t *p_item = p_config + i;
......@@ -814,7 +818,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
config_PutInt( p_intf, "macosx-fspanel", [o_intf_fspanel_ckb state] );
config_PutInt( p_intf, "embedded-video", [o_intf_embedded_ckb state] );
config_PutInt( p_intf, "macosx-appleremote", [o_intf_appleremote_ckb state] );
config_PutInt( p_intf, "macosx-appleremote", [o_intf_appleremote_ckb state] );
config_PutInt( p_intf, "macosx-mediakeys", [o_intf_mediakeys_ckb state] );
config_PutInt( p_intf, "macosx-interfacestyle", [o_intf_style_dark_bcell state] );
config_PutInt( p_intf, "macosx-nativefullscreenmode", [o_intf_nativefullscreen_ckb state] );
......@@ -844,11 +849,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
}
}
/* activate stuff without restart */
if( [o_intf_appleremote_ckb state] == YES )
[[[VLCMain sharedInstance] appleRemoteController] startListening: [VLCMain sharedInstance]];
else
[[[VLCMain sharedInstance] appleRemoteController] stopListening: [VLCMain sharedInstance]];
/* activate stuff without restart */
if( [o_intf_appleremote_ckb state] == YES )
[[[VLCMain sharedInstance] appleRemoteController] startListening: [VLCMain sharedInstance]];
else
[[[VLCMain sharedInstance] appleRemoteController] stopListening: [VLCMain sharedInstance]];
b_intfSettingChanged = NO;
}
......@@ -1319,7 +1324,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[o_hotkeys_change_taken_lbl setStringValue: [NSString stringWithFormat:
_NS("This combination is already taken by \"%@\"."),
[o_hotkeyDescriptions objectAtIndex: i_returnValue2]]];
else
[o_hotkeys_change_taken_lbl setStringValue: @""];
......@@ -1359,7 +1363,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
{
NSMutableString *tempString = [[[NSMutableString alloc] init] autorelease];
NSString *keyString = [o_theEvent characters];
unichar key = [keyString characterAtIndex:0];
unichar key = [keyString characterAtIndex:0];
/* modifiers */
if( [o_theEvent modifierFlags] & NSControlKeyMask )
......
......@@ -71,7 +71,7 @@
[_okayButton setAction:@selector(buttonAction:)];
[_okayButton setKeyEquivalent:@"\r"] ; // enter key
[ourContentView addSubview:_okayButton];
s_rc.origin.x = 94;
s_rc.origin.y = 170;
s_rc.size.height = 14;
......@@ -117,7 +117,7 @@
[_passwordField setEditable:YES];
[_passwordField setImportsGraphics:NO];
[ourContentView addSubview:_passwordField];
s_rc.origin.x = 94;
s_rc.origin.y = 238;
s_rc.size.height = 17;
......
......@@ -81,14 +81,14 @@ int OpenVideoGL ( vlc_object_t * p_this )
p_vout->pf_unlock = cocoaglvoutviewUnlock;
}
#else
/* Let's use the VLCOpenGLVoutView.m class */
p_vout->pf_init = cocoaglvoutviewInit;
p_vout->pf_end = cocoaglvoutviewEnd;
p_vout->pf_manage = cocoaglvoutviewManage;
p_vout->pf_control= cocoaglvoutviewControl;
p_vout->pf_swap = cocoaglvoutviewSwap;
p_vout->pf_lock = cocoaglvoutviewLock;
p_vout->pf_unlock = cocoaglvoutviewUnlock;
/* Let's use the VLCOpenGLVoutView.m class */
p_vout->pf_init = cocoaglvoutviewInit;
p_vout->pf_end = cocoaglvoutviewEnd;
p_vout->pf_manage = cocoaglvoutviewManage;
p_vout->pf_control= cocoaglvoutviewControl;
p_vout->pf_swap = cocoaglvoutviewSwap;
p_vout->pf_lock = cocoaglvoutviewLock;
p_vout->pf_unlock = cocoaglvoutviewUnlock;
#endif
p_vout->p_sys->b_got_frame = false;
......
......@@ -208,8 +208,8 @@ static int Open(vlc_object_t *this)
const vlc_fourcc_t *subpicture_chromas;
video_format_t fmt = vd->fmt;
sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
if (!sys->vgl)
sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
if (!sys->vgl)
{
sys->gl.sys = NULL;
goto error;
......@@ -301,7 +301,8 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
[sys->glView setVoutFlushing:NO];
picture_Release (pic);
sys->has_first_frame = true;
(void)subpicture;
(void)subpicture;
}
static int Control (vout_display_t *vd, int query, va_list ap)
......@@ -697,8 +698,8 @@ static void OpenglSwap(vlc_gl_t *gl)
NSWindow *window = [self window];
// Remove flashes with splitter view.
if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
[window disableScreenUpdatesUntilFlush];
if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
[window disableScreenUpdatesUntilFlush];
[super renewGState];
}
......
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