Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
20 
21 #include <vector>
22 #include <string>
23 
24 #include <gtkmm/button.h>
25 #include <gtkmm/comboboxtext.h>
26 #include <gtkmm/eventbox.h>
27 #include <gtkmm/radiobutton.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/table.h>
30 #include <gtkmm/entry.h>
31 #include <gtkmm/box.h>
32 #include <gtkmm/liststore.h>
33 #include <gtkmm/treestore.h>
34 
35 #include "ardour/types.h"
36 #include "pbd/property_basics.h"
37 
38 #include "widgets/ardour_button.h"
39 
40 #include "ardour_window.h"
41 #include "ardour_dialog.h"
42 
43 namespace Gtk {
44  class Menu;
45 }
46 
47 namespace ARDOUR {
48  class TransportMaster;
49 }
50 
51 class FloatingTextEntry;
52 
54 {
55  public:
58 
60  void set_transport_master (std::shared_ptr<ARDOUR::TransportMaster>);
61 
63 
64  protected:
65  void on_map ();
66  void on_unmap ();
67 
68  private:
69 
71  public:
73  std::string get_name () const;
75 
76  private:
83  };
84 
85  struct Row : sigc::trackable, PBD::ScopedConnectionList {
102  std::string save_last;
103 
105 
106  std::shared_ptr<ARDOUR::TransportMaster> tm;
107 
109 
111  ~Row ();
112 
115 
123  void remove_clicked ();
124 
126  void name_edited (std::string, int);
127 
130 
132  };
133 
134  std::vector<Row*> rows;
135 
138  float align[10];
141 
142  sigc::connection update_connection;
147 
150  add (short_name);
151  add (full_name);
152  }
155  };
156 
158 
159  friend struct Row;
160  Glib::RefPtr<Gtk::ListStore> midi_port_store;
161  Glib::RefPtr<Gtk::ListStore> audio_port_store;
162 
164  void update_ports ();
166  void build_port_model (Glib::RefPtr<Gtk::ListStore>, std::vector<std::string> const &);
167 
168  void rebuild ();
169  void clear ();
170  void current_changed (std::shared_ptr<ARDOUR::TransportMaster> old_master, std::shared_ptr<ARDOUR::TransportMaster> new_master);
171  void add_master ();
173  void allow_master_select (bool);
174 
177  void param_changed (std::string const &);
180 
181  public:
182  bool idle_remove (Row*);
183 };
184 
186 {
187  public:
189 
191 
192  protected:
193  void on_realize ();
194 
195  private:
197 };
198 
199 
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