X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcrossfade_edit.h;h=0c496660959545a24cf59d47ac60bc52bf12dab1;hb=03c4335c1e20311fedd2c61c96a01d34447bf692;hp=5d9e665ba0f3f0515b3a1fe53af4402c972b97d0;hpb=658bb3ccd43658de18fbd43cd91a8e66650e27a7;p=ardour.git diff --git a/gtk2_ardour/crossfade_edit.h b/gtk2_ardour/crossfade_edit.h index 5d9e665ba0..0c49666095 100644 --- a/gtk2_ardour/crossfade_edit.h +++ b/gtk2_ardour/crossfade_edit.h @@ -1,21 +1,25 @@ /* - Copyright (C) 2000-2007 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ + * Copyright (C) 2005-2013 Paul Davis + * Copyright (C) 2005 Taybin Rutkin + * Copyright (C) 2006 Doug McLain + * Copyright (C) 2007-2009 David Robillard + * Copyright (C) 2009-2010 Carl Hetherington + * Copyright (C) 2017 Robin Gareus + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #ifndef __gtk_ardour_xfade_edit_h__ #define __gtk_ardour_xfade_edit_h__ @@ -28,7 +32,7 @@ #include "canvas/canvas.h" -#include "evoral/Curve.hpp" +#include "evoral/Curve.h" #include "ardour/session_handle.h" #include "ardour_dialog.h" @@ -44,12 +48,15 @@ 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 (); @@ -57,25 +64,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; @@ -83,46 +89,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::Rectangle* box; - ArdourCanvas::PolyLine* 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::Rectangle* toplevel; ArdourCanvas::GtkCanvas* canvas; struct 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(); + 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 {