diff options
Diffstat (limited to 'NT/src/rendercontext.cpp')
| -rw-r--r-- | NT/src/rendercontext.cpp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/NT/src/rendercontext.cpp b/NT/src/rendercontext.cpp index 77a7701..217a05a 100644 --- a/NT/src/rendercontext.cpp +++ b/NT/src/rendercontext.cpp @@ -74,24 +74,27 @@ string Render_context::text_render(string node_id){ } } else { - p=graph.get_node(id); + p=graph.get_node(node_id); if (!p){ - logger.error("text_render: node '"+id+"' not found"); + logger.error("text_render: node '"+node_id+"' not found"); return ""; } } Node_type<string>* s=(dynamic_cast<Node_type<string>*>(p)); if (!s) { - logger.error("text_render: node '"+id+"' is not a text node"); + logger.error("text_render: node '"+node_id+"' is not a text node"); return ""; } string st=""; for (double t=0;t<10.0;t+=0.765){ Frame_parameters f=Frame_parameters(t,25.0,10.0,640,360); - st+=(dynamic_cast<Node_type<string>*>(p))->get_output(f)+"\n"; + st+=toString(t)+":"+(dynamic_cast<Node_type<string>*>(p))->get_output(f)+","; } return st; } +bool Render_context::video_render(std::string output_filename,std::string node_id=""){ + return true; +} void Render_context::session_command(const Session_command& command,xmlIO& XML,HTTPResponse::HTTPStatus& status){ string s; @@ -259,6 +262,30 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H status=HTTPResponse::HTTP_OK; } } + if (command.commands[1]=="text") { + if (command.method=="GET") { + if(state==IDLE){ + string text_node=command.body; + if (text_node!=""){ + XML.addValue("data",text_render(text_node)); + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Text node not specified"); + } + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Session busy"); + XML.addValue("error","Session busy"); + } + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Bad request"); + XML.addValue("error","Bad request"); + } + } /* if (command.commands[1]=="signal") { if (command.method=="GET") { //generate xml from 1st signal output |
