resonance 1.0.1
Loading...
Searching...
No Matches
forcefeedbackmgr.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "mid/tick.h"
6#include "sch/time.h"
7
8class Player;
9
30public:
32 struct Slot {
36 };
37
45
53
61
72 void StartMetronome(const Sch::Tick &delay);
73
81 void SetPlayerCount(unsigned int nPlayers);
82
91 void PulseBeat();
92
104
117 void PlayEffect(int nPlayerSlot, int nEffect);
118
126 void Suspend(unsigned char nMask);
127
137 void SetPaused(int bPaused);
138
148 void SetJukeboxMode(int bJukebox);
149
159 void SetPlaybackMode(int bPlayback);
160
168 void SetEnabled(int bEnabled);
169
178 void SetPowerup(unsigned int nPlayerSlot, int bPowerup);
179
190 void StopAll(Sch::Tick when);
191
198 void SetBigMotor(int nPlayerSlot, int nLevel);
199
206 void SetSmallMotor(int nPlayerSlot, int nState);
207
215 void SetBothMotors(int nPlayerSlot, int nSmallState, int nBigLevel);
216
224 void ApplyMotors(int nPlayerSlot);
225
233 void PlayUnusedEffect(Player *pPlayer);
234
244 void PlayBumpEffect(Player *pPlayer);
245
256
267
277 void PlayCrippleEffect(Player *pPlayer);
278
279private:
287 void LoadConfig();
288
289 unsigned char mFlags; // +0x00, any set bit suspends vibration
290 std::vector<Slot> mSlots; // +0x04
291 std::vector<Effect> mEffects; // +0x10
292 int mReserved1c; // +0x1c, never read or written
293 int mReserved20; // +0x20, never read or written
294 Sch::Tick mUnusedPosition; // +0x24, constructed and never read
295 long long mUnusedTime; // +0x28, zero on construction and never read
296 int mMetronomeFirstSetting; // +0x30, the first metronome setting, never read
297 Sch::Time mPulseLength; // +0x38, in nanoseconds
298 Sch::Tick mBeatPeriod; // +0x40, the bar divided by the third metronome setting
299};
void PlayAutocatchEffect(Player *pPlayer)
Play the effect an autocatcher produces, effect 0, on a player's controller.
void SetSmallMotor(int nPlayerSlot, int nState)
void SetJukeboxMode(int bJukebox)
Stop every motor and set the jukebox flag, or clear the flag.
void Suspend(unsigned char nMask)
Stop every motor and set flags in mFlags.
void PlayNeutralizedEffect(Player *pPlayer)
Play the effect a neutralized track produces, effect 3, on a player's controller.
void SetPaused(int bPaused)
Stop every motor and set the paused flag, or clear the flag.
void SetPlayerCount(unsigned int nPlayers)
Size mSlots to the players and suspend everything for three players or more.
void StopAll(Sch::Tick when)
Stop every motor twice over and set the stopped flag.
void PlayUnusedEffect(Player *pPlayer)
Play effect 4, configuration 0x4b6, on a player's controller.
void SetPowerup(unsigned int nPlayerSlot, int bPowerup)
Set a slot's powerup mark when the slot exists.
ForceFeedbackMgr()
Load the configuration and register the object as the unit's instance.
~ForceFeedbackMgr()
Clear mEffects and the unit's instance pointer.
void SyncMetronome()
Schedule the first beat pulse ahead of the next beat by the motors' latency.
void SetEnabled(int bEnabled)
Clear the disabled flag, or stop every motor and set it.
void StartMetronome(const Sch::Tick &delay)
Schedule the metronome's start a delay from the current song position.
void SetBigMotor(int nPlayerSlot, int nLevel)
void PulseBeat()
Pulse the small motor of every idle controller for mPulseLength and schedule the next beat.
void PlayCrippleEffect(Player *pPlayer)
Play the effect a crippler hit produces, effect 2, on a player's controller.
void PlayBumpEffect(Player *pPlayer)
Play the effect a bumper hit produces, effect 1, on the target's controller.
void SetPlaybackMode(int bPlayback)
Stop every motor and set the playback flag, or clear the flag.
void PlayEffect(int nPlayerSlot, int nEffect)
Start one vibration effect on a player's controller.
void SetBothMotors(int nPlayerSlot, int nSmallState, int nBigLevel)
void ApplyMotors(int nPlayerSlot)
Pass a slot's motor state to the controller through InputPoller::SetVibration().
One participant in a session, local or remote.
Definition player.h:39
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
Scheduler time, as a signed 64-bit count.
Definition time.h:44
One vibration effect, read from the configuration by LoadConfig().
Definition forcefeedbackmgr.h:39
int mPulseCount
Definition forcefeedbackmgr.h:42
int mSmallMotor
Definition forcefeedbackmgr.h:40
int mBigMotor
Definition forcefeedbackmgr.h:41
Sch::Tick mPeriod
Definition forcefeedbackmgr.h:43
One controller's motor state.
Definition forcefeedbackmgr.h:32
int mBigMotor
Definition forcefeedbackmgr.h:34
int mSmallMotor
Definition forcefeedbackmgr.h:35
int mPowerup
Definition forcefeedbackmgr.h:33