vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / plugins / ape_reader / MAClib / APECompressCreate.h
bloba83d449cc27498d35a2f270cd47e7af78109c616
1 #ifndef APE_APECOMPRESSCREATE_H
2 #define APE_APECOMPRESSCREATE_H
4 #include "APECompress.h"
6 class CAPECompressCore;
8 class CAPECompressCreate
10 public:
11 CAPECompressCreate();
12 ~CAPECompressCreate();
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);
17 int SetSeekByte(int nFrame, int nByteOffset);
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);
21 int GetFullFrameBytes();
22 int EncodeFrame(const void * pInputData, int nInputBytes);
24 int Finish(const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes);
27 private:
29 CSmartPtr<uint32> m_spSeekTable;
30 int m_nMaxFrames;
32 CSmartPtr<CIO> m_spIO;
33 CSmartPtr<CAPECompressCore> m_spAPECompressCore;
35 WAVEFORMATEX m_wfeInput;
36 int m_nCompressionLevel;
37 int m_nSamplesPerFrame;
38 int m_nFrameIndex;
39 int m_nLastFrameBlocks;
43 #endif // #ifndef APE_APECOMPRESSCREATE_H