actually add and position a beatbox processor to midi tracks

This commit is contained in:
Paul Davis 2018-08-13 08:57:22 -04:00
parent aca1db2d06
commit b2e3df9fda
2 changed files with 22 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include "evoral/midi_util.h"
#include "ardour/amp.h"
#include "ardour/beatbox.h"
#include "ardour/beats_samples_converter.h"
#include "ardour/buffer_set.h"
#include "ardour/debug.h"
@ -110,6 +111,9 @@ MidiTrack::init ()
_disk_writer->DataRecorded.connect_same_thread (*this, boost::bind (&MidiTrack::data_recorded, this, _1));
_beatbox.reset (new BeatBox (_session));
add_processor (_beatbox, PostFader);
return 0;
}

View File

@ -52,6 +52,7 @@
#include "ardour/audio_track.h"
#include "ardour/audio_port.h"
#include "ardour/audioengine.h"
#include "ardour/beatbox.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer.h"
#include "ardour/buffer_set.h"
@ -3075,6 +3076,9 @@ Route::set_processor_state (const XMLNode& node, int version)
assert (is_master ());
_volume->set_state (**niter, version);
new_order.push_back (_volume);
} else if (prop->value() == "beatbox" && _beatbox) {
_beatbox->set_state (**niter, Stateful::current_state_version);
new_order.push_back (_beatbox);
} else if (prop->value() == "meter") {
_meter->set_state (**niter, version);
new_order.push_back (_meter);
@ -5002,6 +5006,12 @@ Route::setup_invisible_processors ()
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<Send> auxsnd = boost::dynamic_pointer_cast<Send> ((*i));
/* XXX temporary hack while we decide on visibility */
if (boost::dynamic_pointer_cast<BeatBox> (*i)) {
continue;
}
if ((*i)->display_to_user ()) {
new_processors.push_back (*i);
}
@ -5111,6 +5121,14 @@ Route::setup_invisible_processors ()
trim = new_processors.begin();
}
/* BEATBOX (for MIDI) */
if (_beatbox) {
ProcessorList::iterator insert_pos = trim;
++insert_pos;
new_processors.insert (insert_pos, _beatbox);
}
/* INTERNAL RETURN */
/* doing this here means that any monitor control will come after