1 #ifndef ___APEReader_H_
2 #define ___APEReader_H_
6 #include "MonkeysAudioMIMEType.h"
7 #include "PositionBridgeIO.h"
9 #include "ReaderPlugin.h" // Haiku private header
12 const int32 BLOCK_COUNT
= 1024*4; // number of blocks, get from MACLib at once
13 const int32 BUFFER_SIZE
= 1024*4; // size of audio data passing to Media Kit
14 const int32 MEDIA_FILE_FORMAT_VERSION
= 100; // media_file_format::version
17 class TAPEReader
: public Reader
21 virtual ~TAPEReader();
23 virtual const char* Copyright();
25 virtual status_t
Sniff(int32
* oStreamCount
);
27 virtual void GetFileFormatInfo(media_file_format
* oMFF
);
29 virtual status_t
AllocateCookie(int32 oStreamNumber
, void** oCookie
);
30 virtual status_t
FreeCookie(void* oCookie
);
32 virtual status_t
GetStreamInfo(void* oCookie
, int64
* oFrameCount
,
33 bigtime_t
* oDuration
, media_format
* oFormat
,
34 const void** oInfoBuffer
, size_t* oInfoSize
);
36 virtual status_t
Seek(void *cookie
, uint32 flags
,
37 int64
*frame
, bigtime_t
*time
);
39 virtual status_t
FindKeyFrame(void* cookie
, uint32 flags
,
40 int64
* frame
, bigtime_t
* time
);
42 virtual status_t
GetNextChunk(void* oCookie
, const void** oChunkBuffer
,
43 size_t* oChunkSize
, media_header
* oMediaHeader
);
48 bigtime_t
CurrentTime() const;
49 status_t
LoadAPECheck() const;
50 status_t
ReadBlocks();
53 char* mDecodedData
; // data after decoding
58 status_t mLoadAPECheck
;
60 IAPEDecompress
* mDecomp
;
61 TPositionBridgeIO mPositionBridgeIO
;
65 class TAPEReaderPlugin
: public ReaderPlugin
69 virtual ~TAPEReaderPlugin();
71 virtual Reader
* NewReader();
75 MediaPlugin
* instantiate_plugin();
78 #endif // ___APEReader_H_