xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/APECompressCreate.h (revision be878f60874196f746f336f235797c8efa25004e)
1 #ifndef APE_APECOMPRESSCREATE_H
2 #define APE_APECOMPRESSCREATE_H
3 
4 #include "APECompress.h"
5 
6 class CAPECompressCore;
7 
8 class CAPECompressCreate
9 {
10 public:
11     CAPECompressCreate();
12     ~CAPECompressCreate();
13 
14     int InitializeFile(CIO * pIO, const WAVEFORMATEX * pwfeInput, int nMaxFrames, int nCompressionLevel, const void * pHeaderData, int nHeaderBytes);
15     int FinalizeFile(CIO * pIO, int nNumberOfFrames, int nFinalFrameBlocks, const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes, int nPeakLevel);
16 
17     int SetSeekByte(int nFrame, int nByteOffset);
18 
19     int Start(CIO * pioOutput, const WAVEFORMATEX * pwfeInput, int nMaxAudioBytes, int nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, int nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION);
20 
21     int GetFullFrameBytes();
22     int EncodeFrame(const void * pInputData, int nInputBytes);
23 
24     int Finish(const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes);
25 
26 
27 private:
28 
29     CSmartPtr<uint32> m_spSeekTable;
30     int m_nMaxFrames;
31 
32     CSmartPtr<CIO> m_spIO;
33     CSmartPtr<CAPECompressCore> m_spAPECompressCore;
34 
35     WAVEFORMATEX    m_wfeInput;
36     int                m_nCompressionLevel;
37     int                m_nSamplesPerFrame;
38     int                m_nFrameIndex;
39     int                m_nLastFrameBlocks;
40 
41 };
42 
43 #endif // #ifndef APE_APECOMPRESSCREATE_H
44