/*---------------------------------------------------------------------------* Project: THP demo File: THPSimple.h Copyright (C)2002-2006 Nintendo All Rights Reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Log: THPSimple.h,v $ Revision 1.3 2008/02/28 06:21:07 aka Moved THP_SOUND_MODE_??? to THPPlayerCommon.h. Revision 1.2 2008/02/28 05:24:37 aka Added THP_SOUND_MODE_???. Added THPSimpleGetSoundMode() Added THPSimpleSetSoundMode(). Added a member soundMode in THPSimple structure. Revision 1.1 2006/02/03 10:00:34 aka Imported from Dolphin tree. 3 02/05/14 9:20a Suzuki Supported multi audio track 2 02/02/28 6:34p Akagi enabled to use with MusyX/AX by Suzuki-san (IRD). 1 02/01/16 11:03a Akagi Initial revision made by Suzuki-san (IRD). $NoKeywords: $ *---------------------------------------------------------------------------*/ #ifndef __THPSIMPLE_H__ #define __THPSIMPLE_H__ #include #include #include #include "THPPlayerCommon.h" #ifdef __cplusplus extern "C" { #endif #define READ_BUFFER_NUM 10 #define AUDIO_BUFFER_NUM 3 typedef enum { THP_DECODE_OK = 0, THP_VIDEO_DECODE_FAIL, THP_NO_READ_BUFFER, THP_NO_AUDIO_BUFFER, THP_INVALID_AUDIO_TRACK } THPDecodeError; typedef struct { DVDFileInfo fileInfo; THPHeader header; THPFrameCompInfo compInfo; THPVideoInfo videoInfo; THPAudioInfo audioInfo; void *thpWork; BOOL open; u8 preFetchState; u8 audioState; u8 loop; u8 audioExist; s32 curOffset; BOOL dvdError; volatile u32 readProgress; s32 nextDecodeIndex; s32 readIndex; s32 readSize; s32 totalReadFrame; f32 curVolume; f32 targetVolume; f32 deltaVolume; s32 rampCount; THPReadBuffer readBuffer[READ_BUFFER_NUM]; THPTextureSet textureSet; THPAudioBuffer audioBuffer[AUDIO_BUFFER_NUM]; s32 audioDecodeIndex; s32 audioOutputIndex; s32 soundMode; } THPSimple; extern BOOL THPSimpleInit(s32 audioSystem); extern void THPSimpleQuit(void); extern BOOL THPSimpleOpen(char *fileName); extern BOOL THPSimpleClose(void); extern u32 THPSimpleCalcNeedMemory(void); extern BOOL THPSimpleSetBuffer(u8 *buffer); extern BOOL THPSimplePreLoad(s32 loop); extern void THPSimpleAudioStart(void); extern void THPSimpleAudioStop(void); extern BOOL THPSimpleLoadStop(void); extern s32 THPSimpleDecode(s32 audioTrack); extern s32 THPSimpleDrawCurrentFrame(GXRenderModeObj *rmode, u32 x, u32 y, u32 polygonW, u32 polygonH); extern BOOL THPSimpleGetVideoInfo(THPVideoInfo *videoInfo); extern BOOL THPSimpleGetAudioInfo(THPAudioInfo *audioInfo); extern f32 THPSimpleGetFrameRate(void); extern u32 THPSimpleGetTotalFrame(void); extern BOOL THPSimpleSetVolume(s32 vol, s32 time); extern s32 THPSimpleGetVolume(void); extern void THPSimpleSetSoundMode(s32 mode); extern s32 THPSimpleGetSoundMode(void); #ifdef __cplusplus } #endif #endif // __THPSIMPLE_H__