ardour
location_ui.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 1999-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_location_ui_h__
21 #define __ardour_location_ui_h__
22 
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>
31 
32 #include "pbd/signals.h"
33 
34 #include "ardour/location.h"
35 #include "ardour/session_handle.h"
36 
37 #include "ardour_window.h"
38 #include "audio_clock.h"
39 
40 namespace ARDOUR {
41  class Location;
42 }
43 
44 class ClockGroup;
45 
46 class LocationEditRow : public Gtk::HBox, public ARDOUR::SessionHandlePtr
47 {
48  public:
49  LocationEditRow (ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1);
50  virtual ~LocationEditRow();
51 
54 
56 
57  void set_number (int);
58  void focus_name();
61 
62  sigc::signal<void,ARDOUR::Location*> remove_requested;
63  sigc::signal<void> redraw_ranges;
64 
65  protected:
66 
67  enum LocationPart {
71  };
72 
74 
75  Gtk::Table item_table;
76 
77  Gtk::Entry name_entry;
78  Gtk::Label name_label;
79  Gtk::Label number_label;
80 
81  Gtk::HBox start_hbox;
84 
85  Gtk::HBox end_hbox;
88 
90  Gtk::CheckButton cd_check_button;
91  Gtk::CheckButton hide_check_button;
92  Gtk::CheckButton lock_check_button;
93  Gtk::CheckButton glue_check_button;
94 
95  Gtk::Button remove_button;
96 
98  Gtk::Entry isrc_entry;
99  Gtk::Label isrc_label;
100 
101 
102  Gtk::Label performer_label;
103  Gtk::Entry performer_entry;
104  Gtk::Label composer_label;
105  Gtk::Entry composer_entry;
106  Gtk::CheckButton scms_check_button;
107  Gtk::Label scms_label;
108  Gtk::CheckButton preemph_check_button;
109  Gtk::Label preemph_label;
111 
113  int number;
114 
115  void name_entry_changed ();
116  void isrc_entry_changed ();
117  void performer_entry_changed ();
118  void composer_entry_changed ();
119 
121 
122  void clock_changed (LocationPart part);
123  bool locate_to_clock (GdkEventButton*, AudioClock*);
124 
125  void cd_toggled ();
126  void hide_toggled ();
127  void lock_toggled ();
128  void glue_toggled ();
129  void remove_button_pressed ();
130 
131  void scms_toggled ();
132  void preemph_toggled ();
133 
134  void end_changed ();
135  void start_changed ();
136  void name_changed ();
137  void location_changed ();
138  void flags_changed ();
139  void lock_changed ();
141 
143  void show_cd_track_details ();
144 
146 };
147 
148 class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
149 {
150  public:
151  LocationUI ();
152  ~LocationUI ();
153 
154  void set_session (ARDOUR::Session *);
156 
157  void add_new_location();
158  void add_new_range();
159 
160  void refresh_location_list ();
161 
162  XMLNode & get_state () const;
163 
164  private:
170 
171  void session_going_away ();
172 
175  Gtk::VBox loop_punch_box;
176 
177  Gtk::VPaned loc_range_panes;
178 
179  Gtk::VBox loc_frame_box;
180  Gtk::Button add_location_button;
181  Gtk::ScrolledWindow location_rows_scroller;
182  Gtk::VBox location_rows;
183 
184  Gtk::VBox range_frame_box;
185  Gtk::Button add_range_button;
186  Gtk::ScrolledWindow range_rows_scroller;
187  Gtk::VBox range_rows;
188 
189  /* When any location changes it start
190  or end points, it sends a signal that is caught
191  by one of these functions
192  */
193 
195 
196  void location_redraw_ranges ();
197 
199 
201 
205 
208 };
209 
211 {
212  public:
213  LocationUIWindow ();
215 
216  void on_map ();
217  void set_session (ARDOUR::Session *);
218 
219  LocationUI& ui() { return _ui; }
220 
221  protected:
223  bool on_delete_event (GdkEventAny*);
224  void session_going_away();
225 };
226 
227 #endif // __ardour_location_ui_h__
ARDOUR::Location * get_location()
Definition: location_ui.h:53
AudioClock::Mode clock_mode_from_session_instant_xml() const
Gtk::CheckButton preemph_check_button
Definition: location_ui.h:108
void set_session(ARDOUR::Session *)
void add_new_range()
void set_clock_group(ClockGroup &)
Definition: location_ui.cc:185
Gtk::VBox range_frame_box
Definition: location_ui.h:184
Gtk::VBox loc_frame_box
Definition: location_ui.h:179
Gtk::CheckButton glue_check_button
Definition: location_ui.h:93
Gtk::VBox loop_punch_box
Definition: location_ui.h:175
std::list< Location * > LocationList
Definition: location.h:167
Gtk::VBox range_rows
Definition: location_ui.h:187
gint do_location_remove(ARDOUR::Location *)
Definition: location_ui.cc:848
void name_entry_changed()
Definition: location_ui.cc:352
Gtk::VPaned loc_range_panes
Definition: location_ui.h:177
Gtk::HBox end_hbox
Definition: location_ui.h:85
Gtk::CheckButton hide_check_button
Definition: location_ui.h:91
void start_changed()
Definition: location_ui.cc:611
guint32 i_am_the_modifier
Definition: location_ui.h:112
LocationUI _ui
Definition: location_ui.h:222
Gtk::Label composer_label
Definition: location_ui.h:104
Gtk::ScrolledWindow location_rows_scroller
Definition: location_ui.h:181
virtual ~LocationEditRow()
Definition: location_ui.cc:171
Gtk::Button add_range_button
Definition: location_ui.h:185
void add_new_location()
guint32 i_am_the_modifier
Definition: location_ui.h:200
ClockGroup * _clock_group
Definition: location_ui.h:110
Gtk::VBox location_rows
Definition: location_ui.h:182
void location_changed()
Definition: location_ui.cc:645
void isrc_entry_changed()
Definition: location_ui.cc:365
PBD::ScopedConnectionList connections
Definition: location_ui.h:145
void composer_entry_changed()
Definition: location_ui.cc:395
void session_going_away()
Gtk::HBox cd_track_details_hbox
Definition: location_ui.h:97
XMLNode & get_state() const
AudioClock length_clock
Definition: location_ui.h:89
void flags_changed()
Definition: location_ui.cc:663
void unset_clock_group()
Definition: location_ui.h:60
void set_clock_editable_status()
Definition: location_ui.cc:715
Gtk::Button start_to_playhead_button
Definition: location_ui.h:83
void set_session(ARDOUR::Session *)
Definition: location_ui.cc:201
Gtk::Label scms_label
Definition: location_ui.h:107
Definition: amp.h:29
Gtk::Entry isrc_entry
Definition: location_ui.h:98
void session_going_away()
LocationEditRow punch_edit_row
Definition: location_ui.h:174
Gtk::CheckButton scms_check_button
Definition: location_ui.h:106
void show_cd_track_details()
Definition: location_ui.cc:459
sigc::signal< void > redraw_ranges
Definition: location_ui.h:63
bool on_delete_event(GdkEventAny *)
void refresh_location_list()
void clock_changed(LocationPart part)
Definition: location_ui.cc:438
Gtk::Label performer_label
Definition: location_ui.h:102
void map_locations(const ARDOUR::Locations::LocationList &)
Definition: location_ui.cc:965
LocationEditRow(ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1)
Definition: location_ui.cc:47
LocationUI & ui()
Definition: location_ui.h:219
AudioClock end_clock
Definition: location_ui.h:86
Gtk::Table item_table
Definition: location_ui.h:75
void set_location(ARDOUR::Location *)
Definition: location_ui.cc:225
void performer_entry_changed()
Definition: location_ui.cc:381
Gtk::Button add_location_button
Definition: location_ui.h:180
AudioClock start_clock
Definition: location_ui.h:82
Gtk::Entry name_entry
Definition: location_ui.h:77
Gtk::Entry performer_entry
Definition: location_ui.h:103
Gtk::Label isrc_label
Definition: location_ui.h:99
ClockGroup * _clock_group
Definition: location_ui.h:206
void location_added(ARDOUR::Location *)
Definition: location_ui.cc:893
Definition: xml++.h:95
void location_redraw_ranges()
Definition: location_ui.cc:880
ARDOUR::Location * location
Definition: location_ui.h:73
LocationEditRow loop_edit_row
Definition: location_ui.h:173
void set_clock_mode(AudioClock::Mode)
sigc::signal< void, ARDOUR::Location * > remove_requested
Definition: location_ui.h:62
void set_number(int)
Definition: location_ui.cc:215
Gtk::Entry composer_entry
Definition: location_ui.h:105
void location_removed(ARDOUR::Location *)
Definition: location_ui.cc:944
void position_lock_style_changed()
Definition: location_ui.cc:695
Gtk::CheckButton cd_check_button
Definition: location_ui.h:90
Gtk::Label number_label
Definition: location_ui.h:79
Gtk::HBox start_hbox
Definition: location_ui.h:81
bool locate_to_clock(GdkEventButton *, AudioClock *)
Definition: location_ui.cc:428
Gtk::Button remove_button
Definition: location_ui.h:95
void preemph_toggled()
Definition: location_ui.cc:583
Gtk::ScrolledWindow range_rows_scroller
Definition: location_ui.h:186
Gtk::Label preemph_label
Definition: location_ui.h:109
void to_playhead_button_pressed(LocationPart part)
Definition: location_ui.cc:409
Gtk::Label name_label
Definition: location_ui.h:78
void set_session(ARDOUR::Session *)
void location_remove_requested(ARDOUR::Location *)
Definition: location_ui.cc:870
ARDOUR::Location * newest_location
Definition: location_ui.h:169
Gtk::Button end_to_playhead_button
Definition: location_ui.h:87
void remove_button_pressed()
Definition: location_ui.cc:558
Gtk::CheckButton lock_check_button
Definition: location_ui.h:92