OROCHI
 
Loading...
Searching...
No Matches
GxResSound.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_SOUND_NAMESPACE_BEGIN()
13
14//===========================================================================
16//===========================================================================
17class GxResSound : public GxResBase
18{
19 //-------------------------------------------------------------
21 //-------------------------------------------------------------
23public:
24 // RTTI定義
26 // ClassBaseReference継承クラス用禁止宣言
28
29
30 //-----------------------------------------------------------
32 //-----------------------------------------------------------
34public:
36 GxResSound(void);
38 void cleanup( void ) override;
40 virtual b32 load(GxStream& stream, u32 dataSize);
41
43 //-------------------------------------------------------------
45 //-------------------------------------------------------------
47public:
49 GX_FORCE_INLINE void* getFinalizeData( void ) { return getDataFromSystem() ? getDataFromSystem() : _pFinalizedData; }
51 constexpr u32 getFinalizeDataSize( void ) const { return _finalizedDataSize; }
52#if defined(_WINDOWS) || defined(_XBOX_XS)
54 const WAVEFORMATEXTENSIBLE& getWaveFormatExtensible(void) const { return *_pWaveFormatExtensible; }
56 const XAUDIO2_BUFFER* getAudio2Buffer(void) const { return _pXaudioBuffer; }
57#endif //_WINDOWS || _XBOX_XS
59 constexpr u32 getAsyncLoadSize(void) const { return getAsyncHandle() != GX_INVALID_HANDLE ? getGxSysFile()->getAsyncRequestSize(getAsyncHandle()) : 0; }
61 constexpr u32 getAsyncLoadRemain(void) const { return getAsyncHandle() != GX_INVALID_HANDLE ? getGxSysFile()->getAsyncRequestRemain(getAsyncHandle()) : 0; }
62
64 //-----------------------------------------------------------
66 //-----------------------------------------------------------
68protected:
70 b32 save( GxStream& stream );
71
73 //-------------------------------------------------------------
75 //-------------------------------------------------------------
77protected:
80#if defined(_WINDOWS) || defined(_XBOX_XS)
81 WAVEFORMATEXTENSIBLE* _pWaveFormatExtensible;
82 XAUDIO2_BUFFER* _pXaudioBuffer;
83#endif //_WINDOWS || _XBOX_XS
84
86};
87
88#if GX_DEVELOP
89//===========================================================================
91//===========================================================================
92class GxResSoundWav : public GxResSound
93{
94 //-----------------------------------------------------------
96 //-----------------------------------------------------------
98public:
99 // RTTI宣言
100 GX_RTTI_RESOURCE(GxResSoundWav, GxResSound)
101 // ClassBaseReference継承クラス用禁止宣言
103
105 //-----------------------------------------------------------
107 //-----------------------------------------------------------
109
111 GxResSoundWav(void){}
112
114 //-----------------------------------------------------------
116 //-----------------------------------------------------------
118
119protected:
121 b32 finalize(void);
123 b32 load(GxStream& stream, u32 dataSize) override;
125 b32 save(GxStream& stream);
126private:
128 b32 findChunk(u32 fourcc, u32*& pChunk, u32& chunkSize);
129
131};
132#endif // GX_DEVELOP
133
134GX_SOUND_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
リソース基底クラス
Definition GxResBase.h:23
サウンドリソースクラス
Definition GxResSound.h:18
GX_FORCE_INLINE void * getFinalizeData(void)
リソースデータを取得
Definition GxResSound.h:49
void * _pFinalizedData
ファイナライズデータバッファ
Definition GxResSound.h:78
b32 save(GxStream &stream)
リソースのセーブ
Definition GxResSound.cpp:95
constexpr u32 getFinalizeDataSize(void) const
リソースデータサイズを取得
Definition GxResSound.h:51
virtual b32 load(GxStream &stream, u32 dataSize)
リソース読み込み
Definition GxResSound.cpp:48
u32 _finalizedDataSize
ファイナライズデータサイズ
Definition GxResSound.h:79
constexpr u32 getAsyncLoadRemain(void) const
非同期読込み残サイズ取得
Definition GxResSound.h:61
@ UNIT_SOUND
サウンドユニット
ストリーム基礎クラス
Definition GxStream.h:20
constexpr u32 getAsyncRequestRemain(GX_HANDLE requestHandle) const
非同期リクエスト残サイズ取得
Definition GxSysFile.h:243
32bitブーリアン
Definition GxDefine.h:173