Browse Source

Add ofxPiMapper::setVideoSource(fileName)

master
Krisjanis Rijnieks 7 years ago
parent
commit
0ef4e1f8b5
  1. 23
      src/Application/Application.cpp
  2. 1
      src/Application/Application.h
  3. 4
      src/ofxPiMapper.cpp
  4. 1
      src/ofxPiMapper.h

23
src/Application/Application.cpp

@ -482,6 +482,29 @@ void Application::setFboSource(std::string sourceId){
}
}
void Application::setVideoSource(std::string fileName){
vector<std::string> loadedVideos = getMediaServer()->getVideoNames();
for(auto i = 0; i < loadedVideos.size(); i++){
if(ofIsStringInString(loadedVideos[i], fileName)){
if(getSurfaceManager()->getSelectedSurface() != 0){
BaseSource * source = getSurfaceManager()->getSelectedSurface()->getSource();
VideoSource * video = dynamic_cast<VideoSource *>(source);
video->stop();
getCmdManager()->exec(
new SetSourceCmd(
SourceType::SOURCE_TYPE_VIDEO,
getMediaServer()->getVideoPaths()[i],
getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getSourcesEditorWidget()));
}else{
getCmdManager()->exec(new SelNextSurfaceCmd(getSurfaceManager()));
}
break;
}
}
}
void Application::addGridRow(){
if(getSurfaceManager()->getSelectedSurface() != 0){
if(getSurfaceManager()->getSelectedSurface()->getType() ==

1
src/Application/Application.h

@ -130,6 +130,7 @@ class Application {
void duplicateSurface();
void setNextSource();
void setFboSource(std::string sourceId);
void setVideoSource(std::string fileName);
void addGridRow();
void addGridColumn();
void removeGridRow();

4
src/ofxPiMapper.cpp

@ -186,6 +186,10 @@ void ofxPiMapper::setFboSource(std::string sourceId){
_application.setFboSource(sourceId);
}
void ofxPiMapper::setVideoSource(std::string fileName){
_application.setVideoSource(fileName);
}
void ofxPiMapper::reboot(){
_application.reboot();
}

1
src/ofxPiMapper.h

@ -86,6 +86,7 @@ class ofxPiMapper {
// Sources, selected surface
void setNextSource();
void setFboSource(std::string sourceId);
void setVideoSource(std::string fileName);
// System commands
void reboot();

Loading…
Cancel
Save