wavelength 1.0.0
Loading...
Searching...
No Matches
fxmgr.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "game/stutter.h"
6#include "os/binstream.h"
7
15class FXMgr {
16public:
22 struct FX {
24 int mFilter;
25 int mChorus;
26 };
27
33 struct FXSet {
34 int mBar;
35 std::vector<FX> mFX;
36 };
37
48 FXMgr(int nNumChannels, int nChorusDepth);
49
57
64 void Activate();
65
72 void Reset();
73
83 void AddSet(int nBar);
84
92 void ApplySet(int nSet);
93
101 int GetNumSets() const;
102
112 int GetCurrentSet() const;
113
124 void CopySet(int nFrom, int nTo);
125
134 int GetSetBar(int nSet) const;
135
147 void SetStutter(int nSet, int nChannel, int nStutter);
148
160 void SetFilter(int nSet, int nChannel, int nFilter);
161
173 void SetChorus(int nSet, int nChannel, int nChorus);
174
186 int GetStutter(int nSet, int nChannel) const;
187
199 int GetFilter(int nSet, int nChannel) const;
200
212 int GetChorus(int nSet, int nChannel) const;
213
223 void Load(BinStream &stream);
224
233 void Save(BinStream &stream) const;
234
235private:
246 void ApplyFilter(int nChannel, int nFilter);
247
258 void ApplyStutter(int nChannel, int nStutter);
259
270 void ApplyChorus(int nChannel, int nChorus);
271
272 int mNumChannels;
273 int mChorusDepth;
274 int mActive;
275 int mCurrentSet;
276 std::vector<FXSet> mSets;
277 Stutter mStutter;
278};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
int GetStutter(int nSet, int nChannel) const
Report the stutter of a channel in a set.
void ApplySet(int nSet)
Make a set current, and apply it to the channels while the manager is active.
int GetFilter(int nSet, int nChannel) const
Report the filter of a channel in a set.
int GetSetBar(int nSet) const
Report the bar a set applies at.
void CopySet(int nFrom, int nTo)
Copy the effects of one set to another.
void AddSet(int nBar)
Append a set of no effects.
void Save(BinStream &stream) const
Write the number of sets in one byte, then for each set the bar in four bytes of the console's byte o...
int GetChorus(int nSet, int nChannel) const
Report the chorus of a channel in a set.
void Reset()
Stop applying the effects and remove them from every channel.
void SetChorus(int nSet, int nChannel, int nChorus)
Set the chorus of a channel in a set, and apply it at once when the set is current.
int GetNumSets() const
Report the number of sets.
void SetFilter(int nSet, int nChannel, int nFilter)
Set the filter of a channel in a set, and apply it at once when the set is current.
void SetStutter(int nSet, int nChannel, int nStutter)
Set the stutter of a channel in a set, and apply it at once when the set is current.
FXMgr(int nNumChannels, int nChorusDepth)
Construct the manager with one set, at bar 0, of no effects.
int GetCurrentSet() const
Report the current set.
~FXMgr()
Release the sets.
void Activate()
Start applying the effects, beginning with the current set.
void Load(BinStream &stream)
Replace the sets with the sets Save() writes, and make the first set current.
Remix effect that gates the volume of chosen mixer channels on and off in time with the song.
Definition stutter.h:13
One set of effects and the bar it applies at.
Definition fxmgr.h:33
int mBar
Definition fxmgr.h:34
std::vector< FX > mFX
Definition fxmgr.h:35
The effects of one channel in a set.
Definition fxmgr.h:22
int mChorus
Definition fxmgr.h:25
int mStutter
Definition fxmgr.h:23
int mFilter
Definition fxmgr.h:24