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.
21 #ifndef __ardour_route_ui__
22 #define __ardour_route_ui__
27 #include <pbd/xml++.h>
28 #include <ardour/ardour.h>
29 #include <ardour/route.h>
31 #include "axis_view.h"
34 class BindableToggleButton;
41 class RouteUI : public virtual AxisView
44 RouteUI(ARDOUR::Route&, ARDOUR::Session&, const char*, const char*, const char*);
47 bool is_audio_track() const;
48 ARDOUR::DiskStream* get_diskstream() const;
50 ARDOUR::Route& route() const { return _route; }
51 ARDOUR::AudioTrack* audio_track() const;
55 ARDOUR::Route& _route;
57 void set_color (Gdk::Color c);
61 bool wait_for_release;
63 Gtkmm2ext::BindableToggleButton * mute_button;
64 Gtkmm2ext::BindableToggleButton * solo_button;
65 Gtkmm2ext::BindableToggleButton * rec_enable_button;
67 virtual string solo_button_name () const { return "SoloButton"; }
68 virtual string safe_solo_button_name () const { return "SafeSoloButton"; }
74 void ensure_xml_node ();
76 XMLNode* get_child_xml_node (std::string childname);
78 gint mute_press(GdkEventButton*);
79 gint mute_release(GdkEventButton*);
80 gint solo_press(GdkEventButton*);
81 gint solo_release(GdkEventButton*);
82 gint rec_enable_press(GdkEventButton*);
84 void solo_changed(void*);
85 void mute_changed(void*);
86 void route_rec_enable_changed(void*);
87 void session_rec_enable_changed();
89 void build_solo_menu (void);
91 void solo_safe_toggle (void*, Gtk::CheckMenuItem*);
92 void toggle_solo_safe (Gtk::CheckMenuItem*);
94 void toggle_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
95 void pre_fader_toggle(void*, Gtk::CheckMenuItem*);
96 void post_fader_toggle(void*, Gtk::CheckMenuItem*);
97 void control_outs_toggle(void*, Gtk::CheckMenuItem*);
98 void main_outs_toggle(void*, Gtk::CheckMenuItem*);
100 void build_mute_menu(void);
101 void init_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
103 void set_mix_group_solo(ARDOUR::Route&, bool);
104 void set_mix_group_mute(ARDOUR::Route&, bool);
105 void set_mix_group_rec_enable(ARDOUR::Route&, bool);
107 int set_color_from_route ();
109 sigc::connection blink_connection;
111 void rec_enable_button_blink (bool onoff, ARDOUR::DiskStream *, Gtk::Widget *w);
113 void remove_this_route ();
114 static gint idle_remove_this_route (RouteUI *);
118 virtual void name_changed (void *src);
119 void route_removed ();
121 static gint okay_gplusplus_cannot_do_complex_templates (RouteUI *rui);
123 Gtk::CheckMenuItem *route_active_menu_item;
124 void toggle_route_active ();
125 virtual void route_active_changed ();
127 void disconnect_input ();
128 void disconnect_output ();
130 void update_rec_display ();
131 void update_mute_display ();
132 void update_solo_display ();
133 virtual void map_frozen ();
135 void reversibly_apply_route_boolean (string name, void (ARDOUR::Route::*func)(bool, void*), bool, void *);
136 void reversibly_apply_audio_track_boolean (string name, void (ARDOUR::AudioTrack::*func)(bool, void*), bool, void *);
139 #endif /* __ardour_route_ui__ */