diff --git a/MainWindow.cpp b/MainWindow.cpp index 5f1d709..f80ce54 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -3296,126 +3296,6 @@ void MainWindow::exitFullScreen() // open(); // } -bool MainWindow::setTextureUri(int texture_id, const std::string &uri) -{ - // TODO: const QString & - - bool success = false; - Paint::ptr paint = this->mappingManager->getPaintById(texture_id); - if (paint.isNull()) - { - std::cout << "No such texture paint id " << texture_id << std::endl; - success = false; - } - else - { - if (paint->getType() == "media") - { - Video *media = static_cast(paint.data()); // FIXME: use sharedptr cast - videoTimer->stop(); - success = media->setUri(QString(uri.c_str())); - videoTimer->start(); - } - else if (paint->getType() == "image") - { - Image *media = (Image*) paint.data(); // FIXME: use sharedptr cast - videoTimer->stop(); - success = media->setUri(QString(uri.c_str())); - videoTimer->start(); - } - else - { - std::cout << "Paint id " << texture_id << " is not a media texture." << std::endl; - return false; - } - } - return success; -} - -bool MainWindow::setTextureRate(int texture_id, double rate) -{ - Paint::ptr paint = this->mappingManager->getPaintById(texture_id); - if (paint.isNull()) - { - std::cout << "No such texture paint id " << texture_id << std::endl; - return false; - } - else - { - if (paint->getType() == "media") - { - Video *media = static_cast(paint.data()); // FIXME: use sharedptr cast - videoTimer->stop(); - media->setRate(rate); - videoTimer->start(); - } - else - { - std::cout << "Paint id " << texture_id << " is not a media texture." << std::endl; - return false; - } - } - return true; -} - -bool MainWindow::setTextureVolume(int texture_id, double volume) -{ - Paint::ptr paint = this->mappingManager->getPaintById(texture_id); - if (paint.isNull()) - { - std::cout << "No such texture paint id " << texture_id << std::endl; - return false; - } - else - { - if (paint->getType() == "media") - { - Video *media = static_cast(paint.data()); // FIXME: use sharedptr cast - videoTimer->stop(); - media->setVolume(volume); - videoTimer->start(); - } - else - { - std::cout << "Paint id " << texture_id << " is not a media texture." << std::endl; - return false; - } - } - return true; -} - -void MainWindow::setTexturePlayState(int texture_id, bool played) -{ - Paint::ptr paint = this->mappingManager->getPaintById(texture_id); - if (paint.isNull()) - { - std::cout << "No such texture paint id " << texture_id << std::endl; - } - else - { - if (paint->getType() == "media") - { - if (played) - { - videoTimer->stop(); - paint->play(); - videoTimer->start(); - } - else - { - videoTimer->stop(); - paint->pause(); - videoTimer->start(); - } - - } - else - { - std::cout << "Paint id " << texture_id << " is not a media texture." << std::endl; - } - } -} - void MainWindow::quitMapMap() { close(); diff --git a/MainWindow.h b/MainWindow.h index f583086..884af7c 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -254,12 +254,6 @@ public slots: /// Reset playback. void rewind(); -public: - bool setTextureUri(int texture_id, const std::string &uri); - bool setTextureRate(int texture_id, double rate); - bool setTextureVolume(int texture_id, double volume); - void setTexturePlayState(int texture_id, bool played); - private: // Internal methods. //////////////////////////////////////////////////////////////////////////////////////