00001 #ifndef INPUT_FLAC_H 00002 #define INPUT_FLAC_H 00003 00004 00005 #include <FLAC++/decoder.h> 00006 #include "audiere.h" 00007 #include "utility.h" 00008 00009 00010 namespace audiere { 00011 00012 class FLACInputStream : public RefImplementation<audiere::SampleSource> { 00013 public: 00014 FLACInputStream(); 00015 ~FLACInputStream(); 00016 00017 bool initialize(File* file); 00018 00019 void ADR_CALL getFormat( 00020 int& channel_count, 00021 int& sample_rate, 00022 SampleFormat& sampleformat); 00023 int ADR_CALL read(int frame_count, void* samples); 00024 void ADR_CALL reset(); 00025 00026 bool ADR_CALL isSeekable(); 00027 int ADR_CALL getLength(); 00028 void ADR_CALL setPosition(int position); 00029 int ADR_CALL getPosition(); 00030 00031 private: 00032 FLAC__StreamDecoderWriteStatus write( 00033 const FLAC__Frame* frame, 00034 const FLAC__int32* const buffer[]); 00035 00036 RefPtr<File> m_file; 00037 00038 FLAC::Decoder::SeekableStream* m_decoder; 00039 00045 SizedBuffer m_multiplexer; 00046 00051 QueueBuffer m_buffer; 00052 00053 int m_channel_count; 00054 int m_sample_rate; 00055 SampleFormat m_sample_format; 00056 00057 int m_length; 00058 int m_position; 00059 00060 friend class MyFLACDecoder; 00061 }; 00062 00063 } 00064 00065 00066 #endif
1.2.17