2 * Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4 * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
5 * Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __gtk_ardour_region_edit_h__
23 #define __gtk_ardour_region_edit_h__
27 #include <gtkmm/label.h>
28 #include <gtkmm/entry.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/togglebutton.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/arrow.h>
33 #include <gtkmm/frame.h>
34 #include <gtkmm/table.h>
35 #include <gtkmm/adjustment.h>
36 #include <gtkmm/separator.h>
37 #include <gtkmm/spinbutton.h>
38 #include <gtkmm/listviewtext.h>
41 #include "pbd/signals.h"
43 #include "audio_clock.h"
44 #include "ardour_dialog.h"
45 #include "region_editor.h"
54 class RegionEditor : public ArdourDialog
57 RegionEditor (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Region>);
58 virtual ~RegionEditor ();
61 virtual void region_changed (const PBD::PropertyChange&);
67 boost::shared_ptr<ARDOUR::Region> _region;
69 void connect_editor_events ();
71 Gtk::Label name_label;
72 Gtk::Entry name_entry;
73 Gtk::ToggleButton audition_button;
75 Gtk::Label position_label;
77 Gtk::Label length_label;
78 Gtk::Label sync_relative_label;
79 Gtk::Label sync_absolute_label;
80 Gtk::Label start_label;
82 ClockGroup* _clock_group;
84 AudioClock position_clock;
86 AudioClock length_clock;
87 AudioClock sync_offset_relative_clock; ///< sync offset relative to the start of the region
88 AudioClock sync_offset_absolute_clock; ///< sync offset relative to the start of the timeline
89 AudioClock start_clock;
91 PBD::ScopedConnection state_connection;
92 PBD::ScopedConnection audition_connection;
94 void bounds_changed (const PBD::PropertyChange&);
97 void audition_state_changed (bool);
101 void name_entry_changed ();
102 void position_clock_changed ();
103 void end_clock_changed ();
104 void length_clock_changed ();
105 void sync_offset_absolute_clock_changed ();
106 void sync_offset_relative_clock_changed ();
108 void audition_button_toggled ();
110 gint bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (RegionEditor::*pmf)());
111 gint breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (RegionEditor::*pmf)());
113 bool on_delete_event (GdkEventAny *);
114 void handle_response (int);
116 bool spin_arrow_grab;
118 Gtk::Label _sources_label;
119 Gtk::ListViewText _sources;
121 void set_clock_mode_from_primary ();
124 #endif /* __gtk_ardour_region_edit_h__ */