diff options
Diffstat (limited to 'rotord/src/rendercontext.h')
| -rw-r--r-- | rotord/src/rendercontext.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/rotord/src/rendercontext.h b/rotord/src/rendercontext.h new file mode 100644 index 0000000..738ce38 --- /dev/null +++ b/rotord/src/rendercontext.h @@ -0,0 +1,61 @@ +#ifndef RENDERCONTEXT_H +#define RENDERCONTEXT_H + +#include "Poco/Task.h" +#include "Poco/File.h" +#include "Poco/StringTokenizer.h" + +#include "rotor.h" + +namespace Rotor { + class Render_context: public Poco::Task { //Poco task object + //manages a 'patchbay' + //high level interfaces for the wizard + //and low level interface onto the graph + public: + Render_context(const std::string& name): Task(name) { + audio_thumb=new Audio_thumbnailer(); + state=IDLE; + output_framerate=25.0f; + audio_loaded=false; + + xmlIO xml; + if(xml.loadFile("settings.xml") ){ + graph_dir=xml.getAttribute("Rotor","graph_dir","",0); + media_dir=xml.getAttribute("Rotor","media_dir","",0); + output_dir=xml.getAttribute("Rotor","output_dir","",0); + } + + else cerr<<"Rotor: settings.xml not found, using defaults"<<endl; + }; + ~Render_context(){delete audio_thumb;}; + void runTask(); + void add_queue(int item); + Command_response session_command(const std::vector<std::string>& command); + void session_command(const std::vector<std::string>& 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 + 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; + Poco::Mutex mutex; //lock for access from parent thread + std::string audio_filename; + std::string output_filename; + std::string graph_dir; + std::string media_dir; + std::string output_dir; + + Audio_thumbnailer *audio_thumb; + Graph graph; + Node_factory factory; + float output_framerate; + bool audio_loaded; + + }; +} + +#endif
\ No newline at end of file |
