diff options
author | David Robillard <d@drobilla.net> | 2007-02-01 05:07:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-01 05:07:13 +0000 |
commit | ed85b5c7d96e40ada730614cb69776672738c87b (patch) | |
tree | 9aee0a533ae8f815e48e3fdf6a48013fe31f1f3c /src/Machine.cpp | |
parent | 822c1f64098b5d81aaa8b4c7d6f75901d9f431f2 (diff) | |
download | machina-ed85b5c7d96e40ada730614cb69776672738c87b.tar.gz machina-ed85b5c7d96e40ada730614cb69776672738c87b.tar.bz2 machina-ed85b5c7d96e40ada730614cb69776672738c87b.zip |
Partially implemented loading (from RDF files).
git-svn-id: http://svn.drobilla.net/lad/machina@272 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Machine.cpp')
-rw-r--r-- | src/Machine.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Machine.cpp b/src/Machine.cpp index 91335c7..246db73 100644 --- a/src/Machine.cpp +++ b/src/Machine.cpp @@ -23,7 +23,8 @@ namespace Machina { Machine::Machine(size_t poly) - : _initial_node(new Node()) + : _activated(false) + , _initial_node(new Node()) , _voices(poly, NULL)//_initial_node) , _time(0) { @@ -35,13 +36,14 @@ Machine::Machine(size_t poly) Machine::~Machine() { - delete _initial_node; } void Machine::reset() { + assert(!_activated); + for (std::vector<Node*>::iterator i = _voices.begin(); i != _voices.end(); ++i) { *i = NULL; @@ -50,11 +52,21 @@ Machine::reset() void +Machine::add_node(const Node::ID& id, SharedPtr<Node> node) +{ + assert(!_activated); + _nodes[id] = node; +} + + +void Machine::process(FrameCount nframes) { const FrameCount cycle_end = _time + nframes; bool done = false; + assert(_activated); + FrameCount latest_event = _time; std::cerr << "--------- " << _time << " - " << _time + nframes << std::endl; |