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 "ardour/location.h"
34 #include "ardour_dialog.h"
35 #include "audio_clock.h"
43 class LocationEditRow : public Gtk::HBox
46 LocationEditRow (ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1);
47 virtual ~LocationEditRow();
49 void set_location (ARDOUR::Location*);
50 ARDOUR::Location * get_location() { return location; }
52 void set_session (ARDOUR::Session *);
54 void set_number (int);
57 sigc::signal<void,ARDOUR::Location*> remove_requested;
58 sigc::signal<void> redraw_ranges;
68 ARDOUR::Location *location;
69 ARDOUR::Session *session;
73 Gtk::Table item_table;
75 Gtk::Entry name_entry;
76 Gtk::Label name_label;
77 Gtk::Label number_label;
80 Gtk::Button start_go_button;
81 AudioClock start_clock;
84 Gtk::Button end_go_button;
87 AudioClock length_clock;
88 Gtk::CheckButton cd_check_button;
89 Gtk::CheckButton hide_check_button;
91 Gtk::Button remove_button;
93 Gtk::HBox cd_track_details_hbox;
94 Gtk::Entry isrc_entry;
95 Gtk::Label isrc_label;
98 Gtk::Label performer_label;
99 Gtk::Entry performer_entry;
100 Gtk::Label composer_label;
101 Gtk::Entry composer_entry;
102 Gtk::CheckButton scms_check_button;
103 Gtk::CheckButton preemph_check_button;
106 guint32 i_am_the_modifier;
109 void name_entry_changed ();
110 void isrc_entry_changed ();
111 void performer_entry_changed ();
112 void composer_entry_changed ();
114 void set_button_pressed (LocationPart part);
115 void go_button_pressed (LocationPart part);
117 void clock_changed (LocationPart part);
118 void change_aborted (LocationPart part);
121 void hide_toggled ();
122 void remove_button_pressed ();
124 void scms_toggled ();
125 void preemph_toggled ();
127 void end_changed (ARDOUR::Location *);
128 void start_changed (ARDOUR::Location *);
129 void name_changed (ARDOUR::Location *);
130 void location_changed (ARDOUR::Location *);
131 void flags_changed (ARDOUR::Location *, void *src);
133 sigc::connection start_changed_connection;
134 sigc::connection end_changed_connection;
135 sigc::connection name_changed_connection;
136 sigc::connection changed_connection;
137 sigc::connection flags_changed_connection;
141 class LocationUI : public Gtk::HBox
147 virtual void set_session (ARDOUR::Session *);
149 void add_new_location();
150 void add_new_range();
152 void refresh_location_list ();
153 void refresh_location_list_s (ARDOUR::Change);
156 ARDOUR::Session* session;
157 ARDOUR::LocationStack* locations;
158 ARDOUR::Location *newest_location;
162 Gtk::VBox location_vpacker;
164 LocationEditRow loop_edit_row;
165 LocationEditRow punch_edit_row;
167 Gtk::VPaned loc_range_panes;
169 Gtk::Frame loc_frame;
170 Gtk::VBox loc_frame_box;
171 Gtk::Button add_location_button;
172 Gtk::ScrolledWindow location_rows_scroller;
173 Gtk::VBox location_rows;
175 Gtk::Frame range_frame;
176 Gtk::VBox range_frame_box;
177 Gtk::Button add_range_button;
178 Gtk::ScrolledWindow range_rows_scroller;
179 Gtk::VBox range_rows;
181 /* When any location changes it start
182 or end points, it sends a signal that is caught
183 by one of these functions
186 void location_remove_requested (ARDOUR::Location *);
188 void location_redraw_ranges ();
190 gint do_location_remove (ARDOUR::Location *);
192 guint32 i_am_the_modifier;
194 void location_removed (ARDOUR::Location *);
195 void location_added (ARDOUR::Location *);
196 void map_locations (ARDOUR::Locations::LocationList&);
199 class LocationUIWindow : public ArdourDialog
203 ~LocationUIWindow ();
206 void set_session (ARDOUR::Session *);
208 LocationUI& ui() { return _ui; }
212 bool on_delete_event (GdkEventAny*);
216 #endif // __ardour_location_ui_h__