Commit 0361c54d authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/Example: FlashVideoDownloader, sample app that download a...

MacOSX/Framework/Example: FlashVideoDownloader, sample app that download a video from YouTube, dailymotion, etc. using VLC's luaplaylist module, and export them to a more readable format. (killer app, imho :), but yet only an code Example. )
parent 7bdcff97
/* Controller */
#import <Cocoa/Cocoa.h>
#import <VLCKit/VLCKit.h>
@interface Controller : NSObject
{
IBOutlet NSView * remoteURLView;
IBOutlet NSView * workingView;
IBOutlet NSWindow * window;
IBOutlet NSButton * openConvertedFileButton;
NSNumber * selectedStreamOutput;
NSString * remoteURLAsString;
VLCMedia * media;
VLCStreamSession * streamSession;
NSString * outputFilePath;
NSString * outputFolderPath;
}
- (void)awakeFromNib;
@property (retain) VLCMedia * media;
@property (retain) VLCStreamSession * streamSession;
@property (assign) NSNumber * selectedStreamOutput;
@property (retain,readonly) NSString * outputFilePath;
@property (retain,readonly) NSString * outputFolderPath;
@property (retain) NSString * remoteURLAsString;
- (IBAction)convert:(id)sender;
- (IBAction)openConvertedFile:(id)sender;
- (IBAction)openConvertedEnclosingFolder:(id)sender;
- (IBAction)pickOutputFolderPath:(id)sender;
@end
#import "Controller.h"
/**********************************************************
* First off, some value transformer to easily play with
* bindings
*/
@interface VLCFloat10000FoldTransformer : NSObject
@end
@implementation VLCFloat10000FoldTransformer
+ (Class)transformedValueClass
{
return [NSNumber class];
}
+ (BOOL)allowsReverseTransformation
{
return YES;
}
- (id)transformedValue:(id)value
{
if( !value ) return nil;
if(![value respondsToSelector: @selector(floatValue)])
{
[NSException raise: NSInternalInconsistencyException
format: @"Value (%@) does not respond to -floatValue.",
[value class]];
return nil;
}
return [NSNumber numberWithFloat: [value floatValue]*10000.];
}
- (id)reverseTransformedValue:(id)value
{
if( !value ) return nil;
if(![value respondsToSelector: @selector(floatValue)])
{
[NSException raise: NSInternalInconsistencyException
format: @"Value (%@) does not respond to -floatValue.",
[value class]];
return nil;
}
return [NSNumber numberWithFloat: [value floatValue]/10000.];
}
@end
/**********************************************************
* @implementation Controller
*/
@interface Controller ()
@property (retain,readwrite) NSString * outputFolderPath;
@end
@implementation Controller
- (id)init
{
if(self = [super init])
{
[self bind:@"outputFolderPath" toObject:[NSUserDefaultsController sharedUserDefaultsController]
withKeyPath:@"values.outputFolderPath" options:nil];
[[[NSUserDefaultsController sharedUserDefaultsController] values] bind:@"outputFolderPath" toObject:self
withKeyPath:@"outputFolderPath" options:nil];
VLCFloat10000FoldTransformer *float100fold;
float100fold = [[[VLCFloat10000FoldTransformer alloc] init] autorelease];
[NSValueTransformer setValueTransformer:(id)float100fold forName:@"Float10000FoldTransformer"];
self.media = nil;
self.streamSession = nil;
selectedStreamOutput = [[NSNumber alloc] initWithInt:0];
self.remoteURLAsString = [NSString stringWithString:@"http://youtube.com/watch?v=IXpx2OEWBdA&feature=bz303"];
outputFilePath = nil;
if( !self.outputFolderPath || [self.outputFolderPath isKindOfClass:[NSNull class]])
self.outputFolderPath = [@"~/Movies/Flash Video Converted" stringByExpandingTildeInPath];
}
return self;
}
- (void)dealloc
{
[outputFilePath release];
[remoteURLAsString release];
[streamSession release];
[media release];
[super dealloc];
}
@synthesize streamSession;
@synthesize selectedStreamOutput;
@synthesize media;
@synthesize outputFolderPath;
- (void)awakeFromNib
{
[window setShowsResizeIndicator:NO];
[NSApp setDelegate: self];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[VLCLibrary sharedLibrary];
}
- (NSString *)remoteURLAsString
{
return remoteURLAsString;
}
- (void)setRemoteURLAsString:(NSString *)newURLAsString
{
[remoteURLAsString release];
remoteURLAsString = [[newURLAsString copy] retain];
media = [[newURLAsString copy] retain];
[self setMedia:[VLCMedia mediaWithPath:newURLAsString]];
}
+ (NSSet *)keyPathsForValuesAffectingOutputFilePath
{
return [NSSet setWithObjects:@"media.metaDictionary.title", nil];
}
- (void)freezeOutputFilePath
{
[outputFilePath release];
outputFilePath = nil;
outputFilePath = [self outputFilePath];
[outputFilePath retain];
}
- (NSString *)outputFilePath
{
if(outputFilePath)
return [outputFilePath copy];
VLCMedia * aMedia = self.streamSession ? self.streamSession.media ? self.streamSession.media : self.media : self.media;
NSString * name = [[[aMedia metaDictionary] objectForKey:@"title"] lastPathComponent];
NSString * extension = [selectedStreamOutput intValue] == 2 ? @"mpeg" : @"mp4";
NSString * path = [NSString stringWithFormat:@"%@/%@.%@", self.outputFolderPath, name, extension ];
int i;
for( i = 0; [[NSFileManager defaultManager] fileExistsAtPath:path]; i ++)
{
path = [NSString stringWithFormat:@"%@/%@ %d.%@", self.outputFolderPath, name, i, extension ];
if( i > 256 )
{
/* Don't got too far */
/* FIXME: Be nicer with the user and give him a choice for the new name */
NSRunAlertPanelRelativeToWindow(@"File already exists",
[NSString stringWithFormat:
@"File '%@', already exists. The old one will be deleted when the OK button will be pressed", path],
@"OK", nil, nil, window);
break;
}
}
return path;
}
- (IBAction)convert:(id)sender
{
VLCStreamOutput * streamOutput;
[self.streamSession removeObserver:self forKeyPath:@"isComplete"];
self.streamSession = [VLCStreamSession streamSession];
[self freezeOutputFilePath];
if([selectedStreamOutput intValue] == 2)
{
streamOutput = [VLCStreamOutput mpeg2StreamOutputWithFilePath:[self outputFilePath]];
}
else if([selectedStreamOutput intValue] == 1)
{
streamOutput = [VLCStreamOutput mpeg4StreamOutputWithFilePath:[self outputFilePath]];
}
else
streamOutput = [VLCStreamOutput ipodStreamOutputWithFilePath:[self outputFilePath]];
/* Make sure we are exporting to a well known directory */
[[NSFileManager defaultManager] createDirectoryAtPath:self.outputFolderPath attributes:nil];
[self.streamSession setStreamOutput:streamOutput];
[self.streamSession setMedia:self.media];
[self.streamSession startStreaming];
[self.streamSession addObserver:self forKeyPath:@"isComplete" options:NSKeyValueObservingOptionNew context:nil];
/* Show the new view */
[[window contentView] addSubview:workingView];
NSRect frame = [workingView frame];
frame.origin.y -= NSHeight([window contentRectForFrameRect:[window frame]]) + 20.f;
[workingView setFrame:frame];
[[window animator] setFrame:NSMakeRect([window frame].origin.x, [window frame].origin.y-NSHeight([workingView frame]), NSWidth([window frame]), NSHeight([window frame])+NSHeight([workingView frame])) display:YES];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if([keyPath isEqualToString:@"isComplete"])
{
if([self.streamSession isComplete])
{
/* Notify the user */
[[NSSound soundNamed:@"Glass"] play];
/* Set the icon */
[openConvertedFileButton setImage:[[NSWorkspace sharedWorkspace] iconForFile:[self outputFilePath]]];
/* Rename the link with a nicer name */
NSString * oldPath = [self outputFilePath];
[self freezeOutputFilePath];
[[NSFileManager defaultManager] moveItemAtPath:oldPath toPath:[self outputFilePath] error:NULL];
}
return;
}
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
- (IBAction)openConvertedFile:(id)sender
{
[[NSWorkspace sharedWorkspace] openFile:[self outputFilePath]];
}
- (IBAction)pickOutputFolderPath:(id)sender;
{
NSOpenPanel * panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:NO];
[panel beginSheetForDirectory:self.outputFolderPath file:nil types:nil modalForWindow:[sender window] modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
}
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if(returnCode != NSOKButton || ![[panel filenames] count])
return;
self.outputFolderPath = [[panel filenames] objectAtIndex:0];
}
- (IBAction)openConvertedEnclosingFolder:(id)sender
{
[[NSWorkspace sharedWorkspace] selectFile:[self outputFilePath] inFileViewerRootedAtPath:[[self outputFilePath] stringByDeletingLastPathComponent]];
}
- (IBAction)cancel:(id)sender
{
[self.streamSession stop];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>GradientBackgroundView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSImageView</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>convert</key>
<string>id</string>
<key>openConvertedEnclosingFolder</key>
<string>id</string>
<key>openConvertedFile</key>
<string>id</string>
<key>pickOutputFolderPath</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>Controller</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>openConvertedFileButton</key>
<string>NSButton</string>
<key>remoteURLView</key>
<string>NSView</string>
<key>titleView</key>
<string>NSView</string>
<key>window</key>
<string>NSWindow</string>
<key>workingView</key>
<string>NSView</string>
</dict>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../FlashVideoDownloader.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>169</integer>
<integer>940</integer>
<integer>704</integer>
</array>
<key>IBSystem Version</key>
<string>9B18</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
632A105C0D39148A00AFC99B /* VLCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 632A0F710D38F71A00AFC99B /* VLCKit.framework */; };
632A122C0D3947D900AFC99B /* GradientBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 632A122B0D3947D900AFC99B /* GradientBackgroundView.m */; };
6333027B0BD24CDB00193D7D /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 633302790BD24CDB00193D7D /* Controller.m */; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
632A0F700D38F71A00AFC99B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 632A0F680D38F71A00AFC99B /* VLCKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
remoteInfo = VLCKit;
};
632A0F780D38F72F00AFC99B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 632A0F680D38F71A00AFC99B /* VLCKit.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = VLCKit;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32CA4F630368D1EE00C91783 /* FlashVideoDownloader_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlashVideoDownloader_Prefix.pch; sourceTree = "<group>"; };
632A0F680D38F71A00AFC99B /* VLCKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = VLCKit.xcodeproj; path = ../../VLCKit.xcodeproj; sourceTree = SOURCE_ROOT; };
632A122A0D3947D900AFC99B /* GradientBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GradientBackgroundView.h; sourceTree = "<group>"; };
632A122B0D3947D900AFC99B /* GradientBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GradientBackgroundView.m; sourceTree = "<group>"; };
633302780BD24CDB00193D7D /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = "<group>"; };
633302790BD24CDB00193D7D /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = "<group>"; };
636836780D3999E5003A1400 /* Flash Video Downloader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Flash Video Downloader.app"; sourceTree = BUILT_PRODUCTS_DIR; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
632A105C0D39148A00AFC99B /* VLCKit.framework in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
632A122A0D3947D900AFC99B /* GradientBackgroundView.h */,
632A122B0D3947D900AFC99B /* GradientBackgroundView.m */,
633302780BD24CDB00193D7D /* Controller.h */,
633302790BD24CDB00193D7D /* Controller.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
636836780D3999E5003A1400 /* Flash Video Downloader.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* test */ = {
isa = PBXGroup;
children = (
632A0F680D38F71A00AFC99B /* VLCKit.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = test;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* FlashVideoDownloader_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
632A0F690D38F71A00AFC99B /* Products */ = {
isa = PBXGroup;
children = (
632A0F710D38F71A00AFC99B /* VLCKit.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Flash Video Downloader */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Flash Video Downloader" */;
buildPhases = (
636836C00D399CF0003A1400 /* ShellScript */,
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
632A0F790D38F72F00AFC99B /* PBXTargetDependency */,
);
name = "Flash Video Downloader";
productInstallPath = "$(HOME)/Applications";
productName = test;
productReference = 636836780D3999E5003A1400 /* Flash Video Downloader.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FlashVideoDownloader" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* test */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 632A0F690D38F71A00AFC99B /* Products */;
ProjectRef = 632A0F680D38F71A00AFC99B /* VLCKit.xcodeproj */;
},
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Flash Video Downloader */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
632A0F710D38F71A00AFC99B /* VLCKit.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = VLCKit.framework;
remoteRef = 632A0F700D38F71A00AFC99B /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
636836C00D399CF0003A1400 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if test \"$SYMROOT\" == \"$PROJECT_DIR/build\"\nthen\n\tVLCFRAMEWORK=\"$SRCROOT/../../build/$CONFIGURATION/VLCKit.framework\"\nelse\n\tVLCFRAMEWORK=\"$SYMROOT/$CONFIGURATION/VLCKit.framework\"\nfi\nmkdir -p \"$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH\"\n/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks \"$VLCFRAMEWORK\" \"$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH\"";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
6333027B0BD24CDB00193D7D /* Controller.m in Sources */,
632A122C0D3947D900AFC99B /* GradientBackgroundView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
632A0F790D38F72F00AFC99B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = VLCKit;
targetProxy = 632A0F780D38F72F00AFC99B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
isa = PBXVariantGroup;
children = (
29B97319FDCFA39411CA2CEA /* English */,
);
name = MainMenu.nib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../build/Release\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../build/Debug\"";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
OTHER_LDFLAGS = (
"$(LD_FLAGS_LIBINTL)",
"$(LD_FLAGS_LIBVLC)",
"$(LD_FLAGS_LIBVLC_CONTROL)",
);
PRODUCT_NAME = "Flash Video Downloader";
VLC_FRAMEWORK = "$(TARGET_BUILD_DIR)/VLC.framework";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../build/Release\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../build/Debug\"";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
OTHER_LDFLAGS = (
"$(LD_FLAGS_LIBINTL)",
"$(LD_FLAGS_LIBVLC)",
"$(LD_FLAGS_LIBVLC_CONTROL)",
);
PRODUCT_NAME = "Flash Video Downloader";
VLC_FRAMEWORK = "$(TARGET_BUILD_DIR)/VLC.framework";
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Flash Video Downloader" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FlashVideoDownloader" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
//
// Prefix header for all source files of the 'test' target in the 'test' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
//
// GradientBackgroundView.h
// iPodConverter
//
// Created by Pierre d'Herbemont on 1/12/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface GradientBackgroundView : NSImageView {
}
@end
//
// GradientBackgroundView.m
// iPodConverter
//
// Created by Pierre d'Herbemont on 1/12/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "GradientBackgroundView.h"
/**********************************************************
* Why not drawing something nice?
*/
@implementation GradientBackgroundView
- (void)awakeFromNib
{
/* Buggy nib files... Force us to be on the back of the view hierarchy */
NSView * superView;
[self retain];
superView = [self superview];
[self removeFromSuperview];
[superView addSubview:self positioned: NSWindowBelow relativeTo:nil];
}
- (void)drawRect:(NSRect)rect
{
NSColor * topGradient = [NSColor colorWithCalibratedWhite:.12f alpha:1.0];
NSColor * bottomGradient = [NSColor colorWithCalibratedWhite:0.55f alpha:0.9];
NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations:bottomGradient, 0.f, bottomGradient, 0.1f, topGradient, 1.f, nil];
[gradient drawInRect:self.bounds angle:90.0];
[super drawRect:rect];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Flash Video Downloader</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.videolan.flashvideodownloader</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Flash Video Downloader</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
//
// main.m
// test
//
// Created by Pierre d'Herbemont on 13/04/07.
// Copyright __MyCompanyName__ 2007. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <VLCKit/VLCKit.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}
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