wavelength 1.0.0
Loading...
Searching...
No Matches
forcefeedbackmgrcontroller.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5
8
15public:
24 Controller(int nController, int nTicksPerBar);
25
33
42 void CancelAll();
43
51 bool IsPlayingEffect() const {
52 for (const auto &pEffect : mEffects) {
53 if (pEffect->GetActive() != 0) {
54 return true;
55 }
56 }
57 return false;
58 }
59
61 int GetSmallMotor() const {
62 return mSmallMotor;
63 }
64
70 void SetSmallMotor(int nSmallMotor) {
71 mSmallMotor = nSmallMotor;
72 }
73
75 int GetBigMotor() const {
76 return mBigMotor;
77 }
78
84 void SetBigMotor(int nBigMotor) {
85 mBigMotor = nBigMotor;
86 }
87
89 int GetVibration() const {
90 return mVibration;
91 }
92
98 void SetVibration(int nVibration) {
99 mVibration = nVibration;
100 }
101
103 int GetEnabled() const {
104 return mEnabled;
105 }
106
112 void SetEnabled(int nEnabled) {
113 mEnabled = nEnabled;
114 }
115
117 const std::vector<std::unique_ptr<MotorEffect>> &GetEffects() const {
118 return mEffects;
119 }
120
123 return mBeatEffect.get();
124 }
125
126private:
127 int mSmallMotor;
128 int mBigMotor;
129 int mVibration;
130 int mEnabled;
131 std::vector<std::unique_ptr<MotorEffect>> mEffects;
132 std::unique_ptr<MotorEffect> mBeatEffect;
133};
One player's controller, with its beat pulse and its effects.
Definition forcefeedbackmgrcontroller.h:14
int GetVibration() const
Definition forcefeedbackmgrcontroller.h:89
void CancelAll()
Cancel the beat pulse and every effect.
int GetBigMotor() const
Definition forcefeedbackmgrcontroller.h:75
void SetEnabled(int nEnabled)
Set whether the beat pulse drives the controller.
Definition forcefeedbackmgrcontroller.h:112
~Controller()
Delete the effects and the beat pulse.
int GetEnabled() const
Definition forcefeedbackmgrcontroller.h:103
Controller(int nController, int nTicksPerBar)
Construct the beat pulse and the effects of a controller.
bool IsPlayingEffect() const
Report whether an effect runs.
Definition forcefeedbackmgrcontroller.h:51
int GetSmallMotor() const
Definition forcefeedbackmgrcontroller.h:61
MotorEffect * GetBeatEffect()
Definition forcefeedbackmgrcontroller.h:122
void SetVibration(int nVibration)
Set the vibration option of the game.
Definition forcefeedbackmgrcontroller.h:98
const std::vector< std::unique_ptr< MotorEffect > > & GetEffects() const
Definition forcefeedbackmgrcontroller.h:117
void SetBigMotor(int nBigMotor)
Set the big motor's last level.
Definition forcefeedbackmgrcontroller.h:84
void SetSmallMotor(int nSmallMotor)
Set the small motor's last state.
Definition forcefeedbackmgrcontroller.h:70
One vibration pattern of a controller, which runs both motors for a duration.
Definition forcefeedbackmgrmotoreffect.h:14