2007-02-24 20:36:27 +00:00
|
|
|
//
|
|
|
|
// MADPropertiesReader.m
|
|
|
|
// MAD
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 2/24/07.
|
|
|
|
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "VorbisPropertiesReader.h"
|
|
|
|
#import "VorbisDecoder.h"
|
|
|
|
|
|
|
|
@implementation VorbisPropertiesReader
|
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source
|
2007-02-24 20:36:27 +00:00
|
|
|
{
|
|
|
|
NSDictionary *properties;
|
|
|
|
VorbisDecoder *decoder;
|
|
|
|
|
|
|
|
decoder = [[VorbisDecoder alloc] init];
|
2007-03-02 01:36:52 +00:00
|
|
|
if (![decoder open:source])
|
2007-02-24 20:36:27 +00:00
|
|
|
{
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
properties = [decoder properties];
|
|
|
|
|
|
|
|
[decoder close];
|
2007-03-02 01:36:52 +00:00
|
|
|
[decoder release];
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
return properties;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ (NSArray *)fileTypes
|
|
|
|
{
|
|
|
|
return [VorbisDecoder fileTypes];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|