summaryrefslogtreecommitdiff
path: root/rotord/rotor.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rotor.h')
-rwxr-xr-xrotord/rotor.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/rotord/rotor.h b/rotord/rotor.h
index 346158e..cd83676 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -57,15 +57,11 @@ next - build signal_output and make a working chain with dummy data
#include "Poco/Random.h"
#include "Poco/AutoPtr.h"
#include "Poco/File.h"
-#include "Poco/Net/HTTPStreamFactory.h"
-#include "Poco/URIStreamOpener.h"
-#include <memory>
#include <iostream>
using Poco::UUID;
using Poco::UUIDGenerator;
using Poco::Net::HTTPResponse;
-using Poco::URIStreamOpener;
#include "vampHost.h"
#include "xmlIO.h"
@@ -121,7 +117,7 @@ namespace Rotor {
};
class Node{
public:
- Node(){type="node";};
+ Node(){};
virtual ~Node() {};
Node(map<string,string> &settings){
cerr << "Node:";
@@ -129,7 +125,7 @@ namespace Rotor {
cerr << it->first << "," << it->second << " ";
}
cerr << endl;
- description=settings["description"];output_type=settings["output"];ID=settings["ID"];
+ description=settings["description"];type=settings["type"];output_type=settings["output"];ID=settings["ID"];
};
UUID uid; //every usable node has a UUID
int id;
@@ -179,7 +175,7 @@ namespace Rotor {
//actual nodes-------------------------------------------------
class Audio_analysis: public Node {
public:
- Audio_analysis(){type="audio_analysis";};
+ Audio_analysis(){};
Audio_analysis(map<string,string> &settings) {
cerr << "Audio analysis:";
for (map<string,string>::iterator it=settings.begin();it!=settings.end();++it) {
@@ -198,7 +194,7 @@ namespace Rotor {
//for now, assume 25
//what to cache? for now, don't cache
public:
- Is_new_integer(){type="is_new_integer";};
+ Is_new_integer(){};
Is_new_integer(map<string,string> &settings) {
cerr << "Is new integer:";
for (map<string,string>::iterator it=settings.begin();it!=settings.end();++it) {
@@ -214,14 +210,14 @@ namespace Rotor {
};
class Signal_output: public Node {
public:
- Signal_output(){type="signal_output";};
+ Signal_output(){};
Signal_output(map<string,string> &settings) {
cerr << "Signal output:";
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"];
};
bool render(const float duration, const float framerate,string &xml_out);
@@ -231,16 +227,15 @@ namespace Rotor {
public:
Node_factory();
template <typename T>
- Node* clone(T *proto,map<string,string> &settings) {
- cerr << "Factory creating a " << proto->type << ", settings: ";
+ T* clone(T* proto,map<string,string> &settings) {
+ cerr << "Factory settings: ";
for (map<string,string>::iterator it=settings.begin();it!=settings.end();++it) {
cerr << it->first << "," << it->second << " ";
}
cerr << endl;
return new T(settings);
- };
- template <typename T>
- void add_type(string type,T *proto){
+ }
+ void add_type(string type,Node* proto){
type_map[type]=proto;
};
Node* create(map<string,string> &settings){
@@ -262,7 +257,6 @@ namespace Rotor {
std::unordered_map<string,Node*> nodes;
Node* find(const string &type){
for (std::unordered_map<string,Node*>::iterator it=nodes.begin();it!=nodes.end();++it) {
- cerr << "checking a " << it->second->type << " looking for a " << type << endl;
if (it->second->type==type) return it->second;
}
return NULL;