1#ifndef APE_PREPARE_H
2#define APE_PREPARE_H
3
4#include "NoWindows.h"
5
6#define SPECIAL_FRAME_MONO_SILENCE              1
7#define SPECIAL_FRAME_LEFT_SILENCE              1
8#define SPECIAL_FRAME_RIGHT_SILENCE             2
9#define SPECIAL_FRAME_PSEUDO_STEREO             4
10
11
12/*****************************************************************************
13Manage the preparation stage of compression and decompression
14
15Tasks:
16
171) convert data to 32-bit
182) convert L,R to X,Y
193) calculate the CRC
204) do simple analysis
215) check for the peak value
22*****************************************************************************/
23
24
25class IPredictorDecompress;
26
27
28class CPrepare
29{
30public:
31    int		Prepare(const unsigned char* pRawData, int nBytes,
32    			const WAVEFORMATEX* pWaveFormatEx, int* pOutputX,
33    			int* pOutputY, unsigned int* pCRC, int* pSpecialCodes,
34    			int* pPeakLevel);
35    void	Unprepare(int X, int Y, const WAVEFORMATEX* pWaveFormatEx,
36    			unsigned char* pOutput, unsigned int* pCRC);
37
38#ifdef BACKWARDS_COMPATIBILITY
39    int 	UnprepareOld(int* pInputX, int* pInputY, int nBlocks,
40    			const WAVEFORMATEX* pWaveFormatEx, unsigned char* pRawData,
41    			unsigned int* pCRC, int* pSpecialCodes, int nFileVersion);
42#endif
43
44};
45
46
47#endif // #ifndef APE_PREPARE_H
48