Fix DSP load sorting with inactive plugins
[ardour.git] / gtk2_ardour / region_editor.h
1 /*
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>
6  *
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.
11  *
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.
16  *
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.
20  */
21
22 #ifndef __gtk_ardour_region_edit_h__
23 #define __gtk_ardour_region_edit_h__
24
25 #include <map>
26
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>
39
40
41 #include "pbd/signals.h"
42
43 #include "audio_clock.h"
44 #include "ardour_dialog.h"
45 #include "region_editor.h"
46
47 namespace ARDOUR {
48         class Region;
49         class Session;
50 }
51
52 class ClockGroup;
53
54 class RegionEditor : public ArdourDialog
55 {
56 public:
57         RegionEditor (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Region>);
58         virtual ~RegionEditor ();
59
60 protected:
61         virtual void region_changed (const PBD::PropertyChange&);
62
63         Gtk::Table _table;
64         int _table_row;
65
66 private:
67         boost::shared_ptr<ARDOUR::Region> _region;
68
69         void connect_editor_events ();
70
71         Gtk::Label name_label;
72         Gtk::Entry name_entry;
73         Gtk::ToggleButton audition_button;
74
75         Gtk::Label position_label;
76         Gtk::Label end_label;
77         Gtk::Label length_label;
78         Gtk::Label sync_relative_label;
79         Gtk::Label sync_absolute_label;
80         Gtk::Label start_label;
81
82         ClockGroup* _clock_group;
83
84         AudioClock position_clock;
85         AudioClock end_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;
90
91         PBD::ScopedConnection state_connection;
92         PBD::ScopedConnection audition_connection;
93
94         void bounds_changed (const PBD::PropertyChange&);
95         void name_changed ();
96
97         void audition_state_changed (bool);
98
99         void activation ();
100
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 ();
107
108         void audition_button_toggled ();
109
110         gint bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (RegionEditor::*pmf)());
111         gint breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (RegionEditor::*pmf)());
112
113         bool on_delete_event (GdkEventAny *);
114         void handle_response (int);
115
116         bool spin_arrow_grab;
117
118         Gtk::Label _sources_label;
119         Gtk::ListViewText _sources;
120
121         void set_clock_mode_from_primary ();
122 };
123
124 #endif /* __gtk_ardour_region_edit_h__ */