mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
implement stub UnknownProcessor
This commit is contained in:
parent
3dd3c35dfe
commit
f7a670bc79
2 changed files with 50 additions and 8 deletions
|
|
@ -43,20 +43,18 @@ class LIBARDOUR_API UnknownProcessor : public Processor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnknownProcessor (Session &, XMLNode const &);
|
UnknownProcessor (Session &, XMLNode const &);
|
||||||
|
virtual ~UnknownProcessor ();
|
||||||
|
|
||||||
/* These processors are hidden from view */
|
bool can_support_io_configuration (const ChanCount &, ChanCount &);
|
||||||
bool display_to_user () const {
|
void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool can_support_io_configuration (const ChanCount &, ChanCount &) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLNode & state (bool);
|
XMLNode & state (bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XMLNode _state;
|
XMLNode _state;
|
||||||
|
bool have_ioconfig;
|
||||||
|
ChanCount *saved_input;
|
||||||
|
ChanCount *saved_output;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ardour/audio_buffer.h"
|
||||||
#include "ardour/unknown_processor.h"
|
#include "ardour/unknown_processor.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
@ -27,11 +28,34 @@ using namespace ARDOUR;
|
||||||
UnknownProcessor::UnknownProcessor (Session& s, XMLNode const & state)
|
UnknownProcessor::UnknownProcessor (Session& s, XMLNode const & state)
|
||||||
: Processor (s, "")
|
: Processor (s, "")
|
||||||
, _state (state)
|
, _state (state)
|
||||||
|
, have_ioconfig (false)
|
||||||
|
, saved_input (0)
|
||||||
|
, saved_output (0)
|
||||||
{
|
{
|
||||||
XMLProperty const * prop = state.property (X_("name"));
|
XMLProperty const * prop = state.property (X_("name"));
|
||||||
if (prop) {
|
if (prop) {
|
||||||
set_name (prop->value ());
|
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 &
|
XMLNode &
|
||||||
|
|
@ -40,3 +64,23 @@ UnknownProcessor::state (bool)
|
||||||
return *(new XMLNode (_state));
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue