mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Removed old useless code from ancient OSC-support system.
This commit is contained in:
-120
@@ -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<Video*>(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<Video*>(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<Video*>(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();
|
||||
|
||||
Reference in New Issue
Block a user