2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
// FlacFile.h
|
|
|
|
// zyVorbis
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 1/25/05.
|
2005-07-02 21:02:06 +00:00
|
|
|
// Copyright 2005 Vincent Spader All rights reserved.
|
2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2005-06-29 15:28:20 +00:00
|
|
|
#import "FLAC/all.h"
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
#define SAMPLES_PER_WRITE 512
|
|
|
|
#define FLAC__MAX_SUPPORTED_CHANNELS 2
|
|
|
|
#define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * FLAC__MAX_SUPPORTED_CHANNELS * (24/8))
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
#import "Plugin.h"
|
|
|
|
|
|
|
|
@interface FlacDecoder : NSObject <CogDecoder>
|
|
|
|
{
|
2007-03-04 21:32:03 +00:00
|
|
|
FLAC__StreamDecoder *decoder;
|
2007-02-27 23:56:52 +00:00
|
|
|
void *buffer;
|
2005-06-02 18:16:43 +00:00
|
|
|
int bufferAmount;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
2007-03-04 21:32:03 +00:00
|
|
|
id<CogSource> source;
|
|
|
|
|
|
|
|
BOOL endOfStream;
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
int bitsPerSample;
|
|
|
|
int channels;
|
|
|
|
float frequency;
|
|
|
|
double length;
|
2005-06-02 18:16:43 +00:00
|
|
|
}
|
|
|
|
|
2007-03-04 21:32:03 +00:00
|
|
|
- (void)setSource:(id<CogSource>)s;
|
|
|
|
- (id<CogSource>)source;
|
|
|
|
|
|
|
|
- (void)setEndOfStream:(BOOL)eos;
|
|
|
|
- (BOOL)endOfStream;
|
|
|
|
|
|
|
|
- (FLAC__StreamDecoder *)decoder;
|
2005-06-02 18:16:43 +00:00
|
|
|
- (char *)buffer;
|
|
|
|
- (int)bufferAmount;
|
|
|
|
- (void)setBufferAmount:(int)amount;
|
|
|
|
|
|
|
|
@end
|