2 Copyright (C) 2002 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_route_ui__
21 #define __ardour_route_ui__
25 #include "pbd/xml++.h"
26 #include "ardour/ardour.h"
27 #include "ardour/mute_master.h"
28 #include "ardour/route.h"
29 #include "ardour/track.h"
31 #include "axis_view.h"
44 class BindableToggleButton;
46 class RouteUI : public virtual AxisView
49 RouteUI(ARDOUR::Session&);
50 RouteUI(boost::shared_ptr<ARDOUR::Route>, ARDOUR::Session&);
54 virtual void set_route (boost::shared_ptr<ARDOUR::Route>);
55 virtual void set_button_names () = 0;
57 bool is_track() const;
58 bool is_audio_track() const;
59 bool is_midi_track() const;
61 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
63 boost::shared_ptr<ARDOUR::Track> track() const;
64 boost::shared_ptr<ARDOUR::AudioTrack> audio_track() const;
65 boost::shared_ptr<ARDOUR::MidiTrack> midi_track() const;
67 boost::shared_ptr<ARDOUR::Diskstream> get_diskstream() const;
69 std::string name() const;
71 // protected: XXX sigh this should be here
73 boost::shared_ptr<ARDOUR::Route> _route;
75 void set_color (const Gdk::Color & c);
79 bool wait_for_release;
80 bool multiple_mute_change;
81 bool multiple_solo_change;
83 BindableToggleButton* mute_button;
84 BindableToggleButton* solo_button;
85 BindableToggleButton* rec_enable_button; /* audio tracks */
86 BindableToggleButton* show_sends_button; /* busses */
88 Gtk::Label solo_button_label;
89 Gtk::Label mute_button_label;
90 Gtk::Label rec_enable_button_label;
92 void send_blink (bool);
93 sigc::connection send_blink_connection;
95 virtual std::string solo_button_name () const { return "SoloButton"; }
96 virtual std::string safe_solo_button_name () const { return "SafeSoloButton"; }
100 Gtk::Menu* sends_menu;
103 void ensure_xml_node ();
105 virtual XMLNode* get_automation_child_xml_node (Evoral::Parameter param);
107 bool mute_press(GdkEventButton*);
108 bool mute_release(GdkEventButton*);
109 bool solo_press(GdkEventButton*);
110 bool solo_release(GdkEventButton*);
111 bool rec_enable_press(GdkEventButton*);
112 bool rec_enable_release(GdkEventButton*);
113 bool show_sends_press(GdkEventButton*);
114 bool show_sends_release(GdkEventButton*);
116 void step_gain_up ();
117 void step_gain_down ();
118 void page_gain_up ();
119 void page_gain_down ();
121 void build_sends_menu ();
122 void set_sends_gain_from_track ();
123 void set_sends_gain_to_zero ();
124 void set_sends_gain_to_unity ();
125 void create_sends (ARDOUR::Placement);
127 void solo_changed(void*);
128 void solo_changed_so_update_mute ();
129 void mute_changed(void*);
130 void listen_changed(void*);
131 virtual void processors_changed () {}
132 void route_rec_enable_changed();
133 void session_rec_enable_changed();
135 void build_solo_menu ();
137 void solo_isolated_toggle (void*, Gtk::CheckMenuItem*);
138 void toggle_solo_isolated (Gtk::CheckMenuItem*);
140 void toggle_mute_menu(ARDOUR::MuteMaster::MutePoint, Gtk::CheckMenuItem*);
141 void pre_fader_toggle(void*, Gtk::CheckMenuItem*);
142 void post_fader_toggle(void*, Gtk::CheckMenuItem*);
143 void control_outs_toggle(void*, Gtk::CheckMenuItem*);
144 void main_outs_toggle(void*, Gtk::CheckMenuItem*);
146 void build_mute_menu(void);
147 void init_mute_menu(ARDOUR::MuteMaster::MutePoint, Gtk::CheckMenuItem*);
149 void set_route_group_solo (boost::shared_ptr<ARDOUR::Route>, bool);
150 void set_route_group_mute (boost::shared_ptr<ARDOUR::Route>, bool);
151 void set_route_group_rec_enable (boost::shared_ptr<ARDOUR::Route>, bool);
153 int set_color_from_route ();
155 void remove_this_route ();
156 static gint idle_remove_this_route (RouteUI *);
160 virtual void name_changed ();
161 void route_removed ();
163 Gtk::CheckMenuItem *route_active_menu_item;
164 void toggle_route_active ();
165 virtual void route_active_changed ();
167 Gtk::CheckMenuItem *polarity_menu_item;
168 void toggle_polarity ();
169 virtual void polarity_changed ();
171 Gtk::CheckMenuItem *denormal_menu_item;
172 void toggle_denormal_protection();
173 virtual void denormal_protection_changed ();
175 void disconnect_input ();
176 void disconnect_output ();
178 virtual void update_rec_display ();
179 void update_mute_display ();
181 void update_solo_display ();
183 virtual void map_frozen ();
185 void reversibly_apply_route_boolean (std::string name, void (ARDOUR::Route::*func)(bool, void*), bool, void *);
186 void reversibly_apply_track_boolean (std::string name, void (ARDOUR::Track::*func)(bool, void*), bool, void *);
188 void adjust_latency ();
189 void save_as_template ();
190 void open_remote_control_id_dialog ();
193 std::vector<sigc::connection> connections;
200 void check_rec_enable_sensitivity ();
201 void parameter_changed (std::string const &);
202 void relabel_solo_button ();
205 #endif /* __ardour_route_ui__ */