strip keyboard.cc of noxious focus handling stuff, and cleanup
[ardour.git] / gtk2_ardour / region_editor.h
1 /*
2     Copyright (C) 2001 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 __gtk_ardour_region_edit_h__
22 #define __gtk_ardour_region_edit_h__
23
24 #include <map>
25
26 #include <gtkmm.h>
27 #include <libgnomecanvas/libgnomecanvas.h>
28 #include <sigc++/signal.h>
29
30 #include "audio_clock.h"
31 #include "ardour_dialog.h"
32
33 namespace ARDOUR {
34         class AudioRegion;
35         class Session;
36 }
37
38 class AudioRegionView;
39
40 class AudioRegionEditor : public ArdourDialog
41 {
42   public:
43         AudioRegionEditor (ARDOUR::Session&, ARDOUR::AudioRegion&, AudioRegionView& rv);
44         ~AudioRegionEditor ();
45
46   private:
47         ARDOUR::Session& _session;
48         ARDOUR::AudioRegion& _region;
49         AudioRegionView& _region_view;
50
51         void connect_editor_events ();
52
53         Gtk::Label name_label;
54         Gtk::Entry name_entry;
55         Gtk::HBox  name_hbox;
56
57         Gtk::HBox  top_row_hbox;
58         Gtk::HBox  top_row_button_hbox;
59
60         Gtk::ToggleButton lock_button;
61         Gtk::ToggleButton mute_button;
62         Gtk::ToggleButton opaque_button;
63         Gtk::ToggleButton envelope_active_button;
64         Gtk::ToggleButton envelope_view_button;
65         Gtk::Label        envelope_active_button_label;
66         Gtk::Label        envelope_view_button_label;
67
68         Gtk::Button       raise_button;
69         Gtk::Arrow        raise_arrow;
70         Gtk::Button       lower_button;
71         Gtk::Arrow        lower_arrow;
72         Gtk::Frame        layer_frame;
73         Gtk::Label        layer_value_label;
74         Gtk::Label        layer_label;
75         Gtk::HBox         layer_hbox;
76
77         Gtk::ToggleButton  audition_button;
78         Gtk::Label         audition_label;
79
80         Gtk::VBox  upper_vbox;
81         Gtk::HBox  lower_hbox;
82         
83         Gtk::Table time_table;
84
85         Gtk::Label start_label;
86         Gtk::Label end_label;
87         Gtk::Label length_label;
88         Gtk::Alignment start_alignment;
89         Gtk::Alignment end_alignment;
90         Gtk::Alignment length_alignment;
91
92         AudioClock start_clock;
93         AudioClock end_clock;
94         AudioClock length_clock;
95         AudioClock sync_offset_clock;
96
97         Gtk::Table  envelope_loop_table;
98         Gtk::Button loop_button;
99         Gtk::Label  loop_label;
100         Gtk::Label  envelope_label;
101
102         Gtk::Table fade_in_table;
103         Gtk::Label fade_in_label;
104         Gtk::Alignment fade_in_label_align;
105         Gtk::Label fade_in_active_button_label;
106         Gtk::ToggleButton fade_in_active_button;
107         Gtk::Label fade_in_length_label;
108
109         Gtk::Adjustment fade_in_length_adjustment;
110         Gtk::SpinButton fade_in_length_spinner;
111
112         Gtk::Table fade_out_table;
113         Gtk::Label fade_out_label;
114         Gtk::Alignment fade_out_label_align;
115         Gtk::Label fade_out_active_button_label;
116         Gtk::ToggleButton fade_out_active_button;
117         Gtk::Label fade_out_length_label;
118
119         Gtk::Adjustment fade_out_length_adjustment;
120         Gtk::SpinButton fade_out_length_spinner;
121
122         Gtk::HSeparator sep3;
123         Gtk::VSeparator sep1;
124         Gtk::VSeparator sep2;
125
126         void region_changed (ARDOUR::Change);
127         void bounds_changed (ARDOUR::Change);
128         void name_changed ();
129         void opacity_changed ();
130         void mute_changed ();
131         void envelope_active_changed ();
132         void lock_changed ();
133         void layer_changed ();
134
135         void fade_in_length_adjustment_changed ();
136         void fade_out_length_adjustment_changed ();
137         void fade_in_changed ();
138         void fade_out_changed ();
139
140         void activation ();
141
142         void name_entry_changed ();
143         void start_clock_changed ();
144         void end_clock_changed ();
145         void length_clock_changed ();
146
147         gint envelope_active_button_press (GdkEventButton *);
148         gint envelope_active_button_release (GdkEventButton *);
149
150         void audition_button_toggled ();
151         void envelope_view_button_toggled ();
152         void lock_button_clicked ();
153         void mute_button_clicked ();
154         void opaque_button_clicked ();
155         void raise_button_clicked ();
156         void lower_button_clicked ();
157
158         void fade_in_active_toggled ();
159         void fade_out_active_toggled ();
160         void fade_in_active_changed ();
161         void fade_out_active_changed ();
162
163         void fade_in_realized ();
164         void fade_out_realized ();
165
166         void start_editing_fade_in ();
167         void start_editing_fade_out ();
168         void stop_editing_fade_in ();
169         void stop_editing_fade_out ();
170
171         gint bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)());
172         gint breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)());
173
174         bool spin_arrow_grab;
175 };
176
177 #endif /* __gtk_ardour_region_edit_h__ */