mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
triggerbox: respond to changes in default trigger input port
This commit is contained in:
parent
52decdd1b4
commit
55209b5df7
3 changed files with 24 additions and 2 deletions
|
|
@ -832,8 +832,6 @@ public:
|
||||||
bool loop_is_possible () const;
|
bool loop_is_possible () const;
|
||||||
PBD::Signal0<void> PunchLoopConstraintChange;
|
PBD::Signal0<void> PunchLoopConstraintChange;
|
||||||
|
|
||||||
// Temporal::TempoMap& tempo_map() { *Temporal::TempoMap::fetch(); }
|
|
||||||
// const Temporal::TempoMap& tempo_map() const { return *Temporal::TempoMap::fetch(); }
|
|
||||||
void maybe_update_tempo_from_midiclock_tempo (float bpm);
|
void maybe_update_tempo_from_midiclock_tempo (float bpm);
|
||||||
|
|
||||||
unsigned int get_xrun_count () const {return _xrun_count; }
|
unsigned int get_xrun_count () const {return _xrun_count; }
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,9 @@ class LIBARDOUR_API TriggerBox : public Processor
|
||||||
void note_on (int note_number, int velocity);
|
void note_on (int note_number, int velocity);
|
||||||
void note_off (int note_number, int velocity);
|
void note_off (int note_number, int velocity);
|
||||||
|
|
||||||
|
void reconnect_to_default ();
|
||||||
|
void parameter_changed (std::string const &);
|
||||||
|
|
||||||
typedef std::map<uint8_t,Triggers::size_type> MidiTriggerMap;
|
typedef std::map<uint8_t,Triggers::size_type> MidiTriggerMap;
|
||||||
MidiTriggerMap midi_trigger_map;
|
MidiTriggerMap midi_trigger_map;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -944,6 +944,8 @@ TriggerBox::TriggerBox (Session& s, DataType dt)
|
||||||
midi_trigger_map.insert (midi_trigger_map.end(), std::make_pair (uint8_t (36), 7));
|
midi_trigger_map.insert (midi_trigger_map.end(), std::make_pair (uint8_t (36), 7));
|
||||||
|
|
||||||
Temporal::TempoMap::MapChanged.connect_same_thread (tempo_map_connection, boost::bind (&TriggerBox::tempo_map_change, this));
|
Temporal::TempoMap::MapChanged.connect_same_thread (tempo_map_connection, boost::bind (&TriggerBox::tempo_map_change, this));
|
||||||
|
|
||||||
|
Config->ParameterChanged.connect_same_thread (*this, boost::bind (&TriggerBox::parameter_changed, this, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1678,3 +1680,22 @@ TriggerBox::tempo_map_change ()
|
||||||
t->tempo_map_change ();
|
t->tempo_map_change ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerBox::parameter_changed (std::string const & param)
|
||||||
|
{
|
||||||
|
if (param == X_("default-trigger-input-port")) {
|
||||||
|
reconnect_to_default ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerBox::reconnect_to_default ()
|
||||||
|
{
|
||||||
|
if (!_sidechain) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sidechain->input()->nth (0)->disconnect_all ();
|
||||||
|
_sidechain->input()->nth (0)->connect (Config->get_default_trigger_input_port());
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue