diff --git a/Application/AppController.h b/Application/AppController.h index 01dff6879..ba135705c 100644 --- a/Application/AppController.h +++ b/Application/AppController.h @@ -21,6 +21,9 @@ IBOutlet NSPanel *mainWindow; + IBOutlet NSPanel *addURLPanel; + IBOutlet NSTextField *urlField; + IBOutlet NSButton *playButton; IBOutlet NSButton *prevButton; IBOutlet NSButton *nextButton; @@ -54,6 +57,10 @@ BOOL remoteButtonHeld; /* true as long as the user holds the left,right,plus or minus on the remote control */ } +- (IBAction)addURL:(id)sender; +- (IBAction)addURLSheetOK:(id)sender; +- (IBAction)addURLSheetCancel:(id)sender; + - (IBAction)openFiles:(id)sender; - (IBAction)delEntries:(id)sender; - (IBAction)savePlaylist:(id)sender; diff --git a/Application/AppController.m b/Application/AppController.m index 91177bc4a..3add400e0 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -144,6 +144,37 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ // [panel release]; } +- (IBAction)addURL:(id)sender +{ + [NSApp beginSheet:addURLPanel modalForWindow:mainWindow modalDelegate:self didEndSelector:nil contextInfo:nil]; +} + +- (IBAction)addURLSheetOK:(id)sender +{ + NSURL *url = [NSURL URLWithString:[urlField stringValue]]; + + PlaylistEntry *pe = [[PlaylistEntry alloc] init]; + + [pe setURL:url]; + [pe setIndex:[[playlistController arrangedObjects] count]]; + [pe setTitle:[urlField stringValue]]; + + [playlistController addObject:pe]; + + [pe release]; + + [NSApp endSheet:addURLPanel]; + [addURLPanel orderOut:self]; +} + +- (IBAction)addURLSheetCancel:(id)sender +{ + NSLog(@"GONE!"); + [NSApp endSheet:addURLPanel]; + [addURLPanel orderOut:self]; +} + + - (IBAction)delEntries:(id)sender { [playlistController remove:self]; diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 62c25c27d..6a2883b26 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -132,7 +132,7 @@ [self updateTimeField:0.0f]; - [audioPlayer play:[NSURL fileURLWithPath:[pe filename]] withUserInfo:pe]; + [audioPlayer play:[pe url] withUserInfo:pe]; [audioPlayer setVolume:currentVolume]; if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) { @@ -300,8 +300,8 @@ [player setNextStream:nil]; else { - DBLog(@"NEXT SONG: %@", [pe filename]); - [player setNextStream:[NSURL fileURLWithPath:[pe filename]] withUserInfo:pe]; + DBLog(@"NEXT SONG: %@", [pe url]); + [player setNextStream:[pe url] withUserInfo:pe]; } } diff --git a/Audio/AudioDecoder.h b/Audio/AudioDecoder.h index db6c65595..366233702 100644 --- a/Audio/AudioDecoder.h +++ b/Audio/AudioDecoder.h @@ -8,11 +8,11 @@ #import -#import "PluginController.h" +#import "Plugin.h" @interface AudioDecoder : NSObject { } -+ audioDecoderForURL:(NSURL *)url; ++ (id)audioDecoderForURL:(NSURL *)url; @end diff --git a/Audio/AudioDecoder.m b/Audio/AudioDecoder.m index 7b653b67f..5b106eb1b 100644 --- a/Audio/AudioDecoder.m +++ b/Audio/AudioDecoder.m @@ -8,10 +8,11 @@ #import "AudioDecoder.h" +#import "PluginController.h" @implementation AudioDecoder -+ audioDecoderForURL:(NSURL *)url ++ (id) audioDecoderForURL:(NSURL *)url { NSString *ext = [[url path] pathExtension]; diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index 66a41954b..a799c5360 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -10,7 +10,7 @@ #import "BufferChain.h" #import "OutputNode.h" #import "Status.h" - +#import "PluginController.h" @implementation AudioPlayer diff --git a/Audio/AudioPropertiesReader.m b/Audio/AudioPropertiesReader.m index 056a37c1f..604815fb9 100644 --- a/Audio/AudioPropertiesReader.m +++ b/Audio/AudioPropertiesReader.m @@ -7,6 +7,8 @@ // #import "AudioPropertiesReader.h" +#import "AudioSource.h" +#import "Plugin.h" #import "PluginController.h" @implementation AudioPropertiesReader @@ -15,11 +17,19 @@ { NSString *ext = [[url path] pathExtension]; + id source = [AudioSource audioSourceForURL:url]; + if (![source open:url]) + return nil; + NSDictionary *propertiesReaders = [[PluginController sharedPluginController] propertiesReaders]; Class propertiesReader = NSClassFromString([propertiesReaders objectForKey:ext]); - return [[[[propertiesReader alloc] init] autorelease] propertiesForURL:url]; + NSDictionary *properties = [propertiesReader propertiesForSource:source]; + + [source close]; + + return properties; } diff --git a/Plugins/MonkeysAudio/MonkeysAudioCodec.h b/Audio/AudioSource.h similarity index 52% rename from Plugins/MonkeysAudio/MonkeysAudioCodec.h rename to Audio/AudioSource.h index e223130f8..aeb1758ec 100644 --- a/Plugins/MonkeysAudio/MonkeysAudioCodec.h +++ b/Audio/AudioSource.h @@ -1,17 +1,18 @@ // -// MusepackCodec.h -// Musepack +// AudioDecoder.h +// CogAudio // // Created by Vincent Spader on 2/21/07. // Copyright 2007 __MyCompanyName__. All rights reserved. // #import -#import "Plugin.h" -@interface MonkeysAudioCodec : NSObject -{ +#import "PluginController.h" +@interface AudioSource : NSObject { } ++ audioSourceForURL:(NSURL *)url; + @end diff --git a/Audio/AudioSource.m b/Audio/AudioSource.m new file mode 100644 index 000000000..b6db2edc5 --- /dev/null +++ b/Audio/AudioSource.m @@ -0,0 +1,25 @@ +// +// AudioDecoder.m +// CogAudio +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "AudioSource.h" + + +@implementation AudioSource + ++ audioSourceForURL:(NSURL *)url +{ + NSString *scheme = [url scheme]; + + NSDictionary *sources = [[PluginController sharedPluginController] sources]; + + Class source = NSClassFromString([sources objectForKey:scheme]); + + return [[[source alloc] init] autorelease]; +} + +@end diff --git a/Audio/Chain/BufferChain.h b/Audio/Chain/BufferChain.h index 318651f8f..86b23646e 100644 --- a/Audio/Chain/BufferChain.h +++ b/Audio/Chain/BufferChain.h @@ -10,9 +10,12 @@ #import "InputNode.h" #import "ConverterNode.h" +#import "sourceNode.h" + #import "AudioPlayer.h" @interface BufferChain : NSObject { + SourceNode *sourceNode; InputNode *inputNode; ConverterNode *converterNode; @@ -37,6 +40,7 @@ - (void)setUserInfo:(id)i; - (NSURL *)streamURL; +- (void)setStreamURL:(NSURL *)url; - (void)setShouldContinue:(BOOL)s; diff --git a/Audio/Chain/BufferChain.m b/Audio/Chain/BufferChain.m index 28c64bc3c..70a009adb 100644 --- a/Audio/Chain/BufferChain.m +++ b/Audio/Chain/BufferChain.m @@ -8,6 +8,8 @@ #import "BufferChain.h" #import "OutputNode.h" +#import "SourceNode.h" +#import "AudioSource.h" #import "CoreAudioUtils.h" @implementation BufferChain @@ -20,6 +22,8 @@ controller = c; streamURL = nil; userInfo = nil; + + sourceNode = nil; inputNode = nil; converterNode = nil; } @@ -29,6 +33,7 @@ - (void)buildChain { + [sourceNode release]; //Source node is allocated on open.. [inputNode release]; [converterNode release]; @@ -40,12 +45,32 @@ - (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat { - [url retain]; - [streamURL release]; - streamURL = url; - + [self setStreamURL:url]; + [self buildChain]; - if (![inputNode open:url]) + + id source = [AudioSource audioSourceForURL:url]; + if ([source buffered]) { + sourceNode = [[SourceNode alloc] initWithSource:source]; + source = sourceNode; + } + else { + sourceNode = nil; + } + + if (![source open:url]) + { + NSLog(@"Couldn't open source..."); + return NO; + } + + if (sourceNode) { //If the source is buffered.. + DBLog(@"LAUNCHING THREAD FOR SOURCE"); + [sourceNode launchThread]; + } + + + if (![inputNode openURL:url withSource:source]) return NO; AudioStreamBasicDescription inputFormat; @@ -128,6 +153,14 @@ return streamURL; } +- (void)setStreamURL:(NSURL *)url +{ + [url retain]; + [streamURL release]; + + streamURL = url; +} + - (void)setShouldContinue:(BOOL)s { [inputNode setShouldContinue:s]; diff --git a/Audio/Chain/InputNode.h b/Audio/Chain/InputNode.h index f0d728961..1fd76690e 100644 --- a/Audio/Chain/InputNode.h +++ b/Audio/Chain/InputNode.h @@ -23,7 +23,7 @@ double seekTime; } -- (BOOL)open:(NSURL *)url; +- (BOOL)openURL:(NSURL *)url withSource:(id)source; - (void)process; - (NSDictionary *) properties; - (void)seek:(double)time; diff --git a/Audio/Chain/InputNode.m b/Audio/Chain/InputNode.m index 8a6dd05a4..1f753d06d 100644 --- a/Audio/Chain/InputNode.m +++ b/Audio/Chain/InputNode.m @@ -8,10 +8,11 @@ #import "InputNode.h" #import "BufferChain.h" +#import "Plugin.h" @implementation InputNode -- (BOOL)open:(NSURL *)url +- (BOOL)openURL:(NSURL *)url withSource:(id)source { NSLog(@"Opening: %@", url); decoder = [AudioDecoder audioDecoderForURL:url]; @@ -21,8 +22,11 @@ if (decoder == nil) return NO; - if (![decoder open:url]) + if (![decoder open:source]) + { + NSLog(@"Couldn't open decoder..."); return NO; + } /* while (decoder == nil) { @@ -37,6 +41,7 @@ shouldContinue = YES; shouldSeek = NO; + NSLog(@"OPENED"); return YES; } diff --git a/Audio/Chain/SourceNode.h b/Audio/Chain/SourceNode.h new file mode 100644 index 000000000..4dcb053e7 --- /dev/null +++ b/Audio/Chain/SourceNode.h @@ -0,0 +1,40 @@ +// +// InputNode.h +// Cog +// +// Created by Vincent Spader on 8/2/05. +// Copyright 2005 Vincent Spader. All rights reserved. +// + +#import + +#import "Node.h" +#import "Plugin.h" + +@interface SourceNode : Node +{ + id source; + + long byteCount; +} + +- (id)initWithSource:(id)source; + +- (void)process; + + +//Same interface as the CogSource protocol +- (BOOL)open:(NSURL *)url; + +- (int)read:(void *)buf amount:(int)amount; + +- (BOOL)seekable; +- (BOOL)seek:(long)offset whence:(int)whence; + +- (long)tell; + +- (void)close; + +- (NSDictionary *) properties; +//End of protocol interface +@end diff --git a/Audio/Chain/SourceNode.m b/Audio/Chain/SourceNode.m new file mode 100644 index 000000000..f7f4fc0f3 --- /dev/null +++ b/Audio/Chain/SourceNode.m @@ -0,0 +1,122 @@ +// +// InputNode.m +// Cog +// +// Created by Vincent Spader on 8/2/05. +// Copyright 2005 Vincent Spader. All rights reserved. +// + +#import "SourceNode.h" + +@implementation SourceNode + +- (id)initWithSource:(id)s +{ + self = [super initWithController:nil previous:self]; + if (self) + { + source = [s retain]; + } + return self; +} + +- (void)process +{ + const int chunk_size = CHUNK_SIZE; + char *buf; + int amountRead; + + buf = malloc(chunk_size); + + while ([self shouldContinue] == YES) + { + NSLog(@"PROCESSING!!!"); + amountRead = [source read:buf amount: chunk_size]; + if (amountRead <= 0) + { + endOfStream = YES; + NSLog(@"END OF SOURCE WAS REACHED"); + break; //eof + } + [self writeData:buf amount:amountRead]; + } + + free(buf); + [source close]; + + NSLog(@"CLOSED: %i", self); +} + +- (BOOL)open:(NSURL *)url +{ + shouldContinue = YES; + endOfStream = NO; + + byteCount = 0; + + return [source open:url]; +} + + +- (int)read:(void *)buf amount:(int)amount +{ + int l; + do { + l = [self readData:buf amount:amount]; + if (l > 0) + byteCount += l; + } while (l == 0 && endOfStream == NO); + + NSLog(@"READ: %i", l); + return l; +} + +//Buffered streams are never seekable. +- (BOOL)seekable +{ + return NO; +} + +- (BOOL)seek:(long)offset whence:(int)whence +{ + return NO; +} + +- (long)tell +{ + return byteCount; +} + +- (void)close +{ + NSLog(@"CLOSING"); + shouldContinue = NO; + + [source close]; +} + +- (void)dealloc +{ + [source release]; + + [super dealloc]; +} + +- (NSDictionary *) properties +{ + return [source properties]; +} + +//Shouldnt be used. Required for protocol +- (BOOL)buffered +{ + return YES; +} + ++ (NSArray *) schemes +{ + return nil; +} +//end of shouldnt be used + +@end diff --git a/Audio/CogAudio.xcodeproj/project.pbxproj b/Audio/CogAudio.xcodeproj/project.pbxproj index ec6306dbc..926529467 100644 --- a/Audio/CogAudio.xcodeproj/project.pbxproj +++ b/Audio/CogAudio.xcodeproj/project.pbxproj @@ -9,6 +9,10 @@ /* Begin PBXBuildFile section */ 17A2D3C50B8D1D37000778C4 /* AudioDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 17A2D3C30B8D1D37000778C4 /* AudioDecoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17A2D3C60B8D1D37000778C4 /* AudioDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17A2D3C40B8D1D37000778C4 /* AudioDecoder.m */; }; + 17ADB13C0B97926D00257CA2 /* AudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 17ADB13A0B97926D00257CA2 /* AudioSource.h */; }; + 17ADB13D0B97926D00257CA2 /* AudioSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB13B0B97926D00257CA2 /* AudioSource.m */; }; + 17ADB1410B97927C00257CA2 /* SourceNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 17ADB13F0B97927C00257CA2 /* SourceNode.h */; }; + 17ADB1420B97927C00257CA2 /* SourceNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB1400B97927C00257CA2 /* SourceNode.m */; }; 17B619300B909BC300BC003F /* AudioPropertiesReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B6192E0B909BC300BC003F /* AudioPropertiesReader.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17B619310B909BC300BC003F /* AudioPropertiesReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B6192F0B909BC300BC003F /* AudioPropertiesReader.m */; }; 17C940230B900909008627D6 /* AudioMetadataReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C940210B900909008627D6 /* AudioMetadataReader.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -64,6 +68,10 @@ 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 17A2D3C30B8D1D37000778C4 /* AudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDecoder.h; sourceTree = ""; }; 17A2D3C40B8D1D37000778C4 /* AudioDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioDecoder.m; sourceTree = ""; }; + 17ADB13A0B97926D00257CA2 /* AudioSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioSource.h; sourceTree = ""; }; + 17ADB13B0B97926D00257CA2 /* AudioSource.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AudioSource.m; sourceTree = ""; }; + 17ADB13F0B97927C00257CA2 /* SourceNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SourceNode.h; sourceTree = ""; }; + 17ADB1400B97927C00257CA2 /* SourceNode.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SourceNode.m; sourceTree = ""; }; 17B6192E0B909BC300BC003F /* AudioPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioPropertiesReader.h; sourceTree = ""; }; 17B6192F0B909BC300BC003F /* AudioPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AudioPropertiesReader.m; sourceTree = ""; }; 17C940210B900909008627D6 /* AudioMetadataReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioMetadataReader.h; sourceTree = ""; }; @@ -169,6 +177,8 @@ 17C940220B900909008627D6 /* AudioMetadataReader.m */, 17B6192E0B909BC300BC003F /* AudioPropertiesReader.h */, 17B6192F0B909BC300BC003F /* AudioPropertiesReader.m */, + 17ADB13A0B97926D00257CA2 /* AudioSource.h */, + 17ADB13B0B97926D00257CA2 /* AudioSource.m */, 17F94DD30B8D0F7000A34E87 /* PluginController.h */, 17F94DD40B8D0F7000A34E87 /* PluginController.m */, 17D21C750B8BE4BA00D1EBDE /* Chain */, @@ -205,6 +215,8 @@ 17D21C750B8BE4BA00D1EBDE /* Chain */ = { isa = PBXGroup; children = ( + 17ADB13F0B97927C00257CA2 /* SourceNode.h */, + 17ADB1400B97927C00257CA2 /* SourceNode.m */, 17D21C760B8BE4BA00D1EBDE /* BufferChain.h */, 17D21C770B8BE4BA00D1EBDE /* BufferChain.m */, 17D21C780B8BE4BA00D1EBDE /* ConverterNode.h */, @@ -298,6 +310,8 @@ 17A2D3C50B8D1D37000778C4 /* AudioDecoder.h in Headers */, 17C940230B900909008627D6 /* AudioMetadataReader.h in Headers */, 17B619300B909BC300BC003F /* AudioPropertiesReader.h in Headers */, + 17ADB13C0B97926D00257CA2 /* AudioSource.h in Headers */, + 17ADB1410B97927C00257CA2 /* SourceNode.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -370,6 +384,8 @@ 17A2D3C60B8D1D37000778C4 /* AudioDecoder.m in Sources */, 17C940240B900909008627D6 /* AudioMetadataReader.m in Sources */, 17B619310B909BC300BC003F /* AudioPropertiesReader.m in Sources */, + 17ADB13D0B97926D00257CA2 /* AudioSource.m in Sources */, + 17ADB1420B97927C00257CA2 /* SourceNode.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -382,29 +398,7 @@ COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_5)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_6)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_7)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_8)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_9)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_10)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../FLAC/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_10 = "\"$(SRCROOT)/../WavPack/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../ID3Tag/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_3 = "\"$(SRCROOT)/../MAC/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_4 = "\"$(SRCROOT)/../MAD/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_5 = "\"$(SRCROOT)/../MPCDec/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_6 = "\"$(SRCROOT)/../Ogg/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_7 = "\"$(SRCROOT)/../Shorten/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_8 = "\"$(SRCROOT)/../TagLib/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_9 = "\"$(SRCROOT)/../Vorbis/build/Release\""; + FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -431,29 +425,7 @@ ); DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_5)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_6)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_7)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_8)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_9)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_10)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../FLAC/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_10 = "\"$(SRCROOT)/../WavPack/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../ID3Tag/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_3 = "\"$(SRCROOT)/../MAC/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_4 = "\"$(SRCROOT)/../MAD/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_5 = "\"$(SRCROOT)/../MPCDec/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_6 = "\"$(SRCROOT)/../Ogg/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_7 = "\"$(SRCROOT)/../Shorten/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_8 = "\"$(SRCROOT)/../TagLib/build/Release\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_9 = "\"$(SRCROOT)/../Vorbis/build/Release\""; + FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; diff --git a/Audio/Plugin.h b/Audio/Plugin.h index 32d770f05..a92bf5fbc 100644 --- a/Audio/Plugin.h +++ b/Audio/Plugin.h @@ -1,35 +1,53 @@ -typedef enum -{ - kCogPluginCodec = 1, - kCogPluginGeneral -} PluginType; +/* + Are defines really appropriate for this? + We want something easily insertable into a dictionary. + Maybe should extern these, and shove the instances in PluginController.m, but will that cause linking problems? +*/ -@protocol CogPlugin -- (PluginType)pluginType; +#define kCogSource @"CogSource" +#define kCogDecoder @"CogDecoder" +#define kCogMetadataReader @"CogMetadataReader" +#define kCogPropertiesReader @"CogPropertiesReader" + +@protocol CogPlugin +//Dictionary containing classname/plugintype pairs. ex: @"VorbisDecoder": kCogDecoder, @"VorbisPropertiesRaeder": kCogPropertiesReader ++ (NSDictionary *)pluginInfo; @end -@protocol CogCodecPlugin -- (Class)decoder; -- (Class)metadataReader; -- (Class)propertiesReader; -@end +@protocol CogSource ++ (NSArray *)schemes; //http, file, etc -@protocol CogDecoder -+ (NSArray *)fileTypes; +- (BOOL)buffered; //Return YES if the input should be buffered, NO if it shouldn't. Used for remote connections (HTTP), not local stuff (file). - (BOOL)open:(NSURL *)url; +- (NSDictionary *)properties; //Perhaps contains header info for HTTP stream, or path for a regular file. +- (BOOL)seekable; +- (BOOL)seek:(long)position whence:(int)whence; +- (long)tell; +- (int)read:(void *)buffer amount:(int)amount; //reads UP TO amount, returns amount read. +- (void)close; +@end + +@protocol CogDecoder ++ (NSArray *)fileTypes; //mp3, ogg, etc + +- (BOOL)open:(id)source; - (NSDictionary *)properties; -- (double)seekToTime:(double)time; +- (BOOL)seekable; +- (double)seekToTime:(double)time; //time is in milleseconds, should return the time actually seeked to. - (int)fillBuffer:(void *)buf ofSize:(UInt32)size; - (void)close; @end -@protocol CogMetadataReader +@protocol CogMetadataReader + (NSArray *)fileTypes; ++ (NSDictionary *)metadataForURL; @end -@protocol CogPropertiesReader +@protocol CogPropertiesReader + (NSArray *)fileTypes; ++ (NSDictionary *)propertiesForSource:(id)source; @end + diff --git a/Audio/PluginController.h b/Audio/PluginController.h index 5f6982fd6..456484347 100644 --- a/Audio/PluginController.h +++ b/Audio/PluginController.h @@ -5,8 +5,7 @@ //Singleton @interface PluginController : NSObject { - NSMutableArray *codecPlugins; - + NSMutableDictionary *sources; NSMutableDictionary *decoders; NSMutableDictionary *metadataReaders; NSMutableDictionary *propertiesReaders; @@ -15,12 +14,17 @@ + (PluginController *)sharedPluginController; //Use this to get the instance. - (void)setup; - -- (void)loadPlugins; -- (void)setupPlugins; - - (void)printPluginInfo; +- (void)loadPlugins; +- (void)loadPluginsAtPath:(NSString *)path; + +- (void)setupSource:(NSString *)className; +- (void)setupDecoder:(NSString *)className; +- (void)setupMetadataReader:(NSString *)className; +- (void)setupPropertiesReader:(NSString *)className; + +- (NSDictionary *)sources; - (NSDictionary *)decoders; - (NSDictionary *)metadataReaders; - (NSDictionary *)propertiesReaders; diff --git a/Audio/PluginController.m b/Audio/PluginController.m index 23166003c..0ff34f86a 100644 --- a/Audio/PluginController.m +++ b/Audio/PluginController.m @@ -58,8 +58,7 @@ static PluginController *sharedPluginController = nil; - (id)init { self = [super init]; if (self) { - codecPlugins = [[NSMutableArray alloc] init]; - + sources = [[NSMutableDictionary alloc] init]; decoders = [[NSMutableDictionary alloc] init]; metadataReaders = [[NSMutableDictionary alloc] init]; propertiesReaders = [[NSMutableDictionary alloc] init]; @@ -73,7 +72,6 @@ static PluginController *sharedPluginController = nil; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [self loadPlugins]; - [self setupPlugins]; [self printPluginInfo]; [pool release]; @@ -99,20 +97,36 @@ static PluginController *sharedPluginController = nil; if (b) { NSLog(@"Loaded bundle: %@", b); - id plugin = [[[b principalClass] alloc] init]; + Class plugin = [b principalClass]; NSLog(@"Candidate: %@", plugin); - if ([plugin respondsToSelector:@selector(pluginType)]) + if ([plugin respondsToSelector:@selector(pluginInfo)]) { - NSLog(@"Responds to selector"); - switch([plugin pluginType]) - { - case kCogPluginCodec: //Only type currently - NSLog(@"Its a codec"); - [codecPlugins addObject:plugin]; - break; - default: - NSLog(@"Unknown plugin type"); - break; + NSLog(@"Responds to selector..."); + //PluginInfo is a dictionary that contains keys/values like pluginClass,classType...ex: VorbisDecoder, Decoder + NSDictionary *pluginInfo = [plugin pluginInfo]; + NSEnumerator *e = [pluginInfo keyEnumerator]; + id className; + while (className = [e nextObject]) { + id pluginType = [pluginInfo objectForKey:className]; + if ([pluginType isEqualToString:kCogDecoder]) { + NSLog(@"DECODER"); + [self setupDecoder:className]; + } + else if ([pluginType isEqualToString:kCogMetadataReader]) { + NSLog(@"Metadata"); + [self setupMetadataReader:className]; + } + else if ([pluginType isEqualToString:kCogPropertiesReader]) { + NSLog(@"Properties"); + [self setupPropertiesReader:className]; + } + else if ([pluginType isEqualToString:kCogSource]) { + NSLog(@"Source"); + [self setupSource:className]; + } + else { + NSLog(@"Unknown plugin type!!"); + } } } } @@ -126,55 +140,69 @@ static PluginController *sharedPluginController = nil; [self loadPluginsAtPath:[@"~/Library/Application Support/Cog/Plugins" stringByExpandingTildeInPath]]; } -- (void)setupInputPlugins +- (void)setupDecoder:(NSString *)className { - NSEnumerator *pluginsEnum = [codecPlugins objectEnumerator]; - id plugin; - while (plugin = [pluginsEnum nextObject]) - { - Class decoder = [plugin decoder]; - Class metadataReader = [plugin metadataReader]; - Class propertiesReader = [plugin propertiesReader]; - - if (decoder) { - NSEnumerator *fileTypesEnum = [[decoder fileTypes] objectEnumerator]; - id fileType; - NSString *classString = NSStringFromClass(decoder); - while (fileType = [fileTypesEnum nextObject]) - { - [decoders setObject:classString forKey:fileType]; - } - } - - if (metadataReader) { - NSEnumerator *fileTypesEnum = [[metadataReader fileTypes] objectEnumerator]; - id fileType; - NSString *classString = NSStringFromClass(metadataReader); - while (fileType = [fileTypesEnum nextObject]) - { - [metadataReaders setObject:classString forKey:fileType]; - } - } - - if (propertiesReader) { - NSEnumerator *fileTypesEnum = [[propertiesReader fileTypes] objectEnumerator]; - id fileType; - NSString *classString = NSStringFromClass(propertiesReader); - while (fileType = [fileTypesEnum nextObject]) - { - [propertiesReaders setObject:classString forKey:fileType]; - } + Class decoder = NSClassFromString(className); + if (decoder && [decoder respondsToSelector:@selector(fileTypes)]) { + NSEnumerator *fileTypesEnum = [[decoder fileTypes] objectEnumerator]; + id fileType; + while (fileType = [fileTypesEnum nextObject]) + { + [decoders setObject:className forKey:fileType]; } } } -- (void)setupPlugins { - [self setupInputPlugins]; +- (void)setupMetadataReader:(NSString *)className +{ + Class metadataReader = NSClassFromString(className); + if (metadataReader && [metadataReader respondsToSelector:@selector(fileTypes)]) { + NSEnumerator *fileTypesEnum = [[metadataReader fileTypes] objectEnumerator]; + id fileType; + while (fileType = [fileTypesEnum nextObject]) + { + [metadataReaders setObject:className forKey:fileType]; + } + } +} + +- (void)setupPropertiesReader:(NSString *)className +{ + Class propertiesReader = NSClassFromString(className); + if (propertiesReader && [propertiesReader respondsToSelector:@selector(fileTypes)]) { + NSEnumerator *fileTypesEnum = [[propertiesReader fileTypes] objectEnumerator]; + id fileType; + while (fileType = [fileTypesEnum nextObject]) + { + [propertiesReaders setObject:className forKey:fileType]; + } + } +} + +- (void)setupSource:(NSString *)className +{ + Class source = NSClassFromString(className); + if (source && [source respondsToSelector:@selector(schemes)]) { + NSEnumerator *schemeEnum = [[source schemes] objectEnumerator]; + id scheme; + while (scheme = [schemeEnum nextObject]) + { + [sources setObject:className forKey:scheme]; + } + } } - (void)printPluginInfo { - NSLog(@"Codecs: %@\n\n", codecPlugins); + NSLog(@"Sources: %@", sources); + NSLog(@"Decoders: %@", decoders); + NSLog(@"Metadata Readers: %@", metadataReaders); + NSLog(@"Properties Readers: %@", propertiesReaders); +} + +- (NSDictionary *)sources +{ + return sources; } - (NSDictionary *)decoders @@ -182,15 +210,18 @@ static PluginController *sharedPluginController = nil; return decoders; } +- (NSDictionary *)propertiesReaders +{ + return propertiesReaders; +} + - (NSDictionary *)metadataReaders { return metadataReaders; } -- (NSDictionary *)propertiesReaders -{ - return propertiesReaders; -} + + @end diff --git a/AudioScrobbler/AudioScrobbler.m b/AudioScrobbler/AudioScrobbler.m index a3c4e52ea..a76a0e7ce 100644 --- a/AudioScrobbler/AudioScrobbler.m +++ b/AudioScrobbler/AudioScrobbler.m @@ -105,7 +105,7 @@ escapeForLastFM(NSString *string) escapeForLastFM([pe album]), @"", // TODO: MusicBrainz support (int)([pe length]/1000.0), - escapeForLastFM([pe filename]) + escapeForLastFM([[pe url] path]) ]]; } diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index 874b9118e..92eba302e 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -62,6 +62,8 @@ 177FD1090B90CB5F0011C3B5 /* MAD.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FD01B0B90CAC60011C3B5 /* MAD.bundle */; }; 177FD10A0B90CB5F0011C3B5 /* Flac.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FD0170B90CABF0011C3B5 /* Flac.bundle */; }; 177FD10B0B90CB5F0011C3B5 /* CoreAudio.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FD0130B90CAB50011C3B5 /* CoreAudio.bundle */; }; + 17ADB4580B979C7C00257CA2 /* FileSource.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB4450B979C5700257CA2 /* FileSource.bundle */; }; + 17ADB6650B97A97100257CA2 /* HTTPSource.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB65C0B97A96400257CA2 /* HTTPSource.bundle */; }; 17B61B5E0B90A27F00BC003F /* CogAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17B61B5D0B90A27F00BC003F /* CogAudio.framework */; }; 17B61B630B90A28100BC003F /* CogAudio.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17B61B5D0B90A27F00BC003F /* CogAudio.framework */; }; 17BB5CED0B8A86010009ACB1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */; }; @@ -113,6 +115,8 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( + 17ADB6650B97A97100257CA2 /* HTTPSource.bundle in CopyFiles */, + 17ADB4580B979C7C00257CA2 /* FileSource.bundle in CopyFiles */, 177FD1030B90CB5F0011C3B5 /* WavPack.bundle in CopyFiles */, 177FD1040B90CB5F0011C3B5 /* Vorbis.bundle in CopyFiles */, 177FD1050B90CB5F0011C3B5 /* TagLib.bundle in CopyFiles */, @@ -219,6 +223,8 @@ 177FD02B0B90CAE50011C3B5 /* TagLib.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = TagLib.bundle; path = Plugins/TagLib/build/Release/TagLib.bundle; sourceTree = ""; }; 177FD02F0B90CAEC0011C3B5 /* Vorbis.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Vorbis.bundle; path = Plugins/Vorbis/build/Release/Vorbis.bundle; sourceTree = ""; }; 177FD0330B90CAF40011C3B5 /* WavPack.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = WavPack.bundle; path = Plugins/WavPack/build/Release/WavPack.bundle; sourceTree = ""; }; + 17ADB4450B979C5700257CA2 /* FileSource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = FileSource.bundle; path = Plugins/FileSource/build/Release/FileSource.bundle; sourceTree = ""; }; + 17ADB65C0B97A96400257CA2 /* HTTPSource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = HTTPSource.bundle; path = Plugins/HTTPSource/build/Release/HTTPSource.bundle; sourceTree = ""; }; 17B61B5D0B90A27F00BC003F /* CogAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CogAudio.framework; path = Audio/build/Release/CogAudio.framework; sourceTree = ""; }; 17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; @@ -495,6 +501,8 @@ 17B619FF0B909ED400BC003F /* PlugIns */ = { isa = PBXGroup; children = ( + 17ADB65C0B97A96400257CA2 /* HTTPSource.bundle */, + 17ADB4450B979C5700257CA2 /* FileSource.bundle */, 177FD0330B90CAF40011C3B5 /* WavPack.bundle */, 177FD02F0B90CAEC0011C3B5 /* Vorbis.bundle */, 177FD02B0B90CAE50011C3B5 /* TagLib.bundle */, diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib index d576a7eba..2da70b08c 100644 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -14,6 +14,9 @@ }, { ACTIONS = { + addURL = id; + addURLSheetCancel = id; + addURLSheetOK = id; delEntries = id; donate = id; loadPlaylist = id; @@ -26,6 +29,7 @@ CLASS = AppController; LANGUAGE = ObjC; OUTLETS = { + addURLPanel = NSPanel; fileButton = NSButton; fileDrawer = NSDrawer; fileOutlineView = FileOutlineView; @@ -49,6 +53,7 @@ showTrackColumn = NSMenuItem; showYearColumn = NSMenuItem; shuffleButton = NSButton; + urlField = NSTextField; }; SUPERCLASS = NSObject; }, diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index 6ebc0d048..5f7d182dd 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -32,11 +32,12 @@ 4 IBOpenObjects - 513 463 1156 - 29 + 1307 + 513 21 + 29 IBSystem Version 8L2127 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 2a3f6a981..3f1ae5788 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 4119e7d3e..27c993ffc 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -122,7 +122,7 @@ { PlaylistEntry *pe = [[PlaylistEntry alloc] init]; - [pe setFilename:[sortedFiles objectAtIndex:i]]; + [pe setURL:[NSURL fileURLWithPath:[sortedFiles objectAtIndex:i]]]; [pe setIndex:index+i]; [pe setTitle:[[sortedFiles objectAtIndex:i] lastPathComponent]]; // [pe performSelectorOnMainThread:@selector(readTags) withObject:nil waitUntilDone:NO]; @@ -365,7 +365,7 @@ - (IBAction)sortByPath:(id)sender { - NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"filename" ascending:YES selector:@selector(compare:)]; + NSSortDescriptor *s = [[NSSortDescriptor alloc] initWithKey:@"url" ascending:YES selector:@selector(compare:)]; [self setSortDescriptors:[NSArray arrayWithObject:s]]; [self rearrangeObjects]; @@ -621,7 +621,7 @@ BOOL found = NO; for (i = 1; i < [shuffleList count]; i++) { - if (found == NO && [[shuffleList objectAtIndex:i] filename] == [currentEntry filename]) + if (found == NO && [[shuffleList objectAtIndex:i] url] == [currentEntry url]) { found = YES; [shuffleList removeObjectAtIndex:i]; @@ -696,7 +696,7 @@ enumerator = [[self content] objectEnumerator]; while (entry = [enumerator nextObject]) { - [filenames addObject:[entry filename]]; + [filenames addObject:[[entry url] path]]; } fileContents = [filenames componentsJoinedByString:@"\n"]; @@ -741,7 +741,7 @@ return; PlaylistEntry* curr = [self entryAtIndex:[self selectionIndex]]; - [ws selectFile:[curr filename] inFileViewerRootedAtPath:[curr filename]]; + [ws selectFile:[[curr url] path] inFileViewerRootedAtPath:[[curr url] path]]; } - (void)handlePlaylistViewHeaderNotification:(NSNotification*)notif diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 5c5556dba..c16bd8983 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -9,7 +9,7 @@ #import @interface PlaylistEntry : NSObject { - NSString *filename; + NSURL *url; NSString *artist; NSString *album; @@ -40,8 +40,8 @@ -(void)setShuffleIndex:(int)si; -(int)shuffleIndex; --(void)setFilename:(NSString *)f; --(NSString *)filename; +-(void)setURL:(NSURL *)u; +-(NSURL *)url; -(void)setCurrent:(BOOL) b; -(BOOL)current; diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 1d0413b42..fc889c600 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -18,7 +18,7 @@ if (self) { [self setIndex:0]; - [self setFilename:@""]; + [self setURL:nil]; } return self; @@ -26,7 +26,7 @@ - (void)dealloc { - [filename release]; + [url release]; [super dealloc]; } @@ -62,16 +62,16 @@ return displayIdx; } --(void)setFilename:(NSString *)f +-(void)setURL:(NSURL *)u { - f = [f copy]; - [filename release]; - filename = f; + [u retain]; + [url release]; + url = u; } --(NSString *)filename +-(NSURL *)url { - return filename; + return url; } -(void)setCurrent:(BOOL) b @@ -177,7 +177,7 @@ - (void)readInfoThreaded { - NSDictionary *properties = [AudioPropertiesReader propertiesForURL:[NSURL fileURLWithPath:filename]]; + NSDictionary *properties = [AudioPropertiesReader propertiesForURL:url]; [self performSelectorOnMainThread:@selector(readInfoThreadedSetVariables:) withObject:properties waitUntilDone:YES]; } @@ -245,7 +245,7 @@ NSString *ti = [m objectForKey:@"title"]; if ([ti isEqualToString:@""]) { - [self setTitle:[filename lastPathComponent]]; + [self setTitle:[[url path] lastPathComponent]]; } else { [self setTitle:[m objectForKey:@"title"]]; @@ -260,7 +260,7 @@ - (void)readTagsThreaded { - NSDictionary *metadata = [AudioMetadataReader metadataForURL:[NSURL fileURLWithPath:filename]]; + NSDictionary *metadata = [AudioMetadataReader metadataForURL:url]; [self performSelectorOnMainThread:@selector(readTagsThreadedSetVariables:) withObject:metadata waitUntilDone:YES]; @@ -268,7 +268,7 @@ - (NSString *)description { - return [NSString stringWithFormat:@"PlaylistEntry %i:(%@)",idx, filename]; + return [NSString stringWithFormat:@"PlaylistEntry %i:(%@)",idx, url]; } @end diff --git a/Plugins/CoreAudio/CoreAudio.xcodeproj/project.pbxproj b/Plugins/CoreAudio/CoreAudio.xcodeproj/project.pbxproj index 5833d3914..f9c1c15b7 100644 --- a/Plugins/CoreAudio/CoreAudio.xcodeproj/project.pbxproj +++ b/Plugins/CoreAudio/CoreAudio.xcodeproj/project.pbxproj @@ -8,10 +8,10 @@ /* Begin PBXBuildFile section */ 1745C21A0B90B7F800A6768C /* CoreAudioPropertiesReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1745C2190B90B7F800A6768C /* CoreAudioPropertiesReader.m */; }; + 17ADB19A0B97937600257CA2 /* CoreAudioPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB1990B97937600257CA2 /* CoreAudioPlugin.m */; }; 17C93E740B8FF192008627D6 /* CoreAudioDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93E730B8FF192008627D6 /* CoreAudioDecoder.m */; }; 17C93EAC0B8FF3CE008627D6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17C93EAB0B8FF3CE008627D6 /* CoreAudio.framework */; }; 17C93EB30B8FF3E1008627D6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17C93EB20B8FF3E1008627D6 /* AudioToolbox.framework */; }; - 17F94E1D0B8D128500A34E87 /* CoreAudioCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 17F94E1C0B8D128500A34E87 /* CoreAudioCodec.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -22,12 +22,12 @@ 1745C2180B90B7F800A6768C /* CoreAudioPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioPropertiesReader.h; sourceTree = ""; }; 1745C2190B90B7F800A6768C /* CoreAudioPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioPropertiesReader.m; sourceTree = ""; }; 177FCFCA0B90C9A10011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; + 17ADB1980B97937600257CA2 /* CoreAudioPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioPlugin.h; sourceTree = ""; }; + 17ADB1990B97937600257CA2 /* CoreAudioPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioPlugin.m; sourceTree = ""; }; 17C93E720B8FF192008627D6 /* CoreAudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioDecoder.h; sourceTree = ""; }; 17C93E730B8FF192008627D6 /* CoreAudioDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioDecoder.m; sourceTree = ""; }; 17C93EAB0B8FF3CE008627D6 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 17C93EB20B8FF3E1008627D6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; - 17F94E1B0B8D128500A34E87 /* CoreAudioCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioCodec.h; sourceTree = ""; }; - 17F94E1C0B8D128500A34E87 /* CoreAudioCodec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreAudioCodec.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* CoreAudio_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudio_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* CoreAudio.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreAudio.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -81,8 +81,8 @@ isa = PBXGroup; children = ( 177FCFCA0B90C9A10011C3B5 /* Plugin.h */, - 17F94E1B0B8D128500A34E87 /* CoreAudioCodec.h */, - 17F94E1C0B8D128500A34E87 /* CoreAudioCodec.m */, + 17ADB1980B97937600257CA2 /* CoreAudioPlugin.h */, + 17ADB1990B97937600257CA2 /* CoreAudioPlugin.m */, 17C93E720B8FF192008627D6 /* CoreAudioDecoder.h */, 17C93E730B8FF192008627D6 /* CoreAudioDecoder.m */, 1745C2180B90B7F800A6768C /* CoreAudioPropertiesReader.h */, @@ -178,9 +178,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 17F94E1D0B8D128500A34E87 /* CoreAudioCodec.m in Sources */, 17C93E740B8FF192008627D6 /* CoreAudioDecoder.m in Sources */, 1745C21A0B90B7F800A6768C /* CoreAudioPropertiesReader.m in Sources */, + 17ADB19A0B97937600257CA2 /* CoreAudioPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/CoreAudio/CoreAudioCodec.m b/Plugins/CoreAudio/CoreAudioCodec.m deleted file mode 100644 index 71a0762f4..000000000 --- a/Plugins/CoreAudio/CoreAudioCodec.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// CoreAudio.m -// CoreAudio -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "CoreAudioCodec.h" -#import "CoreAudioDecoder.h" -#import "CoreAudioPropertiesReader.h" - -@implementation CoreAudioCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [CoreAudioDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [CoreAudioPropertiesReader class]; -} - - - - - -@end diff --git a/Plugins/CoreAudio/CoreAudioCodec.h b/Plugins/CoreAudio/CoreAudioPlugin.h similarity index 78% rename from Plugins/CoreAudio/CoreAudioCodec.h rename to Plugins/CoreAudio/CoreAudioPlugin.h index c61baa3ac..324b378b8 100644 --- a/Plugins/CoreAudio/CoreAudioCodec.h +++ b/Plugins/CoreAudio/CoreAudioPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface CoreAudioCodec : NSObject +@interface CoreAudioPlugin : NSObject { } diff --git a/Plugins/CoreAudio/CoreAudioPlugin.m b/Plugins/CoreAudio/CoreAudioPlugin.m new file mode 100644 index 000000000..e4690270d --- /dev/null +++ b/Plugins/CoreAudio/CoreAudioPlugin.m @@ -0,0 +1,24 @@ +// +// CoreAudio.m +// CoreAudio +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "CoreAudioPlugin.h" +#import "CoreAudioDecoder.h" +#import "CoreAudioPropertiesReader.h" + +@implementation CoreAudioPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [CoreAudioDecoder className], + kCogPropertiesReader, [CoreAudioPropertiesReader className], + nil + ]; +} + +@end diff --git a/Plugins/CoreAudio/Info.plist b/Plugins/CoreAudio/Info.plist index 43bc09cf9..7997fbfa9 100644 --- a/Plugins/CoreAudio/Info.plist +++ b/Plugins/CoreAudio/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - CoreAudioCodec + CoreAudioPlugin diff --git a/Plugins/FileSource/FileSource.h b/Plugins/FileSource/FileSource.h new file mode 100644 index 000000000..9ae4baa7f --- /dev/null +++ b/Plugins/FileSource/FileSource.h @@ -0,0 +1,18 @@ +// +// FileSource.h +// FileSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + +#import "Plugin.h" + +@interface FileSource : NSObject +{ + FILE *_fd; +} + +@end diff --git a/Plugins/FileSource/FileSource.m b/Plugins/FileSource/FileSource.m new file mode 100644 index 000000000..6343a5c09 --- /dev/null +++ b/Plugins/FileSource/FileSource.m @@ -0,0 +1,61 @@ +// +// FileSource.m +// FileSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "FileSource.h" + + +@implementation FileSource + +- (BOOL)buffered +{ + return NO; +} + +- (BOOL)open:(NSURL *)url +{ + _fd = fopen([[url path] UTF8String], "r"); + + return (_fd != NULL); +} + +- (NSDictionary *)properties +{ + return nil; +} + +- (BOOL)seekable +{ + return YES; +} + +- (BOOL)seek:(long)position whence:(int)whence +{ + return (fseek(_fd, position, whence) == 0); +} + +- (long)tell +{ + return ftell(_fd); +} + +- (int)read:(void *)buffer amount:(int)amount +{ + return fread(buffer, 1, amount, _fd); +} + +- (void)close +{ + fclose(_fd); +} + ++ (NSArray *)schemes +{ + return [NSArray arrayWithObject:@"file"]; +} + +@end diff --git a/Plugins/FileSource/FileSource.xcodeproj/project.pbxproj b/Plugins/FileSource/FileSource.xcodeproj/project.pbxproj new file mode 100644 index 000000000..2ed4b1545 --- /dev/null +++ b/Plugins/FileSource/FileSource.xcodeproj/project.pbxproj @@ -0,0 +1,256 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 17ADB3FF0B979A4600257CA2 /* FileSourcePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB3FE0B979A4600257CA2 /* FileSourcePlugin.m */; }; + 17ADB41A0B979AEB00257CA2 /* FileSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB4190B979AEB00257CA2 /* FileSource.m */; }; + 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 17ADB3FD0B979A4600257CA2 /* FileSourcePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSourcePlugin.h; sourceTree = ""; }; + 17ADB3FE0B979A4600257CA2 /* FileSourcePlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileSourcePlugin.m; sourceTree = ""; }; + 17ADB4080B979A8A00257CA2 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; + 17ADB4180B979AEB00257CA2 /* FileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSource.h; sourceTree = ""; }; + 17ADB4190B979AEB00257CA2 /* FileSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileSource.m; sourceTree = ""; }; + 32DBCF630370AF2F00C91783 /* FileSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSource_Prefix.pch; sourceTree = ""; }; + 8D5B49B6048680CD000E48DA /* FileSource.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileSource.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; + D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D5B49B3048680CD000E48DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* FileSource */ = { + isa = PBXGroup; + children = ( + 08FB77AFFE84173DC02AAC07 /* Classes */, + 32C88E010371C26100C91783 /* Other Sources */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, + 19C28FB8FE9D52D311CA2CBB /* Products */, + ); + name = FileSource; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, + ); + name = "Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D5B49B7048680CD000E48DA /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77AFFE84173DC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 17ADB4080B979A8A00257CA2 /* Plugin.h */, + 17ADB3FD0B979A4600257CA2 /* FileSourcePlugin.h */, + 17ADB3FE0B979A4600257CA2 /* FileSourcePlugin.m */, + 17ADB4180B979AEB00257CA2 /* FileSource.h */, + 17ADB4190B979AEB00257CA2 /* FileSource.m */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 089C167FFE841241C02AAC07 /* AppKit.framework */, + D2F7E65807B2D6F200F64583 /* CoreData.framework */, + 089C1672FE841209C02AAC07 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FB8FE9D52D311CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D5B49B6048680CD000E48DA /* FileSource.bundle */, + ); + name = Products; + sourceTree = ""; + }; + 32C88E010371C26100C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32DBCF630370AF2F00C91783 /* FileSource_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D5B49AC048680CD000E48DA /* FileSource */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "FileSource" */; + buildPhases = ( + 8D5B49AF048680CD000E48DA /* Resources */, + 8D5B49B1048680CD000E48DA /* Sources */, + 8D5B49B3048680CD000E48DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FileSource; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = FileSource; + productReference = 8D5B49B6048680CD000E48DA /* FileSource.bundle */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "FileSource" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* FileSource */; + projectDirPath = ""; + targets = ( + 8D5B49AC048680CD000E48DA /* FileSource */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D5B49AF048680CD000E48DA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D5B49B1048680CD000E48DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17ADB3FF0B979A4600257CA2 /* FileSourcePlugin.m in Sources */, + 17ADB41A0B979AEB00257CA2 /* FileSource.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB913B08733D840010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = FileSource_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Bundles"; + PRODUCT_NAME = FileSource; + WRAPPER_EXTENSION = bundle; + ZERO_LINK = YES; + }; + name = Debug; + }; + 1DEB913C08733D840010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = FileSource_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Bundles"; + PRODUCT_NAME = FileSource; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 1DEB913F08733D840010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Debug; + }; + 1DEB914008733D840010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "FileSource" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB913B08733D840010E9CD /* Debug */, + 1DEB913C08733D840010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "FileSource" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB913F08733D840010E9CD /* Debug */, + 1DEB914008733D840010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/Plugins/FileSource/FileSourcePlugin.h b/Plugins/FileSource/FileSourcePlugin.h new file mode 100644 index 000000000..e5f2210ea --- /dev/null +++ b/Plugins/FileSource/FileSourcePlugin.h @@ -0,0 +1,18 @@ +// +// FileSourcePlugin.h +// FileSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + +#import "Plugin.h" + +@interface FileSourcePlugin : NSObject +{ + +} + +@end diff --git a/Plugins/FileSource/FileSourcePlugin.m b/Plugins/FileSource/FileSourcePlugin.m new file mode 100644 index 000000000..a3f0c1a6b --- /dev/null +++ b/Plugins/FileSource/FileSourcePlugin.m @@ -0,0 +1,23 @@ +// +// FileSourcePlugin.m +// FileSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "FileSourcePlugin.h" +#import "FileSource.h" + +@implementation FileSourcePlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogSource, [FileSource className], + nil + ]; +} + + +@end diff --git a/Plugins/FileSource/FileSource_Prefix.pch b/Plugins/FileSource/FileSource_Prefix.pch new file mode 100644 index 000000000..5b4792b4e --- /dev/null +++ b/Plugins/FileSource/FileSource_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'FileSource' target in the 'FileSource' project. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Plugins/FileSource/Info.plist b/Plugins/FileSource/Info.plist new file mode 100644 index 000000000..ad674b62f --- /dev/null +++ b/Plugins/FileSource/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleName + ${PRODUCT_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.yourcocoabundle + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSPrincipalClass + FileSourcePlugin + + diff --git a/Plugins/Flac/Flac.xcodeproj/project.pbxproj b/Plugins/Flac/Flac.xcodeproj/project.pbxproj index f72978eac..cf20ef0b8 100644 --- a/Plugins/Flac/Flac.xcodeproj/project.pbxproj +++ b/Plugins/Flac/Flac.xcodeproj/project.pbxproj @@ -11,8 +11,9 @@ 177FCFC20B90C9960011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCFC10B90C9960011C3B5 /* Plugin.h */; }; 179CFDB20B90C73400C8C4DB /* FLAC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179CFDB10B90C73400C8C4DB /* FLAC.framework */; }; 179CFDB50B90C73900C8C4DB /* FLAC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 179CFDB10B90C73400C8C4DB /* FLAC.framework */; }; + 17ADB1B40B9793A600257CA2 /* FlacPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB1B20B9793A600257CA2 /* FlacPlugin.h */; }; + 17ADB1B50B9793A600257CA2 /* FlacPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB1B30B9793A600257CA2 /* FlacPlugin.m */; }; 17C93F080B8FF67A008627D6 /* FlacDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93F040B8FF67A008627D6 /* FlacDecoder.m */; }; - 17C93F090B8FF67A008627D6 /* FlacCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93F070B8FF67A008627D6 /* FlacCodec.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 179CFDB50B90C73900C8C4DB /* FLAC.framework in CopyFiles */, 177FCFC20B90C9960011C3B5 /* Plugin.h in CopyFiles */, + 17ADB1B40B9793A600257CA2 /* FlacPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -38,10 +40,10 @@ 1745C2C30B90BAC700A6768C /* FlacPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacPropertiesReader.m; sourceTree = ""; }; 177FCFC10B90C9960011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; 179CFDB10B90C73400C8C4DB /* FLAC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FLAC.framework; path = ../../Frameworks/FLAC/build/Release/FLAC.framework; sourceTree = SOURCE_ROOT; }; + 17ADB1B20B9793A600257CA2 /* FlacPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FlacPlugin.h; sourceTree = ""; }; + 17ADB1B30B9793A600257CA2 /* FlacPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacPlugin.m; sourceTree = ""; }; 17C93F030B8FF67A008627D6 /* FlacDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FlacDecoder.h; sourceTree = ""; }; 17C93F040B8FF67A008627D6 /* FlacDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacDecoder.m; sourceTree = ""; }; - 17C93F060B8FF67A008627D6 /* FlacCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FlacCodec.h; sourceTree = ""; }; - 17C93F070B8FF67A008627D6 /* FlacCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacCodec.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* Flac_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flac_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* Flac.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Flac.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -94,8 +96,8 @@ isa = PBXGroup; children = ( 177FCFC10B90C9960011C3B5 /* Plugin.h */, - 17C93F060B8FF67A008627D6 /* FlacCodec.h */, - 17C93F070B8FF67A008627D6 /* FlacCodec.m */, + 17ADB1B20B9793A600257CA2 /* FlacPlugin.h */, + 17ADB1B30B9793A600257CA2 /* FlacPlugin.m */, 17C93F030B8FF67A008627D6 /* FlacDecoder.h */, 17C93F040B8FF67A008627D6 /* FlacDecoder.m */, 1745C2C20B90BAC700A6768C /* FlacPropertiesReader.h */, @@ -192,8 +194,8 @@ buildActionMask = 2147483647; files = ( 17C93F080B8FF67A008627D6 /* FlacDecoder.m in Sources */, - 17C93F090B8FF67A008627D6 /* FlacCodec.m in Sources */, 1745C2C50B90BAC700A6768C /* FlacPropertiesReader.m in Sources */, + 17ADB1B50B9793A600257CA2 /* FlacPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/Flac/FlacCodec.m b/Plugins/Flac/FlacCodec.m deleted file mode 100644 index dcf0f374d..000000000 --- a/Plugins/Flac/FlacCodec.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "FlacCodec.h" -#import "FlacDecoder.h" -#import "FlacPropertiesReader.h" - -@implementation FlacCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [FlacDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [FlacPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/MAD/MADCodec.h b/Plugins/Flac/FlacPlugin.h similarity index 80% rename from Plugins/MAD/MADCodec.h rename to Plugins/Flac/FlacPlugin.h index 43c2a1ea7..3d9461536 100644 --- a/Plugins/MAD/MADCodec.h +++ b/Plugins/Flac/FlacPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface MADCodec : NSObject +@interface FlacPlugin : NSObject { } diff --git a/Plugins/Flac/FlacPlugin.m b/Plugins/Flac/FlacPlugin.m new file mode 100644 index 000000000..74e956098 --- /dev/null +++ b/Plugins/Flac/FlacPlugin.m @@ -0,0 +1,25 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "FlacPlugin.h" +#import "FlacDecoder.h" +#import "FlacPropertiesReader.h" + +@implementation FlacPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [FlacDecoder className], + kCogPropertiesReader, [FlacPropertiesReader className], + nil + ]; +} + + +@end diff --git a/Plugins/Flac/Info.plist b/Plugins/Flac/Info.plist index 2ae4c2612..59c5deaaf 100644 --- a/Plugins/Flac/Info.plist +++ b/Plugins/Flac/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - FlacCodec + FlacPlugin diff --git a/Plugins/HTTPSource/HTTPSource.h b/Plugins/HTTPSource/HTTPSource.h new file mode 100644 index 000000000..eb5310531 --- /dev/null +++ b/Plugins/HTTPSource/HTTPSource.h @@ -0,0 +1,21 @@ +// +// HTTPSource.h +// HTTPSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + +#import "Socket.h" +#import "Plugin.h" + +@interface HTTPSource : NSObject +{ + Socket *_socket; + + long byteCount; +} + +@end diff --git a/Plugins/HTTPSource/HTTPSource.m b/Plugins/HTTPSource/HTTPSource.m new file mode 100644 index 000000000..1fc9e2931 --- /dev/null +++ b/Plugins/HTTPSource/HTTPSource.m @@ -0,0 +1,75 @@ +// +// HTTPSource.m +// HTTPSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "HTTPSource.h" + + +@implementation HTTPSource + +- (BOOL)buffered +{ + return NO; +} + +- (BOOL)open:(NSURL *)url +{ + + unsigned int port = [[url port] unsignedIntValue]; + if (!port) + port = 80; + + _socket = [[Socket alloc] initWithHost:[url host] port:port]; + + if (_socket) { + NSData *request = [[NSString stringWithFormat:@"GET %@ HTTP/1.0\nHOST: %@\n\n",[url path],[url host]] dataUsingEncoding:NSUTF8StringEncoding]; + [_socket send:(void *)[request bytes] amount:[request length]]; + } + + return (_socket != nil); +} + +- (NSDictionary *)properties +{ + return nil; +} + +- (BOOL)seekable +{ + return NO; +} + +- (BOOL)seek:(long)position whence:(int)whence +{ + return NO; +} + +- (long)tell +{ + return byteCount; +} + +- (int)read:(void *)buffer amount:(int)amount +{ + int l = [_socket receive:buffer amount:amount]; + if (l > 0) + byteCount += l; + + return l; +} + +- (void)close +{ + [_socket close]; +} + ++ (NSArray *)schemes +{ + return [NSArray arrayWithObject:@"http"]; +} + +@end diff --git a/Plugins/HTTPSource/HTTPSource.xcodeproj/project.pbxproj b/Plugins/HTTPSource/HTTPSource.xcodeproj/project.pbxproj new file mode 100644 index 000000000..a9cf2d478 --- /dev/null +++ b/Plugins/HTTPSource/HTTPSource.xcodeproj/project.pbxproj @@ -0,0 +1,270 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 17ADB60B0B97A73B00257CA2 /* Socket.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB60A0B97A73B00257CA2 /* Socket.m */; }; + 17ADB6100B97A74800257CA2 /* HTTPSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB60D0B97A74800257CA2 /* HTTPSource.m */; }; + 17ADB6110B97A74800257CA2 /* HTTPSourcePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB60F0B97A74800257CA2 /* HTTPSourcePlugin.m */; }; + 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 17ADB6090B97A73B00257CA2 /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = ""; }; + 17ADB60A0B97A73B00257CA2 /* Socket.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Socket.m; sourceTree = ""; }; + 17ADB60C0B97A74800257CA2 /* HTTPSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTTPSource.h; sourceTree = ""; }; + 17ADB60D0B97A74800257CA2 /* HTTPSource.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HTTPSource.m; sourceTree = ""; }; + 17ADB60E0B97A74800257CA2 /* HTTPSourcePlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTTPSourcePlugin.h; sourceTree = ""; }; + 17ADB60F0B97A74800257CA2 /* HTTPSourcePlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HTTPSourcePlugin.m; sourceTree = ""; }; + 17ADB6340B97A8B400257CA2 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; + 32DBCF630370AF2F00C91783 /* HTTPSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPSource_Prefix.pch; sourceTree = ""; }; + 8D5B49B6048680CD000E48DA /* HTTPSource.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HTTPSource.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; + D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D5B49B3048680CD000E48DA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* HTTPSource */ = { + isa = PBXGroup; + children = ( + 08FB77AFFE84173DC02AAC07 /* Classes */, + 32C88E010371C26100C91783 /* Other Sources */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, + 19C28FB8FE9D52D311CA2CBB /* Products */, + ); + name = HTTPSource; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, + ); + name = "Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D5B49B7048680CD000E48DA /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77AFFE84173DC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 17ADB6340B97A8B400257CA2 /* Plugin.h */, + 17ADB60C0B97A74800257CA2 /* HTTPSource.h */, + 17ADB60D0B97A74800257CA2 /* HTTPSource.m */, + 17ADB60E0B97A74800257CA2 /* HTTPSourcePlugin.h */, + 17ADB60F0B97A74800257CA2 /* HTTPSourcePlugin.m */, + 17ADB6080B97A73B00257CA2 /* Utils */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 089C167FFE841241C02AAC07 /* AppKit.framework */, + D2F7E65807B2D6F200F64583 /* CoreData.framework */, + 089C1672FE841209C02AAC07 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 17ADB6080B97A73B00257CA2 /* Utils */ = { + isa = PBXGroup; + children = ( + 17ADB6090B97A73B00257CA2 /* Socket.h */, + 17ADB60A0B97A73B00257CA2 /* Socket.m */, + ); + path = Utils; + sourceTree = ""; + }; + 19C28FB8FE9D52D311CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D5B49B6048680CD000E48DA /* HTTPSource.bundle */, + ); + name = Products; + sourceTree = ""; + }; + 32C88E010371C26100C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32DBCF630370AF2F00C91783 /* HTTPSource_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D5B49AC048680CD000E48DA /* HTTPSource */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "HTTPSource" */; + buildPhases = ( + 8D5B49AF048680CD000E48DA /* Resources */, + 8D5B49B1048680CD000E48DA /* Sources */, + 8D5B49B3048680CD000E48DA /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HTTPSource; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = HTTPSource; + productReference = 8D5B49B6048680CD000E48DA /* HTTPSource.bundle */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "HTTPSource" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* HTTPSource */; + projectDirPath = ""; + targets = ( + 8D5B49AC048680CD000E48DA /* HTTPSource */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D5B49AF048680CD000E48DA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D5B49B1048680CD000E48DA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17ADB60B0B97A73B00257CA2 /* Socket.m in Sources */, + 17ADB6100B97A74800257CA2 /* HTTPSource.m in Sources */, + 17ADB6110B97A74800257CA2 /* HTTPSourcePlugin.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB913B08733D840010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = HTTPSource_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Bundles"; + PRODUCT_NAME = HTTPSource; + WRAPPER_EXTENSION = bundle; + ZERO_LINK = YES; + }; + name = Debug; + }; + 1DEB913C08733D840010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = HTTPSource_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Library/Bundles"; + PRODUCT_NAME = HTTPSource; + WRAPPER_EXTENSION = bundle; + }; + name = Release; + }; + 1DEB913F08733D840010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Debug; + }; + 1DEB914008733D840010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "HTTPSource" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB913B08733D840010E9CD /* Debug */, + 1DEB913C08733D840010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "HTTPSource" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB913F08733D840010E9CD /* Debug */, + 1DEB914008733D840010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/Plugins/HTTPSource/HTTPSourcePlugin.h b/Plugins/HTTPSource/HTTPSourcePlugin.h new file mode 100644 index 000000000..57703fd70 --- /dev/null +++ b/Plugins/HTTPSource/HTTPSourcePlugin.h @@ -0,0 +1,18 @@ +// +// HTTPSourcePlugin.h +// HTTPSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + +#import "Plugin.h" + +@interface HTTPSourcePlugin : NSObject +{ + +} + +@end diff --git a/Plugins/HTTPSource/HTTPSourcePlugin.m b/Plugins/HTTPSource/HTTPSourcePlugin.m new file mode 100644 index 000000000..82f760d29 --- /dev/null +++ b/Plugins/HTTPSource/HTTPSourcePlugin.m @@ -0,0 +1,23 @@ +// +// HTTPSourcePlugin.m +// FileSource +// +// Created by Vincent Spader on 3/1/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "HTTPSourcePlugin.h" +#import "HTTPSource.h" + +@implementation HTTPSourcePlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogSource, [HTTPSource className], + nil + ]; +} + + +@end diff --git a/Plugins/HTTPSource/HTTPSource_Prefix.pch b/Plugins/HTTPSource/HTTPSource_Prefix.pch new file mode 100644 index 000000000..9314a6e7b --- /dev/null +++ b/Plugins/HTTPSource/HTTPSource_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'HTTPSource' target in the 'HTTPSource' project. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Plugins/HTTPSource/Info.plist b/Plugins/HTTPSource/Info.plist new file mode 100644 index 000000000..a6170715e --- /dev/null +++ b/Plugins/HTTPSource/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleName + ${PRODUCT_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.yourcocoabundle + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSPrincipalClass + HTTPSourcePlugin + + diff --git a/Plugins/HTTPSource/Utils/Socket.h b/Plugins/HTTPSource/Utils/Socket.h new file mode 100644 index 000000000..d77c70a05 --- /dev/null +++ b/Plugins/HTTPSource/Utils/Socket.h @@ -0,0 +1,23 @@ +// +// Socket.h +// Cog +// +// Created by Vincent Spader on 2/28/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + +//Rediculously simple socket wrapper +@interface Socket : NSObject { + int _fd; +} + ++ (id)socketWithHost:(NSString *)host port:(unsigned int) port; +- (id)initWithHost:(NSString *)host port:(unsigned int)port; + +- (int)send:(const void *)data amount:(unsigned int)amount; +- (int)receive:(void *)data amount:(unsigned int)amount; +- (void)close; + +@end diff --git a/Plugins/HTTPSource/Utils/Socket.m b/Plugins/HTTPSource/Utils/Socket.m new file mode 100644 index 000000000..4979e78cf --- /dev/null +++ b/Plugins/HTTPSource/Utils/Socket.m @@ -0,0 +1,77 @@ +// +// Socket.m +// Cog +// +// Created by Vincent Spader on 2/28/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "Socket.h" +#import + +@implementation Socket + ++ (id)socketWithHost:(NSString *)host port:(unsigned int)port +{ + return [[[Socket alloc] initWithHost:host port:port] autorelease]; +} + +- (id)initWithHost:(NSString *)host port:(unsigned int) port +{ + self = [super init]; + if (self) + { + _fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + struct sockaddr_in sin; + struct hostent *he; + + if (_fd < 0) { + NSLog(@"%s\n", strerror(errno)); + return nil; + } + + sin.sin_family = AF_INET; + sin.sin_port = htons(port); + + he = gethostbyname([host UTF8String]); + if (!he) { + NSLog(@"Socket error."); + close(_fd); + return nil; + } + memcpy(&sin.sin_addr, he->h_addr, 4); + + if (connect(_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + NSLog(@"%s\n", strerror(errno)); + close(_fd); + return nil; + } + } + + return self; +} + + +- (int)send:(const void *)data amount:(unsigned int)amount +{ + return send(_fd, data, amount, 0); +} + +- (int)receive:(void *)data amount:(unsigned int)amount +{ + return recv(_fd, data, amount, 0); +} + +- (void)close +{ + close(_fd); +} + +- (void)dealloc +{ + [self close]; + + [super dealloc]; +} + +@end diff --git a/Plugins/MAD/Info.plist b/Plugins/MAD/Info.plist index 520f61603..9666d4342 100644 --- a/Plugins/MAD/Info.plist +++ b/Plugins/MAD/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - MADCodec + MADPlugin diff --git a/Plugins/MAD/MAD.xcodeproj/project.pbxproj b/Plugins/MAD/MAD.xcodeproj/project.pbxproj index 725ac44d4..07f3455c2 100644 --- a/Plugins/MAD/MAD.xcodeproj/project.pbxproj +++ b/Plugins/MAD/MAD.xcodeproj/project.pbxproj @@ -8,12 +8,13 @@ /* Begin PBXBuildFile section */ 170335470B8FC4EE00327265 /* MADDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 170335430B8FC4EE00327265 /* MADDecoder.m */; }; - 170335480B8FC4EE00327265 /* MADCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 170335450B8FC4EE00327265 /* MADCodec.m */; }; 177FCEF40B90C8910011C3B5 /* MAD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177FCEF30B90C8910011C3B5 /* MAD.framework */; }; 177FCEF80B90C8990011C3B5 /* ID3Tag.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177FCEF70B90C8990011C3B5 /* ID3Tag.framework */; }; 177FCF000B90C8A20011C3B5 /* ID3Tag.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCEF70B90C8990011C3B5 /* ID3Tag.framework */; }; 177FCF010B90C8A20011C3B5 /* MAD.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCEF30B90C8910011C3B5 /* MAD.framework */; }; 177FCFBC0B90C98A0011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCFBB0B90C98A0011C3B5 /* Plugin.h */; }; + 17ADB1D20B9793C500257CA2 /* MADPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB1D00B9793C500257CA2 /* MADPlugin.h */; }; + 17ADB1D30B9793C500257CA2 /* MADPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB1D10B9793C500257CA2 /* MADPlugin.m */; }; 17B618AF0B90997E00BC003F /* MADPropertiesReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B618AD0B90997E00BC003F /* MADPropertiesReader.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -28,6 +29,7 @@ 177FCF000B90C8A20011C3B5 /* ID3Tag.framework in CopyFiles */, 177FCF010B90C8A20011C3B5 /* MAD.framework in CopyFiles */, 177FCFBC0B90C98A0011C3B5 /* Plugin.h in CopyFiles */, + 17ADB1D20B9793C500257CA2 /* MADPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -39,11 +41,11 @@ 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 170335420B8FC4EE00327265 /* MADDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MADDecoder.h; sourceTree = ""; }; 170335430B8FC4EE00327265 /* MADDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADDecoder.m; sourceTree = ""; }; - 170335440B8FC4EE00327265 /* MADCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MADCodec.h; sourceTree = ""; }; - 170335450B8FC4EE00327265 /* MADCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADCodec.m; sourceTree = ""; }; 177FCEF30B90C8910011C3B5 /* MAD.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MAD.framework; path = ../../Frameworks/MAD/build/Release/MAD.framework; sourceTree = SOURCE_ROOT; }; 177FCEF70B90C8990011C3B5 /* ID3Tag.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ID3Tag.framework; path = ../../Frameworks/ID3Tag/build/Release/ID3Tag.framework; sourceTree = SOURCE_ROOT; }; 177FCFBB0B90C98A0011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; + 17ADB1D00B9793C500257CA2 /* MADPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MADPlugin.h; sourceTree = ""; }; + 17ADB1D10B9793C500257CA2 /* MADPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADPlugin.m; sourceTree = ""; }; 17B618AC0B90997E00BC003F /* MADPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MADPropertiesReader.h; sourceTree = ""; }; 17B618AD0B90997E00BC003F /* MADPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MADPropertiesReader.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* MAD_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAD_Prefix.pch; sourceTree = ""; }; @@ -99,8 +101,8 @@ isa = PBXGroup; children = ( 177FCFBB0B90C98A0011C3B5 /* Plugin.h */, - 170335440B8FC4EE00327265 /* MADCodec.h */, - 170335450B8FC4EE00327265 /* MADCodec.m */, + 17ADB1D00B9793C500257CA2 /* MADPlugin.h */, + 17ADB1D10B9793C500257CA2 /* MADPlugin.m */, 170335420B8FC4EE00327265 /* MADDecoder.h */, 170335430B8FC4EE00327265 /* MADDecoder.m */, 17B618AC0B90997E00BC003F /* MADPropertiesReader.h */, @@ -198,8 +200,8 @@ buildActionMask = 2147483647; files = ( 170335470B8FC4EE00327265 /* MADDecoder.m in Sources */, - 170335480B8FC4EE00327265 /* MADCodec.m in Sources */, 17B618AF0B90997E00BC003F /* MADPropertiesReader.m in Sources */, + 17ADB1D30B9793C500257CA2 /* MADPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/MAD/MADCodec.m b/Plugins/MAD/MADCodec.m deleted file mode 100644 index 25f38581e..000000000 --- a/Plugins/MAD/MADCodec.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "MADCodec.h" -#import "MADDecoder.h" -#import "MADPropertiesReader.h" - -@implementation MADCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [MADDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [MADPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/Flac/FlacCodec.h b/Plugins/MAD/MADPlugin.h similarity index 80% rename from Plugins/Flac/FlacCodec.h rename to Plugins/MAD/MADPlugin.h index 02fbdd330..b0f410f66 100644 --- a/Plugins/Flac/FlacCodec.h +++ b/Plugins/MAD/MADPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface FlacCodec : NSObject +@interface MADPlugin : NSObject { } diff --git a/Plugins/MAD/MADPlugin.m b/Plugins/MAD/MADPlugin.m new file mode 100644 index 000000000..40cd626a0 --- /dev/null +++ b/Plugins/MAD/MADPlugin.m @@ -0,0 +1,24 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "MADPlugin.h" +#import "MADDecoder.h" +#import "MADPropertiesReader.h" + +@implementation MADPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [MADDecoder className], + kCogPropertiesReader, [MADPropertiesReader className], + nil + ]; +} + +@end diff --git a/Plugins/MonkeysAudio/Info.plist b/Plugins/MonkeysAudio/Info.plist index c6ac94e2a..5b1281943 100644 --- a/Plugins/MonkeysAudio/Info.plist +++ b/Plugins/MonkeysAudio/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier com.yourcompany.yourcocoabundle CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType BNDL CFBundleSignature @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - MonkeysAudioCodec + MonkeysAudioPlugin diff --git a/Plugins/MonkeysAudio/MonkeysAudio.xcodeproj/project.pbxproj b/Plugins/MonkeysAudio/MonkeysAudio.xcodeproj/project.pbxproj index 0840a95d9..e526f78c4 100644 --- a/Plugins/MonkeysAudio/MonkeysAudio.xcodeproj/project.pbxproj +++ b/Plugins/MonkeysAudio/MonkeysAudio.xcodeproj/project.pbxproj @@ -7,12 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 1745C2EC0B90BDD100A6768C /* MonkeysAudioCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C2E60B90BDD100A6768C /* MonkeysAudioCodec.mm */; }; 1745C2ED0B90BDD100A6768C /* MonkeysAudioDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C2E80B90BDD100A6768C /* MonkeysAudioDecoder.mm */; }; 1745C2EE0B90BDD100A6768C /* MonkeysAudioPropertiesReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C2EA0B90BDD100A6768C /* MonkeysAudioPropertiesReader.mm */; }; 177FCFB50B90C97E0011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCFB40B90C97E0011C3B5 /* Plugin.h */; }; 179CFD770B90C70B00C8C4DB /* MAC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179CFD760B90C70B00C8C4DB /* MAC.framework */; }; 179CFD7A0B90C70E00C8C4DB /* MAC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 179CFD760B90C70B00C8C4DB /* MAC.framework */; }; + 17ADB1E80B9793E300257CA2 /* MonkeysAudioPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB1E60B9793E300257CA2 /* MonkeysAudioPlugin.h */; }; + 17ADB1E90B9793E300257CA2 /* MonkeysAudioPlugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB1E70B9793E300257CA2 /* MonkeysAudioPlugin.mm */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 179CFD7A0B90C70E00C8C4DB /* MAC.framework in CopyFiles */, 177FCFB50B90C97E0011C3B5 /* Plugin.h in CopyFiles */, + 17ADB1E80B9793E300257CA2 /* MonkeysAudioPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -34,14 +36,14 @@ 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 1745C2E60B90BDD100A6768C /* MonkeysAudioCodec.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioCodec.mm; sourceTree = ""; }; 1745C2E70B90BDD100A6768C /* MonkeysAudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioDecoder.h; sourceTree = ""; }; 1745C2E80B90BDD100A6768C /* MonkeysAudioDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioDecoder.mm; sourceTree = ""; }; 1745C2E90B90BDD100A6768C /* MonkeysAudioPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioPropertiesReader.h; sourceTree = ""; }; 1745C2EA0B90BDD100A6768C /* MonkeysAudioPropertiesReader.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioPropertiesReader.mm; sourceTree = ""; }; - 1745C2F80B90BDF200A6768C /* MonkeysAudioCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioCodec.h; sourceTree = ""; }; 177FCFB40B90C97E0011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; 179CFD760B90C70B00C8C4DB /* MAC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MAC.framework; path = ../../Frameworks/MAC/build/Release/MAC.framework; sourceTree = SOURCE_ROOT; }; + 17ADB1E60B9793E300257CA2 /* MonkeysAudioPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioPlugin.h; sourceTree = ""; }; + 17ADB1E70B9793E300257CA2 /* MonkeysAudioPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioPlugin.mm; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* MonkeysAudio_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MonkeysAudio_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* MonkeysAudio.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MonkeysAudio.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -93,9 +95,9 @@ 08FB77AFFE84173DC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( + 17ADB1E60B9793E300257CA2 /* MonkeysAudioPlugin.h */, + 17ADB1E70B9793E300257CA2 /* MonkeysAudioPlugin.mm */, 177FCFB40B90C97E0011C3B5 /* Plugin.h */, - 1745C2F80B90BDF200A6768C /* MonkeysAudioCodec.h */, - 1745C2E60B90BDD100A6768C /* MonkeysAudioCodec.mm */, 1745C2E70B90BDD100A6768C /* MonkeysAudioDecoder.h */, 1745C2E80B90BDD100A6768C /* MonkeysAudioDecoder.mm */, 1745C2E90B90BDD100A6768C /* MonkeysAudioPropertiesReader.h */, @@ -191,9 +193,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1745C2EC0B90BDD100A6768C /* MonkeysAudioCodec.mm in Sources */, 1745C2ED0B90BDD100A6768C /* MonkeysAudioDecoder.mm in Sources */, 1745C2EE0B90BDD100A6768C /* MonkeysAudioPropertiesReader.mm in Sources */, + 17ADB1E90B9793E300257CA2 /* MonkeysAudioPlugin.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/MonkeysAudio/MonkeysAudioCodec.mm b/Plugins/MonkeysAudio/MonkeysAudioCodec.mm deleted file mode 100644 index 0ced87f9d..000000000 --- a/Plugins/MonkeysAudio/MonkeysAudioCodec.mm +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "MonkeysAudioCodec.h" -#import "MonkeysAudioDecoder.h" -#import "MonkeysAudioPropertiesReader.h" - -@implementation MonkeysAudioCodec - -- (PluginType)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [MonkeysAudioDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [MonkeysAudioPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/Musepack/MusepackCodec.h b/Plugins/MonkeysAudio/MonkeysAudioPlugin.h similarity index 78% rename from Plugins/Musepack/MusepackCodec.h rename to Plugins/MonkeysAudio/MonkeysAudioPlugin.h index df227b58c..eec5fe216 100644 --- a/Plugins/Musepack/MusepackCodec.h +++ b/Plugins/MonkeysAudio/MonkeysAudioPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface MusepackCodec : NSObject +@interface MonkeysAudioPlugin : NSObject { } diff --git a/Plugins/MonkeysAudio/MonkeysAudioPlugin.mm b/Plugins/MonkeysAudio/MonkeysAudioPlugin.mm new file mode 100644 index 000000000..4455e9d1b --- /dev/null +++ b/Plugins/MonkeysAudio/MonkeysAudioPlugin.mm @@ -0,0 +1,25 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "MonkeysAudioPlugin.h" +#import "MonkeysAudioDecoder.h" +#import "MonkeysAudioPropertiesReader.h" + +@implementation MonkeysAudioPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [MonkeysAudioDecoder className], + kCogPropertiesReader, [MonkeysAudioPropertiesReader className], + nil + ]; +} + + +@end diff --git a/Plugins/Musepack/Info.plist b/Plugins/Musepack/Info.plist index a65b3e8fa..0cb8efad1 100644 --- a/Plugins/Musepack/Info.plist +++ b/Plugins/Musepack/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - MusepackCodec + MusepackPlugin diff --git a/Plugins/Musepack/Musepack.xcodeproj/project.pbxproj b/Plugins/Musepack/Musepack.xcodeproj/project.pbxproj index d65dc72e3..0e5382cf8 100644 --- a/Plugins/Musepack/Musepack.xcodeproj/project.pbxproj +++ b/Plugins/Musepack/Musepack.xcodeproj/project.pbxproj @@ -7,12 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 1703330C0B8FB64500327265 /* MusepackCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 170333080B8FB64500327265 /* MusepackCodec.m */; }; 1703330D0B8FB64500327265 /* MusepackDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1703330A0B8FB64500327265 /* MusepackDecoder.m */; }; 1745C1A40B90B57400A6768C /* MusepackPropertiesReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1745C1A20B90B57400A6768C /* MusepackPropertiesReader.m */; }; 177FCF280B90C8D00011C3B5 /* MPCDec.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177FCF270B90C8D00011C3B5 /* MPCDec.framework */; }; 177FCF2B0B90C8D20011C3B5 /* MPCDec.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCF270B90C8D00011C3B5 /* MPCDec.framework */; }; 177FCF390B90C8F10011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCF380B90C8F10011C3B5 /* Plugin.h */; }; + 17ADB2020B9793FF00257CA2 /* MusepackPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB2000B9793FF00257CA2 /* MusepackPlugin.h */; }; + 17ADB2030B9793FF00257CA2 /* MusepackPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB2010B9793FF00257CA2 /* MusepackPlugin.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 177FCF2B0B90C8D20011C3B5 /* MPCDec.framework in CopyFiles */, 177FCF390B90C8F10011C3B5 /* Plugin.h in CopyFiles */, + 17ADB2020B9793FF00257CA2 /* MusepackPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -34,14 +36,14 @@ 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 170333070B8FB64500327265 /* MusepackCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackCodec.h; sourceTree = ""; }; - 170333080B8FB64500327265 /* MusepackCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackCodec.m; sourceTree = ""; }; 170333090B8FB64500327265 /* MusepackDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackDecoder.h; sourceTree = ""; }; 1703330A0B8FB64500327265 /* MusepackDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackDecoder.m; sourceTree = ""; }; 1745C1A10B90B57400A6768C /* MusepackPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackPropertiesReader.h; sourceTree = ""; }; 1745C1A20B90B57400A6768C /* MusepackPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackPropertiesReader.m; sourceTree = ""; }; 177FCF270B90C8D00011C3B5 /* MPCDec.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MPCDec.framework; path = ../../Frameworks/MPCDec/build/Release/MPCDec.framework; sourceTree = SOURCE_ROOT; }; 177FCF380B90C8F10011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; + 17ADB2000B9793FF00257CA2 /* MusepackPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackPlugin.h; sourceTree = ""; }; + 17ADB2010B9793FF00257CA2 /* MusepackPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackPlugin.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* Musepack_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Musepack_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* Musepack.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Musepack.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -94,8 +96,8 @@ isa = PBXGroup; children = ( 177FCF380B90C8F10011C3B5 /* Plugin.h */, - 170333070B8FB64500327265 /* MusepackCodec.h */, - 170333080B8FB64500327265 /* MusepackCodec.m */, + 17ADB2000B9793FF00257CA2 /* MusepackPlugin.h */, + 17ADB2010B9793FF00257CA2 /* MusepackPlugin.m */, 170333090B8FB64500327265 /* MusepackDecoder.h */, 1703330A0B8FB64500327265 /* MusepackDecoder.m */, 1745C1A10B90B57400A6768C /* MusepackPropertiesReader.h */, @@ -191,9 +193,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1703330C0B8FB64500327265 /* MusepackCodec.m in Sources */, 1703330D0B8FB64500327265 /* MusepackDecoder.m in Sources */, 1745C1A40B90B57400A6768C /* MusepackPropertiesReader.m in Sources */, + 17ADB2030B9793FF00257CA2 /* MusepackPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/Musepack/MusepackCodec.m b/Plugins/Musepack/MusepackCodec.m deleted file mode 100644 index 2114b59d2..000000000 --- a/Plugins/Musepack/MusepackCodec.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "MusepackCodec.h" -#import "MusepackDecoder.h" -#import "MusepackPropertiesReader.h" - -@implementation MusepackCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [MusepackDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [MusepackPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/Vorbis/VorbisCodec.h b/Plugins/Musepack/MusepackPlugin.h similarity index 79% rename from Plugins/Vorbis/VorbisCodec.h rename to Plugins/Musepack/MusepackPlugin.h index 35dbcbe4e..979fca1fa 100644 --- a/Plugins/Vorbis/VorbisCodec.h +++ b/Plugins/Musepack/MusepackPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface VorbisCodec : NSObject +@interface MusepackPlugin : NSObject { } diff --git a/Plugins/Musepack/MusepackPlugin.m b/Plugins/Musepack/MusepackPlugin.m new file mode 100644 index 000000000..25cab2dd0 --- /dev/null +++ b/Plugins/Musepack/MusepackPlugin.m @@ -0,0 +1,24 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "MusepackPlugin.h" +#import "MusepackDecoder.h" +#import "MusepackPropertiesReader.h" + +@implementation MusepackPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [MusepackDecoder className], + kCogPropertiesReader, [MusepackPropertiesReader className], + nil + ]; +} + +@end diff --git a/Plugins/Shorten/Info.plist b/Plugins/Shorten/Info.plist index 192518cd2..878fffb72 100644 --- a/Plugins/Shorten/Info.plist +++ b/Plugins/Shorten/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - ShortenCodec + ShortenPlugin diff --git a/Plugins/Shorten/Shorten.xcodeproj/project.pbxproj b/Plugins/Shorten/Shorten.xcodeproj/project.pbxproj index 3ec476980..e1959b5da 100644 --- a/Plugins/Shorten/Shorten.xcodeproj/project.pbxproj +++ b/Plugins/Shorten/Shorten.xcodeproj/project.pbxproj @@ -7,12 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 1745C42F0B90C1DC00A6768C /* ShortenCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C42A0B90C1DC00A6768C /* ShortenCodec.mm */; }; 1745C4300B90C1DC00A6768C /* ShortenDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C42C0B90C1DC00A6768C /* ShortenDecoder.mm */; }; 1745C4310B90C1DC00A6768C /* ShortenPropertiesReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1745C42E0B90C1DC00A6768C /* ShortenPropertiesReader.mm */; }; 177FCFAD0B90C96B0011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCFAC0B90C96B0011C3B5 /* Plugin.h */; }; 179CFD600B90C6F600C8C4DB /* Shorten.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179CFD5F0B90C6F600C8C4DB /* Shorten.framework */; }; 179CFD630B90C6F800C8C4DB /* Shorten.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 179CFD5F0B90C6F600C8C4DB /* Shorten.framework */; }; + 17ADB2240B97942800257CA2 /* ShortenPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB2220B97942800257CA2 /* ShortenPlugin.h */; }; + 17ADB2250B97942800257CA2 /* ShortenPlugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB2230B97942800257CA2 /* ShortenPlugin.mm */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 179CFD630B90C6F800C8C4DB /* Shorten.framework in CopyFiles */, 177FCFAD0B90C96B0011C3B5 /* Plugin.h in CopyFiles */, + 17ADB2240B97942800257CA2 /* ShortenPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -34,14 +36,14 @@ 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 1745C4290B90C1DC00A6768C /* ShortenCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenCodec.h; sourceTree = ""; }; - 1745C42A0B90C1DC00A6768C /* ShortenCodec.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenCodec.mm; sourceTree = ""; }; 1745C42B0B90C1DC00A6768C /* ShortenDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenDecoder.h; sourceTree = ""; }; 1745C42C0B90C1DC00A6768C /* ShortenDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenDecoder.mm; sourceTree = ""; }; 1745C42D0B90C1DC00A6768C /* ShortenPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenPropertiesReader.h; sourceTree = ""; }; 1745C42E0B90C1DC00A6768C /* ShortenPropertiesReader.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenPropertiesReader.mm; sourceTree = ""; }; 177FCFAC0B90C96B0011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; 179CFD5F0B90C6F600C8C4DB /* Shorten.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Shorten.framework; path = ../../Frameworks/Shorten/build/Release/Shorten.framework; sourceTree = SOURCE_ROOT; }; + 17ADB2220B97942800257CA2 /* ShortenPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenPlugin.h; sourceTree = ""; }; + 17ADB2230B97942800257CA2 /* ShortenPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenPlugin.mm; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* Shorten_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shorten_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* Shorten.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Shorten.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -94,8 +96,8 @@ isa = PBXGroup; children = ( 177FCFAC0B90C96B0011C3B5 /* Plugin.h */, - 1745C4290B90C1DC00A6768C /* ShortenCodec.h */, - 1745C42A0B90C1DC00A6768C /* ShortenCodec.mm */, + 17ADB2220B97942800257CA2 /* ShortenPlugin.h */, + 17ADB2230B97942800257CA2 /* ShortenPlugin.mm */, 1745C42B0B90C1DC00A6768C /* ShortenDecoder.h */, 1745C42C0B90C1DC00A6768C /* ShortenDecoder.mm */, 1745C42D0B90C1DC00A6768C /* ShortenPropertiesReader.h */, @@ -191,9 +193,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1745C42F0B90C1DC00A6768C /* ShortenCodec.mm in Sources */, 1745C4300B90C1DC00A6768C /* ShortenDecoder.mm in Sources */, 1745C4310B90C1DC00A6768C /* ShortenPropertiesReader.mm in Sources */, + 17ADB2250B97942800257CA2 /* ShortenPlugin.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/Shorten/ShortenCodec.mm b/Plugins/Shorten/ShortenCodec.mm deleted file mode 100644 index 3011cbb23..000000000 --- a/Plugins/Shorten/ShortenCodec.mm +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "ShortenCodec.h" -#import "ShortenDecoder.h" -#import "ShortenPropertiesReader.h" - -@implementation ShortenCodec - -- (PluginType)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [ShortenDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [ShortenPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/Shorten/ShortenCodec.h b/Plugins/Shorten/ShortenPlugin.h similarity index 79% rename from Plugins/Shorten/ShortenCodec.h rename to Plugins/Shorten/ShortenPlugin.h index a17cc67d0..5364f5f78 100644 --- a/Plugins/Shorten/ShortenCodec.h +++ b/Plugins/Shorten/ShortenPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface ShortenCodec : NSObject +@interface ShortenPlugin : NSObject { } diff --git a/Plugins/Shorten/ShortenPlugin.mm b/Plugins/Shorten/ShortenPlugin.mm new file mode 100644 index 000000000..9f960edc3 --- /dev/null +++ b/Plugins/Shorten/ShortenPlugin.mm @@ -0,0 +1,24 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "ShortenPlugin.h" +#import "ShortenDecoder.h" +#import "ShortenPropertiesReader.h" + +@implementation ShortenPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [ShortenDecoder className], + kCogPropertiesReader, [ShortenPropertiesReader className], + nil + ]; +} + +@end diff --git a/Plugins/TagLib/TagLibPlugin.h b/Plugins/TagLib/TagLibPlugin.h index a8599b6c4..6b2ec5cc6 100644 --- a/Plugins/TagLib/TagLibPlugin.h +++ b/Plugins/TagLib/TagLibPlugin.h @@ -9,7 +9,7 @@ #import #import "Plugin.h" -@interface TagLibPlugin : NSObject +@interface TagLibPlugin : NSObject { } diff --git a/Plugins/TagLib/TagLibPlugin.m b/Plugins/TagLib/TagLibPlugin.m index 245fdbeb6..56901e36d 100644 --- a/Plugins/TagLib/TagLibPlugin.m +++ b/Plugins/TagLib/TagLibPlugin.m @@ -11,27 +11,12 @@ @implementation TagLibPlugin -- (int)pluginType ++ (NSDictionary *)pluginInfo { - return kCogPluginCodec; + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogMetadataReader, [TagLibMetadataReader className], + nil + ]; } -- (Class)decoder -{ - return nil; -} - -- (Class)metadataReader -{ - return [TagLibMetadataReader class]; -} - -- (Class)propertiesReader -{ - return nil; -} - - - - @end diff --git a/Plugins/Vorbis/Info.plist b/Plugins/Vorbis/Info.plist index 0c6db9857..173d7ac06 100644 --- a/Plugins/Vorbis/Info.plist +++ b/Plugins/Vorbis/Info.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 NSPrincipalClass - VorbisCodec + VorbisPlugin diff --git a/Plugins/Vorbis/Vorbis.xcodeproj/project.pbxproj b/Plugins/Vorbis/Vorbis.xcodeproj/project.pbxproj index 605f653a6..abb6985af 100644 --- a/Plugins/Vorbis/Vorbis.xcodeproj/project.pbxproj +++ b/Plugins/Vorbis/Vorbis.xcodeproj/project.pbxproj @@ -11,7 +11,8 @@ 177FCF9E0B90C9530011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCF9D0B90C9530011C3B5 /* Plugin.h */; }; 179CFDEE0B90C79800C8C4DB /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179CFDED0B90C79800C8C4DB /* Vorbis.framework */; }; 179CFDF20B90C79A00C8C4DB /* Vorbis.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 179CFDED0B90C79800C8C4DB /* Vorbis.framework */; }; - 17C93D350B8FDA66008627D6 /* VorbisCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93D320B8FDA66008627D6 /* VorbisCodec.m */; }; + 17ADB2480B97944D00257CA2 /* VorbisPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB2460B97944D00257CA2 /* VorbisPlugin.h */; }; + 17ADB2490B97944D00257CA2 /* VorbisPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB2470B97944D00257CA2 /* VorbisPlugin.m */; }; 17C93D360B8FDA66008627D6 /* VorbisDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C93D340B8FDA66008627D6 /* VorbisDecoder.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 179CFDF20B90C79A00C8C4DB /* Vorbis.framework in CopyFiles */, 177FCF9E0B90C9530011C3B5 /* Plugin.h in CopyFiles */, + 17ADB2480B97944D00257CA2 /* VorbisPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -38,8 +40,8 @@ 1745C2820B90B9F200A6768C /* VorbisPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisPropertiesReader.m; sourceTree = ""; }; 177FCF9D0B90C9530011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; 179CFDED0B90C79800C8C4DB /* Vorbis.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Vorbis.framework; path = ../../Frameworks/Vorbis/build/Release/Vorbis.framework; sourceTree = SOURCE_ROOT; }; - 17C93D310B8FDA66008627D6 /* VorbisCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisCodec.h; sourceTree = ""; }; - 17C93D320B8FDA66008627D6 /* VorbisCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisCodec.m; sourceTree = ""; }; + 17ADB2460B97944D00257CA2 /* VorbisPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisPlugin.h; sourceTree = ""; }; + 17ADB2470B97944D00257CA2 /* VorbisPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisPlugin.m; sourceTree = ""; }; 17C93D330B8FDA66008627D6 /* VorbisDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisDecoder.h; sourceTree = ""; }; 17C93D340B8FDA66008627D6 /* VorbisDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisDecoder.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* Vorbis_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vorbis_Prefix.pch; sourceTree = ""; }; @@ -94,8 +96,8 @@ isa = PBXGroup; children = ( 177FCF9D0B90C9530011C3B5 /* Plugin.h */, - 17C93D310B8FDA66008627D6 /* VorbisCodec.h */, - 17C93D320B8FDA66008627D6 /* VorbisCodec.m */, + 17ADB2460B97944D00257CA2 /* VorbisPlugin.h */, + 17ADB2470B97944D00257CA2 /* VorbisPlugin.m */, 17C93D330B8FDA66008627D6 /* VorbisDecoder.h */, 17C93D340B8FDA66008627D6 /* VorbisDecoder.m */, 1745C2810B90B9F200A6768C /* VorbisPropertiesReader.h */, @@ -191,9 +193,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 17C93D350B8FDA66008627D6 /* VorbisCodec.m in Sources */, 17C93D360B8FDA66008627D6 /* VorbisDecoder.m in Sources */, 1745C2840B90B9F200A6768C /* VorbisPropertiesReader.m in Sources */, + 17ADB2490B97944D00257CA2 /* VorbisPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/Vorbis/VorbisCodec.m b/Plugins/Vorbis/VorbisCodec.m deleted file mode 100644 index 09d6249a7..000000000 --- a/Plugins/Vorbis/VorbisCodec.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "VorbisCodec.h" -#import "VorbisDecoder.h" -#import "VorbisPropertiesReader.h" - -@implementation VorbisCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [VorbisDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [VorbisPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/Vorbis/VorbisDecoder.h b/Plugins/Vorbis/VorbisDecoder.h index 8f3c2f10e..3d7c45c8b 100644 --- a/Plugins/Vorbis/VorbisDecoder.h +++ b/Plugins/Vorbis/VorbisDecoder.h @@ -21,10 +21,12 @@ @interface VorbisDecoder : NSObject { - FILE *inFd; + id source; + OggVorbis_File vorbisRef; int currentSection; + BOOL seekable; int bitsPerSample; int bitrate; int channels; @@ -32,4 +34,6 @@ double length; } + + @end diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index a55f52ddd..4226d6533 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -11,14 +11,50 @@ @implementation VorbisDecoder -- (BOOL)open:(NSURL *)url +size_t sourceRead(void *buf, size_t size, size_t nmemb, void *datasource) { - inFd = fopen([[url path] UTF8String], "rb"); - if (inFd == 0) - return NO; + id source = (id)datasource; + + return [source read:buf amount:(size*nmemb)]; +} + +int sourceSeek(void *datasource, ogg_int64_t offset, int whence) +{ + id source = (id)datasource; + return ([source seek:offset whence:whence] ? 0 : -1); +} + +int sourceClose(void *datasource) +{ + id source = (id)datasource; + [source close]; + + return 0; +} + +long sourceTell(void *datasource) +{ + id source = (id)datasource; + + return [source tell]; +} + +- (BOOL)open:(id)s +{ + source = [s retain]; - if (ov_open(inFd, &vorbisRef, NULL, 0) != 0) + ov_callbacks callbacks = { + read_func: sourceRead, + seek_func: sourceSeek, + close_func: sourceClose, + tell_func: sourceTell + }; + + if (ov_open_callbacks(source, &vorbisRef, NULL, 0, callbacks) != 0) + { + NSLog(@"FAILED TO OPEN VORBIS FILE"); return NO; + } vorbis_info *vi; @@ -30,9 +66,11 @@ frequency = vi->rate; NSLog(@"INFO: %i", bitsPerSample); - length = ((double)ov_pcm_total(&vorbisRef, -1) * 1000.0)/frequency; + seekable = ov_seekable(&vorbisRef); + + length = 0.0;//((double)ov_pcm_total(&vorbisRef, -1) * 1000.0)/frequency; - NSLog(@"Ok to go WITH OGG."); + NSLog(@"Ok to go WITH OGG. %i", seekable); return YES; } @@ -42,22 +80,34 @@ int numread; int total = 0; - numread = ov_read(&vorbisRef, &((char *)buf)[total], size - total, 0, bitsPerSample/8, 1, ¤tSection); - while (total != size && numread != 0) - { + do { + numread = ov_read(&vorbisRef, &((char *)buf)[total], size - total, 0, bitsPerSample/8, 1, ¤tSection); if (numread > 0) { total += numread; } - numread = ov_read(&vorbisRef, &((char *)buf)[total], size - total, 0, bitsPerSample/8, 1, ¤tSection); - } + } while (total != size && numread != 0); + if (numread == 0) { + char **ptr=ov_comment(&vorbisRef,-1)->user_comments; + vorbis_info *vi=ov_info(&vorbisRef,-1); + while(*ptr){ + NSLog(@"%s\n",*ptr); + ++ptr; + } + NSLog(@"Bitstream is %d channel, %ldHz\n",vi->channels,vi->rate); + NSLog(@"Decoded length: %ld samples\n", + (long)ov_pcm_total(&vorbisRef,-1)); + NSLog(@"Encoded by: %s\n\n", ov_comment(&vorbisRef,-1)->vendor); + NSLog(@"Spewed out crap..."); + } return total; } - (void)close { ov_clear(&vorbisRef); + [source release]; } - (double)seekToTime:(double)milliseconds @@ -67,6 +117,10 @@ return milliseconds; } +- (BOOL) seekable +{ + return [source seekable]; +} - (NSDictionary *)properties { diff --git a/Plugins/Vorbis/VorbisPlugin.h b/Plugins/Vorbis/VorbisPlugin.h new file mode 100644 index 000000000..2b69a9236 --- /dev/null +++ b/Plugins/Vorbis/VorbisPlugin.h @@ -0,0 +1,17 @@ +// +// MusepackCodec.h +// Musepack +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import +#import "Plugin.h" + +@interface VorbisPlugin : NSObject +{ + +} + +@end diff --git a/Plugins/Vorbis/VorbisPlugin.m b/Plugins/Vorbis/VorbisPlugin.m new file mode 100644 index 000000000..2cd25833b --- /dev/null +++ b/Plugins/Vorbis/VorbisPlugin.m @@ -0,0 +1,24 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "VorbisPlugin.h" +#import "VorbisDecoder.h" +#import "VorbisPropertiesReader.h" + +@implementation VorbisPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [VorbisDecoder className], + kCogPropertiesReader, [VorbisPropertiesReader className], + nil + ]; +} + +@end diff --git a/Plugins/Vorbis/VorbisPropertiesReader.m b/Plugins/Vorbis/VorbisPropertiesReader.m index cb2f3012f..ef7e7939a 100644 --- a/Plugins/Vorbis/VorbisPropertiesReader.m +++ b/Plugins/Vorbis/VorbisPropertiesReader.m @@ -11,13 +11,13 @@ @implementation VorbisPropertiesReader -- (NSDictionary *)propertiesForURL:(NSURL *)url ++ (NSDictionary *)propertiesForSource:(id)source { NSDictionary *properties; VorbisDecoder *decoder; decoder = [[VorbisDecoder alloc] init]; - if (![decoder open:url]) + if (![decoder open:source]) { return nil; } @@ -25,6 +25,7 @@ properties = [decoder properties]; [decoder close]; + [decoder release]; return properties; } diff --git a/Plugins/WavPack/WavPack.xcodeproj/project.pbxproj b/Plugins/WavPack/WavPack.xcodeproj/project.pbxproj index dadd49b8a..da6d2f2f0 100644 --- a/Plugins/WavPack/WavPack.xcodeproj/project.pbxproj +++ b/Plugins/WavPack/WavPack.xcodeproj/project.pbxproj @@ -7,12 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 1745C4D90B90C42500A6768C /* WavPackCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 1745C4D40B90C42500A6768C /* WavPackCodec.m */; }; 1745C4DA0B90C42500A6768C /* WavPackDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1745C4D60B90C42500A6768C /* WavPackDecoder.m */; }; 1745C4DB0B90C42500A6768C /* WavPackPropertiesReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1745C4D80B90C42500A6768C /* WavPackPropertiesReader.m */; }; 177FCF950B90C9450011C3B5 /* Plugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 177FCF940B90C9450011C3B5 /* Plugin.h */; }; 179CFD490B90C6DC00C8C4DB /* WavPack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 179CFD480B90C6DC00C8C4DB /* WavPack.framework */; }; 179CFD4C0B90C6DF00C8C4DB /* WavPack.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 179CFD480B90C6DC00C8C4DB /* WavPack.framework */; }; + 17ADB2620B97946600257CA2 /* WavPackPlugin.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17ADB2600B97946600257CA2 /* WavPackPlugin.h */; }; + 17ADB2630B97946600257CA2 /* WavPackPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 17ADB2610B97946600257CA2 /* WavPackPlugin.m */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -25,6 +26,7 @@ files = ( 179CFD4C0B90C6DF00C8C4DB /* WavPack.framework in CopyFiles */, 177FCF950B90C9450011C3B5 /* Plugin.h in CopyFiles */, + 17ADB2620B97946600257CA2 /* WavPackPlugin.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -34,14 +36,14 @@ 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 1745C4D30B90C42500A6768C /* WavPackCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackCodec.h; sourceTree = ""; }; - 1745C4D40B90C42500A6768C /* WavPackCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackCodec.m; sourceTree = ""; }; 1745C4D50B90C42500A6768C /* WavPackDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackDecoder.h; sourceTree = ""; }; 1745C4D60B90C42500A6768C /* WavPackDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackDecoder.m; sourceTree = ""; }; 1745C4D70B90C42500A6768C /* WavPackPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackPropertiesReader.h; sourceTree = ""; }; 1745C4D80B90C42500A6768C /* WavPackPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackPropertiesReader.m; sourceTree = ""; }; 177FCF940B90C9450011C3B5 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = ../../Audio/Plugin.h; sourceTree = SOURCE_ROOT; }; 179CFD480B90C6DC00C8C4DB /* WavPack.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WavPack.framework; path = ../../Frameworks/WavPack/build/Release/WavPack.framework; sourceTree = SOURCE_ROOT; }; + 17ADB2600B97946600257CA2 /* WavPackPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackPlugin.h; sourceTree = ""; }; + 17ADB2610B97946600257CA2 /* WavPackPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackPlugin.m; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* WavPack_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WavPack_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* WavPack.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WavPack.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -94,8 +96,8 @@ isa = PBXGroup; children = ( 177FCF940B90C9450011C3B5 /* Plugin.h */, - 1745C4D30B90C42500A6768C /* WavPackCodec.h */, - 1745C4D40B90C42500A6768C /* WavPackCodec.m */, + 17ADB2600B97946600257CA2 /* WavPackPlugin.h */, + 17ADB2610B97946600257CA2 /* WavPackPlugin.m */, 1745C4D50B90C42500A6768C /* WavPackDecoder.h */, 1745C4D60B90C42500A6768C /* WavPackDecoder.m */, 1745C4D70B90C42500A6768C /* WavPackPropertiesReader.h */, @@ -191,9 +193,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1745C4D90B90C42500A6768C /* WavPackCodec.m in Sources */, 1745C4DA0B90C42500A6768C /* WavPackDecoder.m in Sources */, 1745C4DB0B90C42500A6768C /* WavPackPropertiesReader.m in Sources */, + 17ADB2630B97946600257CA2 /* WavPackPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Plugins/WavPack/WavPackCodec.h b/Plugins/WavPack/WavPackCodec.h deleted file mode 100644 index 342318db8..000000000 --- a/Plugins/WavPack/WavPackCodec.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MusepackCodec.h -// Musepack -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import -#import "Plugin.h" - -@interface WavPackCodec : NSObject -{ - -} - -@end diff --git a/Plugins/WavPack/WavPackCodec.m b/Plugins/WavPack/WavPackCodec.m deleted file mode 100644 index 3f724083f..000000000 --- a/Plugins/WavPack/WavPackCodec.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MusepackCodec.m -// MusepackCodec -// -// Created by Vincent Spader on 2/21/07. -// Copyright 2007 __MyCompanyName__. All rights reserved. -// - -#import "WavPackCodec.h" -#import "WavPackDecoder.h" -#import "WavPackPropertiesReader.h" - -@implementation WavPackCodec - -- (int)pluginType -{ - return kCogPluginCodec; -} - -- (Class)decoder -{ - return [WavPackDecoder class]; -} - -- (Class)metadataReader -{ - return nil; -} - -- (Class)propertiesReader -{ - return [WavPackPropertiesReader class]; -} - - - - -@end diff --git a/Plugins/WavPack/WavPackPlugin.h b/Plugins/WavPack/WavPackPlugin.h new file mode 100644 index 000000000..c221b0dfc --- /dev/null +++ b/Plugins/WavPack/WavPackPlugin.h @@ -0,0 +1,17 @@ +// +// MusepackCodec.h +// Musepack +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import +#import "Plugin.h" + +@interface WavPackPlugin : NSObject +{ + +} + +@end diff --git a/Plugins/WavPack/WavPackPlugin.m b/Plugins/WavPack/WavPackPlugin.m new file mode 100644 index 000000000..7743dab32 --- /dev/null +++ b/Plugins/WavPack/WavPackPlugin.m @@ -0,0 +1,24 @@ +// +// MusepackCodec.m +// MusepackCodec +// +// Created by Vincent Spader on 2/21/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "WavPackPlugin.h" +#import "WavPackDecoder.h" +#import "WavPackPropertiesReader.h" + +@implementation WavPackPlugin + ++ (NSDictionary *)pluginInfo +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + kCogDecoder, [WavPackDecoder className], + kCogPropertiesReader, [WavPackPropertiesReader className, + nil + ]; +} + +@end diff --git a/Scripts/build_plugins.sh b/Scripts/build_plugins.sh index d9e5290c3..f039ad6a2 100755 --- a/Scripts/build_plugins.sh +++ b/Scripts/build_plugins.sh @@ -1,6 +1,6 @@ #!/bin/sh -plugins=( CoreAudio MonkeysAudio Musepack Flac Shorten TagLib Vorbis WavPack MAD ) +plugins=( CoreAudio MonkeysAudio Musepack Flac Shorten TagLib Vorbis WavPack MAD FileSource HTTPSource) for plugin in "${plugins[@]}" do diff --git a/TODO b/TODO new file mode 100644 index 000000000..3ed7e7f57 --- /dev/null +++ b/TODO @@ -0,0 +1,2 @@ +Changed SourceNode to BufferedSource. It's not really a node. +Fix all plugins besides ogg vorbis (already fixed), so they use callbacks and the source.