xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/Prepare.h (revision 23c0ae0362174e8dbdc88d14e03618815dde145e)
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 /*****************************************************************************
13 Manage the preparation stage of compression and decompression
14 
15 Tasks:
16 
17 1) convert data to 32-bit
18 2) convert L,R to X,Y
19 3) calculate the CRC
20 4) do simple analysis
21 5) check for the peak value
22 *****************************************************************************/
23 
24 
25 class IPredictorDecompress;
26 
27 
28 class CPrepare
29 {
30 public:
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