23 #include <sigc++/bind.h>
24 #include <gtkmm/stock.h>
25 #include <gtkmm/messagedialog.h>
26 #include <gtkmm/separator.h>
27 #include <gtkmm/table.h>
55 , routes_adjustment (1, 1, 128, 1, 4)
56 , routes_spinner (routes_adjustment)
57 , configuration_label (
_(
"Configuration:"))
58 , mode_label (
_(
"Record Mode:"))
59 , instrument_label (
_(
"Instrument:"))
61 set_name (
"AddRouteDialog");
63 set_skip_taskbar_hint (
true);
64 set_resizable (
false);
90 VBox* vbox = manage (
new VBox);
93 get_vbox()->set_spacing (4);
95 vbox->set_spacing (18);
96 vbox->set_border_width (5);
98 HBox *type_hbox = manage (
new HBox);
99 type_hbox->set_spacing (6);
103 type_hbox->pack_start (*manage (
new Label (
_(
"Add:"))));
107 vbox->pack_start (*type_hbox,
false,
true);
109 VBox* options_box = manage (
new VBox);
110 Table *table2 = manage (
new Table (3, 3,
false));
112 options_box->set_spacing (6);
113 table2->set_row_spacings (6);
114 table2->set_col_spacing (1, 6);
116 l = manage (
new Label (
_(
"<b>Options</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER,
false));
117 l->set_use_markup ();
118 options_box->pack_start (*l,
false,
true);
120 l = manage (
new Label (
"", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER,
false));
121 l->set_padding (8, 0);
122 table2->attach (*l, 0, 1, 0, 3, Gtk::FILL, Gtk::FILL, 0, 0);
126 l = manage (
new Label (
_(
"Name:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER,
false));
127 table2->attach (*l, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
128 table2->attach (
name_template_entry, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
135 table2->attach (
channel_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
142 mode_label.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
143 table2->attach (
mode_label, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
144 table2->attach (
mode_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
150 table2->attach (
instrument_label, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
151 table2->attach (
instrument_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
156 l = manage (
new Label (
_(
"Group:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER,
false));
157 table2->attach (*l, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
158 table2->attach (
route_group_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
162 l = manage (
new Label (
_(
"Insert:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER,
false));
163 table2->attach (*l, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
164 table2->attach (
insert_at_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
167 options_box->pack_start (*table2,
false,
true);
168 vbox->pack_start (*options_box,
false,
true);
170 get_vbox()->pack_start (*vbox,
false,
false);
178 show_all_children ();
184 add_button (Stock::CANCEL, RESPONSE_CANCEL);
185 add_button (Stock::ADD, RESPONSE_ACCEPT);
186 set_response_sensitive (RESPONSE_ACCEPT,
true);
187 set_default_response (RESPONSE_ACCEPT);
207 if (str ==
_(
"Busses")) {
209 }
else if (str ==
_(
"MIDI Tracks")){
211 }
else if (str ==
_(
"Audio+MIDI Tracks")) {
268 MessageDialog msg (
_(
"Audio+MIDI tracks are intended for use <b>ONLY</b> with plugins that use both audio and MIDI input data\n\n"
269 "If you do not plan to use such a plugin, then use a normal audio or MIDI track instead."),
270 true, MESSAGE_INFO, BUTTONS_OK,
true);
271 msg.set_position (WIN_POS_MOUSE);
306 if (n ==
_(
"Audio") ||
308 n ==
_(
"Audio+MIDI") ||
327 s.push_back (
_(
"Normal"));
330 s.push_back (
_(
"Non Layered"));
331 s.push_back (
_(
"Tape"));
345 std::string str =
mode_combo.get_active_text();
346 if (str ==
_(
"Normal")) {
348 }
else if (str ==
_(
"Non Layered")){
350 }
else if (str ==
_(
"Tape")) {
353 fatal <<
string_compose (
X_(
"programming error: unknown track mode in add route dialog combo = %1"), str)
371 if (str == (*i).name) {
372 ret.
set (DataType::AUDIO, (*i).channels);
376 ret.
set (DataType::MIDI, 0);
380 ret.
set (DataType::AUDIO, 0);
381 ret.
set (DataType::MIDI, 1);
387 if (str == (*i).name) {
388 ret.
set (DataType::AUDIO, (*i).channels);
392 ret.
set (DataType::MIDI, 1);
405 if (str == (*i).name) {
406 return (*i).template_path;
431 chn.
name =
_(
"Mono");
435 chn.
name =
_(
"Stereo");
439 chn.
name =
"separator";
459 chn.
name =
_(
"3 Channel");
463 chn.
name =
_(
"4 Channel");
467 chn.
name =
_(
"5 Channel");
471 chn.
name =
_(
"6 Channel");
475 chn.
name =
_(
"8 Channel");
479 chn.
name =
_(
"12 Channel");
483 chn.
name =
_(
"Custom");
559 if (str ==
_(
"First")) {
561 }
else if (str ==
_(
"After Selection")) {
563 }
else if (str ==
_(
"Before Selection")){
bool channel_separator(const Glib::RefPtr< Gtk::TreeModel > &m, const Gtk::TreeModel::iterator &i)
LIBPBD_API Transmitter fatal
ARDOUR::ChanCount channels()
InstrumentSelector instrument_combo
void add_route_group(RouteGroup *)
RouteGroup * route_group_by_name(std::string)
std::vector< ARDOUR::TemplateInfo > route_templates
void channel_combo_changed()
std::ostream & endmsg(std::ostream &ostr)
LIBGTKMM2EXT_API void set_popdown_strings(Gtk::ComboBoxText &, const std::vector< std::string > &)
Gtk::ComboBoxText channel_combo
TypeWanted type_wanted() const
Gtk::Label configuration_label
virtual bool apply_changes(PropertyBase const &)
void foreach_route_group(boost::function< void(RouteGroup *)> f)
Gtk::ComboBoxText route_group_combo
Gtk::ComboBoxText mode_combo
LIBARDOUR_API void find_route_templates(std::vector< TemplateInfo > &template_names)
Gtk::Entry name_template_entry
bool name_template_is_default() const
Gtk::SpinButton routes_spinner
void refill_route_groups()
void maybe_update_name_template_entry()
void add_route_group(ARDOUR::RouteGroup *)
Gtk::Adjustment routes_adjustment
ARDOUR::PluginInfoPtr selected_instrument()
std::string template_path
LIBARDOUR_API PBD::PropertyDescriptor< bool > active
LIBARDOUR_API RuntimeProfile * Profile
static std::vector< std::string > channel_combo_strings
void refill_track_modes()
std::string track_template()
ChannelSetups channel_setups
ARDOUR::RouteGroup * route_group()
void set(DataType t, uint32_t count)
Gtk::Label instrument_label
Gtk::ComboBoxText track_bus_combo
bool route_separator(const Glib::RefPtr< Gtk::TreeModel > &m, const Gtk::TreeModel::iterator &i)
void refill_channel_setups()
std::string name_template() const
ARDOUR::PluginInfoPtr requested_instrument()
Gtk::ComboBoxText insert_at_combo
bool add(PropertyBase *prop)
ARDOUR::Session * _session
std::string string_compose(const std::string &fmt, const T1 &o1)