Browse Source

Move defines

pull/175/head
Alice 10 years ago
parent
commit
c528b75f96
  1. 8
      src/MagnumPlugins/WavAudioImporter/WavHeader.h
  2. 8
      src/MagnumPlugins/WavAudioImporter/WavImporter.cpp

8
src/MagnumPlugins/WavAudioImporter/WavHeader.h

@ -31,12 +31,6 @@
#include "Magnum/Types.h" #include "Magnum/Types.h"
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_ALAW 0x0006
#define WAVE_FORMAT_MULAW 0x0007
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
namespace Magnum { namespace Audio { namespace Magnum { namespace Audio {
#pragma pack(1) #pragma pack(1)
@ -68,7 +62,7 @@ struct WavFormatChunk {
}; };
#pragma pack() #pragma pack()
static_assert(sizeof(WavHeaderChunk) + sizeof(WavFormatChunk) + sizeof(WavDataChunk) == 44, "WavHeader size is not 44 bytes"); static_assert(sizeof(WavHeaderChunk) + sizeof(WavFormatChunk) + sizeof(RiffChunk) == 44, "WavHeader size is not 44 bytes");
}} }}

8
src/MagnumPlugins/WavAudioImporter/WavImporter.cpp

@ -31,6 +31,12 @@
#include "MagnumPlugins/WavAudioImporter/WavHeader.h" #include "MagnumPlugins/WavAudioImporter/WavHeader.h"
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_ALAW 0x0006
#define WAVE_FORMAT_MULAW 0x0007
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
namespace Magnum { namespace Audio { namespace Magnum { namespace Audio {
WavImporter::WavImporter() = default; WavImporter::WavImporter() = default;
@ -43,7 +49,7 @@ bool WavImporter::doIsOpened() const { return _data; }
void WavImporter::doOpenData(Containers::ArrayView<const char> data) { void WavImporter::doOpenData(Containers::ArrayView<const char> data) {
/* Check file size */ /* Check file size */
if(data.size() < sizeof(WavHeaderChunk) + sizeof(WavFormatChunk) + sizeof(WavDataChunk)) { if(data.size() < sizeof(WavHeaderChunk) + sizeof(WavFormatChunk) + sizeof(RiffChunk)) {
Error() << "Audio::WavImporter::openData(): the file is too short:" << data.size() << "bytes"; Error() << "Audio::WavImporter::openData(): the file is too short:" << data.size() << "bytes";
return; return;
} }

Loading…
Cancel
Save