2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk_ardour_add_route_dialog_h__
21 #define __gtk_ardour_add_route_dialog_h__
25 #include <gtkmm/entry.h>
26 #include <gtkmm/dialog.h>
27 #include <gtkmm/frame.h>
28 #include <gtkmm/radiobutton.h>
29 #include <gtkmm/adjustment.h>
30 #include <gtkmm/spinbutton.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/combobox.h>
33 #include <gtkmm/comboboxtext.h>
34 #include <gtkmm/textview.h>
35 #include <gtkmm/treemodel.h>
36 #include <gtkmm/treeview.h>
37 #include <gtkmm/treestore.h>
38 #include <gtkmm/liststore.h>
39 #include <gtkmm/scrolledwindow.h>
41 #include "ardour/plugin.h"
42 #include "ardour/types.h"
43 #include "ardour/template_utils.h"
45 #include "ardour_dialog.h"
46 #include "instrument_selector.h"
47 #include "route_dialogs.h"
50 class RouteGroupDialog;
52 class AddRouteDialog : public ArdourDialog
72 TypeWanted type_wanted();
74 ARDOUR::ChanCount channels ();
75 uint32_t channel_count ();
78 std::string name_template () const;
79 bool name_template_is_default () const;
80 ARDOUR::PluginInfoPtr requested_instrument ();
82 ARDOUR::TrackMode mode();
83 ARDOUR::RouteGroup* route_group ();
85 RouteDialogs::InsertAt insert_at();
88 std::string get_template_path();
90 void reset_name_edited () { name_edited_by_user = false; }
93 Gtk::Entry name_template_entry;
94 Gtk::Adjustment routes_adjustment;
95 Gtk::SpinButton routes_spinner;
96 Gtk::ComboBoxText channel_combo;
97 Gtk::Label configuration_label;
98 Gtk::Label manual_label;
100 Gtk::Label name_label;
101 Gtk::Label group_label;
102 Gtk::Label insert_label;
103 Gtk::Label strict_io_label;
104 Gtk::Label mode_label;
105 Gtk::Label instrument_label;
106 Gtk::ComboBoxText mode_combo;
107 Gtk::ComboBoxText route_group_combo;
108 InstrumentSelector instrument_combo;
109 Gtk::ComboBoxText insert_at_combo;
110 Gtk::ComboBoxText strict_io_combo;
112 void track_type_chosen ();
113 void refill_channel_setups ();
114 void refill_route_groups ();
115 void refill_track_modes ();
116 void add_route_group (ARDOUR::RouteGroup *);
117 void group_changed ();
118 void channel_combo_changed ();
119 bool channel_separator (const Glib::RefPtr<Gtk::TreeModel> &m, const Gtk::TreeModel::iterator &i);
120 bool route_separator (const Glib::RefPtr<Gtk::TreeModel> &m, const Gtk::TreeModel::iterator &i);
121 void maybe_update_name_template_entry ();
123 struct TrackTemplateColumns : public Gtk::TreeModel::ColumnRecord {
124 TrackTemplateColumns () {
131 Gtk::TreeModelColumn<std::string> name;
132 Gtk::TreeModelColumn<std::string> path;
133 Gtk::TreeModelColumn<std::string> description;
134 Gtk::TreeModelColumn<std::string> modified_with;
137 TrackTemplateColumns track_template_columns;
139 Glib::RefPtr<Gtk::TreeStore> trk_template_model;
140 Gtk::TreeView trk_template_chooser;
142 void trk_template_row_selected ();
144 Gtk::TextView trk_template_desc;
145 Gtk::Frame trk_template_outer_frame;
146 Gtk::Frame trk_template_desc_frame;
148 void reset_template_option_visibility ();
149 void new_group_dialog_finished (int, RouteGroupDialog*);
151 void on_response (int);
153 struct ChannelSetup {
158 typedef std::vector<ChannelSetup> ChannelSetups;
159 ChannelSetups channel_setups;
161 static std::vector<std::pair<std::string, std::string> > builtin_types;
162 static std::vector<std::string> channel_combo_strings;
163 static std::vector<std::string> bus_mode_strings;
165 bool name_edited_by_user;
166 void name_template_entry_insertion (Glib::ustring const &,int*);
167 void name_template_entry_deletion (int, int);
170 #endif /* __gtk_ardour_add_route_dialog_h__ */