Ardour  9.0-pre0-582-g084a23a80d
location_ui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4  * Copyright (C) 2008-2011 David Robillard <d@drobilla.net>
5  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
25 #include <gtkmm/box.h>
26 #include <gtkmm/checkbutton.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/table.h>
29 #include <gtkmm/entry.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/scrolledwindow.h>
32 
33 #include "pbd/signals.h"
34 
35 #include "ardour/location.h"
36 #include "ardour/session_handle.h"
37 
38 #include "widgets/ardour_button.h"
39 #include "widgets/pane.h"
40 
41 #include "ardour_window.h"
42 #include "audio_clock.h"
43 
44 namespace ARDOUR {
45  class Location;
46 }
47 
48 class ClockGroup;
49 
51 {
52 public:
53  LocationEditRow (ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1);
54  virtual ~LocationEditRow();
55 
58 
60 
61  void set_number (int);
62  void focus_name();
65 
66  sigc::signal<void,ARDOUR::Location*> remove_requested;
67  sigc::signal<void> redraw_ranges;
68 
69 protected:
70 
71  enum LocationPart {
74  LocLength
75  };
76 
78 
80 
85 
90 
95 
101 
103 
107 
108 
118 
120  int number;
121 
126 
129 
132 
133  void cd_toggled ();
135  void hide_toggled ();
136  void lock_toggled ();
138 
139  void scms_toggled ();
141 
142  void end_changed ();
143  void start_changed ();
144  void name_changed ();
146  void flags_changed ();
147  void lock_changed ();
148 
151 
153 };
154 
156 {
157 public:
158  LocationUI (std::string state_node_name = "LocationUI");
160 
162 
165 
167 
168  XMLNode & get_state () const;
169  int set_state (const XMLNode&);
170 
171 private:
177 
179 
183 
185 
190 
195 
196  /* When any location changes it start
197  or end points, it sends a signal that is caught
198  by one of these functions
199  */
200 
202 
204 
206 
208 
210 
214 
217 
219  bool _mode_set;
220 
221  std::string _state_node_name;
222 };
223 
225 {
226 public:
229 
230  void on_map ();
232 
233  LocationUI& ui() { return _ui; }
234 
235 protected:
239 };
240 
std::list< Location * > LocationList
Definition: location.h:251
Gtk::Label preemph_label
Definition: location_ui.h:116
Gtk::Label isrc_label
Definition: location_ui.h:106
Gtk::Label name_label
Definition: location_ui.h:82
Gtk::Entry composer_entry
Definition: location_ui.h:112
Gtk::HBox cd_track_details_hbox
Definition: location_ui.h:104
void section_toggled()
ArdourWidgets::ArdourButton locate_to_start_button
Definition: location_ui.h:89
sigc::signal< void > redraw_ranges
Definition: location_ui.h:67
void start_changed()
void show_cd_track_details()
Gtk::Label performer_label
Definition: location_ui.h:109
void clock_changed(LocationPart part)
ARDOUR::Location * location
Definition: location_ui.h:77
Gtk::Label date_label
Definition: location_ui.h:84
void preemph_toggled()
void to_playhead_button_pressed(LocationPart part)
ArdourWidgets::ArdourButton start_to_playhead_button
Definition: location_ui.h:88
Gtk::HBox start_hbox
Definition: location_ui.h:86
void set_location(ARDOUR::Location *)
sigc::signal< void, ARDOUR::Location * > remove_requested
Definition: location_ui.h:66
Gtk::Table item_table
Definition: location_ui.h:79
Gtk::CheckButton cd_check_button
Definition: location_ui.h:97
void composer_entry_changed()
AudioClock start_clock
Definition: location_ui.h:87
void remove_button_pressed()
Gtk::CheckButton lock_check_button
Definition: location_ui.h:100
LocationEditRow(ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1)
Gtk::Label number_label
Definition: location_ui.h:83
AudioClock end_clock
Definition: location_ui.h:92
Gtk::Label scms_label
Definition: location_ui.h:114
void set_clock_group(ClockGroup &)
virtual ~LocationEditRow()
void set_number(int)
Gtk::Entry isrc_entry
Definition: location_ui.h:105
void name_entry_changed()
Gtk::CheckButton scms_check_button
Definition: location_ui.h:113
Gtk::Entry performer_entry
Definition: location_ui.h:110
Gtk::CheckButton hide_check_button
Definition: location_ui.h:99
PBD::ScopedConnectionList connections
Definition: location_ui.h:152
Gtk::Entry name_entry
Definition: location_ui.h:81
bool locate_to_clock(GdkEventButton *, AudioClock *)
void flags_changed()
ArdourWidgets::ArdourButton remove_button
Definition: location_ui.h:102
ArdourWidgets::ArdourButton locate_to_end_button
Definition: location_ui.h:94
guint32 i_am_the_modifier
Definition: location_ui.h:119
void performer_entry_changed()
void location_changed()
void locate_button_pressed(LocationPart part)
ClockGroup * _clock_group
Definition: location_ui.h:117
Gtk::CheckButton preemph_check_button
Definition: location_ui.h:115
void isrc_entry_changed()
Gtk::Label composer_label
Definition: location_ui.h:111
AudioClock length_clock
Definition: location_ui.h:96
ARDOUR::Location * get_location()
Definition: location_ui.h:57
void unset_clock_group()
Definition: location_ui.h:64
void set_session(ARDOUR::Session *)
ArdourWidgets::ArdourButton end_to_playhead_button
Definition: location_ui.h:93
Gtk::CheckButton section_check_button
Definition: location_ui.h:98
Gtk::HBox end_hbox
Definition: location_ui.h:91
void set_clock_editable_status()
LocationUI & ui()
Definition: location_ui.h:233
void set_session(ARDOUR::Session *)
LocationUI _ui
Definition: location_ui.h:236
bool on_delete_event(GdkEventAny *)
This is a default handler for the signal signal_delete_event().
void on_map()
This is a default handler for the signal signal_map().
void session_going_away()
Gtk::Button add_range_button
Definition: location_ui.h:192
Gtk::VBox range_frame_box
Definition: location_ui.h:191
XMLNode & get_state() const
void refresh_location_list()
void session_going_away()
std::string _state_node_name
Definition: location_ui.h:221
void map_locations(const ARDOUR::Locations::LocationList &)
Gtk::ScrolledWindow range_rows_scroller
Definition: location_ui.h:193
void add_new_location()
Gtk::VBox loc_frame_box
Definition: location_ui.h:186
Gtk::Button add_location_button
Definition: location_ui.h:187
void start_changed(ARDOUR::Location *)
void add_new_range()
LocationEditRow loop_edit_row
Definition: location_ui.h:180
Gtk::VBox location_rows
Definition: location_ui.h:189
ArdourWidgets::VPane loc_range_panes
Definition: location_ui.h:184
Gtk::VBox loop_punch_box
Definition: location_ui.h:182
LocationUI(std::string state_node_name="LocationUI")
void location_removed(ARDOUR::Location *)
bool _mode_set
Definition: location_ui.h:219
void location_added(ARDOUR::Location *)
AudioClock::Mode _mode
Definition: location_ui.h:218
AudioClock::Mode clock_mode_from_session_instant_xml()
void set_session(ARDOUR::Session *)
void location_remove_requested(ARDOUR::Location *)
ARDOUR::Location * newest_location
Definition: location_ui.h:176
LocationEditRow punch_edit_row
Definition: location_ui.h:181
ClockGroup * _clock_group
Definition: location_ui.h:215
int set_state(const XMLNode &)
guint32 i_am_the_modifier
Definition: location_ui.h:209
void location_redraw_ranges()
Gtk::ScrolledWindow location_rows_scroller
Definition: location_ui.h:188
Gtk::VBox range_rows
Definition: location_ui.h:194
gint do_location_remove(ARDOUR::Location *)
Definition: xml++.h:114