summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-02-22 15:17:08 +0000
committerTim Redfern <tim@herge.(none)>2013-02-22 15:17:08 +0000
commit6fee126dc8ed8cc7c961c683f17896450dd8de03 (patch)
treea3d68a43ddf6ed684a640ae2296c805720d4d5e9
parent2cc106d2ca074a80d3e1c4a367951ea391f890d9 (diff)
loader for render context
-rw-r--r--onandoff.xml47
-rw-r--r--rotord/rotor.h30
-rw-r--r--rotord/rotord.cpp11
-rw-r--r--rotord/rotord.h25
4 files changed, 68 insertions, 45 deletions
diff --git a/onandoff.xml b/onandoff.xml
index d7be0b5..dec3a05 100644
--- a/onandoff.xml
+++ b/onandoff.xml
@@ -1,57 +1,48 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<canvas description="Off and on template ©Rotor 2013">
+<patchbay ID="0f7aa258-7c2f-11e2-abbd-133252267708">Off and on template ©Rotor 2013
<node ID="01" type="audioLoader">music track to analyse
<output ID="01" type="graph">beat (sawtooth)</output>
<output ID="03" type="graph">excitement</output>
</node>
<node ID="02" type="imageLoader" thumbnail="performance1.jpg">performance take 1
- <output ID="01" type="RGB"/>
+ <output ID="01" type="image"/>
</node>
<node ID="03" type="imageLoader" thumbnail="performance1.jpg">performance take 2
- <output ID="01" type="RGB"/>
+ <output ID="01" type="image"/>
</node>
<node ID="04" type="==">1
- <input ID="01" fromID="01.01" type="graph"/>
+ <input ID="01" from="01.01" type="graph"/>
<output ID="02" type="graph"/>
</node>
<node ID="05" type="toggle switch" >
- <input ID="01" fromID="02.01" type="RGB"/>
- <input ID="02" fromID="03.01" type="RGB"/>
- <input ID="03" fromID="04.02" type="graph"/>
- <output ID="04" type="RGB"/>
+ <input ID="01" from="02.01" type="image"/>
+ <input ID="02" from="03.01" type="image"/>
+ <input ID="03" from="04.02" type="signal"/>
+ <output ID="04" type="image"/>
</node>
<node ID="06" type="frequency/offset" frequency="0.25" offset="1">
- <input ID="01" fromID="01.01" type="graph"/>
+ <input ID="01" from="01.01" type="graph"/>
<output ID="02" type="graph"/>
</node>
<node ID="07" type="*">2
- <input ID="01" fromID="06.02" type="graph"/>
+ <input ID="01" from="06.02" type="graph"/>
<output ID="02" type="graph"/>
</node>
<node ID="08" type="==">1
- <input ID="01" fromID="06.02" type="graph"/>
+ <input ID="01" from="06.02" type="graph"/>
<output ID="02" type="graph"/>
</node>
<node ID="09" type="videoBank" mode="pingpong">
<clip ID="01" file="sample.mov"/>
- <input ID="01" fromID="08.02" type="graph"/>cycle switch
- <output ID="02" type="RGB"/>
+ <input ID="01" from="08.02" type="graph"/>cycle switch
+ <output ID="02" type="image"/>
</node>
<node ID="10" type="shape" mode="triangle">
- <input ID="01" fromID="07.02" type="graph"/>scale
- <output ID="02" type="LUM"/>
+ <input ID="01" from="07.02" type="graph"/>scale
+ <output ID="02" type="image"/>
</node>
<node ID="11" type="channel merge" >
- <input fromID="02.01" type="scale"/>
- <output ID="09" type="LUM"/>
- </node>
-</canvas>
-
-
-//node IDs - specific to the patch or universal (can they be renumbered?)
-//connector nodes - all in the patch or just mention the ones that are used
-//connector IDs - to identify connectors? seperate cIDs within a subcanvas? so- input fromID="02.01"
-//how do we identify a connector? -by type (seperate for each connector) - or by ID - or by description?
-//OR have a unique identifier for every node?
-
-// \ No newline at end of file
+ <input from="02.01" type="scale"/>
+ <output ID="09" type="image"/>
+ </node>
+</patchbay>
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)