summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-15 20:19:30 +0200
committerRobin Gareus <robin@gareus.org>2015-08-15 23:28:50 +0200
commitf7a670bc79ef004ec4c9169d94fbfd57f4aa9e01 (patch)
treeab6e5ffb76eb5cc0cef5d96366c725fbaad85d55
parent3dd3c35dfed2676304801733f7484d865bac60ab (diff)
implement stub UnknownProcessor
-rw-r--r--libs/ardour/ardour/unknown_processor.h14
-rw-r--r--libs/ardour/unknown_processor.cc44
2 files changed, 50 insertions, 8 deletions
diff --git a/libs/ardour/ardour/unknown_processor.h b/libs/ardour/ardour/unknown_processor.h
index 50234e8294..b9743c9599 100644
--- a/libs/ardour/ardour/unknown_processor.h
+++ b/libs/ardour/ardour/unknown_processor.h
@@ -43,20 +43,18 @@ class LIBARDOUR_API UnknownProcessor : public Processor
{
public:
UnknownProcessor (Session &, XMLNode const &);
+ virtual ~UnknownProcessor ();
- /* These processors are hidden from view */
- bool display_to_user () const {
- return false;
- }
-
- bool can_support_io_configuration (const ChanCount &, ChanCount &) {
- return false;
- }
+ bool can_support_io_configuration (const ChanCount &, ChanCount &);
+ void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/);
XMLNode & state (bool);
private:
XMLNode _state;
+ bool have_ioconfig;
+ ChanCount *saved_input;
+ ChanCount *saved_output;
};
}
diff --git a/libs/ardour/unknown_processor.cc b/libs/ardour/unknown_processor.cc
index f6c713404f..4bf4ebeaef 100644
--- a/libs/ardour/unknown_processor.cc
+++ b/libs/ardour/unknown_processor.cc
@@ -17,6 +17,7 @@
*/
+#include "ardour/audio_buffer.h"
#include "ardour/unknown_processor.h"
#include "i18n.h"
@@ -27,11 +28,34 @@ using namespace ARDOUR;
UnknownProcessor::UnknownProcessor (Session& s, XMLNode const & state)
: Processor (s, "")
, _state (state)
+ , have_ioconfig (false)
+ , saved_input (0)
+ , saved_output (0)
{
XMLProperty const * prop = state.property (X_("name"));
if (prop) {
set_name (prop->value ());
+ _display_to_user = true;
}
+
+ int have_io = 0;
+ XMLNodeList kids = state.children ();
+ for (XMLNodeIterator i = kids.begin(); i != kids.end(); ++i) {
+ if ((*i)->name() == X_("ConfiguredInput")) {
+ have_io |= 1;
+ saved_input = new ChanCount(**i);
+ }
+ if ((*i)->name() == X_("ConfiguredOutput")) {
+ have_io |= 2;
+ saved_output = new ChanCount(**i);
+ }
+ }
+ have_ioconfig = (have_io == 3);
+}
+
+UnknownProcessor::~UnknownProcessor () {
+ delete saved_input;;
+ delete saved_output;
}
XMLNode &
@@ -40,3 +64,23 @@ UnknownProcessor::state (bool)
return *(new XMLNode (_state));
}
+bool
+UnknownProcessor::can_support_io_configuration (const ChanCount &in, ChanCount & out) {
+ if (have_ioconfig && in == *saved_input) {
+ out = *saved_output;
+ return true;
+ }
+ return false;
+}
+
+void
+UnknownProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
+{
+ if (!have_ioconfig) {
+ return;
+ }
+ // silence excess output buffers
+ for (uint32_t i = saved_input->n_audio(); i < saved_output->n_audio(); ++i) {
+ bufs.get_audio (i).silence (nframes);
+ }
+}