Updated config.guess file
[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     $Id$
19 */
20
21 #ifndef __ardour_route_ui__
22 #define __ardour_route_ui__
23
24 #include <list>
25
26 #include <pbd/xml++.h>
27 #include <ardour/ardour.h>
28 #include <ardour/route.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(ARDOUR::Route&, ARDOUR::Session&, const char*, const char*, const char*);
48         virtual ~RouteUI();
49
50         bool is_audio_track() const;
51         ARDOUR::AudioDiskstream* get_diskstream() const;
52
53         ARDOUR::Route& route() const { return _route; }
54         ARDOUR::AudioTrack* audio_track() const;
55
56         string name() const;
57         
58         ARDOUR::Route& _route;
59         
60         void set_color (const Gdk::Color & c);
61         bool choose_color ();
62
63         bool ignore_toggle;
64         bool wait_for_release;
65
66         BindableToggleButton* mute_button;
67         BindableToggleButton* solo_button;
68         BindableToggleButton* rec_enable_button;
69         
70         virtual string solo_button_name () const { return "SoloButton"; }
71         virtual string safe_solo_button_name () const { return "SafeSoloButton"; }
72         
73         Gtk::Menu* mute_menu;
74         Gtk::Menu* solo_menu;
75         Gtk::Menu* remote_control_menu;
76
77         XMLNode *xml_node;
78         void ensure_xml_node ();
79
80         XMLNode* get_child_xml_node (const string & childname);
81         
82         gint mute_press(GdkEventButton*);
83         gint mute_release(GdkEventButton*);
84         gint solo_press(GdkEventButton*);
85         gint solo_release(GdkEventButton*);
86         gint rec_enable_press(GdkEventButton*);
87
88         void solo_changed(void*);
89         void mute_changed(void*);
90         void route_rec_enable_changed(void*);
91         void session_rec_enable_changed();
92
93         void build_solo_menu (void);
94         void build_remote_control_menu (void);
95         void refresh_remote_control_menu ();
96
97         void solo_safe_toggle (void*, Gtk::CheckMenuItem*);
98         void toggle_solo_safe (Gtk::CheckMenuItem*);
99
100         void toggle_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
101         void pre_fader_toggle(void*, Gtk::CheckMenuItem*);
102         void post_fader_toggle(void*, Gtk::CheckMenuItem*);
103         void control_outs_toggle(void*, Gtk::CheckMenuItem*);
104         void main_outs_toggle(void*, Gtk::CheckMenuItem*);
105
106         void build_mute_menu(void);
107         void init_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
108         
109         void set_mix_group_solo(ARDOUR::Route&, bool);
110         void set_mix_group_mute(ARDOUR::Route&, bool);
111         void set_mix_group_rec_enable(ARDOUR::Route&, bool);
112
113         int  set_color_from_route ();
114
115         sigc::connection blink_connection;
116
117         void rec_enable_button_blink (bool onoff, ARDOUR::AudioDiskstream *, Gtk::Widget *w);
118         
119         void remove_this_route ();
120         static gint idle_remove_this_route (RouteUI *);
121
122         void route_rename();
123         
124         virtual void name_changed (void *src);
125         void route_removed ();
126
127         Gtk::CheckMenuItem *route_active_menu_item;
128         void toggle_route_active ();
129         virtual void route_active_changed ();
130
131         Gtk::CheckMenuItem *polarity_menu_item;
132         void toggle_polarity ();
133         virtual void polarity_changed ();
134
135         void disconnect_input ();
136         void disconnect_output ();
137
138         void update_rec_display ();
139         void update_mute_display ();
140         void update_solo_display ();
141         virtual void map_frozen ();
142
143         void set_remote_control_id (uint32_t id, Gtk::CheckMenuItem* item);
144
145         void reversibly_apply_route_boolean (string name, void (ARDOUR::Route::*func)(bool, void*), bool, void *);
146         void reversibly_apply_audio_track_boolean (string name, void (ARDOUR::AudioTrack::*func)(bool, void*), bool, void *);
147 };
148
149 #endif /* __ardour_route_ui__ */