summaryrefslogtreecommitdiff
path: root/rotord/src/rendercontext.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-08-16 14:29:23 +0100
committerTim Redfern <tim@eclectronics.org>2013-08-16 14:29:23 +0100
commit10f50e4a6b8cbe83cf8c9bee238afe93a5958053 (patch)
treef0ca9b48ca702878f6c7d2b5492acaace7df5038 /rotord/src/rendercontext.h
parent1af93fbfe4c8cfa214331d2d96327637ffe749bf (diff)
finished render log
Diffstat (limited to 'rotord/src/rendercontext.h')
-rw-r--r--rotord/src/rendercontext.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/rotord/src/rendercontext.h b/rotord/src/rendercontext.h
index 26b39fa..d28cd82 100644
--- a/rotord/src/rendercontext.h
+++ b/rotord/src/rendercontext.h
@@ -8,6 +8,20 @@
#include "rotor.h"
namespace Rotor {
+ #define IDLE 0
+ #define ANALYSING_AUDIO 1
+ #define AUDIO_READY 2
+ #define CREATING_PREVIEW 3
+ #define PREVIEW_READY 4
+ #define RENDERING 5
+ #define RENDER_READY 6
+ #define FAILED 7
+ #define NOT_FOUND 8
+
+ #define ANALYSE_AUDIO 1
+ #define PREVIEW 2
+ #define RENDER 3
+
class Session_command {
public:
Session_command(){body="";};
@@ -15,6 +29,21 @@ namespace Rotor {
string uid,method,id,body;
vector<string> commands;
};
+ class Session_task {
+ public:
+ Session_task():uid(""),task(0){};
+ Session_task(const string &_uid,int _task):uid(_uid),task(_task) {};
+ string uid;
+ int task;
+
+ };
+ class Render_status {
+ public:
+ Render_status():status(0),progress(0.0f){};
+ Render_status(int _status):status(_status),progress(0.0f){};
+ int status;
+ float progress;
+ };
class Render_context: public Poco::Task { //Poco task object
//manages a 'patchbay'
//high level interfaces for the wizard
@@ -37,17 +66,30 @@ namespace Rotor {
};
~Render_context(){delete audio_thumb;};
void runTask();
- void add_queue(int item);
+ void add_queue(Session_task item);
void session_command(const Session_command& command,xmlIO& XML,Poco::Net::HTTPResponse::HTTPStatus& status);
void cancel(); //interrupt locking process
int make_preview(int nodeID, float time); //starts a frame preview - returns status code - how to retrieve?
bool load_audio(const string &filename,vector<Audio_processor*> processors);
bool load_video(const string &nodeID,const string &filename);//can be performance or clip
+ Render_status get_render_status(const string &uid){
+
+ //cerr<<"render status requested: "<<uid<<" status: "<<renders[uid].status<<endl;
+
+ if (renders.find(uid)!=renders.end()){
+ if (renders[uid].status==RENDERING){
+ renders[uid].progress=progress;
+ }
+ return renders[uid];
+ }
+ else return Render_status(NOT_FOUND);
+ };
private:
int state;
float progress; //for a locking process: audio analysis or rendering
//thread only does one thing at once
- std::deque<int> work_queue;
+ std::deque<Session_task> work_queue;
+ std::unordered_map<string,Render_status> renders;
Poco::Mutex mutex; //lock for access from parent thread
std::string audio_filename;
std::string output_filename;