Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 17 files). Show all
Unified · Split
| @@ -17,7 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | #include "Application.h" |
| 19 | 19 | #include "devices/MotionTracker.h" |
| 20 | −#include "devices/SixenseManager.h" | |
| 20 | +//#include "devices/SixenseManager.h" | |
| 21 | 21 | #include "ControllerScriptingInterface.h" |
| 22 | 22 | |
| 23 | 23 | |
| @@ -81,13 +81,14 @@ void inputChannelFromScriptValue(const QScriptValue& object, UserInputMapper::In · 57 unmodified lines | ||
| 81 | 81 | |
| 82 | 82 | QScriptValue actionToScriptValue(QScriptEngine* engine, const UserInputMapper::Action& action) { |
| 83 | 83 | QScriptValue obj = engine->newObject(); |
| 84 | − QVector<UserInputMapper::InputChannel> inputChannels = Application::getUserInputMapper()->getInputChannelsForAction(action); | |
| 84 | + auto userInputMapper = DependencyManager::get<UserInputMapper>(); | |
| 85 | + QVector<UserInputMapper::InputChannel> inputChannels = userInputMapper->getInputChannelsForAction(action); | |
| 85 | 86 | QScriptValue _inputChannels = engine->newArray(inputChannels.size()); |
| 86 | 87 | for (int i = 0; i < inputChannels.size(); i++) { |
| 87 | 88 | _inputChannels.setProperty(i, inputChannelToScriptValue(engine, inputChannels[i])); |
| 88 | 89 | } |
| 89 | 90 | obj.setProperty("action", (int) action); |
| 90 | − obj.setProperty("actionName", Application::getUserInputMapper()->getActionName(action)); | |
| 91 | + obj.setProperty("actionName", userInputMapper->getActionName(action)); | |
| 91 | 92 | obj.setProperty("inputChannels", _inputChannels); |
| 92 | 93 | return obj; |
| 93 | 94 | } |
| @@ -427,43 +428,43 @@ void ControllerScriptingInterface::updateInputControllers() { · 333 unmodified lines | ||
| 427 | 428 | } |
| 428 | 429 | |
| 429 | 430 | QVector<UserInputMapper::Action> ControllerScriptingInterface::getAllActions() { |
| 430 | − return Application::getUserInputMapper()->getAllActions(); | |
| 431 | + return DependencyManager::get<UserInputMapper>()->getAllActions(); | |
| 431 | 432 | } |
| 432 | 433 | |
| 433 | 434 | QVector<UserInputMapper::InputChannel> ControllerScriptingInterface::getInputChannelsForAction(UserInputMapper::Action action) { |
| 434 | − return Application::getUserInputMapper()->getInputChannelsForAction(action); | |
| 435 | + return DependencyManager::get<UserInputMapper>()->getInputChannelsForAction(action); | |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | 438 | QString ControllerScriptingInterface::getDeviceName(unsigned int device) { |
| 438 | − return Application::getUserInputMapper()->getDeviceName((unsigned short) device); | |
| 439 | + return DependencyManager::get<UserInputMapper>()->getDeviceName((unsigned short)device); | |
| 439 | 440 | } |
| 440 | 441 | |
| 441 | 442 | QVector<UserInputMapper::InputChannel> ControllerScriptingInterface::getAllInputsForDevice(unsigned int device) { |
| 442 | − return Application::getUserInputMapper()->getAllInputsForDevice(device); | |
| 443 | + return DependencyManager::get<UserInputMapper>()->getAllInputsForDevice(device); | |
| 443 | 444 | } |
| 444 | 445 | |
| 445 | 446 | bool ControllerScriptingInterface::addInputChannel(UserInputMapper::InputChannel inputChannel) { |
| 446 | − return Application::getUserInputMapper()->addInputChannel(inputChannel._action, inputChannel._input, inputChannel._modifier, inputChannel._scale); | |
| 447 | + return DependencyManager::get<UserInputMapper>()->addInputChannel(inputChannel._action, inputChannel._input, inputChannel._modifier, inputChannel._scale); | |
| 447 | 448 | } |
| 448 | 449 | |
| 449 | 450 | bool ControllerScriptingInterface::removeInputChannel(UserInputMapper::InputChannel inputChannel) { |
| 450 | − return Application::getUserInputMapper()->removeInputChannel(inputChannel); | |
| 451 | + return DependencyManager::get<UserInputMapper>()->removeInputChannel(inputChannel); | |
| 451 | 452 | } |
| 452 | 453 | |
| 453 | 454 | QVector<UserInputMapper::InputPair> ControllerScriptingInterface::getAvailableInputs(unsigned int device) { |
| 454 | − return Application::getUserInputMapper()->getAvailableInputs((unsigned short) device); | |
| 455 | + return DependencyManager::get<UserInputMapper>()->getAvailableInputs((unsigned short)device); | |
| 455 | 456 | } |
| 456 | 457 | |
| 457 | 458 | void ControllerScriptingInterface::resetAllDeviceBindings() { |
| 458 | − Application::getUserInputMapper()->resetAllDeviceBindings(); | |
| 459 | + DependencyManager::get<UserInputMapper>()->resetAllDeviceBindings(); | |
| 459 | 460 | } |
| 460 | 461 | |
| 461 | 462 | void ControllerScriptingInterface::resetDevice(unsigned int device) { |
| 462 | − Application::getUserInputMapper()->resetDevice(device); | |
| 463 | + DependencyManager::get<UserInputMapper>()->resetDevice(device); | |
| 463 | 464 | } |
| 464 | 465 | |
| 465 | 466 | int ControllerScriptingInterface::findDevice(QString name) { |
| 466 | − return Application::getUserInputMapper()->findDevice(name); | |
| 467 | + return DependencyManager::get<UserInputMapper>()->findDevice(name); | |
| 467 | 468 | } |
| 468 | 469 | |
| 469 | 470 | InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) : |