// // HapticService.h // App // // Created by Ben Tkacheff on 2/09/16. // // #pragma once #include "V8Tree/Service.h" namespace RBX { extern const char* const sHapticService; class HapticService : public DescribedCreatable , public Service { public: typedef enum { MOTOR_LARGE = 0, MOTOR_SMALL = 1, MOTOR_LEFTTRIGGER = 2, MOTOR_RIGHTTRIGGER = 3, MOTOR_NONE = 4, } VibrationMotor; private: typedef boost::unordered_map VibrationEnabledMap; typedef boost::unordered_map > VibrationStateMap; typedef boost::unordered_map InputVibrationMap; typedef boost::unordered_map InputVibrationEnabledMap; InputVibrationEnabledMap vibrationMotorsEnabledMap; InputVibrationMap vibrationMotorsStateMap; public: HapticService(); rbx::signal)> setVibrationMotorSignal; rbx::signal setEnabledVibrationMotorsSignal; void setEnabledVibrationMotors(InputObject::UserInputType inputType, HapticService::VibrationMotor vibrationMotor, bool isEnabled); bool isVibrationSupported(InputObject::UserInputType inputType); bool isMotorSupported(InputObject::UserInputType inputType, HapticService::VibrationMotor vibrationMotor); void setMotor(InputObject::UserInputType inputType, HapticService::VibrationMotor vibrationMotor, shared_ptr args); shared_ptr getMotor(InputObject::UserInputType inputType, HapticService::VibrationMotor vibrationMotor); }; }