Unconditionally create Triggerbox for each Track

This addresses and issue when loading old sessions or creating
tracks from [old] templates.
This commit is contained in:
Robin Gareus 2022-01-14 22:36:13 +01:00
parent 0c4769cb3f
commit 76facc0b13
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 17 additions and 17 deletions

View File

@ -738,7 +738,7 @@ public:
PresentationInfo::order_t order,
TrackMode mode = Normal,
bool input_auto_connect = true,
bool with_triggers = true
bool with_triggers = false
);
std::list<boost::shared_ptr<MidiTrack> > new_midi_track (
@ -749,7 +749,7 @@ public:
PresentationInfo::order_t,
TrackMode mode,
bool input_auto_connect,
bool with_triggers = true
bool with_triggers = false
);
RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many, std::string name_template, PresentationInfo::Flag, PresentationInfo::order_t);

View File

@ -2468,11 +2468,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, bool s
route_group->add (track);
}
if (with_triggers) {
boost::shared_ptr<Processor> triggers (new TriggerBox (*this, DataType::MIDI));
track->add_processor (triggers, track->polarity());
track->presentation_info ().set_trigger_track (true);
}
track->presentation_info ().set_trigger_track (with_triggers);
new_routes.push_back (track);
ret.push_back (track);
@ -2735,16 +2731,7 @@ Session::new_audio_track (int input_channels, int output_channels, RouteGroup* r
route_group->add (track);
}
if (with_triggers) {
boost::shared_ptr<TriggerBox> tb (new TriggerBox (*this, DataType::AUDIO));
track->add_processor (tb, track->polarity());
/* if placing this in a route where the default
* data type is AUDIO, the triggerbox will need
* a sidehcain MIDI input to be able to be MIDI controlled
*/
tb->add_midi_sidechain ();
track->presentation_info ().set_trigger_track (true);
}
track->presentation_info ().set_trigger_track (with_triggers);
new_routes.push_back (track);
ret.push_back (track);

View File

@ -39,6 +39,7 @@
#include "ardour/monitor_control.h"
#include "ardour/playlist.h"
#include "ardour/playlist_factory.h"
#include "ardour/polarity_processor.h"
#include "ardour/port.h"
#include "ardour/processor.h"
#include "ardour/profile.h"
@ -50,6 +51,7 @@
#include "ardour/session_playlists.h"
#include "ardour/smf_source.h"
#include "ardour/track.h"
#include "ardour/triggerbox.h"
#include "ardour/types_convert.h"
#include "ardour/utils.h"
@ -99,6 +101,17 @@ Track::init ()
_disk_writer->set_block_size (_session.get_block_size ());
_disk_writer->set_owner (this);
boost::shared_ptr<TriggerBox> tb (new TriggerBox (_session, data_type ()));
tb->set_owner (this);
add_processor (tb, _polarity);
if (data_type () == DataType::AUDIO) {
/* if placing this in a route where the default
* data type is AUDIO, the triggerbox will need
* a sidehcain MIDI input to be able to be MIDI controlled
*/
tb->add_midi_sidechain ();
}
set_align_choice_from_io ();
boost::shared_ptr<Route> rp (boost::dynamic_pointer_cast<Route> (shared_from_this()));