Skip to content

Commit

Permalink
SOUND: Use type alias using in XACT
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Jan 11, 2019
1 parent 4893d8d commit 233e193
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/sound/xactsoundbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ class XACTSoundBank {
size_t weightMax { kWeightMaximum }; ///< Upper bound of this variation's weight.
};

typedef std::vector<Event> Events;
typedef std::vector<WaveVariation> WaveVariations;
using Events = std::vector<Event>;
using WaveVariations = std::vector<WaveVariation>;

/** A track within a sound. */
struct Track {
Expand All @@ -368,7 +368,7 @@ class XACTSoundBank {
WaveVariations waves; ///< All the waves in the track.
};

typedef std::vector<Track> Tracks;
using Tracks = std::vector<Track>;

struct Sound {
Common::UString name; ///< Name of the sound. Can be empty.
Expand Down Expand Up @@ -417,7 +417,7 @@ class XACTSoundBank {
size_t weightMax { kWeightMaximum }; ///< Upper bound of this variation's weight.
};

typedef std::vector<CueVariation> CueVariations;
using CueVariations = std::vector<CueVariation>;

struct Transition {
size_t from { kSoundSilence }; ///< Sound index to transition from.
Expand All @@ -440,7 +440,7 @@ class XACTSoundBank {
uint32 destinationMarkerHigh { 0 }; ///< Upper bound of a marker in the destination.
};

typedef std::vector<Transition> Transitions;
using Transitions = std::vector<Transition>;

struct ParametersCrossfade {
CrossfadeType type { CrossfadeType::Disabled };
Expand Down Expand Up @@ -471,13 +471,13 @@ class XACTSoundBank {
Transitions transitions;
};

typedef std::vector<WaveBank> WaveBanks;
typedef std::vector<Sound> Sounds;
typedef std::vector<Cue> Cues;
using WaveBanks = std::vector<WaveBank>;
using Sounds = std::vector<Sound>;
using Cues = std::vector<Cue>;

typedef std::map<Common::UString, WaveBank *> WaveBankMap;
typedef std::map<Common::UString, Sound *> SoundMap;
typedef std::map<Common::UString, Cue *> CueMap;
using WaveBankMap = std::map<Common::UString, WaveBank *>;
using SoundMap = std::map<Common::UString, Sound *>;
using CueMap = std::map<Common::UString, Cue *>;


Common::UString _name;
Expand Down
5 changes: 4 additions & 1 deletion src/sound/xactwavebank_ascii.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ class XACTWaveBank_ASCII : public XACTWaveBank {
size_t loopLength; ///< Length of the looping section.
};

using Waves = std::vector<Wave>;


Common::UString _name;
bool _streaming;

std::vector<Wave> _waves;
Waves _waves;


void load(Common::SeekableReadStream &xwb);
Expand Down
5 changes: 4 additions & 1 deletion src/sound/xactwavebank_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ class XACTWaveBank_Binary : public XACTWaveBank {
size_t loopLength; ///< Length of the looping section.
};

using Waves = std::vector<Wave>;


Common::ScopedPtr<Common::SeekableReadStream> _xwb;

Common::UString _name; ///< The internal name of this wavebank. */
uint32 _flags;

std::vector<Wave> _waves;
Waves _waves;


void load(Common::SeekableReadStream &xwb);
Expand Down

0 comments on commit 233e193

Please sign in to comment.