X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fcrossfade.cc;h=7bbad9a1d1d5bf0f069845d487648c7ef619c353;hb=c35eae34c39c9962ac93110f67e9ea40f24834b6;hp=556f11125e6576d3347b1d6b455ba02523d2c498;hpb=c190aca4a0debe1220558d14afb8f1ab4adb959f;p=ardour.git diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 556f11125e..7bbad9a1d1 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2003-2006 Paul Davis + Copyright (C) 2003-2006 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 @@ -19,16 +19,16 @@ #include -#include +#include "pbd/stacktrace.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "ardour/types.h" +#include "ardour/crossfade.h" +#include "ardour/crossfade_compare.h" +#include "ardour/audioregion.h" +#include "ardour/playlist.h" +#include "ardour/utils.h" +#include "ardour/session.h" +#include "ardour/source.h" #include "i18n.h" #include @@ -51,15 +51,11 @@ Sample* Crossfade::crossfade_buffer_in = 0; void Crossfade::set_buffer_size (nframes_t sz) { - if (crossfade_buffer_out) { - delete [] crossfade_buffer_out; - crossfade_buffer_out = 0; - } + delete [] crossfade_buffer_out; + crossfade_buffer_out = 0; - if (crossfade_buffer_in) { - delete [] crossfade_buffer_in; - crossfade_buffer_in = 0; - } + delete [] crossfade_buffer_in; + crossfade_buffer_in = 0; if (sz) { crossfade_buffer_out = new Sample[sz]; @@ -73,22 +69,21 @@ Crossfade::operator== (const Crossfade& other) return (_in == other._in) && (_out == other._out); } -Crossfade::Crossfade (boost::shared_ptr in, boost::shared_ptr out, +Crossfade::Crossfade (boost::shared_ptr in, boost::shared_ptr out, nframes_t length, nframes_t position, AnchorPoint ap) : AudioRegion (in->session(), position, length, "foobar"), - _fade_in (Parameter(FadeInAutomation), 0.0, 2.0, 1.0), // linear (gain coefficient) => -inf..+6dB - _fade_out (Parameter(FadeOutAutomation), 0.0, 2.0, 1.0) // linear (gain coefficient) => -inf..+6dB + _fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB + _fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB { _in = in; _out = out; - _anchor_point = ap; _follow_overlap = false; - _active = Config->get_xfades_active (); + _active = _session.config.get_xfades_active (); _fixed = true; initialize (); @@ -96,11 +91,12 @@ Crossfade::Crossfade (boost::shared_ptr in, boost::shared_ptr