1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <stdio.h>
#include "rotor.h"
#include "nodes.h"
#include "factory.h"
using namespace std;
using namespace Rotor;
//factory generates linker errors if rotor.h implementation is seperated: why?
int main(){
Node_factory f;
map<string,string> settings={{"type","time"}};
Node *t=f.create(settings);
settings={{"value","2"},{"type","multiply"}};
Node *m=f.create(settings);
if (!m->connect("inlet",t)) printf("not connected...\n");
settings={{"type","print"}};
Node *p=f.create(settings);
if (!p->connect("inlet",m)) printf("not connected...\n");
for (double t=0;t<10.0;t+=0.765){
Frame_parameters f=Frame_parameters(t,25.0,10.0,640,360);
printf("%04f %s\n",t,(dynamic_cast<Node_type<string>*>(p))->get_output(f).c_str());
}
delete t;
delete m;
delete p;
}
|