Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AURORA: Partial FEV File loader #362

Closed
wants to merge 1 commit into from

Conversation

@Nostritius
Copy link
Contributor

@Nostritius Nostritius commented Sep 6, 2018

This is my first try in actuallly reverse engineering a file format. This loader loads the first three parts of an fmod event file (FEV). In the first one, the associated wave banks are loaded, in the second one, the possilbe categories are loadded, in the third one, the eventgroups, including the events are loaded. There are much more parts in the fev file, but this loader can now laod simple versions of fev files.

Copy link
Member

@DrMcCoy DrMcCoy left a comment

Neat! :)

A few style issues, though. :P

As for the future interface, I'd like some kind of play() method, that you give an event number or otherwise ID, and it plays the sounds of the event.

Plain would be enough for the first iteration, without effects (and possibly only the first actual sound). For the effects, that needs changes to the SoundManager too.

It should probably give out some kind of handle, like the SoundManager does, with which you can stop the event playing again, or otherwise modify it.

If the sound does something in a timed fashion, i.e. play x seconds of sound y, then set effects a, b, c, then play sound z after a minute, or stuff like that, that might need a new kind of manager "in front" of the soundmanager, doing these changes in a new thread. Maybe. :P


#include "src/aurora/fevfile.h"
#include "src/aurora/resman.h"
#include "fevfile.h"
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

  1. Full paths, please
  2. You're already including that file 2 lines above!


FEVFile::FEVFile(const Common::UString &resRef) {
Common::ScopedPtr<Common::SeekableReadStream> fev(ResMan.getResource(resRef, Aurora::kFileTypeFEV));
load(*fev);
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

ResourceManager::getResource() can return 0, if the resource doesn't exist.

load(fev);
}

Common::UString FEVFile::getBankName() {
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

You should return a const Common::UString & here

return _bankName;
}

std::vector<FEVWaveBank> FEVFile::getWaveBanks() {
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

const std::vector<FEVWaveBank> &

return _waveBanks;
}

std::vector<FEVCategory> FEVFile::getCategories() {
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

const std::vector<FEVCategory> &

fev.skip(4); // Unknown value.

uint32 numSubEventCategories = fev.readUint32LE();
uint32 numEvents = fev.readUint32LE();
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

These are all const :P

}

Common::UString FEVFile::readLengthPrefixedString(Common::SeekableReadStream &fev) {
uint32 length = fev.readUint32LE();
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

const :P

* range from 0.0f to 1.0f, which is mapped to different
* dezibel values.
*/
struct FEVEvent {
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

Please, put these structs and enums into class FEVFile, as FEVFile::Category, etc


namespace Aurora {

/** Possible types of streaming for fmod. */
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

Please capitalize FMOD everywhere in the comments

void readEventCategory(Common::SeekableReadStream &fev);
void readEvent(Common::SeekableReadStream &fev);

// Utility Length prefixed string method.
Copy link
Member

@DrMcCoy DrMcCoy Sep 6, 2018

Can you replace that comment with a Doxygen comment that says "Read length-prefixed string" or something like that?

@Nostritius
Copy link
Contributor Author

@Nostritius Nostritius commented Sep 6, 2018

The style issues should now be fixed

@Nostritius
Copy link
Contributor Author

@Nostritius Nostritius commented Sep 6, 2018

About the future versions doesn't require wwise and xact something similar? Maybe we can combine this in a more general system.

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented Sep 8, 2018

Yeah, that would be neat

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented Sep 9, 2018

Merged as ba9aff5, thanks! :)

@DrMcCoy DrMcCoy closed this Sep 9, 2018
@Nostritius Nostritius deleted the aurora_fevfile branch Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants