2 Copyright (C) 1999-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_location_ui_h__
21 #define __ardour_location_ui_h__
23 #include <gtkmm/box.h>
24 #include <gtkmm/checkbutton.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/table.h>
27 #include <gtkmm/entry.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/paned.h>
30 #include <gtkmm/scrolledwindow.h>
32 #include "pbd/signals.h"
34 #include "ardour/location.h"
35 #include "ardour/session_handle.h"
37 #include "ardour_dialog.h"
38 #include "audio_clock.h"
45 class LocationEditRow
: public Gtk::HBox
, public ARDOUR::SessionHandlePtr
48 LocationEditRow (ARDOUR::Session
*sess
=0, ARDOUR::Location
*loc
=0, int32_t num
=-1);
49 virtual ~LocationEditRow();
51 void set_location (ARDOUR::Location
*);
52 ARDOUR::Location
* get_location() { return location
; }
54 void set_session (ARDOUR::Session
*);
56 void set_number (int);
59 sigc::signal
<void,ARDOUR::Location
*> remove_requested
;
60 sigc::signal
<void> redraw_ranges
;
70 ARDOUR::Location
*location
;
72 Gtk::Table item_table
;
74 Gtk::Entry name_entry
;
75 Gtk::Label name_label
;
76 Gtk::Label number_label
;
79 Gtk::Button start_go_button
;
80 AudioClock start_clock
;
83 Gtk::Button end_go_button
;
86 AudioClock length_clock
;
87 Gtk::CheckButton cd_check_button
;
88 Gtk::CheckButton hide_check_button
;
90 Gtk::Button remove_button
;
92 Gtk::HBox cd_track_details_hbox
;
93 Gtk::Entry isrc_entry
;
94 Gtk::Label isrc_label
;
97 Gtk::Label performer_label
;
98 Gtk::Entry performer_entry
;
99 Gtk::Label composer_label
;
100 Gtk::Entry composer_entry
;
101 Gtk::CheckButton scms_check_button
;
102 Gtk::CheckButton preemph_check_button
;
104 guint32 i_am_the_modifier
;
107 void name_entry_changed ();
108 void isrc_entry_changed ();
109 void performer_entry_changed ();
110 void composer_entry_changed ();
112 void set_button_pressed (LocationPart part
);
113 void go_button_pressed (LocationPart part
);
115 void clock_changed (LocationPart part
);
116 void change_aborted (LocationPart part
);
119 void hide_toggled ();
120 void remove_button_pressed ();
122 void scms_toggled ();
123 void preemph_toggled ();
125 void end_changed (ARDOUR::Location
*);
126 void start_changed (ARDOUR::Location
*);
127 void name_changed (ARDOUR::Location
*);
128 void location_changed (ARDOUR::Location
*);
129 void flags_changed (ARDOUR::Location
*, void *src
);
131 PBD::ScopedConnectionList connections
;
134 class LocationUI
: public Gtk::HBox
, public ARDOUR::SessionHandlePtr
140 void set_session (ARDOUR::Session
*);
142 void add_new_location();
143 void add_new_range();
145 void refresh_location_list ();
148 ARDOUR::LocationStack
* locations
;
149 ARDOUR::Location
*newest_location
;
151 void session_going_away ();
153 Gtk::VBox location_vpacker
;
155 LocationEditRow loop_edit_row
;
156 LocationEditRow punch_edit_row
;
157 Gtk::VBox loop_punch_box
;
158 Gtk::ScrolledWindow loop_punch_scroller
;
160 Gtk::VPaned loc_range_panes
;
162 Gtk::Frame loc_frame
;
163 Gtk::VBox loc_frame_box
;
164 Gtk::Button add_location_button
;
165 Gtk::ScrolledWindow location_rows_scroller
;
166 Gtk::VBox location_rows
;
168 Gtk::Frame range_frame
;
169 Gtk::VBox range_frame_box
;
170 Gtk::Button add_range_button
;
171 Gtk::ScrolledWindow range_rows_scroller
;
172 Gtk::VBox range_rows
;
174 /* When any location changes it start
175 or end points, it sends a signal that is caught
176 by one of these functions
179 void location_remove_requested (ARDOUR::Location
*);
181 void location_redraw_ranges ();
183 gint
do_location_remove (ARDOUR::Location
*);
185 guint32 i_am_the_modifier
;
187 void location_removed (ARDOUR::Location
*);
188 void location_added (ARDOUR::Location
*);
189 void locations_changed (ARDOUR::Locations::Change
);
190 void map_locations (ARDOUR::Locations::LocationList
&);
193 class LocationUIWindow
: public ArdourDialog
197 ~LocationUIWindow ();
200 void set_session (ARDOUR::Session
*);
202 LocationUI
& ui() { return _ui
; }
206 bool on_delete_event (GdkEventAny
*);
207 void session_going_away();
210 #endif // __ardour_location_ui_h__