From 11a62e665d5f707857ebd2152b7ec97e6273991b Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 21 May 2016 16:47:54 +0300 Subject: [PATCH] Fix TAB not switching sources properly on Raspberry Pi --- src/Commands/SetNextSourceCmd.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Commands/SetNextSourceCmd.cpp b/src/Commands/SetNextSourceCmd.cpp index cba9e19..3f327cc 100644 --- a/src/Commands/SetNextSourceCmd.cpp +++ b/src/Commands/SetNextSourceCmd.cpp @@ -73,6 +73,7 @@ void SetNextSourceCmd::exec(){ } // Load new source + /* BaseSource * newSource; if(_sources[_nextSourceIndex].type == SourceType::SOURCE_TYPE_IMAGE){ newSource = mediaServer->loadImage(_sources[_nextSourceIndex].id); @@ -86,11 +87,22 @@ void SetNextSourceCmd::exec(){ // Unload old one mediaServer->unloadMedia(sourceId); + */ + + if(_sources[_nextSourceIndex].type == SourceType::SOURCE_TYPE_FBO){ + _sourcesEditor->setFboSource(_sources[_nextSourceIndex].id); + }else if(_sources[_nextSourceIndex].type == SourceType::SOURCE_TYPE_IMAGE){ + _sourcesEditor->setImageSource(_sources[_nextSourceIndex].id); + }else if(_sources[_nextSourceIndex].type == SourceType::SOURCE_TYPE_VIDEO){ + _sourcesEditor->setVideoSource(_sources[_nextSourceIndex].id); + } + } void SetNextSourceCmd::undo(){ ofLogNotice("SetNextSourceCmd", "undo"); + /* MediaServer * mediaServer = _sourcesEditor->getMediaServer(); // Load back old source @@ -101,6 +113,15 @@ void SetNextSourceCmd::undo(){ _surface->setSource(prevSource); mediaServer->unloadMedia(_sources[_nextSourceIndex].id); + */ + + if(_sources[_sourceIndex].type == SourceType::SOURCE_TYPE_FBO){ + _sourcesEditor->setFboSource(_sources[_sourceIndex].id); + }else if(_sources[_sourceIndex].type == SourceType::SOURCE_TYPE_IMAGE){ + _sourcesEditor->setImageSource(_sources[_sourceIndex].id); + }else if(_sources[_sourceIndex].type == SourceType::SOURCE_TYPE_VIDEO){ + _sourcesEditor->setVideoSource(_sources[_sourceIndex].id); + } } } // namespace piMapper