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
|
|
|
//
|
|
|
|
|
2005-06-29 15:28:20 +00:00
|
|
|
#import "FLAC/all.h"
|
2022-02-07 05:49:27 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
#define SAMPLES_PER_WRITE 512
|
2021-12-11 08:22:19 +00:00
|
|
|
#define FLAC__MAX_SUPPORTED_CHANNELS 8
|
2022-02-07 05:49:27 +00:00
|
|
|
#define SAMPLE_blockBuffer_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * FLAC__MAX_SUPPORTED_CHANNELS * (24 / 8))
|
2005-06-02 18:16:43 +00:00
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
#import "Plugin.h"
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
@interface FlacDecoder : NSObject <CogDecoder> {
|
2007-03-04 21:32:03 +00:00
|
|
|
FLAC__StreamDecoder *decoder;
|
2007-11-24 20:16:27 +00:00
|
|
|
void *blockBuffer;
|
|
|
|
int blockBufferFrames;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2007-03-04 21:32:03 +00:00
|
|
|
id<CogSource> source;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2007-03-04 21:32:03 +00:00
|
|
|
BOOL endOfStream;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
int bitsPerSample;
|
|
|
|
int channels;
|
2022-02-07 10:06:51 +00:00
|
|
|
uint32_t channelConfig;
|
2007-02-24 20:36:27 +00:00
|
|
|
float frequency;
|
2007-11-24 20:16:27 +00:00
|
|
|
long totalFrames;
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
long fileSize;
|
|
|
|
|
|
|
|
BOOL hasStreamInfo;
|
2022-02-08 03:18:45 +00:00
|
|
|
BOOL streamOpened;
|
2022-02-09 21:44:50 +00:00
|
|
|
BOOL abortFlag;
|
|
|
|
|
|
|
|
NSString *artist;
|
2022-02-12 15:16:59 +00:00
|
|
|
NSString *albumartist;
|
|
|
|
NSString *album;
|
2022-02-09 21:44:50 +00:00
|
|
|
NSString *title;
|
2022-02-12 15:16:59 +00:00
|
|
|
NSString *genre;
|
|
|
|
NSNumber *year;
|
|
|
|
NSNumber *track;
|
|
|
|
NSNumber *disc;
|
|
|
|
float replayGainAlbumGain;
|
|
|
|
float replayGainAlbumPeak;
|
|
|
|
float replayGainTrackGain;
|
|
|
|
float replayGainTrackPeak;
|
|
|
|
|
|
|
|
NSData *albumArt;
|
|
|
|
|
2022-02-15 03:54:08 +00:00
|
|
|
BOOL cuesheetFound;
|
2022-02-12 15:16:59 +00:00
|
|
|
NSString *cuesheet;
|
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;
|
|
|
|
|
2021-12-11 08:22:19 +00:00
|
|
|
- (void)setSize:(long)size;
|
|
|
|
|
2007-03-04 21:32:03 +00:00
|
|
|
- (FLAC__StreamDecoder *)decoder;
|
2007-11-24 20:16:27 +00:00
|
|
|
- (char *)blockBuffer;
|
|
|
|
- (int)blockBufferFrames;
|
|
|
|
- (void)setBlockBufferFrames:(int)frames;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
@end
|