1 #ifndef APE_APECOMPRESS_H
2 #define APE_APECOMPRESS_H
5 class CAPECompressCreate
;
7 /*************************************************************************************************
8 CAPECompress - uses the CAPECompressHub to provide a simpler compression interface (with buffering, etc)
9 *************************************************************************************************/
10 class CAPECompress
: public IAPECompress
18 int Start(const wchar_t * pOutputFilename
, const WAVEFORMATEX
* pwfeInput
, int nMaxAudioBytes
, int nCompressionLevel
= COMPRESSION_LEVEL_NORMAL
, const void * pHeaderData
= NULL
, int nHeaderBytes
= CREATE_WAV_HEADER_ON_DECOMPRESSION
);
19 int StartEx(CIO
* pioOutput
, const WAVEFORMATEX
* pwfeInput
, int nMaxAudioBytes
, int nCompressionLevel
= COMPRESSION_LEVEL_NORMAL
, const void * pHeaderData
= NULL
, int nHeaderBytes
= CREATE_WAV_HEADER_ON_DECOMPRESSION
);
21 // add data / compress data
23 // allows linear, immediate access to the buffer (fast)
24 int GetBufferBytesAvailable();
25 int UnlockBuffer(int nBytesAdded
, BOOL bProcess
= TRUE
);
26 unsigned char * LockBuffer(int * pBytesAvailable
);
28 // slower, but easier than locking and unlocking (copies data)
29 int AddData(unsigned char * pData
, int nBytes
);
31 // use a CIO (input source) to add data
32 int AddDataFromInputSource(CInputSource
* pInputSource
, int nMaxBytes
= -1, int * pBytesAdded
= NULL
);
35 int Finish(unsigned char * pTerminatingData
, int nTerminatingBytes
, int nWAVTerminatingBytes
);
40 int ProcessBuffer(BOOL bFinalize
= FALSE
);
42 CSmartPtr
<CAPECompressCreate
> m_spAPECompressCreate
;
47 unsigned char * m_pBuffer
;
52 WAVEFORMATEX m_wfeInput
;
56 #endif // #ifndef APE_APECOMPRESS_H