Add API to query if an instrument was fanned out

Since fan-out happens (interactively) in the GUI thread,
we need to keep track of this, in order to prevent later
auto-connection of the track to the master-bus.
This commit is contained in:
Robin Gareus 2020-07-18 22:59:43 +02:00
parent e4232197fe
commit a7a938275f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 7 additions and 0 deletions

View File

@ -511,6 +511,7 @@ public:
*/
boost::shared_ptr<Processor> the_instrument() const;
InstrumentInfo& instrument_info() { return _instrument_info; }
bool instrument_fanned_out () const { return _instrument_fanned_out;}
/* "well-known" controls.
@ -661,6 +662,7 @@ protected:
FedBy _fed_by;
InstrumentInfo _instrument_info;
bool _instrument_fanned_out;
Location* _loop_location;
virtual ChanCount input_streams () const;

View File

@ -123,6 +123,7 @@ Route::Route (Session& sess, string name, PresentationInfo::Flag flag, DataType
, _recordable (true)
, _have_internal_generator (false)
, _default_type (default_type)
, _instrument_fanned_out (false)
, _loop_location (NULL)
, _track_number (0)
, _strict_io (false)
@ -1158,6 +1159,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
&& boost::dynamic_pointer_cast<PluginInsert> (the_instrument ()) == fanout) {
/* This adds new tracks or busses, and changes connections.
* This cannot be done here, and needs to be delegated to the GUI thread. */
_instrument_fanned_out = true;
FanOut (boost::dynamic_pointer_cast<ARDOUR::Route>(shared_from_this())); /* EMIT SIGNAL */
}
return 0;
@ -1698,6 +1700,9 @@ void
Route::reset_instrument_info ()
{
boost::shared_ptr<Processor> instr = the_instrument();
if (!instr) {
_instrument_fanned_out = false;
}
_instrument_info.set_internal_instrument (instr);
}