//CFTTAudio_StreamHandler - [2020-04-13 11:57:46]
#ifndef _CFTTAUDIO_STREAMHANDLER_H_
#define _CFTTAUDIO_STREAMHANDLER_H_

#include "common.h"
#include "CFTTAsyncEvent.h"
#include "CFTTFile.h"

#include "CFTTAudio_Patch.h"
#include "CAndroidBQPlayer.h"
#include "CFTTMemPrivate.h"
/*

CFTTAudio_StreamHandler::AsyncLoadCallback(CFTTAsyncEvent<TFTTFileAsyncEventData> *,TFTTFileAsyncEventData const*,void *)      .text 001FAB1C 00000070 00000010 FFFFFFF0 R . . . . . .
CFTTAudio_StreamHandler::AsyncLoadCallbackFirst(CFTTAsyncEvent<TFTTFileAsyncEventData> *,TFTTFileAsyncEventData const*,void *) .text 001FA6E8 00000084 00000010 FFFFFFF0 R . . . . . .
CFTTAudio_StreamHandler::BufferFirstBlock()                                                                                .text 001FA870 000000FA 00000038 FFFFFFC8 R . . . . T .
CFTTAudio_StreamHandler::BufferNextBlock()                                                                                 .text 001FA774 000000E8 00000038 FFFFFFC8 R . . . . T .
CFTTAudio_StreamHandler::PlatformBeginStream()                                                                             .text 001FC2D0 00000052 00000020 FFFFFFF0 R . . . . T .
CFTTAudio_StreamHandler::PlatformEnqueueStream()                                                                           .text 001FC328 00000022   R . . . . T .
CFTTAudio_StreamHandler::SetUsed(bool)                                                                                         .text 001FA464 00000030 00000010 FFFFFFF0 R . . . . T .


*/
struct StreamHandler_field_20 {
	int length_0;      //length
	int filed_4;
	SLuint32* bufer_8; 
};


//length    0x14044   81988
class CFTTAudio_StreamHandler {
public:
	static void AsyncLoadCallback(CFTTAsyncEvent<TFTTFileAsyncEventData> *, TFTTFileAsyncEventData const*, void *);
	static void AsyncLoadCallbackFirst(CFTTAsyncEvent<TFTTFileAsyncEventData> *, TFTTFileAsyncEventData const*, void *);
	void PlatformEnqueueStream(void);
	void BufferFirstBlock(void);
	void PlatformBeginStream(void);
	void  SetUsed(bool);
	void BufferNextBlock(void);
	char field_0;					//.text:001FACBA                 LDRB            R1, [R0]	
	char field_1;
	char field_2;
	char field_3;
	CFTTAudio_Patch* audioPath_4;
	int filed_8;
	int filed_C;
	int buferIndex_10;
	uchar field_14;					//ext:001FAD26                 STRB            R1, [R0,#0x14]
	char field_15;
	char field_16;
	char field_17;
	int offset_18;					//.text:001FAD3C                 STR             R1, [R0,#0x18]
	int field_1C;
	StreamHandler_field_20 field_20[2];
	SLuint32 field_38[5][0x1000];
	CAndroidBQPlayer* bqPlayer_14038;
	struct OggVorbisFile* memPrivate_1403C;
	bool field_14040;
};


#endif //_CFTTAUDIO_STREAMHANDLER_H_