X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcrossfade_edit.h;h=f18b26ae8ad30262de231af77c94a0f469d30d05;hb=bb2032795941dbb0bf8e8f33a4acc2e075e0104f;hp=29a66b3747aeb13a583d744954afb88c4542155e;hpb=aae367b63c9b619db1e40f27dc334c6987219481;p=ardour.git diff --git a/gtk2_ardour/crossfade_edit.h b/gtk2_ardour/crossfade_edit.h index 29a66b3747..f18b26ae8a 100644 --- a/gtk2_ardour/crossfade_edit.h +++ b/gtk2_ardour/crossfade_edit.h @@ -26,11 +26,12 @@ #include #include +#include "canvas/canvas.h" + #include "evoral/Curve.hpp" #include "ardour/session_handle.h" #include "ardour_dialog.h" -#include "canvas.h" namespace ARDOUR { @@ -39,9 +40,19 @@ namespace ARDOUR class Crossfade; } +namespace ArdourCanvas { + class Rectangle; + class Line; + class Polygon; +} + +namespace ArdourWaveview { + class WaveView; +} + class CrossfadeEditor : public ArdourDialog { - public: +public: CrossfadeEditor (ARDOUR::Session*, boost::shared_ptr, double miny, double maxy); ~CrossfadeEditor (); @@ -49,25 +60,24 @@ class CrossfadeEditor : public ArdourDialog static const double canvas_border; - /* these are public so that a caller/subclass can make them do the right thing. - */ + /* these are public so that a caller/subclass can make them do the right thing. */ Gtk::Button* cancel_button; Gtk::Button* ok_button; struct PresetPoint { - double x; - double y; + double x; + double y; - PresetPoint (double a, double b) - : x (a), y (b) {} + PresetPoint (double a, double b) + : x (a), y (b) {} }; struct Preset : public std::list { - const char* name; - const char* image_name; + const char* name; + const char* image_name; - Preset (const char* n, const char* x) : name (n), image_name (x) {} + Preset (const char* n, const char* x) : name (n), image_name (x) {} }; typedef std::list Presets; @@ -75,46 +85,46 @@ class CrossfadeEditor : public ArdourDialog static Presets* fade_in_presets; static Presets* fade_out_presets; - protected: +protected: bool on_key_press_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*); - private: +private: boost::shared_ptr xfade; Gtk::VBox vpacker; struct Point { - ~Point(); + ~Point(); - ArdourCanvas::SimpleRect* box; - ArdourCanvas::Line* curve; - double x; - double y; + ArdourCanvas::Rectangle* box; + ArdourCanvas::PolyLine* curve; + double x; + double y; - static const int32_t size; + static const int32_t size; - void move_to (double x, double y, double xfract, double yfract); + void move_to (double x, double y, double xfract, double yfract); }; struct PointSorter { - bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) { - return a->x < b->x; - } + bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) { + return a->x < b->x; + } }; - ArdourCanvas::SimpleRect* toplevel; - ArdourCanvas::Canvas* canvas; + ArdourCanvas::Rectangle* toplevel; + ArdourCanvas::GtkCanvas* canvas; struct Half { - ArdourCanvas::Line* line; - ArdourCanvas::Polygon* shading; - std::list points; - ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */ - ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */ - std::vector waves; - - Half(); + ArdourCanvas::PolyLine* line; + ArdourCanvas::Polygon* shading; + std::list points; + ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */ + ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */ + std::vector waves; + + Half(); }; enum WhichFade { @@ -183,7 +193,7 @@ class CrossfadeEditor : public ArdourDialog void set (const ARDOUR::AutomationList& alist, WhichFade); - PBD::ScopedConnection peaks_ready_connection; + PBD::ScopedConnection* _peaks_ready_connection; PBD::ScopedConnection state_connection; void make_waves (boost::shared_ptr, WhichFade); @@ -213,7 +223,7 @@ class CrossfadeEditor : public ArdourDialog void audition_right_dry (); void audition_right (); - void xfade_changed (ARDOUR::Change); + void xfade_changed (const PBD::PropertyChange&); void dump (); };