Cog/Plugins/MAD/MADDecoder.h

51 lines
852 B
C
Raw Normal View History

2006-06-18 20:39:41 -04:00
//
// MADFile.h
// Cog
//
// Created by Vincent Spader on 6/17/06.
// Copyright 2006 Vincent Spader. All rights reserved.
2006-06-18 20:39:41 -04:00
//
#define HAVE_CONFIG_H
2006-06-18 20:39:41 -04:00
#import <Cocoa/Cocoa.h>
#undef HAVE_CONFIG_H
2006-06-18 20:39:41 -04:00
#import "MAD/mad.h"
#import "Plugin.h"
2006-06-18 20:39:41 -04:00
#define INPUT_BUFFER_SIZE 5*8192
@interface MADDecoder : NSObject <CogDecoder>
{
2006-06-18 20:39:41 -04:00
struct mad_stream _stream;
struct mad_frame _frame;
struct mad_synth _synth;
2007-10-17 23:33:12 -03:00
2006-06-18 20:39:41 -04:00
unsigned char _inputBuffer[INPUT_BUFFER_SIZE+MAD_BUFFER_GUARD];
unsigned char *_outputBuffer;
int _outputAvailable;
int _fileSize;
id<CogSource> _source;
2006-06-18 20:39:41 -04:00
2007-03-03 21:17:05 -03:00
BOOL _firstFrame;
2006-09-02 12:09:20 -04:00
//For gapless playback of mp3s
2007-10-17 23:33:12 -03:00
BOOL _foundXingHeader;
BOOL _foundLAMEHeader;
long _samplesDecoded;
long _totalSamples;
uint16_t _startPadding;
uint16_t _endPadding;
int channels;
int bitsPerSample;
float frequency;
int bitrate;
double length;
2006-06-18 20:39:41 -04:00
}
@end