Showing the changes to interface/src/Application.cpp (1 of 25 files). Show all
Unified · Split
| @@ -1188,6 +1188,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1187 unmodified lines | |||
| 1188 | // set the local loopback interface for local sounds | 1188 | // set the local loopback interface for local sounds |
| 1189 | AudioInjector::setLocalAudioInterface(audioIO.data()); | 1189 | AudioInjector::setLocalAudioInterface(audioIO.data()); |
| 1190 | AudioScriptingInterface::getInstance().setLocalAudioInterface(audioIO.data()); | 1190 | AudioScriptingInterface::getInstance().setLocalAudioInterface(audioIO.data()); |
| 1191 | connect(audioIO.data(), &AudioClient::noiseGateOpened, &AudioScriptingInterface::getInstance(), &AudioScriptingInterface::noiseGateOpened); | ||
| 1192 | connect(audioIO.data(), &AudioClient::noiseGateClosed, &AudioScriptingInterface::getInstance(), &AudioScriptingInterface::noiseGateClosed); | ||
| 1193 | connect(audioIO.data(), &AudioClient::inputReceived, &AudioScriptingInterface::getInstance(), &AudioScriptingInterface::inputReceived); | ||
| 1194 | |||
| 1191 | 1195 | ||
| 1192 | this->installEventFilter(this); | 1196 | this->installEventFilter(this); |
| 1193 | 1197 | ||
| @@ -1950,6 +1954,8 @@ void Application::initializeUi() { · 756 unmodified lines | |||
| 1950 | rootContext->setContextProperty("ApplicationInterface", this); | 1954 | rootContext->setContextProperty("ApplicationInterface", this); |
| 1951 | rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance()); | 1955 | rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance()); |
| 1952 | rootContext->setContextProperty("AudioStats", DependencyManager::get<AudioClient>()->getStats().data()); | 1956 | rootContext->setContextProperty("AudioStats", DependencyManager::get<AudioClient>()->getStats().data()); |
| 1957 | rootContext->setContextProperty("AudioScope", DependencyManager::get<AudioScope>().data()); | ||
| 1958 | |||
| 1953 | rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data()); | 1959 | rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data()); |
| 1954 | rootContext->setContextProperty("Entities", DependencyManager::get<EntityScriptingInterface>().data()); | 1960 | rootContext->setContextProperty("Entities", DependencyManager::get<EntityScriptingInterface>().data()); |
| 1955 | _fileDownload = new FileScriptingInterface(engine); | 1961 | _fileDownload = new FileScriptingInterface(engine); |
| @@ -3178,7 +3184,23 @@ void Application::mousePressEvent(QMouseEvent* event) { · 1222 unmodified lines | |||
| 3178 | } | 3184 | } |
| 3179 | } | 3185 | } |
| 3180 | 3186 | ||
| 3181 | void Application::mouseDoublePressEvent(QMouseEvent* event) const { | 3187 | void Application::mouseDoublePressEvent(QMouseEvent* event) { |
| 3188 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | ||
| 3189 | auto eventPosition = getApplicationCompositor().getMouseEventPosition(event); | ||
| 3190 | QPointF transformedPos = offscreenUi->mapToVirtualScreen(eventPosition, _glWidget); | ||
| 3191 | QMouseEvent mappedEvent(event->type(), | ||
| 3192 | transformedPos, | ||
| 3193 | event->screenPos(), event->button(), | ||
| 3194 | event->buttons(), event->modifiers()); | ||
| 3195 | |||
| 3196 | if (!_aboutToQuit) { | ||
| 3197 | getOverlays().mouseDoublePressEvent(&mappedEvent); | ||
| 3198 | if (!_controllerScriptingInterface->areEntityClicksCaptured()) { | ||
| 3199 | getEntities()->mouseDoublePressEvent(&mappedEvent); | ||
| 3200 | } | ||
| 3201 | } | ||
| 3202 | |||
| 3203 | |||
| 3182 | // if one of our scripts have asked to capture this event, then stop processing it | 3204 | // if one of our scripts have asked to capture this event, then stop processing it |
| 3183 | if (_controllerScriptingInterface->isMouseCaptured()) { | 3205 | if (_controllerScriptingInterface->isMouseCaptured()) { |
| 3184 | return; | 3206 | return; |
| @@ -5525,6 +5547,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 2340 unmodified lines | |||
| 5525 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); | 5547 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 5526 | scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance()); | 5548 | scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance()); |
| 5527 | scriptEngine->registerGlobalObject("AudioStats", DependencyManager::get<AudioClient>()->getStats().data()); | 5549 | scriptEngine->registerGlobalObject("AudioStats", DependencyManager::get<AudioClient>()->getStats().data()); |
| 5550 | scriptEngine->registerGlobalObject("AudioScope", DependencyManager::get<AudioScope>().data()); | ||
| 5528 | 5551 | ||
| 5529 | // Caches | 5552 | // Caches |
| 5530 | scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); | 5553 | scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); |