Ardour  9.0-pre0-582-g084a23a80d
us2400/gui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Ben Loftis <ben@harrisonconsoles.com>
3  * Copyright (C) 2019 Johannes Mueller <github@johannes-mueller.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #include <vector>
21 
22 #include <gtkmm/combobox.h>
23 #include <gtkmm/comboboxtext.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/spinbutton.h>
26 #include <gtkmm/table.h>
27 #include <gtkmm/treestore.h>
28 #include <gtkmm/treeview.h>
29 #include <gtkmm/liststore.h>
30 #include <gtkmm/notebook.h>
31 #include <gtkmm/scrolledwindow.h>
32 
33 namespace Gtk {
34  class CellRendererCombo;
35 }
36 
37 #include "button.h"
38 
39 #include "pbd/i18n.h"
40 
41 namespace ActionManager {
42  class ActionModel;
43 }
44 
45 namespace ArdourSurface {
46 
47 class US2400Protocol;
48 
49 namespace US2400 {
50  class Surface;
51 }
52 
54 {
55  public:
57 
58  private:
62 
63  typedef std::vector<Gtk::ComboBox*> PortCombos;
66 
69  add (short_name);
70  add (full_name);
71  }
74  };
75 
78  add (name);
79  add (id);
80  add (plain);
81  add (shift);
82  add (control);
83  add (option);
84  add (cmdalt);
85  add (shiftcontrol);
86  };
95  };
96 
99 
102  Glib::RefPtr<Gtk::ListStore> function_key_model;
103  Glib::RefPtr<Gtk::TreeStore> available_action_model;
104 
105  Glib::RefPtr<Gtk::ListStore> build_midi_port_list (bool for_input);
106 
108 
111  void action_changed (const Glib::ustring &sPath, const Gtk::TreeModel::iterator &, Gtk::TreeModelColumnBase);
113 
115 
119 
121  void device_changed ();
122 
123  void update_port_combos (std::vector<std::string> const&, std::vector<std::string> const&,
124  Gtk::ComboBox* input_combo,
125  Gtk::ComboBox* output_combo,
126  std::shared_ptr<US2400::Surface> surface);
127 
130 
131  Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
134  void active_port_changed (Gtk::ComboBox* combo, std::weak_ptr<US2400::Surface> ws, bool for_input);
135 };
136 
137 }
Gtk::Widget * _device_dependent_widget
Definition: us2400/gui.h:117
void active_port_changed(Gtk::ComboBox *combo, std::weak_ptr< US2400::Surface > ws, bool for_input)
Glib::RefPtr< Gtk::ListStore > build_midi_port_list(bool for_input)
MidiPortColumns midi_port_columns
Definition: us2400/gui.h:98
Gtk::ScrolledWindow function_key_scroller
Definition: us2400/gui.h:100
US2400ProtocolGUI(US2400Protocol &)
PBD::ScopedConnectionList _port_connections
Definition: us2400/gui.h:128
PBD::ScopedConnection device_change_connection
Definition: us2400/gui.h:120
Gtk::Widget * device_dependent_widget()
Glib::RefPtr< Gtk::ListStore > build_midi_port_list(std::vector< std::string > const &ports, bool for_input)
Gtk::CellRendererCombo * make_action_renderer(Glib::RefPtr< Gtk::TreeStore > model, Gtk::TreeModelColumnBase)
void update_port_combos(std::vector< std::string > const &, std::vector< std::string > const &, Gtk::ComboBox *input_combo, Gtk::ComboBox *output_combo, std::shared_ptr< US2400::Surface > surface)
Gtk::ComboBoxText _profile_combo
Definition: us2400/gui.h:61
std::vector< Gtk::ComboBox * > PortCombos
Definition: us2400/gui.h:63
Glib::RefPtr< Gtk::TreeStore > available_action_model
Definition: us2400/gui.h:103
Glib::RefPtr< Gtk::ListStore > function_key_model
Definition: us2400/gui.h:102
FunctionKeyColumns function_key_columns
Definition: us2400/gui.h:97
const ActionManager::ActionModel & action_model
Definition: us2400/gui.h:107
void action_changed(const Glib::ustring &sPath, const Gtk::TreeModel::iterator &, Gtk::TreeModelColumnBase)
void add(TreeModelColumnBase &column)
Definition: ardour_ui.h:188
DebugBits US2400
Gtk::TreeModelColumn< std::string > shiftcontrol
Definition: us2400/gui.h:94
Gtk::TreeModelColumn< std::string > option
Definition: us2400/gui.h:92
Gtk::TreeModelColumn< std::string > control
Definition: us2400/gui.h:91
Gtk::TreeModelColumn< std::string > cmdalt
Definition: us2400/gui.h:93
Gtk::TreeModelColumn< std::string > name
Definition: us2400/gui.h:86
Gtk::TreeModelColumn< US2400::Button::ID > id
Definition: us2400/gui.h:88
Gtk::TreeModelColumn< std::string > shift
Definition: us2400/gui.h:90
Gtk::TreeModelColumn< std::string > plain
Definition: us2400/gui.h:89
Gtk::TreeModelColumn< std::string > full_name
Definition: us2400/gui.h:73
Gtk::TreeModelColumn< std::string > short_name
Definition: us2400/gui.h:72
Definition: getopt.h:74