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 )
msg_Dbg( p_access, "plugin notified" );
close(p_sys->eyetvSock);
close(p_sys->eyetvSock);
msg_Dbg( p_access, "msg port closed and freed" );
......
......@@ -141,7 +141,8 @@ vlc_module_end ()
{
CVImageBufferRef imageBuffer;
mtime_t pts;
void * pixels;
void * pixels;
if(!currentImageBuffer || currentPts == previousPts )
return 0;
......
......@@ -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;
......
......@@ -878,6 +878,7 @@ 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];
}
......@@ -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++ )
......
......@@ -682,6 +682,7 @@ 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) {
[o_shuffle_btn setImage: o_shuffle_on_img];
[o_shuffle_btn setAlternateImage: o_shuffle_on_pressed_img];
......@@ -780,6 +781,7 @@ 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;
......@@ -788,7 +790,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (BOOL)isMainWindow
{
return YES;
return YES;
}
- (void)setTitle:(NSString *)title
......@@ -1975,24 +1978,20 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)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];
}
else {
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) {
if(item==nil)
return [o_sidebaritems objectAtIndex:index];
}
else {
else
return [[item children] objectAtIndex:index];
}
}
......@@ -2042,6 +2041,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
return i_playlist_size;
}
return [item badgeValue];
}
......@@ -2059,7 +2059,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (NSMenu*)sourceList:(PXSourceList*)aSourceList menuForEvent:(NSEvent*)theEvent item:(id)item
{
if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask)) {
if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask))
{
if (item != nil)
{
NSMenu * m;
......@@ -2077,6 +2078,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
return [m autorelease];
}
}
return nil;
}
......@@ -2109,9 +2111,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)sourceListSelectionDidChange:(NSNotification *)notification
{
playlist_t * p_playlist = pl_Get( VLCIntf );
NSIndexSet *selectedIndexes = [o_sidebar_view selectedRowIndexes];
id item = [o_sidebar_view itemAtRow:[selectedIndexes firstIndex]];
//Set the label text to represent the new selection
if ([item sdtype] > -1 && [[item identifier] length] > 0)
{
......
......@@ -60,7 +60,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
{
[self setDelegate:(id<PXSourceListDelegate>)[super delegate]];
[super setDelegate:self];
[self setDataSource:(id<PXSourceListDataSource>)[super dataSource]];
[super setDataSource:self];
......@@ -103,22 +102,14 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
[[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
_secondaryDelegate = aDelegate;
//Register the new delegate to receive notifications
[self registerDelegateToReceiveNotification:PXSLSelectionIsChangingNotification
withSelector:@selector(sourceListSelectionIsChanging:)];
[self registerDelegateToReceiveNotification:PXSLSelectionDidChangeNotification
withSelector:@selector(sourceListSelectionDidChange:)];
[self registerDelegateToReceiveNotification:PXSLItemWillExpandNotification
withSelector:@selector(sourceListItemWillExpand:)];
[self registerDelegateToReceiveNotification:PXSLItemDidExpandNotification
withSelector:@selector(sourceListItemDidExpand:)];
[self registerDelegateToReceiveNotification:PXSLItemWillCollapseNotification
withSelector:@selector(sourceListItemWillCollapse:)];
[self registerDelegateToReceiveNotification:PXSLItemDidCollapseNotification
withSelector:@selector(sourceListItemDidCollapse:)];
[self registerDelegateToReceiveNotification:PXSLDeleteKeyPressedOnRowsNotification
withSelector:@selector(sourceListDeleteKeyPressedOnRows:)];
[self registerDelegateToReceiveNotification:PXSLSelectionIsChangingNotification withSelector:@selector(sourceListSelectionIsChanging:)];
[self registerDelegateToReceiveNotification:PXSLSelectionDidChangeNotification withSelector:@selector(sourceListSelectionDidChange:)];
[self registerDelegateToReceiveNotification:PXSLItemWillExpandNotification withSelector:@selector(sourceListItemWillExpand:)];
[self registerDelegateToReceiveNotification:PXSLItemDidExpandNotification withSelector:@selector(sourceListItemDidExpand:)];
[self registerDelegateToReceiveNotification:PXSLItemWillCollapseNotification withSelector:@selector(sourceListItemWillCollapse:)];
[self registerDelegateToReceiveNotification:PXSLItemDidCollapseNotification withSelector:@selector(sourceListItemDidCollapse:)];
[self registerDelegateToReceiveNotification:PXSLDeleteKeyPressedOnRowsNotification withSelector:@selector(sourceListDeleteKeyPressedOnRows:)];
}
......@@ -132,7 +123,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)setIconSize:(NSSize)newIconSize
{
_iconSize = newIconSize;
CGFloat rowHeight = [self rowHeight];
//Make sure icon height does not exceed row height; if so constrain, keeping width and height in proportion
......@@ -162,7 +152,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
[self expandItem:item expandChildren:NO];
}
}
}
//If there are selected rows and the item hierarchy has changed, make sure a Group row isn't
......@@ -209,7 +198,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
if([_secondaryDataSource respondsToSelector:@selector(sourceList:numberOfChildrenOfItem:)]) {
return [_secondaryDataSource sourceList:self numberOfChildrenOfItem:nil];
}
return 0;
}
......@@ -316,8 +304,8 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
NSSize cellSize = [cell cellSize];
if (!([cell type] == NSImageCellType) && !([cell type] == NSTextCellType))
cellSize = [cell cellSizeForBounds:[super frameOfCellAtColumn:column row:row]];
NSRect cellFrame = [super frameOfCellAtColumn:column row:row];
NSRect cellFrame = [super frameOfCellAtColumn:column row:row];
NSRect rowRect = [self rectOfRow:row];
if([self isGroupItem:item])
......@@ -330,10 +318,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
minX = 7;
}
return NSMakeRect(minX,
NSMidY(cellFrame)-(cellSize.height/2.0),
NSWidth(rowRect)-minX,
cellSize.height);
return NSMakeRect(minX, NSMidY(cellFrame)-(cellSize.height/2.0), NSWidth(rowRect)-minX, cellSize.height);
}
else
{
......@@ -349,11 +334,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
leftIndent += [self iconSize].width+(ICON_SPACING*2);
}
}
return NSMakeRect(leftIndent,
NSMidY(rowRect)-(cellSize.height/2.0),
NSWidth(rowRect)-rightIndent-leftIndent,
cellSize.height);
return NSMakeRect(leftIndent, NSMidY(rowRect)-(cellSize.height/2.0), NSWidth(rowRect)-rightIndent-leftIndent, cellSize.height);
}
}
......@@ -369,9 +350,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
return NSZeroSize;
}
NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]]
attributes:[NSDictionary dictionaryWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, nil]];
NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]] attributes:[NSDictionary dictionaryWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, nil]];
NSSize stringSize = [badgeAttrString size];
//Calculate the width needed to display the text or the minimum width if it's smaller
......@@ -393,7 +372,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect
{
[super drawRow:rowIndex clipRect:clipRect];
id item = [self itemAtRow:rowIndex];
//Draw an icon if the item has one
......@@ -403,27 +381,19 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
{
NSRect cellFrame = [self frameOfCellAtColumn:0 row:rowIndex];
NSSize iconSize = [self iconSize];
NSRect iconRect = NSMakeRect(NSMinX(cellFrame)-iconSize.width-ICON_SPACING,
NSMidY(cellFrame)-(iconSize.width/2.0f),
iconSize.width,
iconSize.height);
NSRect iconRect = NSMakeRect(NSMinX(cellFrame)-iconSize.width-ICON_SPACING, NSMidY(cellFrame)-(iconSize.width/2.0f), iconSize.width, iconSize.height);
if([_secondaryDataSource respondsToSelector:@selector(sourceList:iconForItem:)])
{
NSImage *icon = [_secondaryDataSource sourceList:self iconForItem:item];
if(icon!=nil)
{
NSSize actualIconSize = [icon size];
//If the icon is *smaller* than the size retrieved from the -iconSize property, make sure we
//reduce the size of the rectangle to draw the icon in, so that it is not stretched.
if((actualIconSize.width<iconSize.width)||(actualIconSize.height<iconSize.height))
{
iconRect = NSMakeRect(NSMidX(iconRect)-(actualIconSize.width/2.0f),
NSMidY(iconRect)-(actualIconSize.height/2.0f),
actualIconSize.width,
actualIconSize.height);
iconRect = NSMakeRect(NSMidX(iconRect)-(actualIconSize.width/2.0f), NSMidY(iconRect)-(actualIconSize.height/2.0f), actualIconSize.width, actualIconSize.height);
}
//Use 10.6 NSImage drawing if we can
......@@ -456,7 +426,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
NSMidY(rowRect)-(badgeSize.height/2.0),
badgeSize.width,
badgeSize.height);
[self drawBadgeForRow:rowIndex inRect:badgeFrame];
}
}
......@@ -464,7 +433,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)drawBadgeForRow:(NSInteger)rowIndex inRect:(NSRect)badgeFrame
{
id rowItem = [self itemAtRow:rowIndex];
NSBezierPath *badgePath = [NSBezierPath bezierPathWithRoundedRect:badgeFrame
xRadius:(BADGE_HEIGHT/2.0)
yRadius:(BADGE_HEIGHT/2.0)];
......@@ -481,10 +449,8 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
if([[self selectedRowIndexes] containsIndex:rowIndex])
{
backgroundColor = [NSColor whiteColor];
//Set the text color based on window and control state
NSColor *textColor;
if(isVisible && (isFocused || rowBeingEdited==rowIndex)) {
textColor = BADGE_SELECTED_TEXT_COLOR;
}
......@@ -495,8 +461,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
textColor = BADGE_SELECTED_HIDDEN_TEXT_COLOR;
}
attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName,
textColor, NSForegroundColorAttributeName, nil];
attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, textColor, NSForegroundColorAttributeName, nil];
}
else
{
......@@ -526,22 +491,19 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
else { //Gray colour
backgroundColor = BADGE_HIDDEN_BACKGROUND_COLOR;
}
attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName,
badgeColor, NSForegroundColorAttributeName, nil];
attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, badgeColor, NSForegroundColorAttributeName, nil];
}
[backgroundColor set];
[badgePath fill];
//Draw the badge text
NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]]
attributes:attributes];
NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]] attributes:attributes];
NSSize stringSize = [badgeAttrString size];
NSPoint badgeTextPoint = NSMakePoint(NSMidX(badgeFrame)-(stringSize.width/2.0), //Center in the badge frame
NSMidY(badgeFrame)-(stringSize.height/2.0)); //Center in the badge frame
[badgeAttrString drawAtPoint:badgeTextPoint];
[attributes release];
[badgeAttrString release];
}
......@@ -552,7 +514,6 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)keyDown:(NSEvent *)theEvent
{
NSIndexSet *selectedIndexes = [self selectedRowIndexes];
NSString *keyCharacters = [theEvent characters];
//Make sure we have a selection
......@@ -561,15 +522,15 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
if([keyCharacters length]>0)
{
unichar firstKey = [keyCharacters characterAtIndex:0];
if(firstKey==NSUpArrowFunctionKey||firstKey==NSDownArrowFunctionKey)
{
//Handle keyboard navigation across groups
if([selectedIndexes count]==1&&!([theEvent modifierFlags] & NSShiftKeyMask))
{
int delta = firstKey==NSDownArrowFunctionKey?1:-1; //Search "backwards" if up arrow, "forwards" if down
NSInteger newRow = [selectedIndexes firstIndex];
int delta = firstKey==NSDownArrowFunctionKey?1:-1;
//Search "backwards" if up arrow, "forwards" if down
NSInteger newRow = [selectedIndexes firstIndex];
//Keep incrementing/decrementing the row until a non-header row is reached
do {
newRow+=delta;
......@@ -579,21 +540,22 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
break;
} while([self isGroupItem:[self itemAtRow:newRow]]);
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:newRow] byExtendingSelection:NO];
return;
}
}
else if(firstKey==NSDeleteCharacter||firstKey==NSBackspaceCharacter)
{
//Post the notification
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLDeleteKeyPressedOnRowsNotification
object:self
userInfo:[NSDictionary dictionaryWithObject:selectedIndexes forKey:@"rows"]];
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLDeleteKeyPressedOnRowsNotification object:self userInfo:[NSDictionary dictionaryWithObject:selectedIndexes forKey:@"rows"]];
return;
}
}
}
//We don't care about it
......@@ -607,18 +569,22 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (NSMenu *)menuForEvent:(NSEvent *)theEvent
{
NSMenu * m = nil;
if([_secondaryDelegate respondsToSelector:@selector(sourceList:menuForEvent:item:)]) {
NSPoint clickPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil];
NSInteger row = [self rowAtPoint:clickPoint];
id clickedItem = [self itemAtRow:row];
if ([clickedItem sdtype] > 0)
m = [_secondaryDelegate sourceList:self menuForEvent:theEvent item:clickedItem];
else
m = [super menuForEvent:theEvent];
}
if (m == nil) {
m = [super menuForEvent:theEvent];
}
return m;
}
......@@ -864,30 +830,22 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
- (void)outlineViewItemWillExpand:(NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillExpandNotification
object:self
userInfo:[notification userInfo]];
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillExpandNotification object:self userInfo:[notification userInfo]];
}
- (void)outlineViewItemDidExpand:(NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidExpandNotification
object:self
userInfo:[notification userInfo]];
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidExpandNotification object:self userInfo:[notification userInfo]];
}
- (void)outlineViewItemWillCollapse:(NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillCollapseNotification
object:self
userInfo:[notification userInfo]];
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillCollapseNotification object:self userInfo:[notification userInfo]];
}
- (void)outlineViewItemDidCollapse:(NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidCollapseNotification
object:self
userInfo:[notification userInfo]];
[[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidCollapseNotification object:self userInfo:[notification userInfo]];
}
- (void)registerDelegateToReceiveNotification:(NSString*)notification withSelector:(SEL)selector
......@@ -896,10 +854,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
//Set the delegate as a receiver of the notification if it implements the notification method
if([_secondaryDelegate respondsToSelector:selector]) {
[defaultCenter addObserver:_secondaryDelegate
selector:selector
name:notification
object:self];
[defaultCenter addObserver:_secondaryDelegate selector:selector name:notification object:self];
}
}
......
......@@ -28,17 +28,18 @@
-(id)initWithObject:(id)obj stacktraceSaving:(BOOL)saveStack;
{
self.object = obj;
if(saveStack)
[self saveBacktrace];
return self;
}
-(void)dealloc;
{
free(frameStrings);
self.object = nil;
self.invocation = nil;
[super dealloc];
}
@synthesize invocation = _invocation, object = _object;
......@@ -66,6 +67,7 @@
else if(onMainAfterForward)
[self performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:waitUntilDone];
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)inSelector {
NSMethodSignature *signature = [super methodSignatureForSelector:inSelector];
if (signature == NULL)
......@@ -76,10 +78,10 @@
- (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];
......@@ -97,6 +99,7 @@
frameCount = backtrace(&backtraceFrames[0], 128);
frameStrings = backtrace_symbols(&backtraceFrames[0], frameCount);
}
-(void)printBacktrace;
{
for(int x = 3; x < frameCount; x++) {
......@@ -111,22 +114,26 @@
{
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)nextRunloop;
{
return [self invokeAfter:0];
}
-(id)inBackground;
{
SPInvocationGrabber *grabber = [self grab];
grabber.backgroundAfterForward = YES;
return grabber;
}
-(id)onMainAsync:(BOOL)async;
{
SPInvocationGrabber *grabber = [self grab];
......
......@@ -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;
......
......@@ -22,20 +22,26 @@
- SourceListItem *child1;
- SourceListItem *child2;
- SourceListItem *childOfChild2;
- 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;
......
......@@ -48,6 +48,7 @@
+ (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier icon:(NSImage*)anIcon
{
SideBarItem *item = [[[SideBarItem alloc] init] autorelease];
[item setTitle:aTitle];
......
......@@ -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")];
[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,6 +214,7 @@ 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 (!qtk_currdevice_uid) {
......@@ -234,7 +237,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
[qtk_currdevice_uid release];
}
[self setSubPanel];
[[NSNotificationCenter defaultCenter] addObserver: self
......@@ -275,6 +277,7 @@ 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];
[self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:2.0];
......@@ -455,16 +458,16 @@ 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]];
qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
}
}
......@@ -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)
......