diff options
author | David Robillard <d@drobilla.net> | 2009-02-19 19:42:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-19 19:42:25 +0000 |
commit | 75c15679bf1551dcb93d4fa62075517c66d3b222 (patch) | |
tree | 8a101d994120ee09c3560aebe99b7e565a137d1f /gtk2_ardour | |
parent | c006ff176250a01621437907652ef012789dba2f (diff) |
Only create a Curve for an AutomationList if we need it.
Fix crash on crossfade editor show (ticket 2442).
git-svn-id: svn://localhost/ardour2/branches/3.0@4641 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/crossfade_edit.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/crossfade_edit.h | 3 |
3 files changed, 8 insertions, 8 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 4ec3531000..6af8496e9b 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -33,6 +33,8 @@ #include <pbd/memento_command.h> #include <pbd/stacktrace.h> +#include <evoral/Curve.hpp> + #include "streamview.h" #include "audio_region_view.h" #include "audio_time_axis.h" diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index eb5cb2fba9..f6a0d7e1f7 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -66,10 +66,9 @@ CrossfadeEditor::Presets* CrossfadeEditor::fade_in_presets = 0; CrossfadeEditor::Presets* CrossfadeEditor::fade_out_presets = 0; CrossfadeEditor::Half::Half () - : line (0), - //normative_curve (Evoral::Parameter(GainAutomation, 0.0, 1.0, 1.0)), // FIXME: GainAutomation? - normative_curve (Evoral::Parameter(GainAutomation)), - gain_curve (Evoral::Parameter(GainAutomation)) + : line (0) + , normative_curve (Evoral::Parameter(GainAutomation)) + , gain_curve (Evoral::Parameter(GainAutomation)) { } @@ -726,7 +725,7 @@ CrossfadeEditor::redraw () fade[current].shading->property_points() = spts; for (vector<ArdourCanvas::WaveView*>::iterator i = fade[current].waves.begin(); i != fade[current].waves.end(); ++i) { - (*i)->property_gain_src() = &fade[current].gain_curve; + (*i)->property_gain_src() = static_cast<Evoral::Curve*>(&fade[current].gain_curve.curve()); } } @@ -1124,7 +1123,7 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh waveview->property_sourcefile_length_function() = (void*) sourcefile_length_from_c; waveview->property_peak_function() = (void*) region_read_peaks_from_c; waveview->property_gain_function() = (void*) curve_get_vector_from_c; - waveview->property_gain_src() = &fade[which].gain_curve; + waveview->property_gain_src() = static_cast<Evoral::Curve*>(&fade[which].gain_curve.curve()); waveview->property_x() = canvas_border; waveview->property_y() = yoff; waveview->property_height() = ht; diff --git a/gtk2_ardour/crossfade_edit.h b/gtk2_ardour/crossfade_edit.h index f7f607393f..685dc43772 100644 --- a/gtk2_ardour/crossfade_edit.h +++ b/gtk2_ardour/crossfade_edit.h @@ -96,8 +96,7 @@ class CrossfadeEditor : public ArdourDialog void move_to (double x, double y, double xfract, double yfract); }; - struct PointSorter - { + struct PointSorter { bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) { return a->x < b->x; } |