History

Merge branch 'master' of github.com:highfidelity/hifi into tablet-ui

Seth Alves committed 9 years ago

Commit b5919d82 parents 08ee2fd a38ab4f25 files · +552 −81Browse files

Showing the changes to interface/src/Application.cpp (1 of 25 files). Show all

Unified · Split

interface/src/Application.cpp+24−1
@@ -1188,6 +1188,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1187 unmodified lines
11881188 // set the local loopback interface for local sounds
11891189 AudioInjector::setLocalAudioInterface(audioIO.data());
11901190 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+
11911195
11921196 this->installEventFilter(this);
11931197
@@ -1950,6 +1954,8 @@ void Application::initializeUi() { · 756 unmodified lines
19501954 rootContext->setContextProperty("ApplicationInterface", this);
19511955 rootContext->setContextProperty("Audio", &AudioScriptingInterface::getInstance());
19521956 rootContext->setContextProperty("AudioStats", DependencyManager::get<AudioClient>()->getStats().data());
1957+ rootContext->setContextProperty("AudioScope", DependencyManager::get<AudioScope>().data());
1958+
19531959 rootContext->setContextProperty("Controller", DependencyManager::get<controller::ScriptingInterface>().data());
19541960 rootContext->setContextProperty("Entities", DependencyManager::get<EntityScriptingInterface>().data());
19551961 _fileDownload = new FileScriptingInterface(engine);
@@ -3178,7 +3184,23 @@ void Application::mousePressEvent(QMouseEvent* event) { · 1222 unmodified lines
31783184 }
31793185 }
31803186
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+
31823204 // if one of our scripts have asked to capture this event, then stop processing it
31833205 if (_controllerScriptingInterface->isMouseCaptured()) {
31843206 return;
@@ -5525,6 +5547,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 2340 unmodified lines
55255547 scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance());
55265548 scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance());
55275549 scriptEngine->registerGlobalObject("AudioStats", DependencyManager::get<AudioClient>()->getStats().data());
5550+ scriptEngine->registerGlobalObject("AudioScope", DependencyManager::get<AudioScope>().data());
55285551
55295552 // Caches
55305553 scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data());