Ardour  9.0-pre0-582-g084a23a80d
route_ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2005 Karsten Wiese <fzuuzf@googlemail.com>
4  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
5  * Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
6  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
7  * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
8  * Copyright (C) 2014-2015 Ben Loftis <ben@harrisonconsoles.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #ifndef __ardour_route_ui__
26 #define __ardour_route_ui__
27 
28 #include <list>
29 
30 #include "pbd/signals.h"
31 #include "pbd/xml++.h"
32 
33 #include <gtkmm/colorselection.h>
34 #include <gtkmm/textview.h>
35 
36 #include "gtkmm2ext/widget_state.h"
37 
38 #include "ardour/ardour.h"
39 #include "ardour/mute_master.h"
40 #include "ardour/route.h"
41 #include "ardour/route_group.h"
42 #include "ardour/session.h"
43 #include "ardour/session_event.h"
44 #include "ardour/session_handle.h"
45 #include "ardour/track.h"
46 
47 #include "axis_view.h"
48 #include "selectable.h"
49 #include "stripable_colorpicker.h"
50 #include "window_manager.h"
51 
52 namespace ARDOUR {
53  class AudioTrack;
54  class MidiTrack;
55  class SoloMuteRelease;
56 }
57 
58 namespace Gtk {
59  class Menu;
60  class CheckMenuItem;
61  class Widget;
62 }
63 
64 namespace ArdourWidgets {
65  class ArdourButton;
66  class Prompter;
67 }
68 
69 class ArdourWindow;
70 class IOSelectorWindow;
72 class PlaylistSelector;
73 class SaveTemplateDialog;
74 
76 {
77 public:
78  RoutePinWindowProxy (std::string const&, std::shared_ptr<ARDOUR::Route>);
80 
81  Gtk::Window* get (bool create = false);
83 
84 private:
85  std::weak_ptr<ARDOUR::Route> _route;
86 
89 };
90 
91 class RouteUI : public virtual Selectable, public virtual ARDOUR::SessionHandlePtr, public virtual PBD::ScopedConnectionList, public virtual sigc::trackable
92 {
93 public:
95 
96  virtual ~RouteUI ();
97 
98  std::shared_ptr<ARDOUR::Stripable> stripable () const;
99 
100  virtual void set_session (ARDOUR::Session*);
101  virtual void set_route (std::shared_ptr<ARDOUR::Route>);
102  virtual void set_button_names () = 0;
103 
104  bool is_track () const;
105  bool is_master () const;
106  bool is_foldbackbus () const;
107  bool is_singleton () const;
108  bool is_audio_track () const;
109  bool is_midi_track () const;
110  bool has_audio_outputs () const;
111 
112  std::shared_ptr<ARDOUR::Route> route () const
113  {
114  return _route;
115  }
117 
118  std::shared_ptr<ARDOUR::Track> track () const;
119  std::shared_ptr<ARDOUR::AudioTrack> audio_track () const;
120  std::shared_ptr<ARDOUR::MidiTrack> midi_track () const;
121 
124 
125  // protected: XXX sigh this should be here
126  // callbacks used by dervice classes via &RouteUI::*
127 
131  void choose_color ();
132  void route_rename ();
133  void manage_pins ();
138 
149 
159  void set_route_active (bool, bool);
161  void fan_out (bool to_busses = true, bool group = true);
162 
164  void clear_time_domain (bool);
165 
166  /* The editor calls these when mapping an operation across multiple tracks */
167  void use_new_playlist (std::string name, std::string group_id, std::vector<std::shared_ptr<ARDOUR::Playlist> > const&, bool copy);
168  void clear_playlist ();
169 
170  void use_playlist (Gtk::RadioMenuItem* item, std::weak_ptr<ARDOUR::Playlist> wpl);
171  void select_playlist_matching (std::weak_ptr<ARDOUR::Playlist> wpl);
173 
174  /* used by EditorRoutes */
175  static Gtkmm2ext::ActiveState solo_active_state (std::shared_ptr<ARDOUR::Stripable>);
176  static Gtkmm2ext::ActiveState solo_isolate_active_state (std::shared_ptr<ARDOUR::Stripable>);
177  static Gtkmm2ext::ActiveState solo_safe_active_state (std::shared_ptr<ARDOUR::Stripable>);
178  static Gtkmm2ext::ActiveState mute_active_state (ARDOUR::Session*, std::shared_ptr<ARDOUR::Stripable>);
179 
180 protected:
181  virtual void set_color (uint32_t c);
183 
184  virtual void route_property_changed (const PBD::PropertyChange&) = 0;
185  virtual void route_active_changed () {}
186 
189 
191 
198 
201 
205 
206  std::shared_ptr<ARDOUR::Route> _route;
207  std::shared_ptr<ARDOUR::Delivery> _current_delivery;
208 
217 
218 protected:
219  typedef std::map<PBD::ID, IOSelectorWindow*> IOSelectorMap;
220 
223 
224  static void delete_ioselector (IOSelectorMap&, std::shared_ptr<ARDOUR::Route>);
225 
226  static void help_count_plugins (std::weak_ptr<ARDOUR::Processor> p, uint32_t*);
227 
231 
232  void init ();
233  void reset ();
234 
235  virtual void self_delete ();
236  virtual void blink_rec_display (bool onoff);
237  virtual void map_frozen ();
238  virtual void route_rec_enable_changed ();
239  virtual void route_color_changed () {}
240  virtual void start_step_editing () {}
241  virtual void stop_step_editing () {}
242  virtual void create_sends (ARDOUR::Placement, bool);
244  virtual void bus_send_display_changed (std::shared_ptr<ARDOUR::Route>);
245 
246  bool mark_hidden (bool yn);
249  bool verify_new_route_name (const std::string& name);
252 
254 
255  std::string playlist_tip () const;
258 
262 
264 
265  static void set_showing_sends_to (std::shared_ptr<ARDOUR::Route>);
266  static std::string program_port_prefix;
267 
270 
272 
273 private:
274  void invert_menu_toggled (uint32_t);
276  bool invert_release (GdkEventButton*, uint32_t i);
277 
281 
290  void muting_change ();
291 
292  void step_edit_changed (bool);
294 
297 
302 
307 
309 
310  void parameter_changed (std::string const&);
313  void send_blink (bool);
314 
317 
318  std::string route_state_id () const;
319 
321 
322  std::string resolve_new_group_playlist_name (std::string const&, std::vector<std::shared_ptr<ARDOUR::Playlist> > const&);
323 
325 
328 
331 
336 
337  std::vector<ArdourWidgets::ArdourButton*> _invert_buttons;
338 
340 
341  sigc::connection send_blink_connection;
342  sigc::connection rec_blink_connection;
343 
348  static PBD::Signal<void(std::shared_ptr<ARDOUR::Route> )> BusSendDisplayChanged;
349 
350  static std::weak_ptr<ARDOUR::Route> _showing_sends_to;
351 
352  static uint32_t _max_invert_buttons;
353 };
354 
355 #endif /* __ardour_route_ui__ */
Gtk::Window * get(bool create=false)
ARDOUR::SessionHandlePtr * session_handle()
RoutePinWindowProxy(std::string const &, std::shared_ptr< ARDOUR::Route >)
std::weak_ptr< ARDOUR::Route > _route
Definition: route_ui.h:85
PBD::ScopedConnection going_away_connection
Definition: route_ui.h:88
std::shared_ptr< ARDOUR::MidiTrack > midi_track() const
void track_mode_changed()
Gtk::CheckMenuItem * _step_edit_item
Definition: route_ui.h:329
void use_new_playlist(std::string name, std::string group_id, std::vector< std::shared_ptr< ARDOUR::Playlist > > const &, bool copy)
bool mark_hidden(bool yn)
std::string playlist_tip() const
virtual void processors_changed(ARDOUR::RouteProcessorChange)
Definition: route_ui.h:182
PlaylistSelector * _playlist_selector
Definition: route_ui.h:324
void clear_time_domain(bool)
void update_polarity_tooltips()
void send_blink(bool)
void muting_change()
Gdk::Color route_color() const
void check_rec_enable_sensitivity()
ArdourWidgets::ArdourButton * solo_safe_led
Definition: route_ui.h:199
void toggle_comment_editor()
static std::weak_ptr< ARDOUR::Route > _showing_sends_to
Definition: route_ui.h:350
static uint32_t _max_invert_buttons
Definition: route_ui.h:352
static PBD::Signal< void(std::shared_ptr< ARDOUR::Route >)> BusSendDisplayChanged
Definition: route_ui.h:348
static IOSelectorMap input_selectors
Definition: route_ui.h:221
static void set_showing_sends_to(std::shared_ptr< ARDOUR::Route >)
Gtk::Menu * _record_menu
Definition: route_ui.h:326
bool is_master() const
void toggle_mute_menu(ARDOUR::MuteMaster::MutePoint, Gtk::CheckMenuItem *)
void build_solo_menu()
void select_playlist_matching(std::weak_ptr< ARDOUR::Playlist > wpl)
Gtk::CheckMenuItem * main_mute_check
Definition: route_ui.h:212
StripableColorDialog _color_picker
Definition: route_ui.h:339
static void delete_ioselector(IOSelectorMap &, std::shared_ptr< ARDOUR::Route >)
void set_disk_io_point(ARDOUR::DiskIOPoint)
void maybe_add_route_print_mgr()
virtual void set_route(std::shared_ptr< ARDOUR::Route >)
bool is_midi_track() const
Gtk::CheckMenuItem * pre_fader_mute_check
Definition: route_ui.h:209
bool is_singleton() const
virtual void blink_rec_display(bool onoff)
ArdourWidgets::ArdourButton * monitor_disk_button
Definition: route_ui.h:197
void disconnect_output()
std::vector< ArdourWidgets::ArdourButton * > _invert_buttons
Definition: route_ui.h:337
Gdk::Color route_color_tint() const
void set_sends_gain_to_unity()
void toggle_rec_safe()
bool solo_isolate_button_release(GdkEventButton *)
ArdourWidgets::ArdourButton * rec_enable_button
Definition: route_ui.h:194
void update_solo_display()
void session_rec_enable_changed()
void denormal_protection_changed()
void build_playlist_menu()
virtual void create_selected_sends(ARDOUR::Placement, bool)
void init_mute_menu(ARDOUR::MuteMaster::MutePoint, Gtk::CheckMenuItem *)
virtual void set_session(ARDOUR::Session *)
void update_phase_invert_sensitivty()
void choose_color()
void clear_playlist()
Gtk::CheckMenuItem * surround_mute_check
Definition: route_ui.h:213
Gtk::Menu * solo_menu
Definition: route_ui.h:203
Gtk::Menu * _invert_menu
Definition: route_ui.h:334
bool solo_release(GdkEventButton *)
std::string resolve_new_group_playlist_name(std::string const &, std::vector< std::shared_ptr< ARDOUR::Playlist > > const &)
void set_sends_gain_from_track()
std::map< PBD::ID, IOSelectorWindow * > IOSelectorMap
Definition: route_ui.h:219
ArdourWidgets::ArdourButton * solo_isolated_led
Definition: route_ui.h:200
Gtk::Menu * playlist_action_menu
Definition: route_ui.h:257
Gtk::CheckMenuItem * solo_safe_check
Definition: route_ui.h:214
void set_sends_gain_to_zero()
void comment_changed()
bool show_sends_release(GdkEventButton *)
virtual void create_sends(ARDOUR::Placement, bool)
bool rec_enable_release(GdkEventButton *)
ArdourWidgets::ArdourButton * solo_button
Definition: route_ui.h:193
bool is_audio_track() const
void select_midi_patch()
virtual void route_color_changed()
Definition: route_ui.h:239
Gtk::CheckMenuItem * denormal_menu_item
Definition: route_ui.h:263
Gtk::CheckMenuItem * _rec_safe_item
Definition: route_ui.h:330
uint32_t _n_polarity_invert
Definition: route_ui.h:335
void update_monitoring_display()
bool is_track() const
bool monitor_disk_release(GdkEventButton *)
void toggle_solo_isolated(Gtk::CheckMenuItem *)
void duplicate_selected_routes()
void rename_current_playlist()
void show_playlist_copy_selector()
std::shared_ptr< ARDOUR::Route > _route
Definition: route_ui.h:206
virtual void route_active_changed()
Definition: route_ui.h:185
void comment_editor_done_editing()
bool _ignore_comment_edit
Definition: route_ui.h:332
void save_as_template()
bool monitor_disk_press(GdkEventButton *)
void build_mute_menu()
Gtk::Menu * sends_menu
Definition: route_ui.h:204
ARDOUR::RouteGroup * route_group() const
PBD::ScopedConnectionList send_connections
Definition: route_ui.h:229
void fan_out(bool to_busses=true, bool group=true)
bool mute_press(GdkEventButton *)
static Gtkmm2ext::ActiveState solo_safe_active_state(std::shared_ptr< ARDOUR::Stripable >)
void route_rename()
static Gtkmm2ext::ActiveState mute_active_state(ARDOUR::Session *, std::shared_ptr< ARDOUR::Stripable >)
virtual void route_property_changed(const PBD::PropertyChange &)=0
void show_playlist_share_selector()
bool monitor_input_press(GdkEventButton *)
virtual void bus_send_display_changed(std::shared_ptr< ARDOUR::Route >)
void disconnect_input()
std::shared_ptr< ARDOUR::Route > route() const
Definition: route_ui.h:112
bool solo_safe_button_release(GdkEventButton *)
void update_solo_button()
ArdourWidgets::ArdourButton * show_sends_button
Definition: route_ui.h:195
Gtk::CheckMenuItem * solo_isolated_check
Definition: route_ui.h:215
void edit_output_configuration()
virtual void map_frozen()
bool rec_enable_press(GdkEventButton *)
PBD::ScopedConnectionList route_connections
Definition: route_ui.h:228
ArdourWidgets::ArdourButton * mute_button
Definition: route_ui.h:192
void build_record_menu()
bool invert_release(GdkEventButton *, uint32_t i)
bool verify_new_route_name(const std::string &name)
virtual void stop_step_editing()
Definition: route_ui.h:241
std::string route_state_id() const
void set_route_active(bool, bool)
void reset()
std::shared_ptr< ARDOUR::Track > track() const
void set_time_domain(Temporal::TimeDomain, bool)
void show_playlist_steal_selector()
void show_playlist_selector()
void toggle_step_edit()
bool invert_press(GdkEventButton *)
int _i_am_the_modifier
Definition: route_ui.h:333
sigc::connection send_blink_connection
Definition: route_ui.h:341
void open_comment_editor()
virtual ~RouteUI()
void parameter_changed(std::string const &)
void toggle_solo_safe(Gtk::CheckMenuItem *)
ARDOUR::SoloMuteRelease * _mute_release
Definition: route_ui.h:269
void update_polarity_display()
bool monitor_release(GdkEventButton *, ARDOUR::MonitorChoice)
Gtk::Menu * mute_menu
Definition: route_ui.h:202
Gtk::TextView * _comment_area
Definition: route_ui.h:327
virtual void set_button_names()=0
void use_playlist(Gtk::RadioMenuItem *item, std::weak_ptr< ARDOUR::Playlist > wpl)
void relabel_solo_button()
static IOSelectorMap output_selectors
Definition: route_ui.h:222
void init()
void delete_patch_change_dialog()
void setup_invert_buttons()
virtual void self_delete()
std::shared_ptr< ARDOUR::Stripable > stripable() const
virtual void set_color(uint32_t c)
void build_sends_menu()
static Gtkmm2ext::ActiveState solo_active_state(std::shared_ptr< ARDOUR::Stripable >)
RouteUI(ARDOUR::Session *)
static std::string program_port_prefix
Definition: route_ui.h:266
void toggle_denormal_protection()
void edit_input_configuration()
sigc::connection rec_blink_connection
Definition: route_ui.h:342
bool solo_press(GdkEventButton *)
static void help_count_plugins(std::weak_ptr< ARDOUR::Processor > p, uint32_t *)
bool mute_release(GdkEventButton *)
bool monitor_input_release(GdkEventButton *)
ArdourWidgets::ArdourButton * monitor_input_button
Definition: route_ui.h:196
bool has_audio_outputs() const
Gtk::HBox invert_button_box
Definition: route_ui.h:190
void manage_pins()
bool self_destruct
Definition: route_ui.h:230
void update_mute_display()
virtual void route_rec_enable_changed()
static Gtkmm2ext::ActiveState solo_isolate_active_state(std::shared_ptr< ARDOUR::Stripable >)
void step_edit_changed(bool)
bool is_foldbackbus() const
PatchChangeGridDialog * patch_change_dialog() const
std::shared_ptr< ARDOUR::Delivery > _current_delivery
Definition: route_ui.h:207
Gtk::CheckMenuItem * listen_mute_check
Definition: route_ui.h:211
void invert_menu_toggled(uint32_t)
std::shared_ptr< ARDOUR::AudioTrack > audio_track() const
bool show_sends_press(GdkEventButton *)
Gtk::CheckMenuItem * post_fader_mute_check
Definition: route_ui.h:210
void route_gui_changed(PBD::PropertyChange const &)
void setup_comment_editor()
virtual void start_step_editing()
Definition: route_ui.h:240
void save_as_template_dialog_response(int response, SaveTemplateDialog *d)
ARDOUR::SoloMuteRelease * _solo_release
Definition: route_ui.h:268
void solo_changed_so_update_mute()
int set_color_from_route()
ArdourWindow * _comment_window
Definition: route_ui.h:271
GtkImageIconNameData name
Definition: gtkimage.h:6
Definition: ardour_ui.h:188