diff options
author | Torben Hohn <torbenh@gmx.de> | 2010-06-03 20:09:17 +0000 |
---|---|---|
committer | Torben Hohn <torbenh@gmx.de> | 2010-06-03 20:09:17 +0000 |
commit | 357cf39470e485415aeee8270fe3a786cb0b6ec6 (patch) | |
tree | 4d3292c26f5b1f7940351cc1c40fd2caad059d4b /libs/ardour/graphnode.cc | |
parent | c59dade835fa5aa8150fae6d503bd93eee92075d (diff) |
add missing graph.cc and friends :S
git-svn-id: svn://localhost/ardour2/branches/3.0@7225 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/graphnode.cc')
-rw-r--r-- | libs/ardour/graphnode.cc | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/ardour/graphnode.cc b/libs/ardour/graphnode.cc new file mode 100644 index 0000000000..c8f3e630d1 --- /dev/null +++ b/libs/ardour/graphnode.cc @@ -0,0 +1,48 @@ + +#include "ardour/graph.h" +#include "ardour/graphnode.h" +#include "ardour/route.h" + +using namespace ARDOUR; + +// ========================================== GraphNode + +GraphNode::GraphNode( graph_ptr_t graph ) + : _graph(graph) +{ } + +void +GraphNode::prep( int chain ) +{ + _refcount = _init_refcount[chain]; +} + +void +GraphNode::dec_ref() +{ + if (g_atomic_int_dec_and_test( &_refcount )) + _graph->trigger( this ); +} + +void +GraphNode::finish( int chain ) +{ + node_set_t::iterator i; + bool feeds_somebody = false; + for (i=_activation_set[chain].begin(); i!=_activation_set[chain].end(); i++) + { + (*i)->dec_ref(); + feeds_somebody = true; + } + if (!feeds_somebody) + { + _graph->dec_ref(); + } +} + + +void +GraphNode::process() +{ + _graph->process_one_route( dynamic_cast<Route *>(this) ); +} |