Commit f4e34526 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Examples: remove trailing spaces and tabs

parent 6c0b712c
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
- (id)transformedValue:(id)value - (id)transformedValue:(id)value
{ {
if( !value ) return nil; if( !value ) return nil;
if(![value respondsToSelector: @selector(floatValue)]) if(![value respondsToSelector: @selector(floatValue)])
{ {
[NSException raise: NSInternalInconsistencyException [NSException raise: NSInternalInconsistencyException
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
[value class]]; [value class]];
return nil; return nil;
} }
return [NSNumber numberWithFloat: [value floatValue]*10000.]; return [NSNumber numberWithFloat: [value floatValue]*10000.];
} }
- (id)reverseTransformedValue:(id)value - (id)reverseTransformedValue:(id)value
{ {
if( !value ) return nil; if( !value ) return nil;
if(![value respondsToSelector: @selector(floatValue)]) if(![value respondsToSelector: @selector(floatValue)])
{ {
[NSException raise: NSInternalInconsistencyException [NSException raise: NSInternalInconsistencyException
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
[value class]]; [value class]];
return nil; return nil;
} }
return [NSNumber numberWithFloat: [value floatValue]/10000.]; return [NSNumber numberWithFloat: [value floatValue]/10000.];
} }
@end @end
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
} }
- (void)drawRect:(NSRect)rect - (void)drawRect:(NSRect)rect
{ {
NSColor * topGradient = [NSColor colorWithCalibratedWhite:.12f alpha:1.0]; NSColor * topGradient = [NSColor colorWithCalibratedWhite:.12f alpha:1.0];
NSColor * bottomGradient = [NSColor colorWithCalibratedWhite:0.55f alpha:0.9]; NSColor * bottomGradient = [NSColor colorWithCalibratedWhite:0.55f alpha:0.9];
NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations:bottomGradient, 0.f, bottomGradient, 0.1f, topGradient, 1.f, nil]; NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations:bottomGradient, 0.f, bottomGradient, 0.1f, topGradient, 1.f, nil];
[gradient drawInRect:self.bounds angle:90.0]; [gradient drawInRect:self.bounds angle:90.0];
[super drawRect:rect]; [super drawRect:rect];
} }
......
...@@ -16,15 +16,15 @@ static void *sleepForMe(void) ...@@ -16,15 +16,15 @@ static void *sleepForMe(void)
// Allocate a VLCVideoView instance and tell it what area to occupy. // Allocate a VLCVideoView instance and tell it what area to occupy.
NSRect rect = NSMakeRect(0, 0, 0, 0); NSRect rect = NSMakeRect(0, 0, 0, 0);
rect.size = [videoHolderView frame].size; rect.size = [videoHolderView frame].size;
videoView = [[VLCVideoView alloc] initWithFrame:rect]; videoView = [[VLCVideoView alloc] initWithFrame:rect];
[videoHolderView addSubview:videoView]; [videoHolderView addSubview:videoView];
[videoView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable]; [videoView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable];
videoView.fillScreen = YES; videoView.fillScreen = YES;
playlist = [[VLCMediaList alloc] init]; playlist = [[VLCMediaList alloc] init];
[playlist addObserver:self forKeyPath:@"media" options:NSKeyValueObservingOptionNew context:nil]; [playlist addObserver:self forKeyPath:@"media" options:NSKeyValueObservingOptionNew context:nil];
player = [[VLCMediaPlayer alloc] initWithVideoView:videoView]; player = [[VLCMediaPlayer alloc] initWithVideoView:videoView];
mediaIndex = -1; mediaIndex = -1;
...@@ -39,7 +39,7 @@ static void *sleepForMe(void) ...@@ -39,7 +39,7 @@ static void *sleepForMe(void)
- (void)applicationWillTerminate:(NSNotification *)aNotification - (void)applicationWillTerminate:(NSNotification *)aNotification
{ {
[playlist removeObserver:self forKeyPath:@"media"]; [playlist removeObserver:self forKeyPath:@"media"];
[player pause]; [player pause];
[player setMedia:nil]; [player setMedia:nil];
[player release]; [player release];
...@@ -51,22 +51,22 @@ static void *sleepForMe(void) ...@@ -51,22 +51,22 @@ static void *sleepForMe(void)
{ {
if ([playlistOutline selectedRow] != mediaIndex) if ([playlistOutline selectedRow] != mediaIndex)
{ {
[self setMediaIndex:[playlistOutline selectedRow]]; [self setMediaIndex:[playlistOutline selectedRow]];
if (![player isPlaying]) if (![player isPlaying])
[player play]; [player play];
} }
} }
- (void)setMediaIndex:(int)value - (void)setMediaIndex:(int)value
{ {
if ([playlist count] <= 0) if ([playlist count] <= 0)
return; return;
if (value < 0) if (value < 0)
value = 0; value = 0;
if (value > [playlist count] - 1) if (value > [playlist count] - 1)
value = [playlist count] - 1; value = [playlist count] - 1;
mediaIndex = value; mediaIndex = value;
[player setMedia:[playlist mediaAtIndex:mediaIndex]]; [player setMedia:[playlist mediaAtIndex:mediaIndex]];
} }
...@@ -76,8 +76,8 @@ static void *sleepForMe(void) ...@@ -76,8 +76,8 @@ static void *sleepForMe(void)
[self setMediaIndex:mediaIndex+1]; [self setMediaIndex:mediaIndex+1];
if (![player isPlaying]) if (![player isPlaying])
{ {
NSLog(@"%@ length = %@", [playlist mediaAtIndex:mediaIndex], [[playlist mediaAtIndex:mediaIndex] lengthWaitUntilDate:[NSDate dateWithTimeIntervalSinceNow:60]]); NSLog(@"%@ length = %@", [playlist mediaAtIndex:mediaIndex], [[playlist mediaAtIndex:mediaIndex] lengthWaitUntilDate:[NSDate dateWithTimeIntervalSinceNow:60]]);
[player play]; [player play];
} }
} }
...@@ -101,30 +101,30 @@ static void *sleepForMe(void) ...@@ -101,30 +101,30 @@ static void *sleepForMe(void)
} }
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(int)row row:(int)row
{ {
return [(VLCMedia *)[playlist mediaAtIndex:row].metaDictionary valueForKey:VLCMetaInformationTitle]; return [(VLCMedia *)[playlist mediaAtIndex:row].metaDictionary valueForKey:VLCMetaInformationTitle];
} }
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info - (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info
proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op
{ {
return NSDragOperationEvery; /* This is for now */ return NSDragOperationEvery; /* This is for now */
} }
- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info
row:(int)row dropOperation:(NSTableViewDropOperation)operation row:(int)row dropOperation:(NSTableViewDropOperation)operation
{ {
int i; int i;
NSArray *droppedItems = [[info draggingPasteboard] propertyListForType:NSFilenamesPboardType]; NSArray *droppedItems = [[info draggingPasteboard] propertyListForType:NSFilenamesPboardType];
for (i = 0; i < [droppedItems count]; i++) for (i = 0; i < [droppedItems count]; i++)
{ {
NSString * filename = [droppedItems objectAtIndex:i]; NSString * filename = [droppedItems objectAtIndex:i];
VLCMedia * media = [VLCMedia mediaWithURL:[NSURL fileURLWithPath:filename]]; VLCMedia * media = [VLCMedia mediaWithURL:[NSURL fileURLWithPath:filename]];
[playlist addMedia:media]; [playlist addMedia:media];
} }
return YES; return YES;
} }
@end @end
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