Skip to content

Commit

Permalink
Minor update to enable 'white box' testing of some internal functions (
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Nov 7, 2024
1 parent d8757f1 commit e95c032
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Audio/SoundCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,31 @@ namespace DirectX


// Helper for validating wave format structure
bool IsValid(_In_ const WAVEFORMATEX* wfx) noexcept;
bool __cdecl IsValid(_In_ const WAVEFORMATEX* wfx) noexcept;


// Helper for getting a default channel mask from channels
uint32_t GetDefaultChannelMask(int channels) noexcept;
uint32_t __cdecl GetDefaultChannelMask(int channels) noexcept;


// Helpers for creating various wave format structures
void CreateIntegerPCM(_Out_ WAVEFORMATEX* wfx,
void __cdecl CreateIntegerPCM(_Out_ WAVEFORMATEX* wfx,
int sampleRate, int channels, int sampleBits) noexcept;
void CreateFloatPCM(_Out_ WAVEFORMATEX* wfx,
void __cdecl CreateFloatPCM(_Out_ WAVEFORMATEX* wfx,
int sampleRate, int channels) noexcept;
void CreateADPCM(_Out_writes_bytes_(wfxSize) WAVEFORMATEX* wfx, size_t wfxSize,
void __cdecl CreateADPCM(_Out_writes_bytes_(wfxSize) WAVEFORMATEX* wfx, size_t wfxSize,
int sampleRate, int channels, int samplesPerBlock) noexcept(false);
#ifdef DIRECTX_ENABLE_XWMA
void CreateXWMA(_Out_ WAVEFORMATEX* wfx,
void __cdecl CreateXWMA(_Out_ WAVEFORMATEX* wfx,
int sampleRate, int channels, int blockAlign, int avgBytes, bool wma3) noexcept;
#endif
#ifdef DIRECTX_ENABLE_XMA2
void CreateXMA2(_Out_writes_bytes_(wfxSize) WAVEFORMATEX* wfx, size_t wfxSize,
void __cdecl CreateXMA2(_Out_writes_bytes_(wfxSize) WAVEFORMATEX* wfx, size_t wfxSize,
int sampleRate, int channels, int bytesPerBlock, int blockCount, int samplesEncoded) noexcept(false);
#endif

// Helper for computing pan volume matrix
bool ComputePan(float pan, unsigned int channels, _Out_writes_(16) float* matrix) noexcept;
bool __cdecl ComputePan(float pan, unsigned int channels, _Out_writes_(16) float* matrix) noexcept;

// Helper class for implementing SoundEffectInstance
class SoundEffectInstanceBase
Expand Down
3 changes: 3 additions & 0 deletions Src/LoaderHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ namespace DirectX
size_t bpe = 0;
switch (fmt)
{
case DXGI_FORMAT_UNKNOWN:
return E_INVALIDARG;

case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
Expand Down

0 comments on commit e95c032

Please sign in to comment.