diff options
Diffstat (limited to 'NT/src/rotor.h')
| -rw-r--r-- | NT/src/rotor.h | 9 |
1 files changed, 7 insertions, 2 deletions
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); } }; |
