summaryrefslogtreecommitdiff
path: root/NT
diff options
context:
space:
mode:
Diffstat (limited to 'NT')
-rw-r--r--NT/src/rotor.cpp4
-rw-r--r--NT/src/rotor.h9
2 files changed, 11 insertions, 2 deletions
diff --git a/NT/src/rotor.cpp b/NT/src/rotor.cpp
index 9a0bc5d..056736d 100644
--- a/NT/src/rotor.cpp
+++ b/NT/src/rotor.cpp
@@ -12,4 +12,8 @@ int main(){
m.init(settings);
if (m.connect("inlet",&t)) printf("connected!\n");
else 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()
+ }
} \ No newline at end of file
diff --git a/NT/src/rotor.h b/NT/src/rotor.h
index 93b6865..1451a1b 100644
--- a/NT/src/rotor.h
+++ b/NT/src/rotor.h
@@ -39,7 +39,7 @@ namespace Rotor {
double duration;
Audio_frame *audio;
};
- class Variable { //base type for variable pointers
+ class Variable { //pure virtual base type for variable pointers
public:
virtual void init(std::string s)=0;
virtual ~Variable(){};
@@ -49,6 +49,7 @@ namespace Rotor {
};
template <class T> class Variable_type : public Variable {
public:
+ Variable_type(bool _c){connectable=_c;};
void init(std::string s){
std::istringstream cur(s);
cur >> value;
@@ -108,7 +109,11 @@ namespace Rotor {
return false;
}
template <class IT> IT* create_inlet(std::string name){
- vars[name]=new Variable_type<IT>();
+ vars[name]=new Variable_type<IT>(true);
+ return &((dynamic_cast<Variable_type<IT>*>(vars[name]))->value);
+ }
+ template <class IT> IT* create_attribute(std::string name){
+ vars[name]=new Variable_type<IT>(false);
return &((dynamic_cast<Variable_type<IT>*>(vars[name]))->value);
}
};