incomplete merge of master into windows (requires upcoming changes to master to be...
[ardour.git] / gtk2_ardour / audio_region_editor.h
index ee7d6bd54aab66798e7656fb973a190d6cdd77e7..0d9292b483d84e16ebb30823a2e9c2377355d302 100644 (file)
 #include <libgnomecanvas/libgnomecanvas.h>
 
 #include "pbd/signals.h"
+#ifdef WIN32
+#include "pbd/glib_semaphore.h"
+#else
+#include "pbd/crossthread.h"
+#endif
 
 #include "audio_clock.h"
 #include "ardour_dialog.h"
@@ -53,19 +58,37 @@ class AudioRegionEditor : public RegionEditor
 {
   public:
        AudioRegionEditor (ARDOUR::Session*, boost::shared_ptr<ARDOUR::AudioRegion>);
+       ~AudioRegionEditor ();
+
+       void peak_amplitude_thread ();
 
   private:
 
        void region_changed (PBD::PropertyChange const &);
-       
+
        void gain_changed ();
        void gain_adjustment_changed ();
-       
+
        boost::shared_ptr<ARDOUR::AudioRegion> _audio_region;
 
        Gtk::Label gain_label;
        Gtk::Adjustment gain_adjustment;
        Gtk::SpinButton gain_entry;
+
+       Gtk::Label _peak_amplitude_label;
+       Gtk::Entry _peak_amplitude;
+
+       void signal_peak_thread ();
+       void wait_for_signal ();
+       pthread_t _peak_amplitude_thread_handle;
+       void peak_amplitude_found (double);
+       PBD::Signal1<void, double> PeakAmplitudeFound;
+       PBD::ScopedConnection _peak_amplitude_connection;
+#ifdef WIN32
+       PBD::GlibSemaphore m_peak_sem;
+#else
+       CrossThreadChannel _peak_channel;
+#endif
 };
 
 #endif /* __gtk_ardour_audio_region_edit_h__ */