diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-02-22 15:17:08 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-02-22 15:17:08 +0000 |
| commit | 6fee126dc8ed8cc7c961c683f17896450dd8de03 (patch) | |
| tree | a3d68a43ddf6ed684a640ae2296c805720d4d5e9 /rotord | |
| parent | 2cc106d2ca074a80d3e1c4a367951ea391f890d9 (diff) | |
loader for render context
Diffstat (limited to 'rotord')
| -rw-r--r-- | rotord/rotor.h | 30 | ||||
| -rw-r--r-- | rotord/rotord.cpp | 11 | ||||
| -rw-r--r-- | rotord/rotord.h | 25 |
3 files changed, 49 insertions, 17 deletions
diff --git a/rotord/rotor.h b/rotord/rotor.h index 7f18ee5..32b0173 100644 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -51,6 +51,15 @@ authentication to renderer or just session? files - where generated images & movies where? +nb where a signal enters a channel comp input - it is duplicated + +next - Poco create thread + +1st - create thread and return id - create method to kill it + +sql stuff + + */ #include <unordered_map> @@ -67,6 +76,10 @@ using Poco::UUIDGenerator; #define ROTOR_RENDERING 3 namespace Rotor { + class Command{ + //passes a command from the RESTful url to create/ alter a thread + vector<string> packets; + }; //forward declaration class Node; @@ -80,8 +93,8 @@ namespace Rotor { int num_performances; int num_clips; }; - class Render_context{ //Poco thread object - //manages access to the 'patchbay' + class Render_context: public Poco::Runnable{ //Poco thread object + //manages a 'patchbay' //high level interfaces for the wizard //and low level interface onto the graph public: @@ -119,7 +132,7 @@ namespace Rotor { vector<Signal_input> inputs; //simple node has signal inputs and outputs void get_output(float time); void gather_inputs(float time) { - for (int i=0;i<inputs.size();i++){ + for (uint i=0;i<inputs.size();i++){ if (inputs[i].connection) inputs[i].connection->get_output(time); } } @@ -131,16 +144,17 @@ namespace Rotor { public: vector<Image_input> image_inputs; //image node also has image inputs and outputs void gather_inputs(float time) { - for (int i=0;i<inputs.size();i++){ - if (inputs[i].connection) inputs[i].connection->get_output(time); + Node::gather_inputs(time); + for (uint i=0;i<image_inputs.size();i++){ + if (image_inputs[i].connection) image_inputs[i].connection->get_output(time); } } - Image& get_output(float time){ //sample implementation + Image* get_output(float time){ //sample implementation gather_inputs(time); - //do something: i.e + //do something with the inputs //and then - return &inputs[0].connection->image; + return ((Image_node*)image_inputs[0].connection)->image; } void get_preview(float time); Image* image; //this can be privately allocated or just passed on as the node see fit diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index e6460c6..f20b515 100644 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -106,6 +106,17 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS // string outfilename, bool useFrames); return 0; } + else if (segments[0]=="new") { + // website creating a new render context + + + //Settings(string _so="",string _filter="",string _id="",string _input=""); + return new AudioAnalyserHandler(vampHost::Settings(segments[1],segments[2],segments[3])); + //string audioData=runPlugin(string myname, string soname, string id, + // string output, int outputNo, string wavname, + // string outfilename, bool useFrames); + return 0; + } else { return 0; } diff --git a/rotord/rotord.h b/rotord/rotord.h index 8079dd7..bbc566f 100644 --- a/rotord/rotord.h +++ b/rotord/rotord.h @@ -51,26 +51,32 @@ class RotorRequestHandler: public HTTPRequestHandler std::string _format; }; -class RotorRequestHandlerFactory: public HTTPRequestHandlerFactory +class AudioAnalyserHandler: public HTTPRequestHandler { public: - RotorRequestHandlerFactory(const std::string& format); - HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request); + AudioAnalyserHandler(const vampHost::Settings& _settings); + void handleRequest(HTTPServerRequest& request,HTTPServerResponse& response); private: - std::string _format; + vampHost::Settings settings; }; - -class AudioAnalyserHandler: public HTTPRequestHandler +class RenderContextHandler: public HTTPRequestHandler { public: - AudioAnalyserHandler(const vampHost::Settings& _settings); + RenderContextHandler(const Rotor::Command& command); void handleRequest(HTTPServerRequest& request,HTTPServerResponse& response); private: - vampHost::Settings settings; + //stateless }; - +class RotorRequestHandlerFactory: public HTTPRequestHandlerFactory +{ + public: + RotorRequestHandlerFactory(const std::string& format); + HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request); + private: + std::string _format; +}; class RotorServer: public Poco::Util::ServerApplication { @@ -85,6 +91,7 @@ class RotorServer: public Poco::Util::ServerApplication int main(const std::vector<std::string>& args); private: bool _helpRequested; + std::unordered_map<Poco::UUID,Rotor::Render_context> render_contexts; }; int main(int argc, char** argv) |
