2 Copyright (C) 2018 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 __ardour_gtk_transport_masters_dialog_h__
21 #define __ardour_gtk_transport_masters_dialog_h__
26 #include <gtkmm/button.h>
27 #include <gtkmm/eventbox.h>
28 #include <gtkmm/radiobutton.h>
29 #include <gtkmm/label.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/treestore.h>
33 #include "ardour_window.h"
40 class TransportMaster;
43 class FloatingTextEntry;
45 class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
48 TransportMastersWidget ();
49 ~TransportMastersWidget ();
51 void update (ARDOUR::samplepos_t);
59 struct Row : sigc::trackable, PBD::ScopedConnectionList {
60 Gtk::EventBox label_box;
68 Gtk::CheckButton collect_button;
69 Gtk::RadioButton use_button;
70 Gtk::ComboBoxText port_combo;
71 Gtk::CheckButton sclock_synced_button;
72 Gtk::CheckButton fr2997_button;
73 Gtk::Button request_options;
74 Gtk::Menu* request_option_menu;
75 FloatingTextEntry* name_editor;
76 samplepos_t save_when;
78 void build_request_options();
80 boost::shared_ptr<ARDOUR::TransportMaster> tm;
82 void update (ARDOUR::Session*, ARDOUR::samplepos_t);
86 struct PortColumns : public Gtk::TreeModel::ColumnRecord {
91 Gtk::TreeModelColumn<std::string> short_name;
92 Gtk::TreeModelColumn<std::string> full_name;
95 PortColumns port_columns;
97 void populate_port_combo ();
98 Glib::RefPtr<Gtk::ListStore> build_port_list (std::vector<std::string> const & ports);
100 void use_button_toggled ();
101 void collect_button_toggled ();
102 void sync_button_toggled ();
103 void fr2997_button_toggled ();
104 void port_choice_changed ();
105 void connection_handler ();
106 bool request_option_press (GdkEventButton*);
107 void prop_change (PBD::PropertyChange);
109 bool name_press (GdkEventButton*);
110 void name_edited (std::string, int);
112 PBD::ScopedConnection property_change_connection;
113 bool ignore_active_change;
116 std::vector<Row*> rows;
118 Gtk::RadioButtonGroup use_button_group;
120 Gtk::Label col_title[13];
122 sigc::connection update_connection;
123 PBD::ScopedConnection current_connection;
126 void current_changed (boost::shared_ptr<ARDOUR::TransportMaster> old_master, boost::shared_ptr<ARDOUR::TransportMaster> new_master);
130 class TransportMastersWindow : public ArdourWindow
133 TransportMastersWindow ();
135 void set_session (ARDOUR::Session*);
141 TransportMastersWidget w;
145 #endif /* __ardour_gtk_transport_masters_dialog_h__ */