diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-04-25 16:20:24 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-04-25 16:20:24 +0100 |
| commit | 06ac4feb6f4ce99d3e9fca26fa4045ef01156ff7 (patch) | |
| tree | e311c01725b5cec22f50d0de6450fc0e734dde5b /rotord/graph.cpp | |
| parent | bee668c819c4d83c7492e296afb3a90ea1cd6d06 (diff) | |
video loader begin
Diffstat (limited to 'rotord/graph.cpp')
| -rw-r--r-- | rotord/graph.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/rotord/graph.cpp b/rotord/graph.cpp index 7eeeec3..69c4811 100644 --- a/rotord/graph.cpp +++ b/rotord/graph.cpp @@ -9,6 +9,33 @@ const string Graph::toString(){ } else return ""; } +vector<Node*> Graph::find_nodes(const string &type){ + vector<Node*> found; + for (std::unordered_map<string,Node*>::iterator it=nodes.begin();it!=nodes.end();++it) { + if (it->second->type==type) found.push_back(it->second); + } + return found; +}; +Node* Graph::find_node(const string &type){ + for (std::unordered_map<string,Node*>::iterator it=nodes.begin();it!=nodes.end();++it) { + if (it->second->type==type) return it->second; + } + return nullptr; //can be tested against +}; +bool Graph::signal_render(string &signal_xml,const float framerate) { + if (find_node("signal_output")) { + Signal_output *signal_output=dynamic_cast<Signal_output*>(find_node("signal_output")); + return signal_output->render(duration,framerate,signal_xml); + } + else return false; +} +bool Graph::video_render(const string &output_filename,const string &audio_filename,const float framerate) { + if (find_node("video_output")) { + Video_output *video_output=dynamic_cast<Video_output*>(find_node("video_output")); + return video_output->render(duration,framerate,output_filename,audio_filename); + } + else return false; +} bool Graph::load(string &filename){ loaded=false; printf("loading graph: %s\n",filename.c_str()); |
