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/radiobutton.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/table.h>
30 #include <gtkmm/treestore.h>
32 #include "ardour_window.h"
39 class TransportMaster;
42 class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
45 TransportMastersWidget ();
46 ~TransportMastersWidget ();
48 void update (ARDOUR::samplepos_t);
56 struct Row : sigc::trackable, PBD::ScopedConnectionList {
63 Gtk::CheckButton collect_button;
64 Gtk::RadioButton use_button;
65 Gtk::ComboBoxText port_combo;
66 Gtk::CheckButton sclock_synced_button;
67 Gtk::CheckButton fr2997_button;
68 Gtk::Button request_options;
69 Gtk::Menu* request_option_menu;
71 void build_request_options();
73 boost::shared_ptr<ARDOUR::TransportMaster> tm;
75 void update (ARDOUR::Session*, ARDOUR::samplepos_t);
79 struct PortColumns : public Gtk::TreeModel::ColumnRecord {
84 Gtk::TreeModelColumn<std::string> short_name;
85 Gtk::TreeModelColumn<std::string> full_name;
88 PortColumns port_columns;
90 void populate_port_combo ();
91 Glib::RefPtr<Gtk::ListStore> build_port_list (std::vector<std::string> const & ports);
93 void use_button_toggled ();
94 void collect_button_toggled ();
95 void sync_button_toggled ();
96 void fr2997_button_toggled ();
97 void port_choice_changed ();
98 void connection_handler ();
99 bool request_option_press (GdkEventButton*);
100 void prop_change (PBD::PropertyChange);
102 PBD::ScopedConnection property_change_connection;
103 bool ignore_active_change;
106 std::vector<Row*> rows;
108 Gtk::RadioButtonGroup use_button_group;
110 Gtk::Label col_title[12];
112 sigc::connection update_connection;
113 PBD::ScopedConnection current_connection;
116 void current_changed (boost::shared_ptr<ARDOUR::TransportMaster> old_master, boost::shared_ptr<ARDOUR::TransportMaster> new_master);
120 class TransportMastersWindow : public ArdourWindow
123 TransportMastersWindow ();
125 void set_session (ARDOUR::Session*);
131 TransportMastersWidget w;
135 #endif /* __ardour_gtk_transport_masters_dialog_h__ */