fix mistaken "do not roll" conclusion in TransportFSM::compute_should_roll()
[ardour.git] / gtk2_ardour / audio_region_editor.h
1 /*
2  * Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2006-2013 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
5  * Copyright (C) 2013 John Emmas <john@creativepost.co.uk>
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 #ifndef __gtk_ardour_audio_region_edit_h__
24 #define __gtk_ardour_audio_region_edit_h__
25
26 #include <map>
27
28 #include <gtkmm/label.h>
29 #include <gtkmm/entry.h>
30 #include <gtkmm/box.h>
31 #include <gtkmm/togglebutton.h>
32 #include <gtkmm/button.h>
33 #include <gtkmm/arrow.h>
34 #include <gtkmm/frame.h>
35 #include <gtkmm/table.h>
36 #include <gtkmm/adjustment.h>
37 #include <gtkmm/separator.h>
38 #include <gtkmm/spinbutton.h>
39
40
41 #include "pbd/signals.h"
42 #include "pbd/crossthread.h"
43
44 #include "audio_clock.h"
45 #include "ardour_dialog.h"
46 #include "region_editor.h"
47
48 namespace ARDOUR {
49         class AudioRegion;
50         class Session;
51 }
52
53 class AudioRegionView;
54
55 class AudioRegionEditor : public RegionEditor
56 {
57 public:
58         AudioRegionEditor (ARDOUR::Session*, boost::shared_ptr<ARDOUR::AudioRegion>);
59         ~AudioRegionEditor ();
60
61         void peak_amplitude_thread ();
62
63 private:
64
65         void region_changed (PBD::PropertyChange const &);
66
67         void gain_changed ();
68         void gain_adjustment_changed ();
69
70         boost::shared_ptr<ARDOUR::AudioRegion> _audio_region;
71
72         Gtk::Label gain_label;
73         Gtk::Adjustment gain_adjustment;
74         Gtk::SpinButton gain_entry;
75
76         Gtk::Label _peak_amplitude_label;
77         Gtk::Entry _peak_amplitude;
78
79         void signal_peak_thread ();
80         pthread_t _peak_amplitude_thread_handle;
81         void peak_amplitude_found (double);
82         PBD::Signal1<void, double> PeakAmplitudeFound;
83         PBD::ScopedConnection _peak_amplitude_connection;
84         CrossThreadChannel _peak_channel;
85 };
86
87 #endif /* __gtk_ardour_audio_region_edit_h__ */