AddRouteDialog: Indicate Type: template

This commit is contained in:
Robin Gareus 2017-08-21 16:10:20 +02:00
parent 1c4eb82365
commit f0387f07bd
2 changed files with 34 additions and 22 deletions

View file

@ -66,7 +66,6 @@ AddRouteDialog::AddRouteDialog ()
, configuration_label (_("Configuration:")) , configuration_label (_("Configuration:"))
, manual_label (_("Configuration:")) , manual_label (_("Configuration:"))
, add_label (_("Add:")) , add_label (_("Add:"))
, type_label (_("Type:"))
, name_label (_("Name:")) , name_label (_("Name:"))
, group_label (_("Group:")) , group_label (_("Group:"))
, insert_label (_("Insert At:")) , insert_label (_("Insert At:"))
@ -95,6 +94,10 @@ AddRouteDialog::AddRouteDialog ()
track_bus_combo.append_text (_("VCA Masters")); track_bus_combo.append_text (_("VCA Masters"));
track_bus_combo.set_active (0); track_bus_combo.set_active (0);
template_type_placeholder.append_text (_("Template"));
template_type_placeholder.set_active (0);
template_type_placeholder.set_sensitive (false);
insert_at_combo.append_text (_("First")); insert_at_combo.append_text (_("First"));
insert_at_combo.append_text (_("Before Selection")); insert_at_combo.append_text (_("Before Selection"));
insert_at_combo.append_text (_("After Selection")); insert_at_combo.append_text (_("After Selection"));
@ -159,10 +162,10 @@ AddRouteDialog::AddRouteDialog ()
/* track/bus choice */ /* track/bus choice */
Table *add_table = manage (new Table (8, 5, false)); Table *add_table = manage (new Table (8, 6, false));
add_table->set_row_spacings (8); add_table->set_row_spacings (8);
add_table->set_col_spacings (4); add_table->set_col_spacings (4);
add_table->set_col_spacing (2, 20); add_table->set_col_spacing (3, 20);
add_table->set_border_width (0); add_table->set_border_width (0);
int n = 0; int n = 0;
@ -175,33 +178,37 @@ AddRouteDialog::AddRouteDialog ()
add_table->attach (*align, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (*align, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
// Type // Type
type_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); VBox* tvbox = manage (new VBox);
add_table->attach (type_label, 3, 4, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); tvbox->pack_start (track_bus_combo, true, true);
add_table->attach (track_bus_combo, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); tvbox->pack_start (template_type_placeholder, true, true);
track_bus_combo.set_no_show_all(true);
template_type_placeholder.set_no_show_all(true);
track_bus_combo.show ();
add_table->attach (*tvbox, 2, 3, n, n + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0);
++n; ++n;
// Name // Name
name_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); name_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (name_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (name_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (name_template_entry, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (name_template_entry, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
// Route configuration // Route configuration
configuration_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); configuration_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (configuration_label, 3, 4, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (configuration_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (channel_combo, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (channel_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
++n; ++n;
// instrument choice (for MIDI) // instrument choice (for MIDI)
instrument_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); instrument_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (instrument_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (instrument_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (instrument_combo, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (instrument_combo, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
// Group choice // Group choice
group_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); group_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (group_label, 3, 4, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (group_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (route_group_combo, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (route_group_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
++n; ++n;
@ -211,33 +218,33 @@ AddRouteDialog::AddRouteDialog ()
} else { } else {
strict_io_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); strict_io_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (strict_io_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (strict_io_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (strict_io_combo, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (strict_io_combo, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
ArdourWidgets::set_tooltip (strict_io_combo, ArdourWidgets::set_tooltip (strict_io_combo,
_("With strict-i/o enabled, Effect Processors will not modify the number of channels on a track. The number of output channels will always match the number of input channels.")); _("With strict-i/o enabled, Effect Processors will not modify the number of channels on a track. The number of output channels will always match the number of input channels."));
// recording mode // recording mode
mode_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); mode_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (mode_label, 3, 4, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (mode_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (mode_combo, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (mode_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
++n; ++n;
} }
add_table->attach (*(manage (new Gtk::HSeparator)), 0, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (*(manage (new Gtk::HSeparator)), 0, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
++n; ++n;
// New route will be inserted at.. // New route will be inserted at..
insert_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); insert_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
add_table->attach (insert_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (insert_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
add_table->attach (insert_at_combo, 1, 2, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (insert_at_combo, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
Gtk::Button* addnoclose_button = manage (new Gtk::Button(_("Add selected items (and leave dialog open)"))); Gtk::Button* addnoclose_button = manage (new Gtk::Button(_("Add selected items (and leave dialog open)")));
addnoclose_button->set_can_default (); addnoclose_button->set_can_default ();
addnoclose_button->signal_clicked ().connect (sigc::bind (sigc::mem_fun (*this, &Gtk::Dialog::response), Add)); addnoclose_button->signal_clicked ().connect (sigc::bind (sigc::mem_fun (*this, &Gtk::Dialog::response), Add));
add_table->attach (*addnoclose_button, 3, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); add_table->attach (*addnoclose_button, 4, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0);
vbox->pack_start (*add_table, false, true); vbox->pack_start (*add_table, false, true);
@ -300,7 +307,6 @@ AddRouteDialog::trk_template_row_selected ()
trk_template_desc.set_sensitive (true); trk_template_desc.set_sensitive (true);
type_label.set_sensitive (false);
track_bus_combo.set_sensitive (false); track_bus_combo.set_sensitive (false);
add_label.set_sensitive (rs.find ("how_many") != rs.end ()); add_label.set_sensitive (rs.find ("how_many") != rs.end ());
@ -328,6 +334,8 @@ AddRouteDialog::trk_template_row_selected ()
|| rs.find ("strict_io") != rs.end(); || rs.find ("strict_io") != rs.end();
manual_label.set_sensitive (any_enabled); manual_label.set_sensitive (any_enabled);
track_bus_combo.hide ();
template_type_placeholder.show ();
std::map<string,string>::const_iterator it; std::map<string,string>::const_iterator it;
@ -378,9 +386,11 @@ AddRouteDialog::trk_template_row_selected ()
/* user-template */ /* user-template */
trk_template_desc.set_sensitive (true); trk_template_desc.set_sensitive (true);
track_bus_combo.hide ();
template_type_placeholder.show ();
manual_label.set_sensitive (true); manual_label.set_sensitive (true);
add_label.set_sensitive (true); add_label.set_sensitive (true);
type_label.set_sensitive (false);
name_label.set_sensitive (true); name_label.set_sensitive (true);
group_label.set_sensitive (false); group_label.set_sensitive (false);
strict_io_label.set_sensitive (false); strict_io_label.set_sensitive (false);
@ -399,11 +409,13 @@ AddRouteDialog::trk_template_row_selected ()
} else { } else {
/* all manual mode */ /* all manual mode */
template_type_placeholder.hide ();
track_bus_combo.show ();
trk_template_desc.set_sensitive (false); trk_template_desc.set_sensitive (false);
manual_label.set_sensitive (true); manual_label.set_sensitive (true);
add_label.set_sensitive (true); add_label.set_sensitive (true);
type_label.set_sensitive (true);
name_label.set_sensitive (true); name_label.set_sensitive (true);
group_label.set_sensitive (true); group_label.set_sensitive (true);
strict_io_label.set_sensitive (true); strict_io_label.set_sensitive (true);

View file

@ -95,13 +95,13 @@ private:
Gtk::Label configuration_label; Gtk::Label configuration_label;
Gtk::Label manual_label; Gtk::Label manual_label;
Gtk::Label add_label; Gtk::Label add_label;
Gtk::Label type_label;
Gtk::Label name_label; Gtk::Label name_label;
Gtk::Label group_label; Gtk::Label group_label;
Gtk::Label insert_label; Gtk::Label insert_label;
Gtk::Label strict_io_label; Gtk::Label strict_io_label;
Gtk::Label mode_label; Gtk::Label mode_label;
Gtk::Label instrument_label; Gtk::Label instrument_label;
Gtk::ComboBoxText template_type_placeholder;
Gtk::ComboBoxText mode_combo; Gtk::ComboBoxText mode_combo;
Gtk::ComboBoxText route_group_combo; Gtk::ComboBoxText route_group_combo;
InstrumentSelector instrument_combo; InstrumentSelector instrument_combo;