diff --git a/MainWindow.cpp b/MainWindow.cpp index f45931a..7e16ffb 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -1351,7 +1351,7 @@ void MainWindow::readSettings() outputWindow->restoreGeometry(settings.value("outputWindow").toByteArray()); displayOutputWindow->setChecked(settings.value("displayOutputWindow").toBool()); outputWindowFullScreen->setChecked(settings.value("outputWindowFullScreen").toBool()); - config_osc_receive_port = settings.value("osc_receive_port", 12345).toInt(); + config_osc_receive_port = 12345; // settings.value("osc_receive_port", 12345).toInt(); } void MainWindow::writeSettings() @@ -1904,6 +1904,7 @@ void MainWindow::startOscReceiver() int port = config_osc_receive_port; std::ostringstream os; os << port; + std::cout << "OSC port: " << port << std::endl; osc_interface.reset(new OscInterface(os.str())); if (port != 0) { @@ -1994,12 +1995,16 @@ bool MainWindow::setTextureUri(int texture_id, const std::string &uri) if (paint->getType() == "media") { Media *media = (Media *) paint.get(); // FIXME: use sharedptr cast + videoTimer->stop(); success = media->setUri(QString(uri.c_str())); + videoTimer->start(); } else if (paint->getType() == "image") { Image *media = (Image*) paint.get(); // FIXME: use sharedptr cast + videoTimer->stop(); success = media->setUri(QString(uri.c_str())); + videoTimer->start(); } else { diff --git a/MediaImpl.cpp b/MediaImpl.cpp index f363fe2..57a3fca 100644 --- a/MediaImpl.cpp +++ b/MediaImpl.cpp @@ -246,6 +246,12 @@ gstPollShmsrc (void *user_data) bool MediaImpl::loadMovie(QString filename) { + gchar* filetestpath = (gchar*) filename.toUtf8().constData(); + if (FALSE == g_file_test(filetestpath, G_FILE_TEST_EXISTS)) + { + std::cout << "File " << filetestpath << " does not exist" << std::endl; + return false; + } _uri = filename; qDebug() << "Opening movie: " << filename << "."; diff --git a/OscInterface.cpp b/OscInterface.cpp index fc742de..131e936 100644 --- a/OscInterface.cpp +++ b/OscInterface.cpp @@ -218,6 +218,11 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma //std::cout << "load /mapmap/paint/media/load " << paint_id << " " << image_uri << std::endl; main_window.setTextureUri(paint_id, image_uri); } + else + { + std::cout << "Unhandled OSC message: "; + printCommand(command); + } //else if (path == "/add/quad") // addQuad(); diff --git a/OscReceiver.cpp b/OscReceiver.cpp index 2ecc6b0..2e1e2fe 100644 --- a/OscReceiver.cpp +++ b/OscReceiver.cpp @@ -9,8 +9,8 @@ OscReceiver::OscReceiver(const std::string &port) : port_(port), server_(0) { - server_is_ok_ = (server_ != NULL); server_ = lo_server_thread_new(port_.c_str(), error); + server_is_ok_ = (server_ != NULL); // #ifdef CONFIG_DEBUG // /* add method that will match any path and args */ // lo_server_thread_add_method(server_, NULL, NULL, genericHandler, this);