Remove some unused classes, methods and variables, mostly in ARDOUR_UI
[ardour.git] / gtk2_ardour / route_ui.h
1 /*
2     Copyright (C) 2002 Paul Davis
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __ardour_route_ui__
21 #define __ardour_route_ui__
22
23 #include <list>
24
25 #include <pbd/xml++.h>
26 #include <ardour/ardour.h>
27 #include <ardour/route.h>
28 #include <ardour/track.h>
29
30 #include "axis_view.h"
31
32 namespace ARDOUR {
33         class AudioTrack;
34 }
35
36 namespace Gtk {
37         class Menu;
38         class CheckMenuItem;
39         class Widget;
40 }
41
42 class BindableToggleButton;
43
44 class RouteUI : public virtual AxisView
45 {
46   public:
47         RouteUI(boost::shared_ptr<ARDOUR::Route>, ARDOUR::Session&, const char*, const char*, const char*);
48         virtual ~RouteUI();
49
50         bool is_track() const;
51         bool is_audio_track() const;
52
53         boost::shared_ptr<ARDOUR::Route>      route() const { return _route; }
54         boost::shared_ptr<ARDOUR::Track>      track() const;
55         boost::shared_ptr<ARDOUR::AudioTrack> audio_track() const;
56         boost::shared_ptr<ARDOUR::Diskstream> get_diskstream() const;
57
58         string name() const;
59
60         // protected: XXX sigh this should be here
61
62         boost::shared_ptr<ARDOUR::Route> _route;
63         
64         void set_color (const Gdk::Color & c);
65         bool choose_color ();
66
67         bool ignore_toggle;
68         bool wait_for_release;
69
70         BindableToggleButton* mute_button;
71         BindableToggleButton* solo_button;
72         BindableToggleButton* rec_enable_button;
73         
74         virtual string solo_button_name () const { return "SoloButton"; }
75         virtual string safe_solo_button_name () const { return "SafeSoloButton"; }
76         
77         Gtk::Menu* mute_menu;
78         Gtk::Menu* solo_menu;
79         Gtk::Menu* remote_control_menu;
80
81         XMLNode *xml_node;
82         void ensure_xml_node ();
83
84         XMLNode* get_child_xml_node (const string & childname);
85         
86         bool mute_press(GdkEventButton*);
87         bool mute_release(GdkEventButton*);
88         bool solo_press(GdkEventButton*);
89         bool solo_release(GdkEventButton*);
90         bool rec_enable_press(GdkEventButton*);
91         bool rec_enable_release(GdkEventButton*);
92
93         void solo_changed(void*);
94         void solo_changed_so_update_mute ();
95         void mute_changed(void*);
96         virtual void redirects_changed (void *) {}
97         void route_rec_enable_changed();
98         void session_rec_enable_changed();
99
100         void build_solo_menu (void);
101         void build_remote_control_menu (void);
102         void refresh_remote_control_menu ();
103
104         void solo_safe_toggle (void*, Gtk::CheckMenuItem*);
105         void toggle_solo_safe (Gtk::CheckMenuItem*);
106
107         void toggle_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
108         void pre_fader_toggle(void*, Gtk::CheckMenuItem*);
109         void post_fader_toggle(void*, Gtk::CheckMenuItem*);
110         void control_outs_toggle(void*, Gtk::CheckMenuItem*);
111         void main_outs_toggle(void*, Gtk::CheckMenuItem*);
112
113         void build_mute_menu(void);
114         void init_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
115         
116         void set_mix_group_solo(boost::shared_ptr<ARDOUR::Route>, bool);
117         void set_mix_group_mute(boost::shared_ptr<ARDOUR::Route>, bool);
118         void set_mix_group_rec_enable(boost::shared_ptr<ARDOUR::Route>, bool);
119
120         int  set_color_from_route ();
121
122         void remove_this_route ();
123         static gint idle_remove_this_route (RouteUI *);
124
125         void route_rename();
126         
127         virtual void name_changed (void *src);
128         void route_removed ();
129
130         Gtk::CheckMenuItem *route_active_menu_item;
131         void toggle_route_active ();
132         virtual void route_active_changed ();
133
134         Gtk::CheckMenuItem *polarity_menu_item;
135         void toggle_polarity ();
136         virtual void polarity_changed ();
137
138         Gtk::CheckMenuItem *denormal_menu_item;
139         void toggle_denormal_protection();
140         virtual void denormal_protection_changed ();
141
142         void disconnect_input ();
143         void disconnect_output ();
144
145         virtual void update_rec_display ();
146         void update_mute_display ();
147
148         bool was_solo_safe;
149         void update_solo_display ();
150
151         virtual void map_frozen ();
152
153         void set_remote_control_id (uint32_t id, Gtk::CheckMenuItem* item);
154
155         void reversibly_apply_route_boolean (string name, void (ARDOUR::Route::*func)(bool, void*), bool, void *);
156         void reversibly_apply_audio_track_boolean (string name, void (ARDOUR::AudioTrack::*func)(bool, void*), bool, void *);
157 };
158
159 #endif /* __ardour_route_ui__ */