summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
Diffstat (limited to 'rotord')
-rw-r--r--rotord/rotor.cpp6
-rwxr-xr-xrotord/rotor.h25
2 files changed, 22 insertions, 9 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 4a3d6c9..559e47c 100644
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -75,10 +75,10 @@ Command_response Render_context::session_command(const std::vector<std::string>&
if (command.size()>2) {
if (state==IDLE) {
//check file exists
- //Poco::File f=Poco::File(command[3]);
+ Poco::File f=Poco::File(command[3]);
//std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(command[3]));
- /*
+
if (f.exists()) {
//pass to worker thread ??if engine is ready?? ??what if engine has finished but results aren't read??
audio_filename=command[3]; //for now, store session variables in memory
@@ -89,7 +89,7 @@ Command_response Render_context::session_command(const std::vector<std::string>&
response.status=HTTPResponse::HTTP_NOT_FOUND;
response.description="<status context='"+command[1]+"'>File "+command[3]+" not found</status>\n";
}
- */
+
}
else {
response.status=HTTPResponse::HTTP_BAD_REQUEST;
diff --git a/rotord/rotor.h b/rotord/rotor.h
index cd83676..aab0af9 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -115,10 +115,10 @@ namespace Rotor {
Signal_input(const string &_desc): Input(_desc){};
};
- class Node{
+ class Node{
public:
Node(){};
- virtual ~Node() {};
+ virtual ~Node(){};
Node(map<string,string> &settings){
cerr << "Node:";
for (map<string,string>::iterator it=settings.begin();it!=settings.end();++it) {
@@ -126,7 +126,7 @@ namespace Rotor {
}
cerr << endl;
description=settings["description"];type=settings["type"];output_type=settings["output"];ID=settings["ID"];
- };
+ };
UUID uid; //every usable node has a UUID
int id;
vector<Signal_input*> inputs; //simple node has signal inputs and outputs
@@ -151,6 +151,18 @@ namespace Rotor {
class Image{
char* data;
};
+ class Signal_node: public Node{
+ public:
+ Signal_node(){};
+ Signal_node(map<string,string> &settings){
+ cerr << "Signal_node:";
+ for (map<string,string>::iterator it=settings.begin();it!=settings.end();++it) {
+ cerr << it->first << "," << it->second << " ";
+ }
+ cerr << endl;
+ description=settings["description"];type=settings["type"];output_type=settings["output"];ID=settings["ID"];
+ };
+ };
class Image_node: public Node{
public:
vector<Image_input> image_inputs; //image node also has image inputs and outputs
@@ -173,7 +185,7 @@ namespace Rotor {
float image_time;
};
//actual nodes-------------------------------------------------
- class Audio_analysis: public Node {
+ class Audio_analysis: public Signal_node {
public:
Audio_analysis(){};
Audio_analysis(map<string,string> &settings) {
@@ -189,7 +201,7 @@ namespace Rotor {
return t;
}
};
- class Is_new_integer: public Node {
+ class Is_new_integer: public Signal_node {
//does this require knowing what the framerate is?
//for now, assume 25
//what to cache? for now, don't cache
@@ -208,7 +220,7 @@ namespace Rotor {
else return 0.0f;
}
};
- class Signal_output: public Node {
+ class Signal_output: public Signal_node {
public:
Signal_output(){};
Signal_output(map<string,string> &settings) {
@@ -240,6 +252,7 @@ namespace Rotor {
};
Node* create(map<string,string> &settings){
if (type_map.find(settings["type"])!=type_map.end()) {
+ cerr << "Factory: creating " << settings["type"] << endl;
return clone(type_map[settings["type"]],settings);
}
else return NULL;