diff options
author | David Robillard <d@drobilla.net> | 2009-02-16 23:32:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-16 23:32:59 +0000 |
commit | 3e1eb6bcbd1bf5b9f3bfb64d8b9a5ad68c01368c (patch) | |
tree | 692ec9539da314cd42a2692231deaaeb36aa1720 | |
parent | 87c7b621035d0f3e9bbf613b54709470d6ee7ca5 (diff) |
Fix crash on audio record (time converter segfault wackiness).
git-svn-id: svn://localhost/ardour2/branches/3.0@4607 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/automation_line.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/automation_line.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/automation_region_view.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/automation_time_axis.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/region_gain_line.cc | 9 |
5 files changed, 11 insertions, 15 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index b621773682..ad32290a6b 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -56,14 +56,16 @@ using namespace PBD; using namespace Editing; using namespace Gnome; // for Canvas +static const Evoral::IdentityConverter<double, nframes_t> default_converter; + AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Group& parent, boost::shared_ptr<AutomationList> al, - const Evoral::TimeConverter<double, nframes_t>& converter) + const Evoral::TimeConverter<double, nframes_t>* converter) : trackview (tv) , _name (name) , alist (al) , _parent_group (parent) - , _time_converter (converter) + , _time_converter (converter ? (*converter) : default_converter) { _interpolation = al->interpolation(); points_visible = false; diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index c04f343bcf..342b8ba2a0 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -56,7 +56,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin public: AutomationLine (const string& name, TimeAxisView&, ArdourCanvas::Group&, boost::shared_ptr<ARDOUR::AutomationList>, - const Evoral::TimeConverter<double, nframes_t>& converter); + const Evoral::TimeConverter<double, nframes_t>* converter = 0); virtual ~AutomationLine (); void queue_reset (); @@ -128,7 +128,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin void set_colors(); void modify_point_y (ControlPoint&, double); - + protected: string _name; diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index d95c6a824b..98d402e348 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -71,7 +71,7 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis _line = boost::shared_ptr<AutomationLine>(new AutomationLine( ARDOUR::EventTypeMap::instance().to_symbol(list->parameter()), trackview, *get_canvas_group(), list, - _region->source(0)->time_converter())); + &_region->source(0)->time_converter())); _line->set_colors(); _line->set_interpolation(list->interpolation()); _line->show(); diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 93418201ec..f594901a28 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -211,14 +211,11 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro /* no regions, just a single line for the entire track (e.g. bus gain) */ } else { - static const Evoral::IdentityConverter<double,nframes_t> null_converter; - boost::shared_ptr<AutomationLine> line(new AutomationLine ( ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()), *this, *_canvas_display, - _control->alist(), - null_converter)); + _control->alist())); line->set_line_color (ARDOUR_UI::config()->canvasvar_ProcessorAutomationLine.get()); line->queue_reset (); diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc index 1bc4762eed..86ebe7a465 100644 --- a/gtk2_ardour/region_gain_line.cc +++ b/gtk2_ardour/region_gain_line.cc @@ -30,19 +30,16 @@ #include <ardour/session.h> - #include "i18n.h" - using namespace std; using namespace ARDOUR; using namespace PBD; AudioRegionGainLine::AudioRegionGainLine (const string & name, Session& s, AudioRegionView& r, ArdourCanvas::Group& parent, boost::shared_ptr<AutomationList> l) - : AutomationLine (name, r.get_time_axis_view(), parent, l, - Evoral::IdentityConverter<double, nframes_t>()), - session (s), - rv (r) + : AutomationLine (name, r.get_time_axis_view(), parent, l) + , session (s) + , rv (r) { // If this isn't true something is horribly wrong, and we'll get catastrophic gain values assert(l->parameter().type() == EnvelopeAutomation); |