summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/NodeBase.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-20 20:54:31 +0000
committerDavid Robillard <d@drobilla.net>2007-09-20 20:54:31 +0000
commit615ceaaf519d0c42a9215c4835e1f7348f2e5dca (patch)
tree79093453605d8a1b2ff97dc07cff14324bc14f06 /src/libs/engine/NodeBase.cpp
parenta4625db3f26716fb7a34614c76582ab92b5212e8 (diff)
downloadingen-615ceaaf519d0c42a9215c4835e1f7348f2e5dca.tar.gz
ingen-615ceaaf519d0c42a9215c4835e1f7348f2e5dca.tar.bz2
ingen-615ceaaf519d0c42a9215c4835e1f7348f2e5dca.zip
Remove useless InternalNode class.
Percolate boolean polyphony down through Node class heirarchy (instead of integer). git-svn-id: http://svn.drobilla.net/lad/ingen@742 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/NodeBase.cpp')
-rw-r--r--src/libs/engine/NodeBase.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libs/engine/NodeBase.cpp b/src/libs/engine/NodeBase.cpp
index e8df05d6..90d5864f 100644
--- a/src/libs/engine/NodeBase.cpp
+++ b/src/libs/engine/NodeBase.cpp
@@ -33,10 +33,10 @@ using std::cout; using std::cerr; using std::endl;
namespace Ingen {
-NodeBase::NodeBase(const Plugin* plugin, const string& name, bool poly, Patch* parent, SampleRate srate, size_t buffer_size)
-: Node(parent, name, poly),
+NodeBase::NodeBase(const Plugin* plugin, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size)
+: Node(parent, name, polyphonic),
_plugin(plugin),
- _polyphony(parent ? parent->internal_poly() : 1),
+ _polyphony((polyphonic && parent) ? parent->internal_poly() : 1),
_srate(srate),
_buffer_size(buffer_size),
_activated(false),
@@ -85,6 +85,9 @@ NodeBase::deactivate()
bool
NodeBase::prepare_poly(uint32_t poly)
{
+ if (!_polyphonic)
+ return true;
+
if (_ports)
for (size_t i=0; i < _ports->size(); ++i)
_ports->at(i)->prepare_poly(poly);
@@ -96,6 +99,9 @@ NodeBase::prepare_poly(uint32_t poly)
bool
NodeBase::apply_poly(Raul::Maid& maid, uint32_t poly)
{
+ if (!_polyphonic)
+ return true;
+
if (_ports)
for (size_t i=0; i < _ports->size(); ++i)
_ports->at(i)->apply_poly(maid, poly);