Ardour  8.12
transport_masters_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2019 Paul Davis <paul@linuxaudiosystems.com>
3  *
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.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_gtk_transport_masters_dialog_h__
20 #define __ardour_gtk_transport_masters_dialog_h__
21 
22 #include <vector>
23 #include <string>
24 
25 #include <gtkmm/button.h>
26 #include <gtkmm/comboboxtext.h>
27 #include <gtkmm/eventbox.h>
28 #include <gtkmm/radiobutton.h>
29 #include <gtkmm/label.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/entry.h>
32 #include <gtkmm/box.h>
33 #include <gtkmm/liststore.h>
34 #include <gtkmm/treestore.h>
35 
36 #include "ardour/types.h"
37 #include "pbd/property_basics.h"
38 
39 #include "widgets/ardour_button.h"
40 
41 #include "ardour_window.h"
42 #include "ardour_dialog.h"
43 
44 namespace Gtk {
45  class Menu;
46 }
47 
48 namespace ARDOUR {
49  class TransportMaster;
50 }
51 
52 class FloatingTextEntry;
53 
55 {
56  public:
59 
61  void set_transport_master (std::shared_ptr<ARDOUR::TransportMaster>);
62 
64 
65  protected:
66  void on_map ();
67  void on_unmap ();
68 
69  private:
70 
72  public:
74  std::string get_name () const;
76 
77  private:
84  };
85 
86  struct Row : sigc::trackable, PBD::ScopedConnectionList {
103  std::string save_last;
104 
106 
107  std::shared_ptr<ARDOUR::TransportMaster> tm;
108 
110 
112  ~Row ();
113 
116 
124  void remove_clicked ();
125 
127  void name_edited (std::string, int);
128 
131 
133  };
134 
135  std::vector<Row*> rows;
136 
139  float align[10];
142 
143  sigc::connection update_connection;
148 
151  add (short_name);
152  add (full_name);
153  }
156  };
157 
159 
160  friend struct Row;
161  Glib::RefPtr<Gtk::ListStore> midi_port_store;
162  Glib::RefPtr<Gtk::ListStore> audio_port_store;
163 
165  void update_ports ();
167  void build_port_model (Glib::RefPtr<Gtk::ListStore>, std::vector<std::string> const &);
168 
169  void rebuild ();
170  void clear ();
171  void current_changed (std::shared_ptr<ARDOUR::TransportMaster> old_master, std::shared_ptr<ARDOUR::TransportMaster> new_master);
172  void add_master ();
174  void allow_master_select (bool);
175 
178  void param_changed (std::string const &);
181 
182  public:
183  bool idle_remove (Row*);
184 };
185 
187 {
188  public:
190 
192 
193  protected:
194  void on_realize ();
195 
196  private:
198 };
199 
200 
201 #endif /* __ardour_gtk_transport_masters_dialog_h__ */
void add(TreeModelColumnBase &column)
PBD::ScopedConnection remove_connection
PBD::ScopedConnectionList port_reg_connection
void param_changed(std::string const &)
PBD::ScopedConnection session_config_connection
void set_session(ARDOUR::Session *)
void on_map()
This is a default handler for the signal signal_map().
void on_unmap()
This is a default handler for the signal signal_unmap().
void update(Temporal::timepos_t)
Glib::RefPtr< Gtk::ListStore > audio_port_store
void build_port_model(Glib::RefPtr< Gtk::ListStore >, std::vector< std::string > const &)
PBD::ScopedConnection current_connection
PBD::ScopedConnection engine_running_connection
void current_changed(std::shared_ptr< ARDOUR::TransportMaster > old_master, std::shared_ptr< ARDOUR::TransportMaster > new_master)
void allow_master_select(bool)
Glib::RefPtr< Gtk::ListStore > midi_port_store
void set_transport_master(std::shared_ptr< ARDOUR::TransportMaster >)
PBD::ScopedConnection config_connection
PBD::ScopedConnection add_connection
ArdourWidgets::ArdourButton add_master_button
void on_realize()
This is a default handler for the signal signal_realize().
void set_session(ARDOUR::Session *)
Temporal::samplepos_t samplepos_t
Definition: ardour_ui.h:188
Gtk::TreeModelColumn< std::string > full_name
Gtk::TreeModelColumn< std::string > short_name
Row(TransportMastersWidget &parent)
bool name_press(GdkEventButton *)
void update(ARDOUR::Session *, ARDOUR::samplepos_t)
void mod_request_type(ARDOUR::TransportRequestType)
ArdourWidgets::ArdourButton remove_button
void prop_change(PBD::PropertyChange)
PBD::ScopedConnection property_change_connection
void name_edited(std::string, int)
void build_port_list(ARDOUR::DataType)
bool port_combo_proxy(GdkEventButton *)
std::shared_ptr< ARDOUR::TransportMaster > tm
TransportMastersWidget & parent