diff options
| -rwxr-xr-x | install_dependencies_linux.sh | 1 | ||||
| -rw-r--r-- | rotord/src/graph.cpp | 17 | ||||
| -rw-r--r-- | rotord/src/rendercontext.cpp | 2 | ||||
| -rwxr-xr-x | rotord/src/rotor.h | 4 |
4 files changed, 19 insertions, 5 deletions
diff --git a/install_dependencies_linux.sh b/install_dependencies_linux.sh index b54750a..8f5f2d6 100755 --- a/install_dependencies_linux.sh +++ b/install_dependencies_linux.sh @@ -58,4 +58,5 @@ sudo apt-get -y install libopencv-dev libopencv-core-dev libopencv-highgui-dev sudo apt-get -y install libjsoncpp0 libjsoncpp-dev +sudo mkdir /usr/lib/vamp sudo cp qm-vamp-plugins-1.7-amd64-linux/* /usr/lib/vamp diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index dc3e13e..9536fdc 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -33,11 +33,22 @@ bool Graph::signal_render(string &signal_xml,const float framerate) { return false; } */ -bool Graph::preview(xmlIO &XML,string node,int w,int h){ +bool Graph::preview(xmlIO &XML,string node,int frame,int w,int h){ // //bool imencode(const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>()) - - return true; + //if (find_node_id) + if (nodes.find(node)!=nodes.end()){ + float t=frame*framerate; + if (dynamic_cast<Signal_node*>(nodes[node])){ + Time_spec ts=Time_spec(t,framerate,0.0f); + XML.addValue("signal",dynamic_cast<Signal_node*>(nodes[node])->get_output(ts)); + return true; + } + if (dynamic_cast<Image_node*>(nodes[node])){ + return true; + } + } + return false; } bool Graph::video_render(const string &output_filename,const string &audio_filename,const float framerate,float& progress) { diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index a5bb54f..b93f39d 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -312,7 +312,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H int frame=root["frame"].asInt(); int width=root["width"].asInt(); int height=root["height"].asInt(); - if (graph.preview(XML,preview_node,width,height)) { + if (graph.preview(XML,preview_node,frame,width,height)) { status=HTTPResponse::HTTP_OK; } else { diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index f52c212..299510a 100755 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -1199,6 +1199,7 @@ namespace Rotor { uid=_uid; description=_desc; duration=20.0f; + framerate=25.0f; }; string uid; //every version of a graph has a UUID, no particular need to actually read its data(?) //?? is it faster than using strings?? @@ -1213,9 +1214,10 @@ namespace Rotor { bool parseXml(string media_path); bool parseJson(string &data,string &media_path); bool set_resolution(int w,int h); - bool preview(xmlIO &XML,string node,int w,int h); + bool preview(xmlIO &XML,string node,int frame,int w,int h); bool loaded; float duration; + float framerate; const string toString(); xmlIO xml; private: |
