Added source plugin support. Things are incredibly broken. Besides Ogg Vorbis. That should still work.

CQTexperiment
vspader 2007-03-02 01:36:52 +00:00
parent c98aa0af87
commit 934840ace5
90 changed files with 1827 additions and 594 deletions

View File

@ -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;

View File

@ -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];

View File

@ -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];
}
}

View File

@ -8,11 +8,11 @@
#import <Cocoa/Cocoa.h>
#import "PluginController.h"
#import "Plugin.h"
@interface AudioDecoder : NSObject {
}
+ audioDecoderForURL:(NSURL *)url;
+ (id<CogDecoder>)audioDecoderForURL:(NSURL *)url;
@end

View File

@ -8,10 +8,11 @@
#import "AudioDecoder.h"
#import "PluginController.h"
@implementation AudioDecoder
+ audioDecoderForURL:(NSURL *)url
+ (id<CogDecoder>) audioDecoderForURL:(NSURL *)url
{
NSString *ext = [[url path] pathExtension];

View File

@ -10,7 +10,7 @@
#import "BufferChain.h"
#import "OutputNode.h"
#import "Status.h"
#import "PluginController.h"
@implementation AudioPlayer

View File

@ -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<CogSource> 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;
}

View File

@ -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 <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface MonkeysAudioCodec : NSObject <CogCodecPlugin>
{
#import "PluginController.h"
@interface AudioSource : NSObject {
}
+ audioSourceForURL:(NSURL *)url;
@end

25
Audio/AudioSource.m Normal file
View File

@ -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

View File

@ -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;

View File

@ -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<CogSource> 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];

View File

@ -23,7 +23,7 @@
double seekTime;
}
- (BOOL)open:(NSURL *)url;
- (BOOL)openURL:(NSURL *)url withSource:(id<CogSource>)source;
- (void)process;
- (NSDictionary *) properties;
- (void)seek:(double)time;

View File

@ -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<CogSource>)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;
}

40
Audio/Chain/SourceNode.h Normal file
View File

@ -0,0 +1,40 @@
//
// InputNode.h
// Cog
//
// Created by Vincent Spader on 8/2/05.
// Copyright 2005 Vincent Spader. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Node.h"
#import "Plugin.h"
@interface SourceNode : Node <CogSource>
{
id<CogSource> source;
long byteCount;
}
- (id)initWithSource:(id<CogSource>)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

122
Audio/Chain/SourceNode.m Normal file
View File

@ -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<CogSource>)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

View File

@ -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 = "<absolute>"; };
17A2D3C30B8D1D37000778C4 /* AudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDecoder.h; sourceTree = "<group>"; };
17A2D3C40B8D1D37000778C4 /* AudioDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioDecoder.m; sourceTree = "<group>"; };
17ADB13A0B97926D00257CA2 /* AudioSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioSource.h; sourceTree = "<group>"; };
17ADB13B0B97926D00257CA2 /* AudioSource.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AudioSource.m; sourceTree = "<group>"; };
17ADB13F0B97927C00257CA2 /* SourceNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SourceNode.h; sourceTree = "<group>"; };
17ADB1400B97927C00257CA2 /* SourceNode.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SourceNode.m; sourceTree = "<group>"; };
17B6192E0B909BC300BC003F /* AudioPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioPropertiesReader.h; sourceTree = "<group>"; };
17B6192F0B909BC300BC003F /* AudioPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AudioPropertiesReader.m; sourceTree = "<group>"; };
17C940210B900909008627D6 /* AudioMetadataReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioMetadataReader.h; sourceTree = "<group>"; };
@ -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;

View File

@ -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 <NSObject>
//Dictionary containing classname/plugintype pairs. ex: @"VorbisDecoder": kCogDecoder, @"VorbisPropertiesRaeder": kCogPropertiesReader
+ (NSDictionary *)pluginInfo;
@end
@protocol CogCodecPlugin
- (Class)decoder;
- (Class)metadataReader;
- (Class)propertiesReader;
@end
@protocol CogSource <NSObject>
+ (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 <NSObject>
+ (NSArray *)fileTypes; //mp3, ogg, etc
- (BOOL)open:(id<CogSource>)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 <NSObject>
+ (NSArray *)fileTypes;
+ (NSDictionary *)metadataForURL;
@end
@protocol CogPropertiesReader
@protocol CogPropertiesReader <NSObject>
+ (NSArray *)fileTypes;
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source;
@end

View File

@ -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;

View File

@ -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

View File

@ -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])
]];
}

View File

@ -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 = "<group>"; };
177FD02F0B90CAEC0011C3B5 /* Vorbis.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Vorbis.bundle; path = Plugins/Vorbis/build/Release/Vorbis.bundle; sourceTree = "<group>"; };
177FD0330B90CAF40011C3B5 /* WavPack.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = WavPack.bundle; path = Plugins/WavPack/build/Release/WavPack.bundle; sourceTree = "<group>"; };
17ADB4450B979C5700257CA2 /* FileSource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = FileSource.bundle; path = Plugins/FileSource/build/Release/FileSource.bundle; sourceTree = "<group>"; };
17ADB65C0B97A96400257CA2 /* HTTPSource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = HTTPSource.bundle; path = Plugins/HTTPSource/build/Release/HTTPSource.bundle; sourceTree = "<group>"; };
17B61B5D0B90A27F00BC003F /* CogAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CogAudio.framework; path = Audio/build/Release/CogAudio.framework; sourceTree = "<group>"; };
17BB5CEC0B8A86010009ACB1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
@ -495,6 +501,8 @@
17B619FF0B909ED400BC003F /* PlugIns */ = {
isa = PBXGroup;
children = (
17ADB65C0B97A96400257CA2 /* HTTPSource.bundle */,
17ADB4450B979C5700257CA2 /* FileSource.bundle */,
177FD0330B90CAF40011C3B5 /* WavPack.bundle */,
177FD02F0B90CAEC0011C3B5 /* Vorbis.bundle */,
177FD02B0B90CAE50011C3B5 /* TagLib.bundle */,

View File

@ -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;
},

View File

@ -32,11 +32,12 @@
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>513</integer>
<integer>463</integer>
<integer>1156</integer>
<integer>29</integer>
<integer>1307</integer>
<integer>513</integer>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>

Binary file not shown.

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
@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;

View File

@ -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

View File

@ -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 = "<group>"; };
1745C2190B90B7F800A6768C /* CoreAudioPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioPropertiesReader.m; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB1990B97937600257CA2 /* CoreAudioPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioPlugin.m; sourceTree = "<group>"; };
17C93E720B8FF192008627D6 /* CoreAudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioDecoder.h; sourceTree = "<group>"; };
17C93E730B8FF192008627D6 /* CoreAudioDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioDecoder.m; sourceTree = "<group>"; };
17C93EAB0B8FF3CE008627D6 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
17C93EB20B8FF3E1008627D6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
17F94E1B0B8D128500A34E87 /* CoreAudioCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioCodec.h; sourceTree = "<group>"; };
17F94E1C0B8D128500A34E87 /* CoreAudioCodec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreAudioCodec.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* CoreAudio_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudio_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface CoreAudioCodec : NSObject <CogCodecPlugin>
@interface CoreAudioPlugin : NSObject <CogPlugin>
{
}

View File

@ -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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>CoreAudioCodec</string>
<string>CoreAudioPlugin</string>
</dict>
</plist>

View File

@ -0,0 +1,18 @@
//
// FileSource.h
// FileSource
//
// Created by Vincent Spader on 3/1/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface FileSource : NSObject <CogSource>
{
FILE *_fd;
}
@end

View File

@ -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

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
17ADB3FD0B979A4600257CA2 /* FileSourcePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSourcePlugin.h; sourceTree = "<group>"; };
17ADB3FE0B979A4600257CA2 /* FileSourcePlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileSourcePlugin.m; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB4190B979AEB00257CA2 /* FileSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileSource.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* FileSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSource_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
/* 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 = "<group>";
};
089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */,
);
name = "Frameworks and Libraries";
sourceTree = "<group>";
};
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D5B49B7048680CD000E48DA /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AFFE84173DC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
17ADB4080B979A8A00257CA2 /* Plugin.h */,
17ADB3FD0B979A4600257CA2 /* FileSourcePlugin.h */,
17ADB3FE0B979A4600257CA2 /* FileSourcePlugin.m */,
17ADB4180B979AEB00257CA2 /* FileSource.h */,
17ADB4190B979AEB00257CA2 /* FileSource.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
089C167FFE841241C02AAC07 /* AppKit.framework */,
D2F7E65807B2D6F200F64583 /* CoreData.framework */,
089C1672FE841209C02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FB8FE9D52D311CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D5B49B6048680CD000E48DA /* FileSource.bundle */,
);
name = Products;
sourceTree = "<group>";
};
32C88E010371C26100C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
32DBCF630370AF2F00C91783 /* FileSource_Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
/* 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 */;
}

View File

@ -0,0 +1,18 @@
//
// FileSourcePlugin.h
// FileSource
//
// Created by Vincent Spader on 3/1/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface FileSourcePlugin : NSObject <CogPlugin>
{
}
@end

View File

@ -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

View File

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'FileSource' target in the 'FileSource' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.yourcocoabundle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>FileSourcePlugin</string>
</dict>
</plist>

View File

@ -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 = "<group>"; };
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 = "<group>"; };
17ADB1B30B9793A600257CA2 /* FlacPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacPlugin.m; sourceTree = "<group>"; };
17C93F030B8FF67A008627D6 /* FlacDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FlacDecoder.h; sourceTree = "<group>"; };
17C93F040B8FF67A008627D6 /* FlacDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacDecoder.m; sourceTree = "<group>"; };
17C93F060B8FF67A008627D6 /* FlacCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FlacCodec.h; sourceTree = "<group>"; };
17C93F070B8FF67A008627D6 /* FlacCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FlacCodec.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* Flac_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flac_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface MADCodec : NSObject <CogCodecPlugin>
@interface FlacPlugin : NSObject <CogPlugin>
{
}

25
Plugins/Flac/FlacPlugin.m Normal file
View File

@ -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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>FlacCodec</string>
<string>FlacPlugin</string>
</dict>
</plist>

View File

@ -0,0 +1,21 @@
//
// HTTPSource.h
// HTTPSource
//
// Created by Vincent Spader on 3/1/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Socket.h"
#import "Plugin.h"
@interface HTTPSource : NSObject <CogSource>
{
Socket *_socket;
long byteCount;
}
@end

View File

@ -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

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
17ADB6090B97A73B00257CA2 /* Socket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Socket.h; sourceTree = "<group>"; };
17ADB60A0B97A73B00257CA2 /* Socket.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Socket.m; sourceTree = "<group>"; };
17ADB60C0B97A74800257CA2 /* HTTPSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTTPSource.h; sourceTree = "<group>"; };
17ADB60D0B97A74800257CA2 /* HTTPSource.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HTTPSource.m; sourceTree = "<group>"; };
17ADB60E0B97A74800257CA2 /* HTTPSourcePlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTTPSourcePlugin.h; sourceTree = "<group>"; };
17ADB60F0B97A74800257CA2 /* HTTPSourcePlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = HTTPSourcePlugin.m; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
/* 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 = "<group>";
};
089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */,
);
name = "Frameworks and Libraries";
sourceTree = "<group>";
};
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D5B49B7048680CD000E48DA /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
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 = "<group>";
};
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
089C167FFE841241C02AAC07 /* AppKit.framework */,
D2F7E65807B2D6F200F64583 /* CoreData.framework */,
089C1672FE841209C02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
17ADB6080B97A73B00257CA2 /* Utils */ = {
isa = PBXGroup;
children = (
17ADB6090B97A73B00257CA2 /* Socket.h */,
17ADB60A0B97A73B00257CA2 /* Socket.m */,
);
path = Utils;
sourceTree = "<group>";
};
19C28FB8FE9D52D311CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D5B49B6048680CD000E48DA /* HTTPSource.bundle */,
);
name = Products;
sourceTree = "<group>";
};
32C88E010371C26100C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
32DBCF630370AF2F00C91783 /* HTTPSource_Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
/* 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 */;
}

View File

@ -0,0 +1,18 @@
//
// HTTPSourcePlugin.h
// HTTPSource
//
// Created by Vincent Spader on 3/1/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface HTTPSourcePlugin : NSObject <CogPlugin>
{
}
@end

View File

@ -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

View File

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'HTTPSource' target in the 'HTTPSource' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.yourcocoabundle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>HTTPSourcePlugin</string>
</dict>
</plist>

View File

@ -0,0 +1,23 @@
//
// Socket.h
// Cog
//
// Created by Vincent Spader on 2/28/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//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

View File

@ -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 <netdb.h>
@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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>MADCodec</string>
<string>MADPlugin</string>
</dict>
</plist>

View File

@ -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 = "<absolute>"; };
170335420B8FC4EE00327265 /* MADDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MADDecoder.h; sourceTree = "<group>"; };
170335430B8FC4EE00327265 /* MADDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADDecoder.m; sourceTree = "<group>"; };
170335440B8FC4EE00327265 /* MADCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MADCodec.h; sourceTree = "<group>"; };
170335450B8FC4EE00327265 /* MADCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADCodec.m; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB1D10B9793C500257CA2 /* MADPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MADPlugin.m; sourceTree = "<group>"; };
17B618AC0B90997E00BC003F /* MADPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MADPropertiesReader.h; sourceTree = "<group>"; };
17B618AD0B90997E00BC003F /* MADPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MADPropertiesReader.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* MAD_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MAD_Prefix.pch; sourceTree = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface FlacCodec : NSObject <CogCodecPlugin>
@interface MADPlugin : NSObject <CogPlugin>
{
}

24
Plugins/MAD/MADPlugin.m Normal file
View File

@ -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

View File

@ -6,14 +6,14 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.yourcocoabundle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>MonkeysAudioCodec</string>
<string>MonkeysAudioPlugin</string>
</dict>
</plist>

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1745C2E60B90BDD100A6768C /* MonkeysAudioCodec.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioCodec.mm; sourceTree = "<group>"; };
1745C2E70B90BDD100A6768C /* MonkeysAudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioDecoder.h; sourceTree = "<group>"; };
1745C2E80B90BDD100A6768C /* MonkeysAudioDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioDecoder.mm; sourceTree = "<group>"; };
1745C2E90B90BDD100A6768C /* MonkeysAudioPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioPropertiesReader.h; sourceTree = "<group>"; };
1745C2EA0B90BDD100A6768C /* MonkeysAudioPropertiesReader.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioPropertiesReader.mm; sourceTree = "<group>"; };
1745C2F80B90BDF200A6768C /* MonkeysAudioCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MonkeysAudioCodec.h; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB1E70B9793E300257CA2 /* MonkeysAudioPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MonkeysAudioPlugin.mm; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* MonkeysAudio_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MonkeysAudio_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface MusepackCodec : NSObject <CogCodecPlugin>
@interface MonkeysAudioPlugin : NSObject <CogPlugin>
{
}

View File

@ -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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>MusepackCodec</string>
<string>MusepackPlugin</string>
</dict>
</plist>

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
170333070B8FB64500327265 /* MusepackCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackCodec.h; sourceTree = "<group>"; };
170333080B8FB64500327265 /* MusepackCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackCodec.m; sourceTree = "<group>"; };
170333090B8FB64500327265 /* MusepackDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackDecoder.h; sourceTree = "<group>"; };
1703330A0B8FB64500327265 /* MusepackDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackDecoder.m; sourceTree = "<group>"; };
1745C1A10B90B57400A6768C /* MusepackPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MusepackPropertiesReader.h; sourceTree = "<group>"; };
1745C1A20B90B57400A6768C /* MusepackPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackPropertiesReader.m; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB2010B9793FF00257CA2 /* MusepackPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MusepackPlugin.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* Musepack_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Musepack_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface VorbisCodec : NSObject <CogCodecPlugin>
@interface MusepackPlugin : NSObject <CogPlugin>
{
}

View File

@ -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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>ShortenCodec</string>
<string>ShortenPlugin</string>
</dict>
</plist>

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1745C4290B90C1DC00A6768C /* ShortenCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenCodec.h; sourceTree = "<group>"; };
1745C42A0B90C1DC00A6768C /* ShortenCodec.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenCodec.mm; sourceTree = "<group>"; };
1745C42B0B90C1DC00A6768C /* ShortenDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenDecoder.h; sourceTree = "<group>"; };
1745C42C0B90C1DC00A6768C /* ShortenDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenDecoder.mm; sourceTree = "<group>"; };
1745C42D0B90C1DC00A6768C /* ShortenPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShortenPropertiesReader.h; sourceTree = "<group>"; };
1745C42E0B90C1DC00A6768C /* ShortenPropertiesReader.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenPropertiesReader.mm; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB2230B97942800257CA2 /* ShortenPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ShortenPlugin.mm; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* Shorten_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shorten_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface ShortenCodec : NSObject <CogCodecPlugin>
@interface ShortenPlugin : NSObject <CogPlugin>
{
}

View File

@ -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

View File

@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface TagLibPlugin : NSObject <CogCodecPlugin>
@interface TagLibPlugin : NSObject <CogPlugin>
{
}

View File

@ -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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>VorbisCodec</string>
<string>VorbisPlugin</string>
</dict>
</plist>

View File

@ -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 = "<group>"; };
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 = "<group>"; };
17C93D320B8FDA66008627D6 /* VorbisCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisCodec.m; sourceTree = "<group>"; };
17ADB2460B97944D00257CA2 /* VorbisPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisPlugin.h; sourceTree = "<group>"; };
17ADB2470B97944D00257CA2 /* VorbisPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisPlugin.m; sourceTree = "<group>"; };
17C93D330B8FDA66008627D6 /* VorbisDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VorbisDecoder.h; sourceTree = "<group>"; };
17C93D340B8FDA66008627D6 /* VorbisDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VorbisDecoder.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* Vorbis_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vorbis_Prefix.pch; sourceTree = "<group>"; };
@ -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;
};

View File

@ -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

View File

@ -21,10 +21,12 @@
@interface VorbisDecoder : NSObject <CogDecoder>
{
FILE *inFd;
id<CogSource> source;
OggVorbis_File vorbisRef;
int currentSection;
BOOL seekable;
int bitsPerSample;
int bitrate;
int channels;
@ -32,4 +34,6 @@
double length;
}
@end

View File

@ -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<CogSource>)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, &currentSection);
while (total != size && numread != 0)
{
do {
numread = ov_read(&vorbisRef, &((char *)buf)[total], size - total, 0, bitsPerSample/8, 1, &currentSection);
if (numread > 0) {
total += numread;
}
numread = ov_read(&vorbisRef, &((char *)buf)[total], size - total, 0, bitsPerSample/8, 1, &currentSection);
}
} 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
{

View File

@ -0,0 +1,17 @@
//
// MusepackCodec.h
// Musepack
//
// Created by Vincent Spader on 2/21/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface VorbisPlugin : NSObject <CogPlugin>
{
}
@end

View File

@ -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

View File

@ -11,13 +11,13 @@
@implementation VorbisPropertiesReader
- (NSDictionary *)propertiesForURL:(NSURL *)url
+ (NSDictionary *)propertiesForSource:(id<CogSource>)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;
}

View File

@ -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 = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1745C4D30B90C42500A6768C /* WavPackCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackCodec.h; sourceTree = "<group>"; };
1745C4D40B90C42500A6768C /* WavPackCodec.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackCodec.m; sourceTree = "<group>"; };
1745C4D50B90C42500A6768C /* WavPackDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackDecoder.h; sourceTree = "<group>"; };
1745C4D60B90C42500A6768C /* WavPackDecoder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackDecoder.m; sourceTree = "<group>"; };
1745C4D70B90C42500A6768C /* WavPackPropertiesReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WavPackPropertiesReader.h; sourceTree = "<group>"; };
1745C4D80B90C42500A6768C /* WavPackPropertiesReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackPropertiesReader.m; sourceTree = "<group>"; };
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 = "<group>"; };
17ADB2610B97946600257CA2 /* WavPackPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WavPackPlugin.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* WavPack_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WavPack_Prefix.pch; sourceTree = "<group>"; };
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 = "<group>"; };
@ -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;
};

View File

@ -1,17 +0,0 @@
//
// MusepackCodec.h
// Musepack
//
// Created by Vincent Spader on 2/21/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface WavPackCodec : NSObject <CogCodecPlugin>
{
}
@end

View File

@ -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

View File

@ -0,0 +1,17 @@
//
// MusepackCodec.h
// Musepack
//
// Created by Vincent Spader on 2/21/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Plugin.h"
@interface WavPackPlugin : NSObject <CogPlugin>
{
}
@end

View File

@ -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

View File

@ -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

2
TODO Normal file
View File

@ -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.