2 * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4 * Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
5 * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
6 * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
7 * Copyright (C) 2015 Nick Mainsbridge <mainsbridge@gmail.com>
8 * Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com>
9 * Copyright (C) 2018 Len Ovens <len@ovenwerks.net>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __gtk_ardour_add_route_dialog_h__
27 #define __gtk_ardour_add_route_dialog_h__
31 #include <gtkmm/entry.h>
32 #include <gtkmm/dialog.h>
33 #include <gtkmm/frame.h>
34 #include <gtkmm/radiobutton.h>
35 #include <gtkmm/adjustment.h>
36 #include <gtkmm/spinbutton.h>
37 #include <gtkmm/button.h>
38 #include <gtkmm/combobox.h>
39 #include <gtkmm/comboboxtext.h>
40 #include <gtkmm/textview.h>
41 #include <gtkmm/treemodel.h>
42 #include <gtkmm/treeview.h>
43 #include <gtkmm/treestore.h>
44 #include <gtkmm/liststore.h>
45 #include <gtkmm/scrolledwindow.h>
47 #include "ardour/plugin.h"
48 #include "ardour/types.h"
49 #include "ardour/template_utils.h"
51 #include "ardour_dialog.h"
52 #include "instrument_selector.h"
53 #include "route_dialogs.h"
56 class RouteGroupDialog;
58 class AddRouteDialog : public ArdourDialog
78 TypeWanted type_wanted();
80 ARDOUR::ChanCount channels ();
81 uint32_t channel_count ();
84 std::string name_template () const;
85 bool name_template_is_default () const;
86 ARDOUR::PluginInfoPtr requested_instrument ();
88 ARDOUR::TrackMode mode();
89 ARDOUR::RouteGroup* route_group ();
91 RouteDialogs::InsertAt insert_at();
94 std::string get_template_path();
96 void reset_name_edited () { name_edited_by_user = false; }
99 Gtk::Entry name_template_entry;
100 Gtk::Adjustment routes_adjustment;
101 Gtk::SpinButton routes_spinner;
102 Gtk::ComboBoxText channel_combo;
103 Gtk::Label configuration_label;
104 Gtk::Label manual_label;
105 Gtk::Label add_label;
106 Gtk::Label name_label;
107 Gtk::Label group_label;
108 Gtk::Label insert_label;
109 Gtk::Label strict_io_label;
110 Gtk::Label mode_label;
111 Gtk::Label instrument_label;
112 Gtk::ComboBoxText mode_combo;
113 Gtk::ComboBoxText route_group_combo;
114 InstrumentSelector instrument_combo;
115 Gtk::ComboBoxText insert_at_combo;
116 Gtk::ComboBoxText strict_io_combo;
118 void track_type_chosen ();
119 void refill_channel_setups ();
120 void refill_route_groups ();
121 void refill_track_modes ();
122 void add_route_group (ARDOUR::RouteGroup *);
123 void group_changed ();
124 void channel_combo_changed ();
125 bool channel_separator (const Glib::RefPtr<Gtk::TreeModel> &m, const Gtk::TreeModel::iterator &i);
126 bool route_separator (const Glib::RefPtr<Gtk::TreeModel> &m, const Gtk::TreeModel::iterator &i);
127 void maybe_update_name_template_entry ();
129 struct TrackTemplateColumns : public Gtk::TreeModel::ColumnRecord {
130 TrackTemplateColumns () {
137 Gtk::TreeModelColumn<std::string> name;
138 Gtk::TreeModelColumn<std::string> path;
139 Gtk::TreeModelColumn<std::string> description;
140 Gtk::TreeModelColumn<std::string> modified_with;
143 TrackTemplateColumns track_template_columns;
145 Glib::RefPtr<Gtk::TreeStore> trk_template_model;
146 Gtk::TreeView trk_template_chooser;
148 void trk_template_row_selected ();
150 Gtk::TextView trk_template_desc;
151 Gtk::Frame trk_template_outer_frame;
152 Gtk::Frame trk_template_desc_frame;
154 void reset_template_option_visibility ();
155 void new_group_dialog_finished (int, RouteGroupDialog*);
157 void on_response (int);
159 struct ChannelSetup {
164 typedef std::vector<ChannelSetup> ChannelSetups;
165 ChannelSetups channel_setups;
167 static std::vector<std::pair<std::string, std::string> > builtin_types;
168 static std::vector<std::string> channel_combo_strings;
169 static std::vector<std::string> bus_mode_strings;
171 bool name_edited_by_user;
172 void name_template_entry_insertion (Glib::ustring const &,int*);
173 void name_template_entry_deletion (int, int);
176 #endif /* __gtk_ardour_add_route_dialog_h__ */