Skip to content

Commit

Permalink
SOUND: Rename FEVFile to FMODEventFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Jan 29, 2019
1 parent 51cd408 commit 8bda311
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
32 changes: 16 additions & 16 deletions src/sound/fevfile.cpp → src/sound/fmodeventfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,41 @@

#include "src/aurora/resman.h"

#include "src/sound/fevfile.h"
#include "src/sound/fmodeventfile.h"

namespace Sound {

static const uint32 kFEVID = MKTAG('F', 'E', 'V', '1');

FEVFile::FEVFile(const Common::UString &resRef) {
FMODEventFile::FMODEventFile(const Common::UString &resRef) {
Common::ScopedPtr<Common::SeekableReadStream> fev(ResMan.getResource(resRef, Aurora::kFileTypeFEV));

if (!fev)
throw Common::Exception("FEVFile::FEVFile(): Resource %s not found", resRef.c_str());
throw Common::Exception("FMODEventFile::FMODEventFile(): Resource %s not found", resRef.c_str());

load(*fev);
}

FEVFile::FEVFile(Common::SeekableReadStream &fev) {
FMODEventFile::FMODEventFile(Common::SeekableReadStream &fev) {
load(fev);
}

const Common::UString &FEVFile::getBankName() {
const Common::UString &FMODEventFile::getBankName() {
return _bankName;
}

const std::vector<FEVFile::WaveBank> &FEVFile::getWaveBanks() {
const std::vector<FMODEventFile::WaveBank> &FMODEventFile::getWaveBanks() {
return _waveBanks;
}

const std::vector<FEVFile::Category> &FEVFile::getCategories() {
const std::vector<FMODEventFile::Category> &FMODEventFile::getCategories() {
return _categories;
}

void FEVFile::load(Common::SeekableReadStream &fev) {
void FMODEventFile::load(Common::SeekableReadStream &fev) {
const uint32 magic = fev.readUint32BE();
if (magic != kFEVID)
throw Common::Exception("FEVFile::load(): Invalid magic number");
throw Common::Exception("FMODEventFile::load(): Invalid magic number");

fev.skip(12); // Unknown values

Expand Down Expand Up @@ -164,7 +164,7 @@ void FEVFile::load(Common::SeekableReadStream &fev) {
}
}

void FEVFile::readCategory(Common::SeekableReadStream &fev) {
void FMODEventFile::readCategory(Common::SeekableReadStream &fev) {
const Common::UString name = readLengthPrefixedString(fev);

Category category;
Expand All @@ -181,7 +181,7 @@ void FEVFile::readCategory(Common::SeekableReadStream &fev) {
_categories.push_back(category);
}

void FEVFile::readEventCategory(Common::SeekableReadStream &fev) {
void FMODEventFile::readEventCategory(Common::SeekableReadStream &fev) {
Common::UString name = readLengthPrefixedString(fev);

// Read user properties
Expand All @@ -199,7 +199,7 @@ void FEVFile::readEventCategory(Common::SeekableReadStream &fev) {
}
}

void FEVFile::readEvent(Common::SeekableReadStream &fev) {
void FMODEventFile::readEvent(Common::SeekableReadStream &fev) {
Event event;

fev.skip(4);
Expand Down Expand Up @@ -300,9 +300,9 @@ void FEVFile::readEvent(Common::SeekableReadStream &fev) {
_events.push_back(event);
}

std::map<Common::UString, FEVFile::Property> FEVFile::readProperties(Common::SeekableReadStream &fev) {
std::map<Common::UString, FMODEventFile::Property> FMODEventFile::readProperties(Common::SeekableReadStream &fev) {
const uint32 numUserProperties = fev.readUint32LE();
std::map<Common::UString, FEVFile::Property> properties;
std::map<Common::UString, FMODEventFile::Property> properties;
for (uint32 i = 0; i < numUserProperties; ++i) {
Common::UString propertyName = readLengthPrefixedString(fev);
Property property;
Expand All @@ -318,7 +318,7 @@ std::map<Common::UString, FEVFile::Property> FEVFile::readProperties(Common::See
property.value = readLengthPrefixedString(fev);
break;
default:
throw Common::Exception("FEVFile::readEventCategory() Invalid property type %i", property.type);
throw Common::Exception("FMODEventFile::readEventCategory() Invalid property type %i", property.type);
}

properties.insert(std::make_pair(propertyName, property));
Expand All @@ -327,7 +327,7 @@ std::map<Common::UString, FEVFile::Property> FEVFile::readProperties(Common::See
return properties;
}

Common::UString FEVFile::readLengthPrefixedString(Common::SeekableReadStream &fev) {
Common::UString FMODEventFile::readLengthPrefixedString(Common::SeekableReadStream &fev) {
const uint32 length = fev.readUint32LE();
return Common::readStringFixed(fev, Common::kEncodingASCII, length);
}
Expand Down
12 changes: 6 additions & 6 deletions src/sound/fevfile.h → src/sound/fmodeventfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* A loader for FEV (FMOD Event) files.
*/

#ifndef SOUND_FEVFILE_H
#define SOUND_FEVFILE_H
#ifndef SOUND_FMODEVENTFILE_H
#define SOUND_FMODEVENTFILE_H

#include <map>

Expand All @@ -40,7 +40,7 @@ namespace Sound {
* There is currently only one relevant version of fev files
* with the FourCC "FEV1".
*/
class FEVFile {
class FMODEventFile {
public:
/** If an event is 2D or 3D. */
enum EventMode {
Expand Down Expand Up @@ -218,8 +218,8 @@ class FEVFile {
float lfReference;
};

FEVFile(const Common::UString &resRef);
FEVFile(Common::SeekableReadStream &fev);
FMODEventFile(const Common::UString &resRef);
FMODEventFile(Common::SeekableReadStream &fev);

const Common::UString &getBankName();

Expand Down Expand Up @@ -251,4 +251,4 @@ class FEVFile {

} // End of namespace Sound

#endif // SOUND_FEVFILE_H
#endif // SOUND_FMODEVENTFILE_H
4 changes: 2 additions & 2 deletions src/sound/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ src_sound_libsound_la_SOURCES += \
src/sound/xactsoundbank_binary.h \
src/sound/fmodsamplebank.h \
src/sound/wwisesoundbank.h \
src/sound/fevfile.h \
src/sound/fmodeventfile.h \
$(EMPTY)

src_sound_libsound_la_SOURCES += \
Expand All @@ -50,7 +50,7 @@ src_sound_libsound_la_SOURCES += \
src/sound/xactsoundbank_binary.cpp \
src/sound/fmodsamplebank.cpp \
src/sound/wwisesoundbank.cpp \
src/sound/fevfile.cpp \
src/sound/fmodeventfile.cpp \
$(EMPTY)

src_sound_libsound_la_LIBADD = \
Expand Down

0 comments on commit 8bda311

Please sign in to comment.