objects don't have a time domain, they have a time domain provider (libs)
This commit is contained in:
parent
e430b54554
commit
3b565693c8
@ -43,7 +43,7 @@ using namespace PBD;
|
||||
#define GAIN_COEFF_DELTA (1e-5)
|
||||
|
||||
Amp::Amp (Session& s, const std::string& name, std::shared_ptr<GainControl> gc, bool control_midi_also)
|
||||
: Processor(s, "Amp", Temporal::AudioTime)
|
||||
: Processor(s, "Amp", Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _apply_gain_automation(false)
|
||||
, _current_gain(GAIN_COEFF_ZERO)
|
||||
, _current_automation_sample (INT64_MAX)
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include "evoral/ControlSet.h"
|
||||
|
||||
#include "temporal/domain_provider.h"
|
||||
|
||||
#include "ardour/libardour_visibility.h"
|
||||
#include "ardour/slavable.h"
|
||||
#include "ardour/types.h"
|
||||
@ -48,10 +50,10 @@ class AutomationControl;
|
||||
/* The inherited ControlSet is virtual because AutomatableSequence inherits
|
||||
* from this AND EvoralSequence, which is also a ControlSet
|
||||
*/
|
||||
class LIBARDOUR_API Automatable : virtual public Evoral::ControlSet, public Slavable
|
||||
class LIBARDOUR_API Automatable : virtual public Evoral::ControlSet, public Slavable, public Temporal::TimeDomainProvider
|
||||
{
|
||||
public:
|
||||
Automatable(Session&, Temporal::TimeDomain);
|
||||
Automatable(Session&, Temporal::TimeDomainProvider const &);
|
||||
Automatable (const Automatable& other);
|
||||
|
||||
virtual ~Automatable();
|
||||
@ -117,8 +119,6 @@ public:
|
||||
|
||||
PBD::Signal0<void> AutomationStateChanged;
|
||||
|
||||
Temporal::TimeDomain time_domain() const { return _time_domain; }
|
||||
|
||||
protected:
|
||||
Session& _a_session;
|
||||
|
||||
@ -141,7 +141,6 @@ protected:
|
||||
|
||||
private:
|
||||
PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals
|
||||
Temporal::TimeDomain _time_domain;
|
||||
};
|
||||
|
||||
|
||||
|
@ -30,15 +30,15 @@ namespace ARDOUR {
|
||||
template<typename T>
|
||||
class /*LIBARDOUR_API*/ AutomatableSequence : public Automatable, public Evoral::Sequence<T> {
|
||||
public:
|
||||
AutomatableSequence(Session& s, Temporal::TimeDomain td)
|
||||
AutomatableSequence(Session& s, Temporal::TimeDomainProvider const & tdp)
|
||||
: Evoral::ControlSet()
|
||||
, Automatable(s, td)
|
||||
, Automatable(s, tdp)
|
||||
, Evoral::Sequence<T>(EventTypeMap::instance())
|
||||
{}
|
||||
|
||||
AutomatableSequence(const AutomatableSequence<T>& other)
|
||||
: Evoral::ControlSet(other)
|
||||
, Automatable(other._a_session, other.time_domain())
|
||||
, Automatable(other._a_session, other)
|
||||
, Evoral::Sequence<T>(other)
|
||||
{}
|
||||
|
||||
|
@ -73,8 +73,8 @@ private:
|
||||
class LIBARDOUR_API AutomationList : public Evoral::ControlList, public PBD::StatefulDestructible
|
||||
{
|
||||
public:
|
||||
AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc, Temporal::TimeDomain);
|
||||
AutomationList (const Evoral::Parameter& id, Temporal::TimeDomain);
|
||||
AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc, Temporal::TimeDomainProvider const &);
|
||||
AutomationList (const Evoral::Parameter& id, Temporal::TimeDomainProvider const &);
|
||||
AutomationList (const XMLNode&, Evoral::Parameter id);
|
||||
AutomationList (const AutomationList&);
|
||||
AutomationList (const AutomationList&, timepos_t const & start, timepos_t const & end);
|
||||
@ -82,7 +82,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<ControlList> create(const Evoral::Parameter& id,
|
||||
const Evoral::ParameterDescriptor& desc,
|
||||
Temporal::TimeDomain);
|
||||
Temporal::TimeDomainProvider const &);
|
||||
|
||||
AutomationList& operator= (const AutomationList&);
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
|
||||
static const std::string state_node_name;
|
||||
|
||||
DiskIOProcessor (Session&, Track&, const std::string& name, Flag f, Temporal::TimeDomain td);
|
||||
DiskIOProcessor (Session&, Track&, const std::string& name, Flag f, Temporal::TimeDomainProvider const &);
|
||||
|
||||
virtual ~DiskIOProcessor ();
|
||||
|
||||
|
@ -41,7 +41,7 @@ template <typename T> class MidiRingBuffer;
|
||||
class LIBARDOUR_API DiskReader : public DiskIOProcessor
|
||||
{
|
||||
public:
|
||||
DiskReader (Session&, Track&, std::string const& name, Temporal::TimeDomain, DiskIOProcessor::Flag f = DiskIOProcessor::Flag (0));
|
||||
DiskReader (Session&, Track&, std::string const& name, Temporal::TimeDomainProvider const &, DiskIOProcessor::Flag f = DiskIOProcessor::Flag (0));
|
||||
~DiskReader ();
|
||||
|
||||
bool set_name (std::string const& str);
|
||||
|
@ -34,7 +34,7 @@ class InternalSend;
|
||||
class LIBARDOUR_API InternalReturn : public Processor
|
||||
{
|
||||
public:
|
||||
InternalReturn (Session&, Temporal::TimeDomain, std::string const& name = "Return");
|
||||
InternalReturn (Session&, Temporal::TimeDomainProvider const &, std::string const& name = "Return");
|
||||
|
||||
void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
|
||||
bool configure_io (ChanCount, ChanCount);
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false);
|
||||
|
||||
IOProcessor (Session&, std::shared_ptr<IO> input, std::shared_ptr<IO> output,
|
||||
const std::string& proc_name, Temporal::TimeDomain, bool sendish=false);
|
||||
const std::string& proc_name, Temporal::TimeDomainProvider const &, bool sendish=false);
|
||||
|
||||
virtual ~IOProcessor ();
|
||||
|
||||
|
@ -36,7 +36,7 @@ class Session;
|
||||
class LIBARDOUR_API MonitorControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomain);
|
||||
MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomainProvider const &);
|
||||
~MonitorControl() {}
|
||||
|
||||
MonitorChoice monitoring_choice() const { return static_cast<MonitorChoice> ((int)get_value()); }
|
||||
|
@ -28,7 +28,7 @@ class AudioPort;
|
||||
class LIBARDOUR_API MonitorReturn : public InternalReturn
|
||||
{
|
||||
public:
|
||||
MonitorReturn (Session&, Temporal::TimeDomain);
|
||||
MonitorReturn (Session&, Temporal::TimeDomainProvider const &);
|
||||
~MonitorReturn ();
|
||||
|
||||
void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
|
||||
|
@ -36,7 +36,7 @@ class Muteable;
|
||||
class LIBARDOUR_API MuteControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
MuteControl (Session& session, std::string const& name, Muteable&, Temporal::TimeDomain td);
|
||||
MuteControl (Session& session, std::string const& name, Muteable&, Temporal::TimeDomainProvider const &);
|
||||
|
||||
double get_value () const;
|
||||
double get_save_value() const { return muted_by_self(); }
|
||||
|
@ -36,11 +36,11 @@ class Pannable;
|
||||
class LIBARDOUR_API PanControllable : public AutomationControl
|
||||
{
|
||||
public:
|
||||
PanControllable (Session& s, std::string name, Pannable* o, Evoral::Parameter param, Temporal::TimeDomain td)
|
||||
PanControllable (Session& s, std::string name, Pannable* o, Evoral::Parameter param, Temporal::TimeDomainProvider const & tdp)
|
||||
: AutomationControl (s,
|
||||
param,
|
||||
ParameterDescriptor(param),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(param, td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(param, tdp)),
|
||||
name)
|
||||
, owner (o)
|
||||
{}
|
||||
|
@ -38,7 +38,7 @@ class Panner;
|
||||
class LIBARDOUR_API Pannable : public PBD::Stateful, public Automatable, public SessionHandleRef
|
||||
{
|
||||
public:
|
||||
Pannable (Session& s, Temporal::TimeDomain);
|
||||
Pannable (Session& s, Temporal::TimeDomainProvider const &);
|
||||
~Pannable ();
|
||||
|
||||
std::shared_ptr<AutomationControl> pan_azimuth_control;
|
||||
|
@ -51,7 +51,7 @@ class Pannable;
|
||||
class LIBARDOUR_API PannerShell : public SessionObject
|
||||
{
|
||||
public:
|
||||
PannerShell (std::string name, Session&, std::shared_ptr<Pannable>, Temporal::TimeDomain, bool is_send = false);
|
||||
PannerShell (std::string name, Session&, std::shared_ptr<Pannable>, Temporal::TimeDomainProvider const &, bool is_send = false);
|
||||
virtual ~PannerShell ();
|
||||
|
||||
std::string describe_parameter (Evoral::Parameter param);
|
||||
|
@ -38,7 +38,7 @@ class Session;
|
||||
class LIBARDOUR_API PhaseControl : public AutomationControl
|
||||
{
|
||||
public:
|
||||
PhaseControl (Session& session, std::string const & name, Temporal::TimeDomain);
|
||||
PhaseControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const &);
|
||||
|
||||
/* There are two approaches to designing/using a PhaseControl. One is
|
||||
* to have one such control for every channel of the control's
|
||||
|
@ -59,7 +59,7 @@ class Plugin;
|
||||
class LIBARDOUR_API PluginInsert : public Processor, public PlugInsertBase, public std::enable_shared_from_this <PluginInsert>
|
||||
{
|
||||
public:
|
||||
PluginInsert (Session&, Temporal::TimeDomain td, std::shared_ptr<Plugin> = std::shared_ptr<Plugin>());
|
||||
PluginInsert (Session&, Temporal::TimeDomainProvider const & tdp, std::shared_ptr<Plugin> = std::shared_ptr<Plugin>());
|
||||
~PluginInsert ();
|
||||
|
||||
void drop_references ();
|
||||
|
@ -51,7 +51,7 @@ class LIBARDOUR_API Processor : public SessionObject, public Automatable, public
|
||||
public:
|
||||
static const std::string state_node_name;
|
||||
|
||||
Processor(Session&, const std::string& name, Temporal::TimeDomain);
|
||||
Processor(Session&, const std::string& name, Temporal::TimeDomainProvider const &);
|
||||
Processor (const Processor& other);
|
||||
|
||||
virtual ~Processor();
|
||||
|
@ -36,7 +36,7 @@ class Session;
|
||||
class LIBARDOUR_API RecordEnableControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
RecordEnableControl (Session& session, std::string const & name, Recordable& m, Temporal::TimeDomain);
|
||||
RecordEnableControl (Session& session, std::string const & name, Recordable& m, Temporal::TimeDomainProvider const &);
|
||||
~RecordEnableControl() {}
|
||||
|
||||
/* Most (Slavable)AutomationControls do not override this, but we need
|
||||
|
@ -34,7 +34,7 @@ class Session;
|
||||
class LIBARDOUR_API RecordSafeControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
RecordSafeControl (Session& session, std::string const & name, Recordable& m, Temporal::TimeDomain td);
|
||||
RecordSafeControl (Session& session, std::string const & name, Recordable& m, Temporal::TimeDomainProvider const & td);
|
||||
~RecordSafeControl() {}
|
||||
|
||||
protected:
|
||||
|
@ -68,6 +68,7 @@
|
||||
#include "lua/luastate.h"
|
||||
|
||||
#include "temporal/range.h"
|
||||
#include "temporal/domain_provider.h"
|
||||
|
||||
#include "midi++/types.h"
|
||||
#include "midi++/mmc.h"
|
||||
@ -199,7 +200,7 @@ private:
|
||||
};
|
||||
|
||||
/** Ardour Session */
|
||||
class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager, public TransportAPI
|
||||
class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager, public TransportAPI, public Temporal::TimeDomainProvider
|
||||
{
|
||||
private:
|
||||
|
||||
|
@ -34,7 +34,7 @@ class Muteable;
|
||||
class LIBARDOUR_API SoloControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
SoloControl (Session& session, std::string const & name, Soloable& soloable, Muteable& m, Temporal::TimeDomain);
|
||||
SoloControl (Session& session, std::string const & name, Soloable& soloable, Muteable& m, Temporal::TimeDomainProvider const &);
|
||||
|
||||
double get_value () const;
|
||||
double get_save_value() const { return self_soloed(); }
|
||||
|
@ -36,7 +36,7 @@ class Muteable;
|
||||
class LIBARDOUR_API SoloIsolateControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
SoloIsolateControl (Session& session, std::string const & name, Soloable& soloable, Temporal::TimeDomain);
|
||||
SoloIsolateControl (Session& session, std::string const & name, Soloable& soloable, Temporal::TimeDomainProvider const &);
|
||||
|
||||
double get_value () const;
|
||||
|
||||
|
@ -34,7 +34,7 @@ class Session;
|
||||
class LIBARDOUR_API SoloSafeControl : public SlavableAutomationControl
|
||||
{
|
||||
public:
|
||||
SoloSafeControl (Session& session, std::string const & name, Temporal::TimeDomain);
|
||||
SoloSafeControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const &);
|
||||
|
||||
double get_value () const;
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include <boost/utility.hpp>
|
||||
|
||||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour/automatable.h"
|
||||
|
@ -205,17 +205,17 @@ AudioRegion::register_properties ()
|
||||
add_property (_envelope);
|
||||
}
|
||||
|
||||
#define AUDIOREGION_STATE_DEFAULT \
|
||||
#define AUDIOREGION_STATE_DEFAULT(tdp) \
|
||||
_envelope_active (Properties::envelope_active, false) \
|
||||
, _default_fade_in (Properties::default_fade_in, true) \
|
||||
, _default_fade_out (Properties::default_fade_out, true) \
|
||||
, _fade_in_active (Properties::fade_in_active, true) \
|
||||
, _fade_out_active (Properties::fade_out_active, true) \
|
||||
, _scale_amplitude (Properties::scale_amplitude, 1.0) \
|
||||
, _fade_in (Properties::fade_in, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::AudioTime))) \
|
||||
, _inverse_fade_in (Properties::inverse_fade_in, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::AudioTime))) \
|
||||
, _fade_out (Properties::fade_out, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeOutAutomation), Temporal::AudioTime))) \
|
||||
, _inverse_fade_out (Properties::inverse_fade_out, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeOutAutomation), Temporal::AudioTime)))
|
||||
, _fade_in (Properties::fade_in, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), tdp))) \
|
||||
, _inverse_fade_in (Properties::inverse_fade_in, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), tdp))) \
|
||||
, _fade_out (Properties::fade_out, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeOutAutomation), tdp))) \
|
||||
, _inverse_fade_out (Properties::inverse_fade_out, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeOutAutomation), tdp)))
|
||||
|
||||
#define AUDIOREGION_COPY_STATE(other) \
|
||||
_envelope_active (Properties::envelope_active, other->_envelope_active) \
|
||||
@ -248,9 +248,9 @@ AudioRegion::init ()
|
||||
/** Constructor for use by derived types only */
|
||||
AudioRegion::AudioRegion (Session& s, timepos_t const & start, timecnt_t const & len, std::string name)
|
||||
: Region (s, start, len, name, DataType::AUDIO)
|
||||
, AUDIOREGION_STATE_DEFAULT
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter(EnvelopeAutomation), Temporal::AudioTime)))
|
||||
, _automatable (s, Temporal::AudioTime)
|
||||
, AUDIOREGION_STATE_DEFAULT(Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter(EnvelopeAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime))))
|
||||
, _automatable (s, Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -261,9 +261,9 @@ AudioRegion::AudioRegion (Session& s, timepos_t const & start, timecnt_t const
|
||||
/** Basic AudioRegion constructor */
|
||||
AudioRegion::AudioRegion (const SourceList& srcs)
|
||||
: Region (srcs)
|
||||
, AUDIOREGION_STATE_DEFAULT
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter(EnvelopeAutomation), Temporal::AudioTime)))
|
||||
, _automatable(srcs[0]->session(), Temporal::AudioTime)
|
||||
, AUDIOREGION_STATE_DEFAULT(Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter(EnvelopeAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime))))
|
||||
, _automatable(srcs[0]->session(), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -278,7 +278,7 @@ AudioRegion::AudioRegion (std::shared_ptr<const AudioRegion> other)
|
||||
* to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset.
|
||||
*/
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (*other->_envelope.val(), timepos_t (Temporal::AudioTime), other->len_as_tpos ())))
|
||||
, _automatable (other->session(), Temporal::AudioTime)
|
||||
, _automatable (other->session(), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -300,7 +300,7 @@ AudioRegion::AudioRegion (std::shared_ptr<const AudioRegion> other, timecnt_t co
|
||||
to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset.
|
||||
*/
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (*other->_envelope.val(), timepos_t (offset.samples()), other->len_as_tpos ())))
|
||||
, _automatable (other->session(), Temporal::AudioTime)
|
||||
, _automatable (other->session(), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -319,7 +319,7 @@ AudioRegion::AudioRegion (std::shared_ptr<const AudioRegion> other, const Source
|
||||
: Region (std::static_pointer_cast<const Region>(other), srcs)
|
||||
, AUDIOREGION_COPY_STATE (other)
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList (*other->_envelope.val())))
|
||||
, _automatable (other->session(), Temporal::AudioTime)
|
||||
, _automatable (other->session(), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -336,9 +336,9 @@ AudioRegion::AudioRegion (std::shared_ptr<const AudioRegion> other, const Source
|
||||
|
||||
AudioRegion::AudioRegion (SourceList& srcs)
|
||||
: Region (srcs)
|
||||
, AUDIOREGION_STATE_DEFAULT
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList(Evoral::Parameter(EnvelopeAutomation), Temporal::AudioTime)))
|
||||
, _automatable(srcs[0]->session(), Temporal::AudioTime)
|
||||
, AUDIOREGION_STATE_DEFAULT(srcs[0]->session())
|
||||
, _envelope (Properties::envelope, std::shared_ptr<AutomationList> (new AutomationList(Evoral::Parameter(EnvelopeAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime))))
|
||||
, _automatable(srcs[0]->session(), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _fade_in_suspended (0)
|
||||
, _fade_out_suspended (0)
|
||||
{
|
||||
@ -1037,9 +1037,9 @@ void
|
||||
AudioRegion::set_fade_in (FadeShape shape, samplecnt_t len)
|
||||
{
|
||||
const ARDOUR::ParameterDescriptor desc(FadeInAutomation);
|
||||
std::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::AudioTime));
|
||||
std::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::AudioTime));
|
||||
std::shared_ptr<Evoral::ControlList> c3 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::AudioTime));
|
||||
std::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
std::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
std::shared_ptr<Evoral::ControlList> c3 (new Evoral::ControlList (FadeInAutomation, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
|
||||
_fade_in->freeze ();
|
||||
_fade_in->clear ();
|
||||
@ -1120,8 +1120,8 @@ void
|
||||
AudioRegion::set_fade_out (FadeShape shape, samplecnt_t len)
|
||||
{
|
||||
const ARDOUR::ParameterDescriptor desc(FadeOutAutomation);
|
||||
std::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeOutAutomation, desc, Temporal::AudioTime));
|
||||
std::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeOutAutomation, desc, Temporal::AudioTime));
|
||||
std::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeOutAutomation, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
std::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeOutAutomation, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
|
||||
_fade_out->freeze ();
|
||||
_fade_out->clear ();
|
||||
|
@ -153,7 +153,7 @@ Auditioner::load_synth ()
|
||||
|
||||
std::shared_ptr<Plugin> p = audition_synth_info->load (_session);
|
||||
if (p) {
|
||||
asynth = std::shared_ptr<Processor> (new PluginInsert (_session, time_domain(), p));
|
||||
asynth = std::shared_ptr<Processor> (new PluginInsert (_session, *this, p));
|
||||
}
|
||||
|
||||
if (asynth) {
|
||||
|
@ -59,17 +59,18 @@ bool Automatable::skip_saving_automation = false;
|
||||
|
||||
const string Automatable::xml_node_name = X_("Automation");
|
||||
|
||||
Automatable::Automatable(Session& session, Temporal::TimeDomain td)
|
||||
Automatable::Automatable(Session& session, Temporal::TimeDomainProvider const & tdp)
|
||||
: ControlSet ()
|
||||
, TimeDomainProvider (tdp)
|
||||
, _a_session(session)
|
||||
, _automated_controls (new AutomationControlList ())
|
||||
, _time_domain (td)
|
||||
{
|
||||
}
|
||||
|
||||
Automatable::Automatable (const Automatable& other)
|
||||
: ControlSet (other)
|
||||
, Slavable ()
|
||||
, TimeDomainProvider (other.time_domain(), other._a_session)
|
||||
, _a_session (other._a_session)
|
||||
, _automated_controls (new AutomationControlList)
|
||||
{
|
||||
@ -554,7 +555,7 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||
if (!Variant::type_is_numeric(desc.datatype)) {
|
||||
make_list = false; // Can't automate non-numeric data yet
|
||||
} else {
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, Temporal::AudioTime));
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
}
|
||||
control = new PluginInsert::PluginPropertyControl(pi, param, desc, list);
|
||||
}
|
||||
@ -574,35 +575,35 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||
} else if (param.type() == PanAzimuthAutomation || param.type() == PanWidthAutomation || param.type() == PanElevationAutomation) {
|
||||
Pannable* pannable = dynamic_cast<Pannable*>(this);
|
||||
if (pannable) {
|
||||
control = new PanControllable (_a_session, describe_parameter (param), pannable, param, time_domain());
|
||||
control = new PanControllable (_a_session, describe_parameter (param), pannable, param, *this);
|
||||
} else {
|
||||
warning << "PanAutomation for non-Pannable" << endl;
|
||||
}
|
||||
} else if (param.type() == RecEnableAutomation) {
|
||||
Recordable* re = dynamic_cast<Recordable*> (this);
|
||||
if (re) {
|
||||
control = new RecordEnableControl (_a_session, X_("recenable"), *re, time_domain());
|
||||
control = new RecordEnableControl (_a_session, X_("recenable"), *re, *this);
|
||||
}
|
||||
} else if (param.type() == MonitoringAutomation) {
|
||||
Monitorable* m = dynamic_cast<Monitorable*>(this);
|
||||
if (m) {
|
||||
control = new MonitorControl (_a_session, X_("monitor"), *m, time_domain());
|
||||
control = new MonitorControl (_a_session, X_("monitor"), *m, *this);
|
||||
}
|
||||
} else if (param.type() == SoloAutomation) {
|
||||
Soloable* s = dynamic_cast<Soloable*>(this);
|
||||
Muteable* m = dynamic_cast<Muteable*>(this);
|
||||
if (s && m) {
|
||||
control = new SoloControl (_a_session, X_("solo"), *s, *m, time_domain());
|
||||
control = new SoloControl (_a_session, X_("solo"), *s, *m, *this);
|
||||
}
|
||||
} else if (param.type() == MuteAutomation) {
|
||||
Muteable* m = dynamic_cast<Muteable*>(this);
|
||||
if (m) {
|
||||
control = new MuteControl (_a_session, X_("mute"), *m, time_domain());
|
||||
control = new MuteControl (_a_session, X_("mute"), *m, *this);
|
||||
}
|
||||
}
|
||||
|
||||
if (make_list && !list) {
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, time_domain()));
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, *this));
|
||||
}
|
||||
|
||||
if (!control) {
|
||||
|
@ -61,8 +61,8 @@ static void dumpit (const AutomationList& al, string prefix = "")
|
||||
cerr << "\n";
|
||||
}
|
||||
#endif
|
||||
AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc, Temporal::TimeDomain time_domain)
|
||||
: ControlList(id, desc, time_domain)
|
||||
AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc, Temporal::TimeDomainProvider const & tdp)
|
||||
: ControlList(id, desc, tdp)
|
||||
, _before (0)
|
||||
{
|
||||
_state = Off;
|
||||
@ -75,8 +75,8 @@ AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::Param
|
||||
AutomationListCreated(this);
|
||||
}
|
||||
|
||||
AutomationList::AutomationList (const Evoral::Parameter& id, Temporal::TimeDomain time_domain)
|
||||
: ControlList(id, ARDOUR::ParameterDescriptor(id), time_domain)
|
||||
AutomationList::AutomationList (const Evoral::Parameter& id, Temporal::TimeDomainProvider const & tdp)
|
||||
: ControlList(id, ARDOUR::ParameterDescriptor(id), tdp)
|
||||
, _before (0)
|
||||
{
|
||||
_state = Off;
|
||||
@ -120,7 +120,7 @@ AutomationList::AutomationList (const AutomationList& other, timepos_t const & s
|
||||
* in or below the AutomationList node. It is used if @p id is non-null.
|
||||
*/
|
||||
AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id)
|
||||
: ControlList(id, ARDOUR::ParameterDescriptor(id), Temporal::AudioTime) /* domain may change in ::set_state */
|
||||
: ControlList(id, ARDOUR::ParameterDescriptor(id), Temporal::TimeDomainProvider (Temporal::AudioTime)) /* domain may change in ::set_state */
|
||||
, _before (0)
|
||||
{
|
||||
_touching.store (0);
|
||||
@ -147,9 +147,9 @@ AutomationList::~AutomationList()
|
||||
std::shared_ptr<Evoral::ControlList>
|
||||
AutomationList::create(const Evoral::Parameter& id,
|
||||
const Evoral::ParameterDescriptor& desc,
|
||||
Temporal::TimeDomain time_domain)
|
||||
Temporal::TimeDomainProvider const & tdp)
|
||||
{
|
||||
return std::shared_ptr<Evoral::ControlList>(new AutomationList(id, desc, time_domain));
|
||||
return std::shared_ptr<Evoral::ControlList>(new AutomationList(id, desc, tdp));
|
||||
}
|
||||
|
||||
void
|
||||
@ -449,7 +449,7 @@ AutomationList::set_state (const XMLNode& node, int version)
|
||||
Temporal::TimeDomain time_domain;
|
||||
|
||||
if (node.get_property ("time-domain", time_domain)) {
|
||||
set_time_domain_empty (time_domain);
|
||||
set_time_domain (time_domain);
|
||||
}
|
||||
|
||||
if (node.name() == X_("events")) {
|
||||
|
@ -27,7 +27,7 @@
|
||||
namespace ARDOUR {
|
||||
|
||||
CapturingProcessor::CapturingProcessor (Session & session, samplecnt_t latency)
|
||||
: Processor (session, X_("capture point"), Temporal::AudioTime)
|
||||
: Processor (session, X_("capture point"), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, block_size (AudioEngine::instance()->samples_per_cycle())
|
||||
, _latency (latency)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
|
||||
DelayLine::DelayLine (Session& s, const std::string& name)
|
||||
: Processor (s, string_compose ("latcomp-%1-%2", name, this), Config->get_default_automation_time_domain())
|
||||
: Processor (s, string_compose ("latcomp-%1-%2", name, this), Temporal::TimeDomainProvider (Config->get_default_automation_time_domain()))
|
||||
, _bsiz (0)
|
||||
, _delay (0)
|
||||
, _pending_delay (0)
|
||||
|
@ -57,7 +57,7 @@ bool Delivery::panners_legal = false;
|
||||
|
||||
Delivery::Delivery (Session& s, std::shared_ptr<IO> io, std::shared_ptr<Pannable> pannable,
|
||||
std::shared_ptr<MuteMaster> mm, const string& name, Role r)
|
||||
: IOProcessor(s, std::shared_ptr<IO>(), (role_requires_output_ports (r) ? io : std::shared_ptr<IO>()), name, Temporal::AudioTime, (r == Send || r == Aux || r == Foldback))
|
||||
: IOProcessor(s, std::shared_ptr<IO>(), (role_requires_output_ports (r) ? io : std::shared_ptr<IO>()), name, Temporal::TimeDomainProvider (Temporal::AudioTime), (r == Send || r == Aux || r == Foldback))
|
||||
, _role (r)
|
||||
, _output_buffers (new BufferSet())
|
||||
, _current_gain (GAIN_COEFF_ZERO)
|
||||
@ -68,7 +68,7 @@ Delivery::Delivery (Session& s, std::shared_ptr<IO> io, std::shared_ptr<Pannable
|
||||
if (pannable) {
|
||||
bool is_send = false;
|
||||
if (r & (Delivery::Send|Delivery::Aux|Delivery::Foldback)) is_send = true;
|
||||
_panshell = std::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, time_domain(), is_send));
|
||||
_panshell = std::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, *this, is_send));
|
||||
}
|
||||
|
||||
_display_to_user = false;
|
||||
@ -92,7 +92,7 @@ Delivery::Delivery (Session& s, std::shared_ptr<Pannable> pannable, std::shared_
|
||||
if (pannable) {
|
||||
bool is_send = false;
|
||||
if (r & (Delivery::Send|Delivery::Aux|Delivery::Foldback)) is_send = true;
|
||||
_panshell = std::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, time_domain(), is_send));
|
||||
_panshell = std::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, *this, is_send));
|
||||
}
|
||||
|
||||
_display_to_user = false;
|
||||
|
@ -48,8 +48,8 @@ const string DiskIOProcessor::state_node_name = X_("DiskIOProcessor");
|
||||
// PBD::Signal0<void> DiskIOProcessor::DiskOverrun;
|
||||
// PBD::Signal0<void> DiskIOProcessor::DiskUnderrun;
|
||||
|
||||
DiskIOProcessor::DiskIOProcessor (Session& s, Track& t, string const & str, Flag f, Temporal::TimeDomain td)
|
||||
: Processor (s, str, td)
|
||||
DiskIOProcessor::DiskIOProcessor (Session& s, Track& t, string const & str, Flag f, Temporal::TimeDomainProvider const & tdp)
|
||||
: Processor (s, str, tdp)
|
||||
, _flags (f)
|
||||
, _slaved (false)
|
||||
, in_set_state (false)
|
||||
|
@ -57,8 +57,8 @@ DiskReader::Declicker DiskReader::loop_declick_in;
|
||||
DiskReader::Declicker DiskReader::loop_declick_out;
|
||||
samplecnt_t DiskReader::loop_fade_length (0);
|
||||
|
||||
DiskReader::DiskReader (Session& s, Track& t, string const& str, Temporal::TimeDomain td, DiskIOProcessor::Flag f)
|
||||
: DiskIOProcessor (s, t, X_("player:") + str, f, td)
|
||||
DiskReader::DiskReader (Session& s, Track& t, string const& str, Temporal::TimeDomainProvider const & tdp, DiskIOProcessor::Flag f)
|
||||
: DiskIOProcessor (s, t, X_("player:") + str, f, tdp)
|
||||
, overwrite_sample (0)
|
||||
, run_must_resolve (false)
|
||||
, _declick_amp (s.nominal_sample_rate ())
|
||||
|
@ -48,7 +48,7 @@ ARDOUR::samplecnt_t DiskWriter::_chunk_samples = DiskWriter::default_chunk_sampl
|
||||
PBD::Signal0<void> DiskWriter::Overrun;
|
||||
|
||||
DiskWriter::DiskWriter (Session& s, Track& t, string const & str, DiskIOProcessor::Flag f)
|
||||
: DiskIOProcessor (s, t, X_("recorder:") + str, f, Config->get_default_automation_time_domain())
|
||||
: DiskIOProcessor (s, t, X_("recorder:") + str, f, Temporal::TimeDomainProvider (Config->get_default_automation_time_domain()))
|
||||
, _capture_captured (0)
|
||||
, _was_recording (false)
|
||||
, _xrun_flag (false)
|
||||
|
@ -67,7 +67,7 @@ static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter co
|
||||
case InsertReturnLevel:
|
||||
/* fallthrough */
|
||||
case TrimAutomation:
|
||||
return std::shared_ptr<AutomationList> (new AutomationList (param, Temporal::AudioTime));
|
||||
return std::shared_ptr<AutomationList> (new AutomationList (param, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
case MainOutVolume:
|
||||
/* not automatable */
|
||||
break;
|
||||
|
@ -28,8 +28,8 @@
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
|
||||
InternalReturn::InternalReturn (Session& s, Temporal::TimeDomain td, std::string const& name)
|
||||
: Processor (s, name, td)
|
||||
InternalReturn::InternalReturn (Session& s, Temporal::TimeDomainProvider const & tdp, std::string const& name)
|
||||
: Processor (s, name, tdp)
|
||||
{
|
||||
_display_to_user = false;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ namespace ARDOUR { class Session; }
|
||||
|
||||
IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
|
||||
const string& proc_name, const string io_name, DataType dtype, bool sendish)
|
||||
: Processor (s, proc_name, (dtype == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime))
|
||||
: Processor (s, proc_name, Temporal::TimeDomainProvider (dtype == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime))
|
||||
{
|
||||
/* these are true in this constructor whether we actually create the associated
|
||||
IO objects or not.
|
||||
@ -71,8 +71,8 @@ IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
|
||||
/* create an IOProcessor that proxies to an existing IO object */
|
||||
|
||||
IOProcessor::IOProcessor (Session& s, std::shared_ptr<IO> in, std::shared_ptr<IO> out,
|
||||
const string& proc_name, Temporal::TimeDomain td, bool sendish)
|
||||
: Processor(s, proc_name, td)
|
||||
const string& proc_name, Temporal::TimeDomainProvider const & tdp, bool sendish)
|
||||
: Processor(s, proc_name, tdp)
|
||||
, _input (in)
|
||||
, _output (out)
|
||||
{
|
||||
|
@ -115,7 +115,8 @@ ARDOUR::LuaAPI::new_luaproc_with_time_domain (Session *s, const string& name, Te
|
||||
return std::shared_ptr<Processor> ();
|
||||
}
|
||||
|
||||
return std::shared_ptr<Processor> (new PluginInsert (*s, td, p));
|
||||
/* Lua processor takes time domain from session */
|
||||
return std::shared_ptr<Processor> (new PluginInsert (*s, *s, p));
|
||||
}
|
||||
|
||||
std::shared_ptr<Processor>
|
||||
@ -244,7 +245,8 @@ ARDOUR::LuaAPI::new_plugin_with_time_domain (Session *s, const string& name, ARD
|
||||
}
|
||||
}
|
||||
|
||||
return std::shared_ptr<Processor> (new PluginInsert (*s, td, p));
|
||||
/* Lua processor takes time domain from session */
|
||||
return std::shared_ptr<Processor> (new PluginInsert (*s, *s, p));
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -42,7 +42,7 @@ using namespace std;
|
||||
using namespace ARDOUR;
|
||||
|
||||
PeakMeter::PeakMeter (Session& s, const std::string& name)
|
||||
: Processor (s, string_compose ("meter-%1", name), Temporal::AudioTime)
|
||||
: Processor (s, string_compose ("meter-%1", name), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
{
|
||||
Kmeterdsp::init (s.nominal_sample_rate ());
|
||||
Iec1ppmdsp::init (s.nominal_sample_rate ());
|
||||
|
@ -59,7 +59,7 @@ using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
MidiModel::MidiModel (MidiSource& s)
|
||||
: AutomatableSequence<TimeType> (s.session(), Temporal::BeatTime)
|
||||
: AutomatableSequence<TimeType> (s.session(), Temporal::TimeDomainProvider (Temporal::BeatTime))
|
||||
, _midi_source (s)
|
||||
{
|
||||
_midi_source.InterpolationChanged.connect_same_thread (_midi_source_connections, boost::bind (&MidiModel::source_interpolation_changed, this, _1, _2));
|
||||
|
@ -24,9 +24,9 @@
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
MonitorControl::MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomain td)
|
||||
MonitorControl::MonitorControl (Session& session, std::string const & name, Monitorable& m, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, MonitoringAutomation, ParameterDescriptor (MonitoringAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(MonitoringAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(MonitoringAutomation), tdp)),
|
||||
name)
|
||||
|
||||
, _monitorable (m)
|
||||
|
@ -48,7 +48,7 @@ namespace ARDOUR {
|
||||
}
|
||||
|
||||
MonitorProcessor::MonitorProcessor (Session& s)
|
||||
: Processor (s, X_("MonitorOut"), Temporal::AudioTime)
|
||||
: Processor (s, X_("MonitorOut"), Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, solo_cnt (0)
|
||||
, _monitor_active (false)
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
using namespace ARDOUR;
|
||||
|
||||
MonitorReturn::MonitorReturn (Session& s, Temporal::TimeDomain td)
|
||||
: InternalReturn (s, td, "Monitor Return")
|
||||
MonitorReturn::MonitorReturn (Session& s, Temporal::TimeDomainProvider const & tdp)
|
||||
: InternalReturn (s, tdp, "Monitor Return")
|
||||
, _nch (0)
|
||||
, _gain (1.f)
|
||||
{
|
||||
|
@ -29,9 +29,9 @@ using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
||||
|
||||
MuteControl::MuteControl (Session& session, std::string const & name, Muteable& m, Temporal::TimeDomain td)
|
||||
MuteControl::MuteControl (Session& session, std::string const & name, Muteable& m, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, MuteAutomation, ParameterDescriptor (MuteAutomation),
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (MuteAutomation), td)),
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (MuteAutomation), tdp)),
|
||||
name)
|
||||
, _muteable (m)
|
||||
{
|
||||
|
@ -39,14 +39,14 @@ using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
|
||||
Pannable::Pannable (Session& s, Temporal::TimeDomain td)
|
||||
: Automatable (s, td)
|
||||
Pannable::Pannable (Session& s, Temporal::TimeDomainProvider const & tdp)
|
||||
: Automatable (s, tdp)
|
||||
, SessionHandleRef (s)
|
||||
, pan_azimuth_control (new PanControllable (s, "", this, PanAzimuthAutomation, td))
|
||||
, pan_elevation_control (new PanControllable (s, "", this, PanElevationAutomation, td))
|
||||
, pan_width_control (new PanControllable (s, "", this, PanWidthAutomation, td))
|
||||
, pan_frontback_control (new PanControllable (s, "", this, PanFrontBackAutomation, td))
|
||||
, pan_lfe_control (new PanControllable (s, "", this, PanLFEAutomation, td))
|
||||
, pan_azimuth_control (new PanControllable (s, "", this, PanAzimuthAutomation, tdp))
|
||||
, pan_elevation_control (new PanControllable (s, "", this, PanElevationAutomation, tdp))
|
||||
, pan_width_control (new PanControllable (s, "", this, PanWidthAutomation, tdp))
|
||||
, pan_frontback_control (new PanControllable (s, "", this, PanFrontBackAutomation, tdp))
|
||||
, pan_lfe_control (new PanControllable (s, "", this, PanLFEAutomation, tdp))
|
||||
, _auto_state (Off)
|
||||
, _has_state (false)
|
||||
, _responding_to_control_auto_state_change (0)
|
||||
|
@ -66,7 +66,7 @@ using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
PannerShell::PannerShell (string name, Session& s, std::shared_ptr<Pannable> p, Temporal::TimeDomain td, bool is_send)
|
||||
PannerShell::PannerShell (string name, Session& s, std::shared_ptr<Pannable> p, Temporal::TimeDomainProvider const & tdp, bool is_send)
|
||||
: SessionObject (s, name)
|
||||
, _pannable_route (p)
|
||||
, _is_send (is_send)
|
||||
@ -78,7 +78,7 @@ PannerShell::PannerShell (string name, Session& s, std::shared_ptr<Pannable> p,
|
||||
, _force_reselect (false)
|
||||
{
|
||||
if (is_send) {
|
||||
_pannable_internal.reset(new Pannable (s, td));
|
||||
_pannable_internal.reset(new Pannable (s, tdp));
|
||||
if (Config->get_link_send_and_route_panner()) {
|
||||
_panlinked = true;
|
||||
} else {
|
||||
|
@ -25,9 +25,9 @@ using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
|
||||
PhaseControl::PhaseControl (Session& session, std::string const & name, Temporal::TimeDomain td)
|
||||
PhaseControl::PhaseControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const & tdp)
|
||||
: AutomationControl (session, PhaseAutomation, ParameterDescriptor (PhaseAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), tdp)),
|
||||
name)
|
||||
{
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ using namespace PBD;
|
||||
|
||||
const string PluginInsert::port_automation_node_name = "PortAutomation";
|
||||
|
||||
PluginInsert::PluginInsert (Session& s, Temporal::TimeDomain td, std::shared_ptr<Plugin> plug)
|
||||
: Processor (s, (plug ? plug->name() : string ("toBeRenamed")), td)
|
||||
PluginInsert::PluginInsert (Session& s, Temporal::TimeDomainProvider const & tdp, std::shared_ptr<Plugin> plug)
|
||||
: Processor (s, (plug ? plug->name() : string ("toBeRenamed")), tdp)
|
||||
, _sc_playback_latency (0)
|
||||
, _sc_capture_latency (0)
|
||||
, _plugin_signal_latency (0)
|
||||
@ -537,7 +537,7 @@ PluginInsert::create_automatable_parameters ()
|
||||
|
||||
const bool automatable = a.find(param) != a.end();
|
||||
|
||||
std::shared_ptr<AutomationList> list(new AutomationList(param, desc, time_domain()));
|
||||
std::shared_ptr<AutomationList> list(new AutomationList(param, desc, *this));
|
||||
std::shared_ptr<AutomationControl> c (new PluginControl(this, param, desc, list));
|
||||
if (!automatable || (limit_automatables > 0 && what_can_be_automated ().size() > limit_automatables)) {
|
||||
c->set_flag (Controllable::NotAutomatable);
|
||||
@ -557,7 +557,7 @@ PluginInsert::create_automatable_parameters ()
|
||||
if (desc.datatype != Variant::NOTHING) {
|
||||
std::shared_ptr<AutomationList> list;
|
||||
if (Variant::type_is_numeric(desc.datatype)) {
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, time_domain()));
|
||||
list = std::shared_ptr<AutomationList>(new AutomationList(param, desc, *this));
|
||||
}
|
||||
std::shared_ptr<AutomationControl> c (new PluginPropertyControl(this, param, desc, list));
|
||||
if (!Variant::type_is_numeric(desc.datatype)) {
|
||||
@ -580,7 +580,7 @@ PluginInsert::create_automatable_parameters ()
|
||||
desc.lower = 0;
|
||||
desc.upper = 1;
|
||||
|
||||
std::shared_ptr<AutomationList> list(new AutomationList(param, desc, time_domain()));
|
||||
std::shared_ptr<AutomationList> list(new AutomationList(param, desc, *this));
|
||||
std::shared_ptr<AutomationControl> c (new PluginControl(this, param, desc, list));
|
||||
|
||||
add_control (c);
|
||||
|
@ -28,7 +28,7 @@ using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
PolarityProcessor::PolarityProcessor (Session& s, std::shared_ptr<PhaseControl> control)
|
||||
: Processor(s, "Polarity", Temporal::AudioTime)
|
||||
: Processor(s, "Polarity", Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _control (control)
|
||||
{
|
||||
}
|
||||
|
@ -57,13 +57,13 @@ PortInsert::PortInsert (Session& s, std::shared_ptr<Pannable> pannable, std::sha
|
||||
, _measured_latency (0)
|
||||
{
|
||||
/* Send */
|
||||
_out->set_gain_control (std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(BusSendLevel), std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (BusSendLevel), time_domain())))));
|
||||
_out->set_gain_control (std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(BusSendLevel), std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (BusSendLevel), *this)))));
|
||||
|
||||
_out->set_polarity_control (std::shared_ptr<AutomationControl> (new AutomationControl (_session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), time_domain())), "polarity-invert")));
|
||||
_out->set_polarity_control (std::shared_ptr<AutomationControl> (new AutomationControl (_session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), *this)), "polarity-invert")));
|
||||
_send_meter.reset (new PeakMeter (_session, name()));
|
||||
|
||||
/* Return */
|
||||
_gain_control = std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(InsertReturnLevel), std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (InsertReturnLevel), time_domain()))));
|
||||
_gain_control = std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(InsertReturnLevel), std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (InsertReturnLevel), *this))));
|
||||
_amp.reset (new Amp (_session, _("Return"), _gain_control, true));
|
||||
_return_meter.reset (new PeakMeter (_session, name()));
|
||||
|
||||
|
@ -58,9 +58,9 @@ namespace ARDOUR { class Session; }
|
||||
// Always saved as Processor, but may be IOProcessor or Send in legacy sessions
|
||||
const string Processor::state_node_name = "Processor";
|
||||
|
||||
Processor::Processor(Session& session, const string& name, Temporal::TimeDomain td)
|
||||
Processor::Processor(Session& session, const string& name, Temporal::TimeDomainProvider const & tdp)
|
||||
: SessionObject(session, name)
|
||||
, Automatable (session, td)
|
||||
, Automatable (session, tdp)
|
||||
, _pending_active(false)
|
||||
, _active(false)
|
||||
, _next_ab_is_active(false)
|
||||
@ -82,7 +82,7 @@ Processor::Processor(Session& session, const string& name, Temporal::TimeDomain
|
||||
Processor::Processor (const Processor& other)
|
||||
: Evoral::ControlSet (other)
|
||||
, SessionObject (other.session(), other.name())
|
||||
, Automatable (other.session(), other.time_domain())
|
||||
, Automatable (other.session(), other)
|
||||
, Latent (other)
|
||||
, _pending_active(other._pending_active)
|
||||
, _active(other._active)
|
||||
|
@ -24,9 +24,9 @@
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
RecordEnableControl::RecordEnableControl (Session& session, std::string const & name, Recordable& r, Temporal::TimeDomain td)
|
||||
RecordEnableControl::RecordEnableControl (Session& session, std::string const & name, Recordable& r, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, RecEnableAutomation, ParameterDescriptor (RecEnableAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(RecEnableAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(RecEnableAutomation), tdp)),
|
||||
name)
|
||||
, _recordable (r)
|
||||
{
|
||||
|
@ -24,9 +24,9 @@
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
RecordSafeControl::RecordSafeControl (Session& session, std::string const & name, Recordable& r, Temporal::TimeDomain td)
|
||||
RecordSafeControl::RecordSafeControl (Session& session, std::string const & name, Recordable& r, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(RecSafeAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(RecSafeAutomation), tdp)),
|
||||
name)
|
||||
, _recordable (r)
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ Return::Return (Session& s, bool internal)
|
||||
{
|
||||
/* never muted */
|
||||
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation), time_domain()));
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation), *this));
|
||||
_gain_control = std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter (GainAutomation), gl));
|
||||
add_control (_gain_control);
|
||||
|
||||
|
@ -170,26 +170,28 @@ Route::init ()
|
||||
* Automatable API. -- Don't call add_control () here.
|
||||
*/
|
||||
|
||||
_solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, time_domain()));
|
||||
Temporal::TimeDomainProvider const & tdp (*this);
|
||||
|
||||
_solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, tdp));
|
||||
add_control (_solo_control);
|
||||
_solo_control->Changed.connect_same_thread (*this, boost::bind (&Route::solo_control_changed, this, _1, _2));
|
||||
|
||||
_mute_control.reset (new MuteControl (_session, X_("mute"), *this, time_domain()));
|
||||
_mute_control.reset (new MuteControl (_session, X_("mute"), *this, tdp));
|
||||
add_control (_mute_control);
|
||||
|
||||
_phase_control.reset (new PhaseControl (_session, X_("phase"), time_domain()));
|
||||
_phase_control.reset (new PhaseControl (_session, X_("phase"), tdp));
|
||||
add_control (_phase_control);
|
||||
|
||||
_solo_isolate_control.reset (new SoloIsolateControl (_session, X_("solo-iso"), *this, time_domain()));
|
||||
_solo_isolate_control.reset (new SoloIsolateControl (_session, X_("solo-iso"), *this, tdp));
|
||||
add_control (_solo_isolate_control);
|
||||
|
||||
_solo_safe_control.reset (new SoloSafeControl (_session, X_("solo-safe"), time_domain()));
|
||||
_solo_safe_control.reset (new SoloSafeControl (_session, X_("solo-safe"), tdp));
|
||||
add_control (_solo_safe_control);
|
||||
|
||||
/* panning */
|
||||
|
||||
if (!(_presentation_info.flags() & PresentationInfo::MonitorOut)) {
|
||||
_pannable.reset (new Pannable (_session, Config->get_default_automation_time_domain()));
|
||||
_pannable.reset (new Pannable (_session, Temporal::TimeDomainProvider (Config->get_default_automation_time_domain())));
|
||||
}
|
||||
|
||||
/* input and output objects */
|
||||
@ -275,7 +277,7 @@ Route::init ()
|
||||
|
||||
if (is_monitor()) {
|
||||
/* where we listen to tracks */
|
||||
_intreturn.reset (new MonitorReturn (_session, time_domain()));
|
||||
_intreturn.reset (new MonitorReturn (_session, tdp));
|
||||
_intreturn->activate ();
|
||||
|
||||
/* the thing that provides proper control over a control/monitor/listen bus
|
||||
@ -956,7 +958,7 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
|
||||
if (_session.get_disable_all_loaded_plugins ()) {
|
||||
processor.reset (new UnknownProcessor (_session, node, this));
|
||||
} else {
|
||||
processor.reset (new PluginInsert (_session, time_domain()));
|
||||
processor.reset (new PluginInsert (_session, *this));
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -966,7 +968,7 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
|
||||
|
||||
} else if (node.name() == "Send") {
|
||||
|
||||
std::shared_ptr<Pannable> sendpan (new Pannable (_session, Config->get_default_automation_time_domain()));
|
||||
std::shared_ptr<Pannable> sendpan (new Pannable (_session, Temporal::TimeDomainProvider (Config->get_default_automation_time_domain())));
|
||||
processor.reset (new Send (_session, sendpan, _mute_master));
|
||||
|
||||
} else {
|
||||
@ -3118,6 +3120,7 @@ Route::set_processor_state (const XMLNode& node, int version)
|
||||
XMLNodeConstIterator niter;
|
||||
ProcessorList new_order;
|
||||
bool must_configure = false;
|
||||
Temporal::TimeDomainProvider const & tdp (*this);
|
||||
|
||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
||||
|
||||
@ -3150,7 +3153,7 @@ Route::set_processor_state (const XMLNode& node, int version)
|
||||
_main_outs->set_state (**niter, version);
|
||||
} else if (prop->value() == "monreturn") {
|
||||
if (!_intreturn) {
|
||||
_intreturn.reset (new MonitorReturn (_session, time_domain()));
|
||||
_intreturn.reset (new MonitorReturn (_session, tdp));
|
||||
must_configure = true;
|
||||
}
|
||||
_intreturn->set_state (**niter, version);
|
||||
@ -3158,9 +3161,9 @@ Route::set_processor_state (const XMLNode& node, int version)
|
||||
if (!_intreturn) {
|
||||
|
||||
if (is_monitor ()) {
|
||||
_intreturn.reset (new MonitorReturn (_session, time_domain()));
|
||||
_intreturn.reset (new MonitorReturn (_session, tdp));
|
||||
} else {
|
||||
_intreturn.reset (new InternalReturn (_session, time_domain()));
|
||||
_intreturn.reset (new InternalReturn (_session, tdp));
|
||||
}
|
||||
|
||||
must_configure = true;
|
||||
@ -3252,6 +3255,7 @@ bool
|
||||
Route::set_processor_state (XMLNode const& node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure)
|
||||
{
|
||||
ProcessorList::iterator o;
|
||||
Temporal::TimeDomainProvider const & tdp (*this);
|
||||
|
||||
for (o = _processors.begin(); o != _processors.end(); ++o) {
|
||||
XMLProperty const * id_prop = node.property(X_("id"));
|
||||
@ -3284,7 +3288,7 @@ Route::set_processor_state (XMLNode const& node, int version, XMLProperty const*
|
||||
if (_session.get_disable_all_loaded_plugins ()) {
|
||||
processor.reset (new UnknownProcessor (_session, node, this));
|
||||
} else {
|
||||
processor.reset (new PluginInsert (_session, time_domain()));
|
||||
processor.reset (new PluginInsert (_session, tdp));
|
||||
processor->set_owner (this);
|
||||
}
|
||||
} else if (prop->value() == "port") {
|
||||
@ -3386,7 +3390,7 @@ void
|
||||
Route::add_internal_return ()
|
||||
{
|
||||
if (!_intreturn) {
|
||||
_intreturn.reset (new InternalReturn (_session, time_domain()));
|
||||
_intreturn.reset (new InternalReturn (_session, *this));
|
||||
add_processor (_intreturn, PreFader);
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ Send::Send (Session& s, std::shared_ptr<Pannable> p, std::shared_ptr<MuteMaster>
|
||||
{
|
||||
//boost_debug_shared_ptr_mark_interesting (this, "send");
|
||||
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (BusSendLevel), time_domain()));
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (BusSendLevel), *this));
|
||||
set_gain_control (std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(BusSendLevel), gl)));
|
||||
|
||||
gain_control ()->set_flag (Controllable::InlineControl);
|
||||
@ -110,7 +110,7 @@ Send::Send (Session& s, std::shared_ptr<Pannable> p, std::shared_ptr<MuteMaster>
|
||||
|
||||
|
||||
if (_role == Delivery::Aux || _role == Delivery::Send) {
|
||||
set_polarity_control (std::shared_ptr<AutomationControl> (new AutomationControl (_session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), time_domain())), "polarity-invert")));
|
||||
set_polarity_control (std::shared_ptr<AutomationControl> (new AutomationControl (_session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(PhaseAutomation), *this)), "polarity-invert")));
|
||||
add_control (polarity_control ());
|
||||
}
|
||||
|
||||
|
@ -918,7 +918,7 @@ Session::setup_click ()
|
||||
{
|
||||
_clicking = false;
|
||||
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation), Temporal::AudioTime));
|
||||
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
std::shared_ptr<GainControl> gain_control = std::shared_ptr<GainControl> (new GainControl (*this, Evoral::Parameter(GainAutomation), gl));
|
||||
|
||||
_click_io.reset (new ClickIO (*this, X_("Click")));
|
||||
@ -3397,7 +3397,7 @@ Session::load_and_connect_instruments (RouteList& new_routes, bool strict_io, st
|
||||
if (pset) {
|
||||
plugin->load_preset (*pset);
|
||||
}
|
||||
std::shared_ptr<PluginInsert> pi (new PluginInsert (*this, (*r)->time_domain(), plugin));
|
||||
std::shared_ptr<PluginInsert> pi (new PluginInsert (*this, **r, plugin));
|
||||
if (strict_io) {
|
||||
pi->set_strict_io (true);
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ using namespace ARDOUR;
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
|
||||
SoloControl::SoloControl (Session& session, std::string const & name, Soloable& s, Muteable& m, Temporal::TimeDomain td)
|
||||
SoloControl::SoloControl (Session& session, std::string const & name, Soloable& s, Muteable& m, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, SoloAutomation, ParameterDescriptor (SoloAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloAutomation), tdp)),
|
||||
name)
|
||||
, _soloable (s)
|
||||
, _muteable (m)
|
||||
|
@ -28,9 +28,9 @@ using namespace ARDOUR;
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
|
||||
SoloIsolateControl::SoloIsolateControl (Session& session, std::string const & name, Soloable& s, Temporal::TimeDomain td)
|
||||
SoloIsolateControl::SoloIsolateControl (Session& session, std::string const & name, Soloable& s, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, SoloIsolateAutomation, ParameterDescriptor (SoloIsolateAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloIsolateAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloIsolateAutomation), tdp)),
|
||||
name)
|
||||
, _soloable (s)
|
||||
, _solo_isolated (false)
|
||||
|
@ -28,9 +28,9 @@ using namespace ARDOUR;
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
|
||||
SoloSafeControl::SoloSafeControl (Session& session, std::string const & name, Temporal::TimeDomain td)
|
||||
SoloSafeControl::SoloSafeControl (Session& session, std::string const & name, Temporal::TimeDomainProvider const & tdp)
|
||||
: SlavableAutomationControl (session, SoloSafeAutomation, ParameterDescriptor (SoloSafeAutomation),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloSafeAutomation), td)),
|
||||
std::shared_ptr<AutomationList>(new AutomationList(Evoral::Parameter(SoloSafeAutomation), tdp)),
|
||||
name)
|
||||
, _solo_safe (false)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ using std::string;
|
||||
|
||||
Stripable::Stripable (Session& s, string const & name, PresentationInfo const & pi)
|
||||
: SessionObject (s, name)
|
||||
, Automatable (s, (pi.flags() & PresentationInfo::MidiIndicatingFlags) ? Temporal::BeatTime : Temporal::AudioTime)
|
||||
, Automatable (s, Temporal::TimeDomainProvider ((pi.flags() & PresentationInfo::MidiIndicatingFlags) ? Temporal::BeatTime : Temporal::AudioTime))
|
||||
, _presentation_info (pi)
|
||||
, _active_color_picker (0)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ AutomationListPropertyTest::basicTest ()
|
||||
descriptor.property_id = g_quark_from_static_string ("FadeIn");
|
||||
AutomationListProperty property (
|
||||
descriptor,
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::AudioTime))
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime)))
|
||||
);
|
||||
|
||||
property.clear_changes ();
|
||||
@ -115,7 +115,7 @@ class Fred : public StatefulDestructible
|
||||
{
|
||||
public:
|
||||
Fred ()
|
||||
: _jim (_descriptor, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::AudioTime)))
|
||||
: _jim (_descriptor, std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (FadeInAutomation), Temporal::TimeDomainProvider (Temporal::AudioTime))))
|
||||
|
||||
{
|
||||
add_property (_jim);
|
||||
|
@ -91,7 +91,7 @@ LuaScriptTest::dsp_script_test ()
|
||||
PluginPtr p = (*i)->load (*_session);
|
||||
CPPUNIT_ASSERT_MESSAGE ((*i)->name, p);
|
||||
|
||||
std::shared_ptr<Processor> processor (new PluginInsert (*_session, r->time_domain(), p));
|
||||
std::shared_ptr<Processor> processor (new PluginInsert (*_session, Temporal::TimeDomainProvider (r->time_domain()), p));
|
||||
processor->enable (true);
|
||||
|
||||
int rv = r->add_processor (processor, std::shared_ptr<Processor>(), 0);
|
||||
|
@ -99,7 +99,7 @@ Track::init ()
|
||||
|
||||
DiskIOProcessor::Flag dflags = DiskIOProcessor::Recordable;
|
||||
|
||||
_disk_reader.reset (new DiskReader (_session, *this, name(), Config->get_default_automation_time_domain(), dflags));
|
||||
_disk_reader.reset (new DiskReader (_session, *this, name(), Temporal::TimeDomainProvider (Config->get_default_automation_time_domain()), dflags));
|
||||
_disk_reader->set_block_size (_session.get_block_size ());
|
||||
_disk_reader->set_owner (this);
|
||||
|
||||
@ -116,13 +116,13 @@ Track::init ()
|
||||
std::shared_ptr<Route> rp (std::dynamic_pointer_cast<Route> (shared_from_this()));
|
||||
std::shared_ptr<Track> rt = std::dynamic_pointer_cast<Track> (rp);
|
||||
|
||||
_record_enable_control.reset (new RecordEnableControl (_session, EventTypeMap::instance().to_symbol (RecEnableAutomation), *this, time_domain()));
|
||||
_record_enable_control.reset (new RecordEnableControl (_session, EventTypeMap::instance().to_symbol (RecEnableAutomation), *this, *this));
|
||||
add_control (_record_enable_control);
|
||||
|
||||
_record_safe_control.reset (new RecordSafeControl (_session, EventTypeMap::instance().to_symbol (RecSafeAutomation), *this, time_domain()));
|
||||
_record_safe_control.reset (new RecordSafeControl (_session, EventTypeMap::instance().to_symbol (RecSafeAutomation), *this, *this));
|
||||
add_control (_record_safe_control);
|
||||
|
||||
_monitoring_control.reset (new MonitorControl (_session, EventTypeMap::instance().to_symbol (MonitoringAutomation), *this, time_domain()));
|
||||
_monitoring_control.reset (new MonitorControl (_session, EventTypeMap::instance().to_symbol (MonitoringAutomation), *this, *this));
|
||||
add_control (_monitoring_control);
|
||||
|
||||
if (!name().empty()) {
|
||||
|
@ -3079,7 +3079,7 @@ TriggerBox::static_init (Session & s)
|
||||
}
|
||||
|
||||
TriggerBox::TriggerBox (Session& s, DataType dt)
|
||||
: Processor (s, _("TriggerBox"), Temporal::BeatTime)
|
||||
: Processor (s, _("TriggerBox"), Temporal::TimeDomainProvider (Temporal::BeatTime))
|
||||
, tracker (dt == DataType::MIDI ? new MidiStateTracker : 0)
|
||||
, _data_type (dt)
|
||||
, _order (-1)
|
||||
@ -3091,7 +3091,6 @@ TriggerBox::TriggerBox (Session& s, DataType dt)
|
||||
, _locate_armed (false)
|
||||
, _cancel_locate_armed (false)
|
||||
, _fast_forwarding (false)
|
||||
|
||||
, requests (1024)
|
||||
{
|
||||
set_display_to_user (false);
|
||||
|
@ -58,7 +58,7 @@ proc_type_map (std::string const& str)
|
||||
}
|
||||
|
||||
UnknownProcessor::UnknownProcessor (Session&s, XMLNode const &state, SessionObject* o)
|
||||
: Processor (s, "", Temporal::AudioTime)
|
||||
: Processor (s, "", Temporal::TimeDomainProvider (Temporal::AudioTime))
|
||||
, _state (state)
|
||||
, have_ioconfig (false)
|
||||
, saved_input (0)
|
||||
|
@ -79,8 +79,8 @@ VCA::VCA (Session& s, int32_t num, const string& name)
|
||||
int
|
||||
VCA::init ()
|
||||
{
|
||||
_solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, time_domain()));
|
||||
_mute_control.reset (new MuteControl (_session, X_("mute"), *this, time_domain()));
|
||||
_solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this, *this));
|
||||
_mute_control.reset (new MuteControl (_session, X_("mute"), *this, *this));
|
||||
|
||||
add_control (_gain_control);
|
||||
add_control (_solo_control);
|
||||
|
@ -32,7 +32,7 @@ using namespace std;
|
||||
|
||||
VelocityControl::VelocityControl (Session& session)
|
||||
: SlavableAutomationControl (session, Evoral::Parameter (MidiVelocityAutomation), ParameterDescriptor (Evoral::Parameter (MidiVelocityAutomation)),
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (MidiVelocityAutomation), Temporal::BeatTime)),
|
||||
std::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (MidiVelocityAutomation), Temporal::TimeDomainProvider (Temporal::BeatTime))),
|
||||
_("Velocity"))
|
||||
{
|
||||
}
|
||||
|
@ -64,33 +64,33 @@ event_time_less_than (ControlEvent* a, ControlEvent* b)
|
||||
return a->when < b->when;
|
||||
}
|
||||
|
||||
ControlList::ControlList (const Parameter& id, const ParameterDescriptor& desc, TimeDomain ts)
|
||||
: _parameter (id)
|
||||
ControlList::ControlList (const Parameter& id, const ParameterDescriptor& desc, TimeDomainProvider const & tds)
|
||||
: TimeDomainProvider (tds)
|
||||
, _parameter (id)
|
||||
, _desc (desc)
|
||||
, _interpolation (default_interpolation ())
|
||||
, _time_domain (ts)
|
||||
, _curve (0)
|
||||
{
|
||||
_frozen = 0;
|
||||
_changed_when_thawed = false;
|
||||
_lookup_cache.left = timepos_t::max (_time_domain);
|
||||
_lookup_cache.left = timepos_t::max (time_domain());
|
||||
_lookup_cache.range.first = _events.end ();
|
||||
_lookup_cache.range.second = _events.end ();
|
||||
_search_cache.left = timepos_t::max (_time_domain);
|
||||
_search_cache.left = timepos_t::max (time_domain());
|
||||
_search_cache.first = _events.end ();
|
||||
_sort_pending = false;
|
||||
new_write_pass = true;
|
||||
_in_write_pass = false;
|
||||
did_write_during_pass = false;
|
||||
insert_position = timepos_t::max (_time_domain);
|
||||
insert_position = timepos_t::max (time_domain());
|
||||
most_recent_insert_iterator = _events.end ();
|
||||
}
|
||||
|
||||
ControlList::ControlList (const ControlList& other)
|
||||
: _parameter (other._parameter)
|
||||
: TimeDomainProvider (other)
|
||||
, _parameter (other._parameter)
|
||||
, _desc (other._desc)
|
||||
, _interpolation (other._interpolation)
|
||||
, _time_domain (other._time_domain)
|
||||
, _curve (0)
|
||||
{
|
||||
_frozen = 0;
|
||||
@ -102,7 +102,7 @@ ControlList::ControlList (const ControlList& other)
|
||||
new_write_pass = true;
|
||||
_in_write_pass = false;
|
||||
did_write_during_pass = false;
|
||||
insert_position = timepos_t::max (_time_domain);
|
||||
insert_position = timepos_t::max (time_domain());
|
||||
most_recent_insert_iterator = _events.end ();
|
||||
|
||||
// XXX copy_events() emits Dirty, but this is just assignment copy/construction
|
||||
@ -110,10 +110,10 @@ ControlList::ControlList (const ControlList& other)
|
||||
}
|
||||
|
||||
ControlList::ControlList (const ControlList& other, timepos_t const& start, timepos_t const& end)
|
||||
: _parameter (other._parameter)
|
||||
: TimeDomainProvider (other)
|
||||
, _parameter (other._parameter)
|
||||
, _desc (other._desc)
|
||||
, _interpolation (other._interpolation)
|
||||
, _time_domain (other._time_domain)
|
||||
, _curve (0)
|
||||
{
|
||||
_frozen = 0;
|
||||
@ -135,7 +135,7 @@ ControlList::ControlList (const ControlList& other, timepos_t const& start, time
|
||||
new_write_pass = true;
|
||||
_in_write_pass = false;
|
||||
did_write_during_pass = false;
|
||||
insert_position = timepos_t::max (_time_domain);
|
||||
insert_position = timepos_t::max (time_domain());
|
||||
most_recent_insert_iterator = _events.end ();
|
||||
|
||||
mark_dirty ();
|
||||
@ -152,9 +152,10 @@ ControlList::~ControlList ()
|
||||
}
|
||||
|
||||
std::shared_ptr<ControlList>
|
||||
ControlList::create (const Parameter& id, const ParameterDescriptor& desc, TimeDomain time_style)
|
||||
ControlList::create (const Parameter& id, const ParameterDescriptor& desc, TimeDomainProvider const & tdp)
|
||||
{
|
||||
return std::shared_ptr<ControlList> (new ControlList (id, desc, time_style));
|
||||
ControlList* cl (new ControlList (id, desc, tdp));
|
||||
return std::shared_ptr<ControlList> (cl);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -176,7 +177,7 @@ ControlList::operator= (const ControlList& other)
|
||||
new_write_pass = true;
|
||||
_in_write_pass = false;
|
||||
did_write_during_pass = false;
|
||||
insert_position = timepos_t::max (_time_domain);
|
||||
insert_position = timepos_t::max (time_domain());
|
||||
|
||||
_parameter = other._parameter;
|
||||
_desc = other._desc;
|
||||
@ -267,8 +268,9 @@ ControlList::x_scale (ratio_t const& factor)
|
||||
timepos_t
|
||||
ControlList::ensure_time_domain (timepos_t const& val) const
|
||||
{
|
||||
if (val.time_domain () != _time_domain) {
|
||||
switch (_time_domain) {
|
||||
TimeDomain td (time_domain());
|
||||
if (val.time_domain () != td) {
|
||||
switch (td) {
|
||||
case Temporal::AudioTime:
|
||||
return timepos_t (val.samples ());
|
||||
break;
|
||||
@ -527,7 +529,7 @@ ControlList::start_write_pass (timepos_t const& time)
|
||||
*/
|
||||
if (_in_write_pass && !new_write_pass) {
|
||||
#if 1
|
||||
add_guard_point (when, timecnt_t (_time_domain)); // also sets most_recent_insert_iterator
|
||||
add_guard_point (when, timecnt_t (time_domain())); // also sets most_recent_insert_iterator
|
||||
#else
|
||||
const ControlEvent cp (when, 0.0);
|
||||
most_recent_insert_iterator = lower_bound (_events.begin (), _events.end (), &cp, time_comparator);
|
||||
@ -557,7 +559,7 @@ ControlList::set_in_write_pass (bool yn, bool add_point, timepos_t when)
|
||||
|
||||
if (yn && add_point) {
|
||||
Glib::Threads::RWLock::WriterLock lm (_lock);
|
||||
add_guard_point (when, timecnt_t (_time_domain));
|
||||
add_guard_point (when, timecnt_t (time_domain()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -565,7 +567,7 @@ void
|
||||
ControlList::add_guard_point (timepos_t const& time, timecnt_t const& offset)
|
||||
{
|
||||
/* we do not convert this yet */
|
||||
assert (offset.time_domain () == _time_domain);
|
||||
assert (offset.time_domain () == time_domain());
|
||||
|
||||
timepos_t when = ensure_time_domain (time);
|
||||
|
||||
@ -686,7 +688,7 @@ ControlList::editor_add (timepos_t const& time, double value, bool with_guard)
|
||||
*/
|
||||
|
||||
if (when >= 1) {
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (_time_domain), value));
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (time_domain()), value));
|
||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added value %2 at zero\n", this, value));
|
||||
}
|
||||
}
|
||||
@ -772,8 +774,8 @@ ControlList::editor_add_ordered (OrderedPoints const & points, bool with_guard)
|
||||
* the same value.
|
||||
*/
|
||||
|
||||
if (_events.empty () && when > timecnt_t (_time_domain)) {
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (_time_domain), value));
|
||||
if (_events.empty () && when > timecnt_t (time_domain())) {
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (time_domain()), value));
|
||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added value %2 at zero\n", this, value));
|
||||
}
|
||||
|
||||
@ -899,11 +901,11 @@ ControlList::add (timepos_t const& time, double value, bool with_guards, bool wi
|
||||
if (when >= 1) {
|
||||
if (_desc.toggled) {
|
||||
const double opp_val = ((value >= 0.5) ? 1.0 : 0.0);
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (_time_domain), opp_val));
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (time_domain()), opp_val));
|
||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added toggled value %2 at zero\n", this, opp_val));
|
||||
|
||||
} else {
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (_time_domain), value));
|
||||
_events.insert (_events.end (), new ControlEvent (timepos_t (time_domain()), value));
|
||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 added default value %2 at zero\n", this, _desc.normal));
|
||||
}
|
||||
}
|
||||
@ -913,7 +915,7 @@ ControlList::add (timepos_t const& time, double value, bool with_guards, bool wi
|
||||
/* first write in a write pass: add guard point if requested */
|
||||
|
||||
if (with_guards) {
|
||||
add_guard_point (insert_position, timecnt_t (_time_domain));
|
||||
add_guard_point (insert_position, timecnt_t (time_domain()));
|
||||
} else {
|
||||
/* not adding a guard, but we need to set iterator appropriately */
|
||||
const ControlEvent cp (when, 0.0);
|
||||
@ -1319,10 +1321,10 @@ ControlList::thaw ()
|
||||
void
|
||||
ControlList::mark_dirty () const
|
||||
{
|
||||
_lookup_cache.left = timepos_t::max (_time_domain);
|
||||
_lookup_cache.left = timepos_t::max (time_domain());
|
||||
_lookup_cache.range.first = _events.end ();
|
||||
_lookup_cache.range.second = _events.end ();
|
||||
_search_cache.left = timepos_t::max (_time_domain);
|
||||
_search_cache.left = timepos_t::max (time_domain());
|
||||
_search_cache.first = _events.end ();
|
||||
|
||||
if (_curve) {
|
||||
@ -1461,7 +1463,7 @@ ControlList::truncate_start (timecnt_t const& overall)
|
||||
|
||||
if (np < 2) {
|
||||
/* less than 2 points: add a new point */
|
||||
_events.push_front (new ControlEvent (timepos_t (_time_domain), _events.front ()->value));
|
||||
_events.push_front (new ControlEvent (timepos_t (time_domain()), _events.front ()->value));
|
||||
|
||||
} else {
|
||||
/* more than 2 points: check to see if the first 2 values
|
||||
@ -1474,10 +1476,10 @@ ControlList::truncate_start (timecnt_t const& overall)
|
||||
|
||||
if (_events.front ()->value == (*second)->value) {
|
||||
/* first segment is flat, just move start point back to zero */
|
||||
_events.front ()->when = timepos_t (_time_domain);
|
||||
_events.front ()->when = timepos_t (time_domain());
|
||||
} else {
|
||||
/* leave non-flat segment in place, add a new leading point. */
|
||||
_events.push_front (new ControlEvent (timepos_t (_time_domain), _events.front ()->value));
|
||||
_events.push_front (new ControlEvent (timepos_t (time_domain()), _events.front ()->value));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1518,7 +1520,7 @@ ControlList::truncate_start (timecnt_t const& overall)
|
||||
|
||||
/* add a new point for the interpolated new value */
|
||||
|
||||
_events.push_front (new ControlEvent (timepos_t (_time_domain), first_legal_value));
|
||||
_events.push_front (new ControlEvent (timepos_t (time_domain()), first_legal_value));
|
||||
}
|
||||
|
||||
unlocked_invalidate_insert_iterator ();
|
||||
@ -1620,7 +1622,7 @@ ControlList::multipoint_eval (timepos_t const& xtime) const
|
||||
|
||||
/* Only do the range lookup if xtime is in a different range than last time
|
||||
* this was called (or if the lookup cache has been marked "dirty" (left<0) */
|
||||
if ((_lookup_cache.left == timepos_t::max (_time_domain)) ||
|
||||
if ((_lookup_cache.left == timepos_t::max (time_domain())) ||
|
||||
((_lookup_cache.left > xtime) ||
|
||||
(_lookup_cache.range.first == _events.end ()) ||
|
||||
((*_lookup_cache.range.second)->when < xtime))) {
|
||||
@ -1675,7 +1677,7 @@ ControlList::multipoint_eval (timepos_t const& xtime) const
|
||||
}
|
||||
|
||||
/* x is a control point in the data */
|
||||
_lookup_cache.left = timepos_t::max (_time_domain);
|
||||
_lookup_cache.left = timepos_t::max (time_domain());
|
||||
return (*range.first)->value;
|
||||
}
|
||||
|
||||
@ -1687,9 +1689,9 @@ ControlList::build_search_cache_if_necessary (timepos_t const& start_time) const
|
||||
if (_events.empty ()) {
|
||||
/* Empty, nothing to cache, move to end. */
|
||||
_search_cache.first = _events.end ();
|
||||
_search_cache.left = timepos_t::max (_time_domain);
|
||||
_search_cache.left = timepos_t::max (time_domain());
|
||||
return;
|
||||
} else if ((_search_cache.left == timepos_t::max (_time_domain)) || (_search_cache.left > start)) {
|
||||
} else if ((_search_cache.left == timepos_t::max (time_domain())) || (_search_cache.left > start)) {
|
||||
/* Marked dirty (left == max), or we're too far forward, re-search. */
|
||||
|
||||
const ControlEvent start_point (start, 0);
|
||||
@ -1920,7 +1922,7 @@ ControlList::rt_safe_earliest_event_linear_unlocked (Temporal::timepos_t const&
|
||||
std::shared_ptr<ControlList>
|
||||
ControlList::cut_copy_clear (timepos_t const& start_time, timepos_t const& end_time, int op)
|
||||
{
|
||||
std::shared_ptr<ControlList> nal = create (_parameter, _desc, _time_domain);
|
||||
std::shared_ptr<ControlList> nal = create (_parameter, _desc, *this);
|
||||
|
||||
iterator s, e;
|
||||
timepos_t start = start_time;
|
||||
@ -1964,7 +1966,7 @@ ControlList::cut_copy_clear (timepos_t const& start_time, timepos_t const& end_t
|
||||
}
|
||||
|
||||
if (op != 2) { // ! clear
|
||||
nal->_events.push_back (new ControlEvent (timepos_t (_time_domain), val));
|
||||
nal->_events.push_back (new ControlEvent (timepos_t (time_domain()), val));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2070,10 +2072,10 @@ ControlList::paste (const ControlList& alist, timepos_t const& time)
|
||||
|
||||
timepos_t adj_pos;
|
||||
|
||||
if (_time_domain == (*i)->when.time_domain ()) {
|
||||
if (time_domain() == (*i)->when.time_domain ()) {
|
||||
adj_pos = (*i)->when + pos;
|
||||
} else {
|
||||
if (_time_domain == AudioTime) {
|
||||
if (time_domain() == AudioTime) {
|
||||
adj_pos = timepos_t (((*i)->when + pos).samples ());
|
||||
} else {
|
||||
adj_pos = timepos_t (((*i)->when + pos).beats ());
|
||||
@ -2155,7 +2157,7 @@ ControlList::move_ranges (const list<RangeMove>& movements)
|
||||
while (j != old_events.end ()) {
|
||||
timepos_t jtime;
|
||||
|
||||
switch (_time_domain) {
|
||||
switch (time_domain()) {
|
||||
case AudioTime:
|
||||
jtime = (*j)->when;
|
||||
break;
|
||||
@ -2174,7 +2176,7 @@ ControlList::move_ranges (const list<RangeMove>& movements)
|
||||
if (jtime >= i->from) {
|
||||
ControlEvent* ev = new ControlEvent (**j);
|
||||
|
||||
switch (_time_domain) {
|
||||
switch (time_domain()) {
|
||||
case AudioTime:
|
||||
ev->when += dx;
|
||||
break;
|
||||
@ -2288,22 +2290,4 @@ ControlList::dump (ostream& o)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlList::set_time_domain (Temporal::TimeDomain td)
|
||||
{
|
||||
assert (_events.empty ());
|
||||
_time_domain = td;
|
||||
/* XXX: TODO: apply to all points */
|
||||
}
|
||||
|
||||
void
|
||||
ControlList::set_time_domain_empty (Temporal::TimeDomain td)
|
||||
{
|
||||
/* the event list may or may not be empty, but we act as if it is. This
|
||||
is used in e.g. ::set_state(), since we do not need to modify the
|
||||
event time domains there.
|
||||
*/
|
||||
_time_domain = td;
|
||||
}
|
||||
|
||||
} // namespace Evoral
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "temporal/domain_provider.h"
|
||||
#include "temporal/timeline.h"
|
||||
#include "temporal/types.h"
|
||||
#include "temporal/range.h"
|
||||
@ -84,7 +85,7 @@ public:
|
||||
|
||||
/** A list (sequence) of time-stamped values for a control
|
||||
*/
|
||||
class LIBEVORAL_API ControlList
|
||||
class LIBEVORAL_API ControlList : public Temporal::TimeDomainProvider
|
||||
{
|
||||
public:
|
||||
typedef std::list<ControlEvent*> EventList;
|
||||
@ -93,15 +94,12 @@ public:
|
||||
typedef EventList::const_iterator const_iterator;
|
||||
typedef EventList::const_reverse_iterator const_reverse_iterator;
|
||||
|
||||
ControlList (const Parameter& id, const ParameterDescriptor& desc, Temporal::TimeDomain);
|
||||
ControlList (const Parameter& id, const ParameterDescriptor& desc, Temporal::TimeDomainProvider const &);
|
||||
ControlList (const ControlList&, Temporal::timepos_t const & start, Temporal::timepos_t const & end);
|
||||
ControlList (const ControlList&);
|
||||
virtual ~ControlList();
|
||||
|
||||
Temporal::TimeDomain time_domain() const { return _time_domain; }
|
||||
void set_time_domain (Temporal::TimeDomain td);
|
||||
|
||||
virtual std::shared_ptr<ControlList> create(const Parameter& id, const ParameterDescriptor& desc, Temporal::TimeDomain);
|
||||
virtual std::shared_ptr<ControlList> create(const Parameter& id, const ParameterDescriptor& desc, Temporal::TimeDomainProvider const &);
|
||||
|
||||
void dump (std::ostream&);
|
||||
|
||||
@ -389,8 +387,6 @@ public:
|
||||
|
||||
virtual void maybe_signal_changed ();
|
||||
|
||||
void set_time_domain_empty (Temporal::TimeDomain td);
|
||||
|
||||
void _x_scale (Temporal::ratio_t const &);
|
||||
|
||||
mutable LookupCache _lookup_cache;
|
||||
@ -405,7 +401,6 @@ public:
|
||||
int8_t _frozen;
|
||||
bool _changed_when_thawed;
|
||||
bool _sort_pending;
|
||||
Temporal::TimeDomain _time_domain;
|
||||
|
||||
Curve* _curve;
|
||||
|
||||
|
@ -366,7 +366,7 @@ CurveTest::constrainedCubic ()
|
||||
Evoral::ParameterDescriptor pd;
|
||||
pd.lower = 5;
|
||||
pd.upper = 325;
|
||||
Evoral::ControlList l(p, pd, AudioTime);
|
||||
Evoral::ControlList l(p, pd, Temporal::TimeDomainProvider (AudioTime));
|
||||
|
||||
size_t i;
|
||||
l.set_interpolation(Evoral::ControlList::Curved);
|
||||
|
@ -30,6 +30,6 @@ private:
|
||||
std::shared_ptr<Evoral::ControlList> TestCtrlList() {
|
||||
Evoral::Parameter param (Evoral::Parameter(0));
|
||||
const Evoral::ParameterDescriptor desc;
|
||||
return std::shared_ptr<Evoral::ControlList> (new Evoral::ControlList(param, desc, Temporal::AudioTime));
|
||||
return std::shared_ptr<Evoral::ControlList> (new Evoral::ControlList(param, desc, Temporal::TimeDomainProvider (Temporal::AudioTime)));
|
||||
}
|
||||
};
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
Evoral::ParameterDescriptor desc;
|
||||
desc.upper = 127;
|
||||
desc.rangesteps = 128;
|
||||
std::shared_ptr<ControlList> list(new ControlList(param, desc, Temporal::BeatTime));
|
||||
std::shared_ptr<ControlList> list(new ControlList(param, desc, Temporal::TimeDomainProvider (Temporal::BeatTime)));
|
||||
return std::shared_ptr<Control>(new Control(param, desc, list));
|
||||
}
|
||||
};
|
||||
|
@ -19,26 +19,66 @@
|
||||
#ifndef __temporal_domain_provider_h__
|
||||
#define __temporal_domain_provider_h__
|
||||
|
||||
#include "pbd/signals.h"
|
||||
#include "temporal/types.h"
|
||||
|
||||
namespace Temporal {
|
||||
|
||||
class TimeDomainProvider {
|
||||
public:
|
||||
TimeDomainProvider () : have_domain (false), parent (nullptr) {}
|
||||
TimeDomainProvider (TimeDomain td) : have_domain (true), domain (td), parent (nullptr) {}
|
||||
TimeDomainProvider (TimeDomain td, TimeDomainProvider const & p) : have_domain (true), domain (td), parent (&p) {}
|
||||
TimeDomainProvider (TimeDomainProvider const & p) : have_domain (false), parent (&p) {}
|
||||
explicit TimeDomainProvider () : have_domain (false), parent (nullptr) {}
|
||||
explicit TimeDomainProvider (TimeDomain td) : have_domain (true), domain (td), parent (nullptr) {}
|
||||
TimeDomainProvider (TimeDomain td, TimeDomainProvider const & p) : have_domain (true), domain (td), parent (&p) { listen(); }
|
||||
TimeDomainProvider (TimeDomainProvider const & other) : have_domain (other.have_domain), domain (other.domain), parent (other.parent) { listen(); }
|
||||
virtual ~TimeDomainProvider() {}
|
||||
|
||||
TimeDomainProvider& operator= (TimeDomainProvider const & other) {
|
||||
if (this != &other) {
|
||||
parent_connection.disconnect ();
|
||||
have_domain = other.have_domain;
|
||||
domain = other.domain;
|
||||
parent = other.parent;
|
||||
listen ();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
TimeDomain time_domain() const { if (have_domain) return domain; if (parent) return parent->time_domain(); return AudioTime; }
|
||||
void set_time_domain (TimeDomain td) { have_domain = true; domain = td; }
|
||||
void clear_time_domain () { have_domain = false; }
|
||||
|
||||
void clear_time_domain () { have_domain = false; TimeDomainChanged(); /* EMIT SIGNAL */ }
|
||||
void set_time_domain (TimeDomain td) { have_domain = true; domain = td; TimeDomainChanged(); /* EMIT SIGNAL */}
|
||||
|
||||
bool has_parent() const { return (bool) parent; }
|
||||
void clear_time_domain_parent () { parent = nullptr; TimeDomainChanged (); /* EMIT SIGNAL */ }
|
||||
void set_time_domain_parent (TimeDomainProvider const & p) {
|
||||
parent_connection.disconnect ();
|
||||
TimeDomain old_domain = time_domain();
|
||||
parent = &p;
|
||||
TimeDomain new_domain = time_domain ();
|
||||
if (old_domain != new_domain) {
|
||||
TimeDomainChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
mutable PBD::Signal0<void> TimeDomainChanged;
|
||||
|
||||
virtual void time_domain_changed() {
|
||||
/* Forward a time domain change to children */
|
||||
TimeDomainChanged();
|
||||
}
|
||||
|
||||
protected:
|
||||
void listen () {
|
||||
if (parent) {
|
||||
parent->TimeDomainChanged.connect_same_thread (parent_connection, boost::bind (&TimeDomainProvider::time_domain_changed, this));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool have_domain;
|
||||
TimeDomain domain;
|
||||
TimeDomainProvider const * parent;
|
||||
PBD::ScopedConnection parent_connection;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user