summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-02 02:51:41 +0000
committerDavid Robillard <d@drobilla.net>2007-01-02 02:51:41 +0000
commit84906b5777d6748c09dd5ca56169aa3366d13c71 (patch)
tree69207ea182be5c44c0a5e89d3d475ab0b39e97c5 /src/libs/engine/InputPort.cpp
parentb249234a26f3a424fcf977b1a3b8fed4d5ac7d39 (diff)
downloadingen-84906b5777d6748c09dd5ca56169aa3366d13c71.tar.gz
ingen-84906b5777d6748c09dd5ca56169aa3366d13c71.tar.bz2
ingen-84906b5777d6748c09dd5ca56169aa3366d13c71.zip
Initial work on dynamic (Jack) buffer resizing (still unworking).
git-svn-id: http://svn.drobilla.net/lad/ingen@229 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/InputPort.cpp')
-rw-r--r--src/libs/engine/InputPort.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index 830b370c..8b170958 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -71,7 +71,7 @@ InputPort<T>::add_connection(ListNode<TypedConnection<T>*>* const c)
// m_tied_port->buffer(i)->join(m_buffers.at(i));
}
}
- update_buffers();
+ TypedPort<T>::connect_buffers();
}
//assert( ! m_is_tied || m_tied_port != NULL);
@@ -125,7 +125,7 @@ InputPort<T>::remove_connection(const OutputPort<T>* const src_port)
}
if (modify_buffers)
- update_buffers();
+ TypedPort<T>::connect_buffers();
//assert( ! m_is_tied || m_tied_port != NULL);
//assert( ! m_is_tied || m_buffers.at(0)->data() == m_tied_port->buffer(0)->data());
@@ -138,22 +138,6 @@ template ListNode<TypedConnection<MidiMessage>*>*
InputPort<MidiMessage>::remove_connection(const OutputPort<MidiMessage>* const src_port);
-/** Update any changed buffers with the plugin this is a port on.
- *
- * This calls ie the LADSPA connect_port function when buffers have been changed
- * due to a connection or disconnection.
- */
-template <typename T>
-void
-InputPort<T>::update_buffers()
-{
- for (size_t i=0; i < _poly; ++i)
- InputPort<T>::parent_node()->set_port_buffer(i, _index, m_buffers.at(i)->data());
-}
-template void InputPort<Sample>::update_buffers();
-template void InputPort<MidiMessage>::update_buffers();
-
-
/** Returns whether this port is connected to the passed port.
*/
template <typename T>
@@ -234,7 +218,7 @@ InputPort<Sample>::process(SampleCount nframes, FrameTime start, FrameTime end)
m_buffers.at(0)->join((*m_connections.begin())->buffer(0));
do_mixdown = false;
}
- update_buffers();
+ connect_buffers();
} else {
do_mixdown = false;
}
@@ -303,7 +287,7 @@ InputPort<MidiMessage>::process(SampleCount nframes, FrameTime start, FrameTime
// m_tied_port->buffer(0)->join(m_buffers.at(0));
do_mixdown = false;
}
- update_buffers();
+ connect_buffers();
} else {
do_mixdown = false;
}
@@ -349,5 +333,20 @@ InputPort<MidiMessage>::process(SampleCount nframes, FrameTime start, FrameTime
}
+template <typename T>
+void
+InputPort<T>::set_buffer_size(size_t size)
+{
+ TypedPort<T>::set_buffer_size(size);
+ assert(_buffer_size = size);
+
+ for (typename List<TypedConnection<T>*>::iterator c = m_connections.begin(); c != m_connections.end(); ++c)
+ (*c)->set_buffer_size(size);
+
+}
+template void InputPort<Sample>::set_buffer_size(size_t size);
+template void InputPort<MidiMessage>::set_buffer_size(size_t size);
+
+
} // namespace Ingen