summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-09-07 15:05:08 +0100
committerTim Redfern <tim@eclectronics.org>2013-09-07 15:05:08 +0100
commitc82fb2010c8ce4741f30f91816fca76d6de98dbf (patch)
tree867ff492cb4cdbe084175eae7c1b9d27f7a04751 /rotord
parent6f0f7600e22590b28fc6b0d11a28fa7a42931e20 (diff)
refactored progress indicator
Diffstat (limited to 'rotord')
-rw-r--r--rotord/src/graph.cpp2
-rw-r--r--rotord/src/graph.h2
-rw-r--r--rotord/src/rendercontext.cpp6
-rw-r--r--rotord/src/rendercontext.h3
4 files changed, 6 insertions, 7 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index e6c0e3f..333d11c 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -79,7 +79,7 @@ bool Graph::preview(xmlIO &XML,string &node,string &_format,int frame,int w,int
return false;
}
-bool Graph::video_render(const string &output_filename,const float framerate,float& progress) {
+bool Graph::video_render(const string &output_filename,const float framerate) {
//vector<Node*> loaders=find_nodes("video_loader");
//for (auto i:loaders){
// if (!dynamic_cast<Video_loader*>(i)->isLoaded) {
diff --git a/rotord/src/graph.h b/rotord/src/graph.h
index 1c76937..2b2b8d0 100644
--- a/rotord/src/graph.h
+++ b/rotord/src/graph.h
@@ -25,7 +25,7 @@ namespace Rotor {
vector<Node*> find_nodes(const string &type); //could be a way of finding a set based on capabilities?
Node* find_node(const string &type);
bool signal_render(string &signal_xml,const float framerate);
- bool video_render(const string &output_filename,const float framerate,float& progress);
+ bool video_render(const string &output_filename,const float framerate);
bool load(string data,string media_path);
bool loadFile(string &filename,string media_path);
bool parseXml(string media_path);
diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp
index 1cc440a..b40b385 100644
--- a/rotord/src/rendercontext.cpp
+++ b/rotord/src/rendercontext.cpp
@@ -36,7 +36,7 @@ void Render_context::runTask() {
if(cmd.task==RENDER) {
state=RENDERING;
renders[cmd.uid]=Render_status(RENDERING);
- if(graph.video_render(output_filename,output_framerate,progress)){
+ if(graph.video_render(output_filename,output_framerate)){
state=IDLE;
if (graph.cancelled) renders[cmd.uid].status=CANCELLED;
else renders[cmd.uid].status=RENDER_READY;
@@ -126,7 +126,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
status=HTTPResponse::HTTP_OK;
XML.addValue("status","Analysing audio");
char c[20];
- sprintf(c,"%02f",progress);
+ sprintf(c,"%02f",graph.progress);
XML.addValue("progress",string(c));
}
else if (graph.audio_loaded) {
@@ -380,7 +380,7 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
if(state==RENDERING){
status=HTTPResponse::HTTP_OK;
XML.addValue("status","Rendering video");
- XML.addValue("progress",ofToString(progress));
+ XML.addValue("progress",ofToString(graph.progress));
}
else {
logger.error("ERROR: Render progress requested but not rendering");
diff --git a/rotord/src/rendercontext.h b/rotord/src/rendercontext.h
index bd37c53..8542bf1 100644
--- a/rotord/src/rendercontext.h
+++ b/rotord/src/rendercontext.h
@@ -76,7 +76,7 @@ namespace Rotor {
if (renders.find(uid)!=renders.end()){
if (renders[uid].status==RENDERING){
- renders[uid].progress=progress;
+ renders[uid].progress=graph.progress;
}
return renders[uid];
}
@@ -84,7 +84,6 @@ namespace Rotor {
};
private:
int state;
- float progress; //for a locking process: audio analysis or rendering
//thread only does one thing at once
std::deque<Session_task> work_queue;
std::unordered_map<string,Render_status> renders;