mirror of
https://github.com/kr15h/ofxPiMapper.git
synced 2026-06-16 12:31:49 +02:00
Add ofxPiMapper::setVideoSource(fileName)
This commit is contained in:
@@ -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() ==
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user