From 357cf39470e485415aeee8270fe3a786cb0b6ec6 Mon Sep 17 00:00:00 2001 From: Torben Hohn Date: Thu, 3 Jun 2010 20:09:17 +0000 Subject: add missing graph.cc and friends :S git-svn-id: svn://localhost/ardour2/branches/3.0@7225 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/graphnode.cc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 libs/ardour/graphnode.cc (limited to 'libs/ardour/graphnode.cc') 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(this) ); +} -- cgit v1.2.3