Ardour  9.0-pre0-582-g084a23a80d
add_route_dialog.h
Go to the documentation of this file.
1 /*
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>
10  *
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.
15  *
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.
20  *
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.
24  */
25 
26 #pragma once
27 
28 #include <string>
29 
30 #include <gtkmm/entry.h>
31 #include <gtkmm/dialog.h>
32 #include <gtkmm/frame.h>
33 #include <gtkmm/radiobutton.h>
34 #include <gtkmm/adjustment.h>
35 #include <gtkmm/spinbutton.h>
36 #include <gtkmm/button.h>
37 #include <gtkmm/combobox.h>
38 #include <gtkmm/comboboxtext.h>
39 #include <gtkmm/textview.h>
40 #include <gtkmm/treemodel.h>
41 #include <gtkmm/treeview.h>
42 #include <gtkmm/treestore.h>
43 #include <gtkmm/liststore.h>
44 #include <gtkmm/scrolledwindow.h>
45 
46 #include "ardour/plugin.h"
47 #include "ardour/types.h"
48 #include "ardour/template_utils.h"
49 #include "ardour/route_group.h"
50 
51 #include "ardour_dialog.h"
52 #include "instrument_selector.h"
53 #include "route_dialogs.h"
54 
55 class Editor;
56 class RouteGroupDialog;
57 
59 {
60 public:
63 
64  enum ResponseId {
65  Add,
67  };
68 
69  enum TypeWanted {
76  };
78 
80  uint32_t channel_count ();
81  int count ();
82 
83  std::string name_template () const;
84  bool name_template_is_default () const;
86 
89 
91  bool use_strict_io ();
92 
94 
95  std::string get_template_path ();
96 
98 
99 private:
119 
126  void group_changed ();
128  bool channel_separator (const Glib::RefPtr<Gtk::TreeModel>& m, const Gtk::TreeModel::iterator& i);
129  bool route_separator (const Glib::RefPtr<Gtk::TreeModel>& m, const Gtk::TreeModel::iterator& i);
132 
135  {
136  add (name);
137  add (path);
138  add (description);
139  add (modified_with);
140  }
141 
146  };
147 
149 
150  Glib::RefPtr<Gtk::TreeStore> trk_template_model;
152 
154 
158 
160  void on_show () override;
161  void on_response (int) override;
162 
163  struct ChannelSetup {
164  std::string name;
165  uint32_t channels;
166  };
167 
168  typedef std::vector<ChannelSetup> ChannelSetups;
170 
173 
174  static std::vector<std::pair<std::string, std::string>> builtin_types;
175  static std::vector<std::string> channel_combo_strings;
176  static std::vector<std::string> bus_mode_strings;
177 
179  void name_template_entry_insertion (Glib::ustring const&, int*);
181 };
182 
Gtk::ComboBoxText route_group_combo
Gtk::ComboBoxText strict_io_combo
void new_group_dialog_finished(int, RouteGroupDialog *)
bool route_separator(const Glib::RefPtr< Gtk::TreeModel > &m, const Gtk::TreeModel::iterator &i)
bool name_template_is_default() const
void instrument_changed()
Gtk::Entry name_template_entry
void name_template_entry_deletion(int, int)
Gtk::Adjustment routes_adjustment
void group_changed()
std::string name_template() const
Gtk::Label name_label
Gtk::TreeView trk_template_chooser
Gtk::Frame trk_template_desc_frame
void refill_track_modes()
std::vector< ChannelSetup > ChannelSetups
static std::vector< std::pair< std::string, std::string > > builtin_types
bool use_strict_io()
bool channel_separator(const Glib::RefPtr< Gtk::TreeModel > &m, const Gtk::TreeModel::iterator &i)
Gtk::Label insert_label
uint32_t channel_count()
void reset_name_edited()
Gtk::TextView trk_template_desc
static std::vector< std::string > bus_mode_strings
void refill_channel_setups()
Gtk::Label manual_label
Gtk::Frame trk_template_outer_frame
static std::vector< std::string > channel_combo_strings
ARDOUR::TrackMode mode()
Gtk::ComboBoxText insert_at_combo
bool show_on_cue_page()
Gtk::ComboBoxText channel_combo
ARDOUR::PluginInfoPtr requested_instrument()
void on_response(int) override
This is a default handler for the signal signal_response().
Gtk::Label instrument_label
Gtk::Label add_label
void name_template_entry_insertion(Glib::ustring const &, int *)
Gtk::CheckButton show_on_cue_chkbox
void add_route_group(ARDOUR::RouteGroup *)
void trk_template_row_selected()
void channel_combo_changed()
void maybe_update_name_template_entry()
Gtk::Label configuration_label
ChannelSetups channel_setups
Gtk::Label group_label
InstrumentSelector instrument_combo
Gtk::Label mode_label
RouteDialogs::InsertAt insert_at()
void refill_route_groups()
TrackTemplateColumns track_template_columns
Gtk::ComboBoxText mode_combo
Glib::RefPtr< Gtk::TreeStore > trk_template_model
bool route_count_set_by_template
Gtk::Label strict_io_label
std::string get_template_path()
TypeWanted type_wanted()
ARDOUR::RouteGroup * route_group()
ARDOUR::ChanCount channels()
void track_type_chosen()
void on_show() override
This is a default handler for the signal signal_show().
std::string type_wanted_to_localized_string(TypeWanted type_wanted)
Gtk::SpinButton routes_spinner
Definition: editor.h:158
void add(TreeModelColumnBase &column)
std::shared_ptr< PluginInfo > PluginInfoPtr
Definition: plugin.h:65
Gtk::TreeModelColumn< std::string > modified_with
Gtk::TreeModelColumn< std::string > path
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< std::string > description