From 9878e8a8783fb5536b8f823176ff8fa3a87bc710 Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Sun, 11 Jan 2015 19:16:59 -0500 Subject: [PATCH] OSC: implement fullscreen and quit --- MainWindow.cpp | 28 ++++++++++++++++++++++++++-- MainWindow.h | 2 ++ OscInterface.cpp | 9 +++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 95fb3be..d7408b6 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -319,14 +319,24 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) outputWindow->setVisible(true); break; case Qt::Key_P: - if (_isPlaying) pause(); else play(); + if (_isPlaying) + { + pause(); + } + else + { + play(); + } break; case Qt::Key_R: rewind(); break; } } - else if (keyEvent->key() == Qt::Key_Escape) outputWindow->setFullScreen(false); + else if (keyEvent->key() == Qt::Key_Escape) + { + outputWindow->setFullScreen(false); + } eventKey = false; return eventKey; @@ -338,6 +348,14 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) } } +void MainWindow::setOutputWindowFullScreen(bool enable) +{ + outputWindow->setFullScreen(false); + // setCheckState + outputWindowFullScreen->setChecked(enable); + displayCanvasControls->setChecked(enable); +} + void MainWindow::newFile() { // Stop video playback to avoid lags. XXX Hack @@ -2438,3 +2456,9 @@ bool MainWindow::setTextureRate(int texture_id, double rate) } return true; } + +void MainWindow::quitMapMap() +{ + close(); +} + diff --git a/MainWindow.h b/MainWindow.h index 7b79928..a99770a 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -370,6 +370,8 @@ public: bool setOscPort(QString portNumber); bool setOscPort(int portNumber); int getOscPort() const; + void setOutputWindowFullScreen(bool enable); + void quitMapMap(); public: // Constants. /////////////////////////////////////////////////////////////////////////////////////// static const int DEFAULT_WIDTH = 1600; diff --git a/OscInterface.cpp b/OscInterface.cpp index 2783725..1ce270a 100644 --- a/OscInterface.cpp +++ b/OscInterface.cpp @@ -233,6 +233,15 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma main_window.setMappingItemVisibility(mappingId, visible ? true : false); main_window.setMappingVisible(mappingId, visible ? true : false); } + else if (path == "/mapmap/output/fullscreen" && typetags == "i") + { + int enable = command.at(2).toInt(); + main_window.setOutputWindowFullScreen(enable == 1 ? true : false); + } + else if (path == "/mapmap/quit") + { + main_window.quitMapMap(); + } else { std::cout << "Unhandled OSC message: ";