//CFTTAudio - [2020-04-13 11:57:46]
#ifndef _CFTTAUDIO_H_
#define _CFTTAUDIO_H_

#include "common.h"
#include "FTTMutex.h"
#include "CFTTAudio_SoundPlayer.h"
#include "CFTTJob.h"
#include "vorbis/vorbis/vorbisfile.h"
#include "CFTTJobQueue.h"
/*
001FA3D8 CFTTAudio::Init()
001FA49C CFTTAudio::Shutdown()
001FA52C CFTTAudio::GetAudioStats(char *,int)
001FA5A8 CFTTAudio::GetPlayer(CFTTAudio_SoundPlayer **)
001FA5FC CFTTAudio::GetPlayer(CFTTAudio_SoundPlayer **,CFTTAudio_Patch *)
001FA6AC CFTTAudio::GetStreamer()
001FA980 CFTTAudio::DecodeOggVorbisJob(CFTTJob *,void *)
001FAEA0 CFTTAudio::OggVorbisReadFunc(void *,uint,uint,void *)
001FBB18 CFTTAudio::PlatformInit()
001FBE08 CFTTAudio::PlatformShutdown()
001FBEC0 CFTTAudio::PlatformGetVoice(CFTTAudio::EFormat,int,bool,CFTTAudio_SoundPlayer *)
001FC0B0 CFTTAudio::PlatformGetUsedVoiceCount()
*/

struct  OggVorbisFile {
	uchar field_0 ;                                   //.text:001FA8D8                 STRB.W          R9, [R0]
	char field_1;
	char field_2;
	char field_3;
	char * bufer_4;
	int buferSize_8;
	class CFTTAudio_StreamHandler * StreamHandler_C;
	OggVorbis_File vf_10;
	int field_2E0;
	int field_2E4;
};

struct SLTAudioObject {
	//int number;					//dword_5A97D0
	int dword_5A97D0_0;
	SLObjectItf outputMixObject_4;//创建混音器接口对象：//dword_5A97D4
	SLEngineItf engineInterface_8;//	建引擎接口对象：engineEngine//dword_5A97D8
	SLObjectItf engineObject_C;	////引擎对象
	int field_10;
  int filed_14;
  int filed_18;
	FTTMutex mutex_1C;

};

int sub_1FC144(float s0);
struct Audio_unk1 {
  int field_0;
  int field_4;
  int field_8;
  int pEngine_C;
  int field_10;
  int field_14;
  int field_18;
  FTTMutex mutex_1C;
};

class CFTTAudio {
public:
  enum EFormat {
    EFormat_0,
    EFormat_1,
    EFormat_2,
    EFormat_3,
    EFormat_4,
    EFormat_5,
    EFormat_6,
    EFormat_7,
    EFormat_8,
    EFormat_9,
    EFormat_10
  };

  static void Init();                                                                                 //001FA3D8
  static void Shutdown();                                                                             //001FA49C
  static void GetAudioStats(char *, int);                                                             //001FA52C
  static CFTTAudio_SoundPlayer *GetPlayer(CFTTAudio_SoundPlayer **);                                  //001FA5A8
  static CFTTAudio_SoundPlayer *GetPlayer(CFTTAudio_SoundPlayer **, CFTTAudio_Patch *);               //001FA5FC
  static CFTTAudio_StreamHandler * GetStreamer();                                                     //001FA6AC
  static void DecodeOggVorbisJob(CFTTJob *, void *);                                                  //001FA980
  static int OggVorbisReadFunc(void *, uint, uint, void *);                                           //001FAEA0
  static void PlatformInit();                                                                         //001FBB18
  static void PlatformShutdown();                                                                     //001FBE08
  static CAndroidBQPlayer* PlatformGetVoice(CFTTAudio::EFormat, int, bool, CFTTAudio_SoundPlayer *);  //001FBEC0
  static void PlatformGetUsedVoiceCount();                                                            //001FC0B0

  static FTTMutex ms_tMutex;
  static bool ms_bIsInit;
  static CFTTJobQueue *   ms_pJobQueue;
};

#endif  //_CFTTAUDIO_H_