diff options
| author | Comment <tim@gray.(none)> | 2013-02-19 23:41:48 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-02-19 23:41:48 +0000 |
| commit | e1fba85c11ccce9a541f9d2f9c7db09658df8260 (patch) | |
| tree | 258177ffc9cb03feec321a0f8960f543aa7d5463 | |
| parent | 6dc658df9d43eb66eb168a883c1cf68474015d14 (diff) | |
writing framework
| -rw-r--r-- | interfaces02.h | 20 | ||||
| -rw-r--r-- | rotord/Makefile | 2 | ||||
| -rw-r--r-- | rotord/baseNode.cpp | 0 | ||||
| -rw-r--r-- | rotord/baseNode.h | 0 | ||||
| -rw-r--r-- | rotord/nodeGraph.cpp | 0 | ||||
| -rw-r--r-- | rotord/nodeGraph.h | 0 | ||||
| -rw-r--r-- | rotord/rotor.h | 162 | ||||
| -rw-r--r-- | rotord/rotord.h | 1 |
8 files changed, 181 insertions, 4 deletions
diff --git a/interfaces02.h b/interfaces02.h index 85f2543..9960828 100644 --- a/interfaces02.h +++ b/interfaces02.h @@ -53,16 +53,30 @@ maybe we should look at time in int (frames) - - what does this imply #define ROTOR_RENDERING 3 namespace Rotor { + class Render_status{ + public: + int id; + float progress; + } + class Render_requirements{ + public: + int num_performances; + int num_clips; + } class Render_context{ //Poco thread object //manages access to the 'patchbay' //high level interfaces for the wizard //and low level interface onto the graph public: - int get_status(); - float get_progress(): + Render_status get_status(); void cancel(); //interrupt locking process - int make_preview(int nodeID, float time); //starts a frame preview - how to retrieve? + int make_preview(int nodeID, float time); //starts a frame preview - returns status code - how to retrieve? int load_graph(Poco::UUID uid); + Poco::UUID save_graph(); //returns UUID of saved graph + int load_audio(string filename); + Render_requirements get_requirements(); + int load_video(int num,string filename); //can be performance or clip + private: int status; float progress; //for a locking process: audio analysis or rendering diff --git a/rotord/Makefile b/rotord/Makefile index f96f587..6d0e513 100644 --- a/rotord/Makefile +++ b/rotord/Makefile @@ -1,5 +1,5 @@ # The pre-processor and compiler options. -MY_CFLAGS = -I ../ffmpeg -fpermissive +MY_CFLAGS = -I ../ffmpeg -fpermissive -std=c++11 # The linker options. MY_LIBS = -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -lavcodec diff --git a/rotord/baseNode.cpp b/rotord/baseNode.cpp deleted file mode 100644 index e69de29..0000000 --- a/rotord/baseNode.cpp +++ /dev/null diff --git a/rotord/baseNode.h b/rotord/baseNode.h deleted file mode 100644 index e69de29..0000000 --- a/rotord/baseNode.h +++ /dev/null diff --git a/rotord/nodeGraph.cpp b/rotord/nodeGraph.cpp deleted file mode 100644 index e69de29..0000000 --- a/rotord/nodeGraph.cpp +++ /dev/null diff --git a/rotord/nodeGraph.h b/rotord/nodeGraph.h deleted file mode 100644 index e69de29..0000000 --- a/rotord/nodeGraph.h +++ /dev/null diff --git a/rotord/rotor.h b/rotord/rotor.h new file mode 100644 index 0000000..ae6c41d --- /dev/null +++ b/rotord/rotor.h @@ -0,0 +1,162 @@ +/* +requirement driven design + +do we store graphs as files or in a db with UUID as key? + +do we traverse the graph as direct recursive function calls or programmatically from outside? +or keep a reference to the container graph in each node? + +graph parent; +vector<signal_input> signal_inputs; +vector<image_input> image_inputs; + +//in input +int input_id; + + +&image get_ouput() +{ + for (int i=0;i<inputs.size;i++){ + if (inputs[i].input_id) parent.nodes[input_id].get_output(); ///how to find the output in the node? uids for everything? + } + + render(); + return &image_data; +} + +OR + +for (int i=0;i<inputs.size;i++){ + if (inputs[i].connection) inputs[i].connection->get_output(); ///methinks this is neater? you can check pointer for NULL, can't be ref +} + +NO NODE HAS MORE THAN ONE OUTPUT +WE DON'T LINK TO AN OUTPUT OBJECT WE LINK TO THE NODE - GET_OUTPUT IS THE RENDER FUNCTION + +settings - how do we deal with settings being controllable +signal inputs can have a gui representation as well +other gui items don't have an input + +scaling to come + +time is always in floating points seconds - time has to be requested when rendering - either a preview +what about testing a float for equality? +maybe we should look at time in int (frames) - - what does this imply +is it easier to have a function like: +bool Same_frame(float time1, float time2); + +2 main questions +authentication - how +authentication to renderer or just session? +files - where +generated images & movies where? + +*/ + +#include <unordered_map> + +#include "Poco/UUID.h" +#include "Poco/UUIDGenerator.h" + +using Poco::UUID; +using Poco::UUIDGenerator; + +#define ROTOR_READY 0 +#define ROTOR_ANALYSING_AUDIO 1 +#define ROTOR_CREATING_PREVIEW 2 +#define ROTOR_RENDERING 3 + +namespace Rotor { + //forward declaration + class Node; + + class Render_status{ + public: + int id; + float progress; + }; + class Render_requirements{ + public: + int num_performances; + int num_clips; + }; + class Render_context{ //Poco thread object + //manages access to the 'patchbay' + //high level interfaces for the wizard + //and low level interface onto the graph + public: + Render_status get_status(); + void cancel(); //interrupt locking process + int make_preview(int nodeID, float time); //starts a frame preview - returns status code - how to retrieve? + int load_graph(Poco::UUID uid); + UUID save_graph(); //returns UUID of saved graph + int load_audio(string filename); + Render_requirements get_requirements(); + int load_video(int num,string filename); //can be performance or clip + + private: + int status; + float progress; //for a locking process: audio analysis or rendering + + }; + class Input{ + public: + Node* connection; + + }; + class Image_input: public Input{ + public: + + }; + class Signal_input: public Input{ + public: + + }; + class Node{ + public: + UUID uid; //every usable node has a UUID + int id; + 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++){ + if (inputs[i].connection) inputs[i].connection->get_output(time); + } + } + + }; + class Image{ + char* data; + }; + class Image_node: public Node{ + 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); + } + } + Image& get_output(float time){ //sample implementation + gather_inputs(time); + //do something: i.e + + //and then + return &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 + private: + float image_time; + }; + class Graph{ + public: + UUID uid; //every version of a graph has a UUID + private: + std::unordered_map<int,Node> nodes; + }; +} + +/* +coding style +Types begin with a capital, use underscore as a seperator +*/
\ No newline at end of file diff --git a/rotord/rotord.h b/rotord/rotord.h index a90bd75..8079dd7 100644 --- a/rotord/rotord.h +++ b/rotord/rotord.h @@ -40,6 +40,7 @@ using Poco::Util::HelpFormatter; #include "vampHost.h" #include "avCodec.h" +#include "rotor.h" class RotorRequestHandler: public HTTPRequestHandler { |
