2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CRUMBLEGENERATOR
|
|
|
|
#define _CRUMBLEGENERATOR
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Kyoto/Input/CRumbleVoice.hpp"
|
2022-10-05 00:16:03 +00:00
|
|
|
#include "Kyoto/Input/InputTypes.hpp"
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
class CRumbleGenerator {
|
|
|
|
private:
|
2023-01-07 19:41:26 +00:00
|
|
|
static const EMotorState kStopAll[4];
|
2022-08-13 02:48:34 +00:00
|
|
|
CRumbleVoice x0_voices[4];
|
2022-10-09 05:37:23 +00:00
|
|
|
float xc0_periodTime[4];
|
|
|
|
float xd0_onTime[4];
|
2022-08-13 02:48:34 +00:00
|
|
|
EMotorState xe0_commandArray[4];
|
|
|
|
bool xf0_24_disabled : 1;
|
2022-10-17 11:10:16 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CRumbleGenerator();
|
|
|
|
~CRumbleGenerator();
|
|
|
|
|
2023-01-07 19:41:26 +00:00
|
|
|
short Rumble(const SAdsrData& adsr, float, ERumblePriority prio, EIOPort port);
|
2022-10-17 11:10:16 +00:00
|
|
|
void Stop(short id, EIOPort port) {
|
|
|
|
if (id == -1)
|
|
|
|
return;
|
|
|
|
CRumbleVoice& vox = x0_voices[size_t(port)];
|
|
|
|
vox.Deactivate(id, false);
|
|
|
|
}
|
|
|
|
void Deactivate(short, bool);
|
|
|
|
void Update(float);
|
|
|
|
void HardStopAll();
|
2023-01-07 19:41:26 +00:00
|
|
|
void SetDisabled(const bool disabled);
|
2022-08-13 02:48:34 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CRUMBLEGENERATOR
|