trigger_ui: (de)sensitize more stretch and follow options
This commit is contained in:
parent
945849cfb5
commit
e6bb88178c
|
@ -74,34 +74,34 @@ AudioTriggerPropertiesBox::AudioTriggerPropertiesBox ()
|
|||
bpm_table->attach (_stretch_toggle, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (_stretch_selector, 1, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK); row++;
|
||||
|
||||
label = manage (new Gtk::Label (_("BPM:")));
|
||||
label->set_alignment (1.0, 0.5);
|
||||
bpm_table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
_bpm_label.set_text(_("BPM:"));
|
||||
_bpm_label.set_alignment (1.0, 0.5);
|
||||
bpm_table->attach (_bpm_label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (_abpm_label, 1, 2, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
|
||||
ArdourButton *half = manage (new ArdourButton (_("/2")));
|
||||
half->signal_clicked.connect(sigc::bind (sigc::mem_fun(*this, &AudioTriggerPropertiesBox::MultiplyTempo), 0.5));
|
||||
bpm_table->attach (*half, 2, 3, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||
ArdourButton *dbl = manage (new ArdourButton (_("x2")));
|
||||
dbl->signal_clicked.connect(sigc::bind (sigc::mem_fun(*this, &AudioTriggerPropertiesBox::MultiplyTempo), 2.0));
|
||||
bpm_table->attach (*dbl, 3, 4, row, row + 1, Gtk::SHRINK, Gtk::SHRINK);
|
||||
_half_button.set_text(_("/2"));
|
||||
_half_button.signal_clicked.connect(sigc::bind (sigc::mem_fun(*this, &AudioTriggerPropertiesBox::MultiplyTempo), 0.5));
|
||||
bpm_table->attach (_half_button, 2, 3, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
_dbl_button.set_text(_("x2"));
|
||||
_dbl_button.signal_clicked.connect(sigc::bind (sigc::mem_fun(*this, &AudioTriggerPropertiesBox::MultiplyTempo), 2.0));
|
||||
bpm_table->attach (_dbl_button, 3, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
|
||||
row++;
|
||||
|
||||
label = manage (new Gtk::Label (_("Meter:")));
|
||||
label->set_alignment (1.0, 0.5);
|
||||
bpm_table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
_meter_label.set_text(_("Meter:"));
|
||||
_meter_label.set_alignment (1.0, 0.5);
|
||||
bpm_table->attach (_meter_label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (_meter_selector, 1, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
|
||||
row++;
|
||||
|
||||
label = manage (new Gtk::Label (_("Clip Length:")));
|
||||
label->set_alignment (1.0, 0.5);
|
||||
Gtk::Label *bar_label = manage (new Gtk::Label (_("(bars)")));
|
||||
bar_label->set_alignment (0.0, 0.5);
|
||||
bpm_table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
_length_label.set_text(_("Clip Length:"));
|
||||
_length_label.set_alignment (1.0, 0.5);
|
||||
_bar_label.set_text(_("(bars)"));
|
||||
_bar_label.set_alignment (0.0, 0.5);
|
||||
bpm_table->attach (_length_label,0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (_bar_spinner, 1, 2, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (*bar_label, 2, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
bpm_table->attach (_bar_label, 2, 4, row, row + 1, Gtk::FILL, Gtk::SHRINK);
|
||||
|
||||
ArdourWidgets::Frame* eTempoBox = manage (new ArdourWidgets::Frame);
|
||||
eTempoBox->set_label("Stretch Options");
|
||||
|
@ -237,9 +237,34 @@ AudioTriggerPropertiesBox::on_trigger_changed (const PBD::PropertyChange& pc)
|
|||
|
||||
if (pc.contains (Properties::stretch_mode) || pc.contains (Properties::stretchable)) {
|
||||
_stretch_toggle.set_active (at->stretchable () ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
|
||||
|
||||
_stretch_selector.set_sensitive(at->stretchable ());
|
||||
_stretch_selector.set_text(stretch_mode_to_string(at->stretch_mode ()));
|
||||
|
||||
/* set widget sensitivity based on stretchable button state */
|
||||
bool follow_widgets_sensitive = at->stretchable ();
|
||||
|
||||
if (follow_widgets_sensitive) {
|
||||
_stretch_selector.set_sensitive(true);
|
||||
_meter_selector.set_sensitive(true);
|
||||
_bar_spinner.set_sensitive(true);
|
||||
_bar_label.set_sensitive(true);
|
||||
_length_label.set_sensitive(true);
|
||||
_meter_label.set_sensitive(true);
|
||||
_bpm_label.set_sensitive(true);
|
||||
_half_button.set_sensitive(true);
|
||||
_dbl_button.set_sensitive(true);
|
||||
_abpm_label.set_sensitive(true);
|
||||
} else {
|
||||
_stretch_selector.set_sensitive(false);
|
||||
_meter_selector.set_sensitive(false);
|
||||
_bar_spinner.set_sensitive(false);
|
||||
_bar_label.set_sensitive(false);
|
||||
_length_label.set_sensitive(false);
|
||||
_meter_label.set_sensitive(false);
|
||||
_bpm_label.set_sensitive(false);
|
||||
_half_button.set_sensitive(false);
|
||||
_dbl_button.set_sensitive(false);
|
||||
_abpm_label.set_sensitive(false);
|
||||
}
|
||||
}
|
||||
|
||||
_ignore_changes = false;
|
||||
|
|
|
@ -76,6 +76,11 @@ private:
|
|||
AudioClock _length_clock;
|
||||
AudioClock _start_clock;
|
||||
|
||||
Gtk::Label _bpm_label;
|
||||
Gtk::Label _length_label;
|
||||
Gtk::Label _bar_label;
|
||||
Gtk::Label _meter_label;
|
||||
|
||||
ArdourWidgets::ArdourDropdown _meter_selector;
|
||||
|
||||
Gtk::Adjustment _bar_adjustment;
|
||||
|
@ -87,6 +92,9 @@ private:
|
|||
|
||||
ArdourWidgets::ArdourButton _abpm_label;
|
||||
|
||||
ArdourWidgets::ArdourButton _half_button;
|
||||
ArdourWidgets::ArdourButton _dbl_button;
|
||||
|
||||
bool _ignore_changes;
|
||||
};
|
||||
|
||||
|
|
|
@ -238,7 +238,6 @@ SlotPropertyTable::SlotPropertyTable ()
|
|||
set_homogeneous (false);
|
||||
|
||||
int row=0;
|
||||
Gtk::Label *label;
|
||||
|
||||
/* ---- Basic trigger properties (name, color) ----- */
|
||||
_trigger_table.set_spacings (4);
|
||||
|
@ -259,20 +258,20 @@ SlotPropertyTable::SlotPropertyTable ()
|
|||
_launch_table.set_homogeneous (false);
|
||||
row=0;
|
||||
|
||||
label = manage(new Gtk::Label(_("Velocity Sense:"))); label->set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_vel_sense_label.set_text(_("Velocity Sense:")); _vel_sense_label.set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(_vel_sense_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_table.attach(_velocity_slider, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
|
||||
label = manage(new Gtk::Label(_("Launch Style:"))); label->set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_style_label.set_text(_("Launch Style:")); _launch_style_label.set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(_launch_style_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_table.attach(_launch_style_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
|
||||
label = manage(new Gtk::Label(_("Launch Quantize:"))); label->set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_table.attach(_quantize_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
_launch_quant_label.set_text(_("Launch Quantize:")); _launch_quant_label.set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(_launch_quant_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_table.attach(_quantize_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
|
||||
label = manage(new Gtk::Label(_("Legato Mode:"))); label->set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(*label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_legato_label.set_text(_("Launch Quantize:")); _legato_label.set_alignment(1.0, 0.5);
|
||||
_launch_table.attach(_legato_label, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_launch_table.attach(_legato_button, 1, 3, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
|
||||
|
||||
|
@ -299,21 +298,20 @@ SlotPropertyTable::SlotPropertyTable ()
|
|||
fol_table->set_spacings(2);
|
||||
fol_table->set_border_width(4);
|
||||
|
||||
label = manage(new Gtk::Label(_("Follow Count:"))); label->set_alignment(1.0, 0.5);
|
||||
fol_table->attach(*label, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_follow_count_label.set_text(_("Follow Count:")); _follow_count_label.set_alignment(1.0, 0.5);
|
||||
fol_table->attach(_follow_count_label, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
Gtk::Alignment *align = manage (new Gtk::Alignment (0, .5, 0, 0));
|
||||
align->add (_follow_count_spinner);
|
||||
fol_table->attach(*align, 2, 3, row, row+1, Gtk::FILL, Gtk::SHRINK, 0, 0 ); row++;
|
||||
fol_table->attach(*align, 2, 3, row, row+1, Gtk::FILL, Gtk::SHRINK, 0, 0 ); row++;
|
||||
|
||||
label = manage(new Gtk::Label(_("Follow Length:"))); label->set_alignment(1.0, 0.5);
|
||||
Gtk::Label *beat_label = manage (new Gtk::Label (_("(beats)")));
|
||||
beat_label->set_alignment (0.0, 0.5);
|
||||
_follow_length_label.set_text(_("Follow Length:")); _follow_length_label.set_alignment(1.0, 0.5);
|
||||
_beat_label.set_text(_("(beats)")); _beat_label.set_alignment (0.0, 0.5);
|
||||
Gtk::Alignment *fl_align = manage (new Gtk::Alignment (0, .5, 0, 0));
|
||||
fl_align->add (_follow_length_spinner);
|
||||
fol_table->attach(_use_follow_length_button, 0, 1, row, row+1, Gtk::SHRINK, Gtk::SHRINK);
|
||||
fol_table->attach(*label, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
fol_table->attach(_follow_length_label, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
fol_table->attach(*fl_align, 2, 3, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
fol_table->attach(*beat_label, 3, 4, row, row+1, Gtk::SHRINK, Gtk::SHRINK);
|
||||
fol_table->attach(_beat_label, 3, 4, row, row+1, Gtk::SHRINK, Gtk::SHRINK);
|
||||
|
||||
_follow_table.attach(_follow_left, 0, 1, row, row+1, Gtk::FILL, Gtk::SHRINK );
|
||||
_follow_table.attach(_follow_right, 1, 2, row, row+1, Gtk::FILL, Gtk::SHRINK ); row++;
|
||||
|
@ -537,7 +535,33 @@ SlotPropertyTable::on_trigger_changed (PropertyChange const& pc)
|
|||
}
|
||||
|
||||
if (pc.contains (Properties::follow_action0)) {
|
||||
_follow_left.set_text (follow_action_to_string (trigger()->follow_action (0)));
|
||||
_follow_left.set_text (follow_action_to_string (trigger()->follow_action (0)));
|
||||
|
||||
/* set widget sensitivity based on 'left' follow action */
|
||||
bool follow_widgets_sensitive = trigger()->follow_action (0) != Trigger::None;
|
||||
if (follow_widgets_sensitive) {
|
||||
_follow_right.set_sensitive(true);
|
||||
_follow_count_spinner.set_sensitive(true);
|
||||
_follow_length_spinner.set_sensitive(true);
|
||||
_use_follow_length_button.set_sensitive(true);
|
||||
_follow_probability_slider.set_sensitive(true);
|
||||
_left_probability_label.set_sensitive(true);
|
||||
_right_probability_label.set_sensitive(true);
|
||||
_beat_label.set_sensitive(true);
|
||||
_follow_count_label.set_sensitive(true);
|
||||
_follow_length_label.set_sensitive(true);
|
||||
} else {
|
||||
_follow_right.set_sensitive(false);
|
||||
_follow_count_spinner.set_sensitive(false);
|
||||
_follow_length_spinner.set_sensitive(false);
|
||||
_use_follow_length_button.set_sensitive(false);
|
||||
_follow_probability_slider.set_sensitive(false);
|
||||
_left_probability_label.set_sensitive(false);
|
||||
_right_probability_label.set_sensitive(false);
|
||||
_beat_label.set_sensitive(false);
|
||||
_follow_count_label.set_sensitive(false);
|
||||
_follow_length_label.set_sensitive(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pc.contains (Properties::follow_action1)) {
|
||||
|
@ -554,22 +578,6 @@ SlotPropertyTable::on_trigger_changed (PropertyChange const& pc)
|
|||
_right_probability_label.set_text (string_compose(_("%1%% Right"), probability));
|
||||
}
|
||||
|
||||
bool follow_widgets_sensitive = trigger()->follow_action (0) != Trigger::None;
|
||||
|
||||
if (follow_widgets_sensitive) {
|
||||
_follow_right.set_sensitive(true);
|
||||
_follow_count_spinner.set_sensitive(true);
|
||||
_follow_length_spinner.set_sensitive(true);
|
||||
_use_follow_length_button.set_sensitive(true);
|
||||
_follow_probability_slider.set_sensitive(true);
|
||||
} else {
|
||||
_follow_right.set_sensitive(false);
|
||||
_follow_count_spinner.set_sensitive(false);
|
||||
_follow_length_spinner.set_sensitive(false);
|
||||
_use_follow_length_button.set_sensitive(false);
|
||||
_follow_probability_slider.set_sensitive(false);
|
||||
}
|
||||
|
||||
_ignore_changes = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,6 +77,10 @@ class SlotPropertyTable : public TriggerUI, public Gtk::Table
|
|||
Gtk::SpinButton _gain_spinner;
|
||||
Gtk::Label _gain_label;
|
||||
|
||||
Gtk::Label _beat_label;
|
||||
Gtk::Label _follow_length_label;
|
||||
Gtk::Label _follow_count_label;
|
||||
|
||||
Gtk::Label _left_probability_label;
|
||||
Gtk::Label _right_probability_label;
|
||||
Gtk::Adjustment _follow_probability_adjustment;
|
||||
|
@ -92,6 +96,11 @@ class SlotPropertyTable : public TriggerUI, public Gtk::Table
|
|||
ArdourWidgets::ArdourDropdown _follow_left;
|
||||
ArdourWidgets::ArdourDropdown _follow_right;
|
||||
|
||||
Gtk::Label _vel_sense_label;
|
||||
Gtk::Label _launch_style_label;
|
||||
Gtk::Label _launch_quant_label;
|
||||
Gtk::Label _legato_label;
|
||||
|
||||
ArdourWidgets::ArdourButton _legato_button;
|
||||
|
||||
ArdourWidgets::ArdourDropdown _quantize_button;
|
||||
|
|
Loading…
Reference in New Issue