class name change to clearly disambiguate Evoral::ControlList (a list of time/value pairs) from lists of Controls in libardour
This commit is contained in:
parent
af2e0e279c
commit
2bbf06c8cc
@ -125,7 +125,7 @@ protected:
|
||||
void can_automate(Evoral::Parameter);
|
||||
|
||||
virtual void automation_list_automation_state_changed (Evoral::Parameter const&, AutoState);
|
||||
SerializedRCUManager<ControlList> _automated_controls;
|
||||
SerializedRCUManager<AutomationControlList> _automated_controls;
|
||||
|
||||
int load_automation (const std::string& path);
|
||||
int old_set_automation_state(const XMLNode&);
|
||||
@ -134,7 +134,7 @@ protected:
|
||||
|
||||
samplepos_t _last_automation_snapshot;
|
||||
|
||||
SlavableControlList slavables () const { return SlavableControlList(); }
|
||||
SlavableAutomationControlList slavables () const { return SlavableAutomationControlList(); }
|
||||
|
||||
void find_next_ac_event (std::shared_ptr<AutomationControl>, Temporal::timepos_t const & start, Temporal::timepos_t const & end, Evoral::ControlEvent& ev) const;
|
||||
void find_prev_ac_event (std::shared_ptr<AutomationControl>, Temporal::timepos_t const & start, Temporal::timepos_t const & end, Evoral::ControlEvent& ev) const;
|
||||
|
@ -122,7 +122,7 @@ public:
|
||||
const ARDOUR::Session& session() const { return _session; }
|
||||
void commit_transaction (bool did_write);
|
||||
|
||||
ControlList grouped_controls () const;
|
||||
AutomationControlList grouped_controls () const;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ControlGroup> _group;
|
||||
|
@ -56,7 +56,7 @@ class LIBARDOUR_API ControlGroup : public std::enable_shared_from_this<ControlGr
|
||||
|
||||
void pop_all ();
|
||||
|
||||
ControlList controls () const;
|
||||
AutomationControlList controls () const;
|
||||
|
||||
void clear (bool pop = false);
|
||||
|
||||
|
@ -737,7 +737,7 @@ protected:
|
||||
|
||||
std::shared_ptr<Processor> the_instrument_unlocked() const;
|
||||
|
||||
SlavableControlList slavables () const;
|
||||
SlavableAutomationControlList slavables () const;
|
||||
|
||||
private:
|
||||
/* no copy construction */
|
||||
|
@ -972,7 +972,7 @@ public:
|
||||
|
||||
/* Control-based methods */
|
||||
|
||||
void set_controls (std::shared_ptr<ControlList>, double val, PBD::Controllable::GroupControlDisposition);
|
||||
void set_controls (std::shared_ptr<AutomationControlList>, double val, PBD::Controllable::GroupControlDisposition);
|
||||
void set_control (std::shared_ptr<AutomationControl>, double val, PBD::Controllable::GroupControlDisposition);
|
||||
|
||||
void set_exclusive_input_active (std::shared_ptr<RouteList> rt, bool onoff, bool flip_others = false);
|
||||
@ -2259,7 +2259,7 @@ private:
|
||||
}
|
||||
|
||||
/* specialized version realtime "apply to set of controls" operations */
|
||||
SessionEvent* get_rt_event (std::shared_ptr<WeakControlList> cl, double arg, PBD::Controllable::GroupControlDisposition group_override) {
|
||||
SessionEvent* get_rt_event (std::shared_ptr<WeakAutomationControlList> cl, double arg, PBD::Controllable::GroupControlDisposition group_override) {
|
||||
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
|
||||
ev->rt_slot = boost::bind (&Session::rt_set_controls, this, cl, arg, group_override);
|
||||
ev->rt_return = Session::rt_cleanup;
|
||||
@ -2268,7 +2268,7 @@ private:
|
||||
return ev;
|
||||
}
|
||||
|
||||
void rt_set_controls (std::shared_ptr<WeakControlList>, double val, PBD::Controllable::GroupControlDisposition group_override);
|
||||
void rt_set_controls (std::shared_ptr<WeakAutomationControlList>, double val, PBD::Controllable::GroupControlDisposition group_override);
|
||||
void rt_clear_all_solo_state (std::shared_ptr<RouteList const>, bool yn, PBD::Controllable::GroupControlDisposition group_override);
|
||||
|
||||
void setup_midi_machine_control ();
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
|
||||
typedef boost::function<void (SessionEvent*)> RTeventCallback;
|
||||
|
||||
std::shared_ptr<ControlList> controls; /* apply to */
|
||||
std::shared_ptr<AutomationControlList> controls; /* apply to */
|
||||
std::shared_ptr<RouteList> routes; /* apply to */
|
||||
boost::function<void (void)> rt_slot; /* what to call in RT context */
|
||||
RTeventCallback rt_return; /* called after rt_slot, with this event as an argument */
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
bool assigned_to (VCAManager*, std::shared_ptr<VCA>) const;
|
||||
|
||||
protected:
|
||||
virtual SlavableControlList slavables () const = 0;
|
||||
virtual SlavableAutomationControlList slavables () const = 0;
|
||||
|
||||
private:
|
||||
bool assign_controls (std::shared_ptr<VCA>);
|
||||
|
@ -655,9 +655,9 @@ typedef std::list<std::shared_ptr<GraphNode> > GraphNodeList;
|
||||
typedef std::list<std::shared_ptr<Stripable> > StripableList;
|
||||
typedef std::list<std::weak_ptr <Route> > WeakRouteList;
|
||||
typedef std::list<std::weak_ptr <Stripable> > WeakStripableList;
|
||||
typedef std::list<std::shared_ptr<AutomationControl> > ControlList;
|
||||
typedef std::list<std::weak_ptr <AutomationControl> > WeakControlList;
|
||||
typedef std::list<std::shared_ptr<SlavableAutomationControl> > SlavableControlList;
|
||||
typedef std::list<std::shared_ptr<AutomationControl> > AutomationControlList;
|
||||
typedef std::list<std::weak_ptr <AutomationControl> > WeakAutomationControlList;
|
||||
typedef std::list<std::shared_ptr<SlavableAutomationControl> > SlavableAutomationControlList;
|
||||
typedef std::set <AutomationType> AutomationTypeSet;
|
||||
|
||||
typedef std::list<std::shared_ptr<VCA> > VCAList;
|
||||
|
@ -112,8 +112,8 @@ LIBARDOUR_API uint32_t how_many_dsp_threads ();
|
||||
|
||||
LIBARDOUR_API std::string compute_sha1_of_file (std::string path);
|
||||
|
||||
template<typename T> std::shared_ptr<ControlList> route_list_to_control_list (std::shared_ptr<RouteList const> rl, std::shared_ptr<T> (Stripable::*get_control)() const) {
|
||||
std::shared_ptr<ControlList> cl (new ControlList);
|
||||
template<typename T> std::shared_ptr<AutomationControlList> route_list_to_control_list (std::shared_ptr<RouteList const> rl, std::shared_ptr<T> (Stripable::*get_control)() const) {
|
||||
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
|
||||
if (!rl) { return cl; }
|
||||
for (auto const& r : *rl) {
|
||||
std::shared_ptr<AutomationControl> ac = (r.get()->*get_control)();
|
||||
|
@ -178,7 +178,7 @@ class LIBARDOUR_API VCA : public Stripable,
|
||||
std::shared_ptr<AutomationControl> filter_enable_controllable () const { return std::shared_ptr<AutomationControl>(); }
|
||||
|
||||
protected:
|
||||
SlavableControlList slavables () const;
|
||||
SlavableAutomationControlList slavables () const;
|
||||
|
||||
private:
|
||||
int32_t _number;
|
||||
|
@ -62,7 +62,7 @@ const string Automatable::xml_node_name = X_("Automation");
|
||||
Automatable::Automatable(Session& session, Temporal::TimeDomain td)
|
||||
: ControlSet ()
|
||||
, _a_session(session)
|
||||
, _automated_controls (new ControlList ())
|
||||
, _automated_controls (new AutomationControlList ())
|
||||
, _time_domain (td)
|
||||
{
|
||||
}
|
||||
@ -71,7 +71,7 @@ Automatable::Automatable (const Automatable& other)
|
||||
: ControlSet (other)
|
||||
, Slavable ()
|
||||
, _a_session (other._a_session)
|
||||
, _automated_controls (new ControlList)
|
||||
, _automated_controls (new AutomationControlList)
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (other._control_lock);
|
||||
|
||||
@ -84,8 +84,8 @@ Automatable::Automatable (const Automatable& other)
|
||||
Automatable::~Automatable ()
|
||||
{
|
||||
{
|
||||
RCUWriter<ControlList> writer (_automated_controls);
|
||||
std::shared_ptr<ControlList> cl = writer.get_copy ();
|
||||
RCUWriter<AutomationControlList> writer (_automated_controls);
|
||||
std::shared_ptr<AutomationControlList> cl = writer.get_copy ();
|
||||
cl->clear ();
|
||||
}
|
||||
_automated_controls.flush ();
|
||||
@ -478,8 +478,8 @@ void
|
||||
Automatable::automation_run (samplepos_t start, pframes_t nframes, bool only_active)
|
||||
{
|
||||
if (only_active) {
|
||||
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
std::shared_ptr<AutomationControlList const> cl = _automated_controls.reader ();
|
||||
for (AutomationControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
(*ci)->automation_run (start, nframes);
|
||||
}
|
||||
return;
|
||||
@ -502,10 +502,10 @@ Automatable::automation_list_automation_state_changed (Evoral::Parameter const&
|
||||
std::shared_ptr<AutomationControl> c (automation_control(param));
|
||||
assert (c && c->list());
|
||||
|
||||
RCUWriter<ControlList> writer (_automated_controls);
|
||||
std::shared_ptr<ControlList> cl = writer.get_copy ();
|
||||
RCUWriter<AutomationControlList> writer (_automated_controls);
|
||||
std::shared_ptr<AutomationControlList> cl = writer.get_copy ();
|
||||
|
||||
ControlList::iterator fi = std::find (cl->begin(), cl->end(), c);
|
||||
AutomationControlList::iterator fi = std::find (cl->begin(), cl->end(), c);
|
||||
if (fi != cl->end()) {
|
||||
cl->erase (fi);
|
||||
}
|
||||
@ -663,8 +663,8 @@ Automatable::find_next_event (timepos_t const & start, timepos_t const & end, Ev
|
||||
next_event.when = start <= end ? timepos_t::max (start.time_domain()) : timepos_t (start.time_domain());
|
||||
|
||||
if (only_active) {
|
||||
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
std::shared_ptr<AutomationControlList const> cl = _automated_controls.reader ();
|
||||
for (AutomationControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
if ((*ci)->automation_playback()) {
|
||||
if (start <= end) {
|
||||
find_next_ac_event (*ci, start, end, next_event);
|
||||
|
@ -153,13 +153,13 @@ AutomationControl::set_value (double val, PBD::Controllable::GroupControlDisposi
|
||||
}
|
||||
}
|
||||
|
||||
ControlList
|
||||
AutomationControlList
|
||||
AutomationControl::grouped_controls () const
|
||||
{
|
||||
if (_group && _group->use_me (PBD::Controllable::UseGroup)) {
|
||||
return _group->controls ();
|
||||
} else {
|
||||
return ControlList ();
|
||||
return AutomationControlList ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,10 +86,10 @@ ControlGroup::clear (bool pop)
|
||||
}
|
||||
}
|
||||
|
||||
ControlList
|
||||
AutomationControlList
|
||||
ControlGroup::controls () const
|
||||
{
|
||||
ControlList c;
|
||||
AutomationControlList c;
|
||||
|
||||
if (_active) {
|
||||
Glib::Threads::RWLock::WriterLock lm (controls_lock);
|
||||
|
@ -923,8 +923,8 @@ PluginInsert::connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t e
|
||||
bufs.set_count(ChanCount::max(bufs.count(), _configured_out));
|
||||
|
||||
if (with_auto) {
|
||||
std::shared_ptr<ControlList const> cl = _automated_controls.reader ();
|
||||
for (ControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
std::shared_ptr<AutomationControlList const> cl = _automated_controls.reader ();
|
||||
for (AutomationControlList::const_iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
AutomationControl& c = *(ci->get());
|
||||
std::shared_ptr<const Evoral::ControlList> clist (c.list());
|
||||
/* we still need to check for Touch and Latch */
|
||||
|
@ -6139,10 +6139,10 @@ Route::automatables (PBD::ControllableSet& s) const
|
||||
}
|
||||
}
|
||||
|
||||
SlavableControlList
|
||||
SlavableAutomationControlList
|
||||
Route::slavables () const
|
||||
{
|
||||
SlavableControlList rv;
|
||||
SlavableAutomationControlList rv;
|
||||
rv.push_back (_gain_control);
|
||||
rv.push_back (_mute_control);
|
||||
rv.push_back (_solo_control);
|
||||
|
@ -3986,7 +3986,7 @@ Session::cancel_all_mute ()
|
||||
StripableList all;
|
||||
get_stripables (all);
|
||||
std::vector<std::weak_ptr<AutomationControl> > muted;
|
||||
std::shared_ptr<ControlList> cl (new ControlList);
|
||||
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
|
||||
for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
|
||||
assert (!(*i)->is_auditioner());
|
||||
if ((*i)->is_monitor()) {
|
||||
|
@ -41,7 +41,7 @@ using namespace ARDOUR;
|
||||
using namespace Glib;
|
||||
|
||||
void
|
||||
Session::set_controls (std::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
|
||||
Session::set_controls (std::shared_ptr<AutomationControlList> cl, double val, Controllable::GroupControlDisposition gcd)
|
||||
{
|
||||
if (cl->empty()) {
|
||||
return;
|
||||
@ -71,8 +71,8 @@ Session::set_controls (std::shared_ptr<ControlList> cl, double val, Controllable
|
||||
}
|
||||
#endif
|
||||
|
||||
std::shared_ptr<WeakControlList> wcl (new WeakControlList);
|
||||
for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
std::shared_ptr<WeakAutomationControlList> wcl (new WeakAutomationControlList);
|
||||
for (AutomationControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
|
||||
/* as of july 2017 this is a no-op for everything except record enable */
|
||||
(*ci)->pre_realtime_queue_stuff (val, gcd);
|
||||
/* fill in weak pointer ctrl list */
|
||||
@ -89,13 +89,13 @@ Session::set_control (std::shared_ptr<AutomationControl> ac, double val, Control
|
||||
return;
|
||||
}
|
||||
|
||||
std::shared_ptr<ControlList> cl (new ControlList);
|
||||
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
|
||||
cl->push_back (ac);
|
||||
set_controls (cl, val, gcd);
|
||||
}
|
||||
|
||||
void
|
||||
Session::rt_set_controls (std::shared_ptr<WeakControlList> cl, double val, Controllable::GroupControlDisposition gcd)
|
||||
Session::rt_set_controls (std::shared_ptr<WeakAutomationControlList> cl, double val, Controllable::GroupControlDisposition gcd)
|
||||
{
|
||||
/* Note that we require that all controls in the ControlList are of the
|
||||
same type.
|
||||
|
@ -1083,8 +1083,8 @@ Session::solo_selection_active ()
|
||||
void
|
||||
Session::solo_selection (StripableList &list, bool new_state)
|
||||
{
|
||||
std::shared_ptr<ControlList> solo_list (new ControlList);
|
||||
std::shared_ptr<ControlList> unsolo_list (new ControlList);
|
||||
std::shared_ptr<AutomationControlList> solo_list (new AutomationControlList);
|
||||
std::shared_ptr<AutomationControlList> unsolo_list (new AutomationControlList);
|
||||
|
||||
std::shared_ptr<RouteList const> rl = get_routes();
|
||||
|
||||
|
@ -134,8 +134,8 @@ Slavable::do_assign (VCAManager* manager)
|
||||
assign (*v);
|
||||
}
|
||||
|
||||
SlavableControlList scl = slavables ();
|
||||
for (SlavableControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
SlavableAutomationControlList scl = slavables ();
|
||||
for (SlavableAutomationControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
(*i)->use_saved_master_ratios ();
|
||||
}
|
||||
}
|
||||
@ -197,8 +197,8 @@ bool
|
||||
Slavable::assign_controls (std::shared_ptr<VCA> vca)
|
||||
{
|
||||
bool rv = false;
|
||||
SlavableControlList scl = slavables ();
|
||||
for (SlavableControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
SlavableAutomationControlList scl = slavables ();
|
||||
for (SlavableAutomationControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
rv |= assign_control (vca, *i);
|
||||
}
|
||||
return rv;
|
||||
@ -207,8 +207,8 @@ Slavable::assign_controls (std::shared_ptr<VCA> vca)
|
||||
void
|
||||
Slavable::unassign_controls (std::shared_ptr<VCA> vca)
|
||||
{
|
||||
SlavableControlList scl = slavables ();
|
||||
for (SlavableControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
SlavableAutomationControlList scl = slavables ();
|
||||
for (SlavableAutomationControlList::iterator i = scl.begin(); i != scl.end(); ++i) {
|
||||
unassign_control (vca, *i);
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +405,7 @@ SlavableAutomationControl::clear_masters ()
|
||||
|
||||
const double old_val = AutomationControl::get_double ();
|
||||
|
||||
ControlList masters;
|
||||
AutomationControlList masters;
|
||||
bool update_value = false;
|
||||
double master_ratio = 0;
|
||||
double list_ratio = toggled () ? 0 : 1;
|
||||
@ -447,7 +447,7 @@ SlavableAutomationControl::clear_masters ()
|
||||
if (_list) {
|
||||
XMLNode* before = &alist ()->get_state ();
|
||||
if (!masters.empty()) {
|
||||
for (ControlList::const_iterator m = masters.begin(); m != masters.end(); ++m) {
|
||||
for (AutomationControlList::const_iterator m = masters.begin(); m != masters.end(); ++m) {
|
||||
_list->list_merge (*(*m)->list().get(), boost::bind (&SlavableAutomationControl::scale_automation_callback, this, _1, _2));
|
||||
}
|
||||
_list->y_transform (boost::bind (&SlavableAutomationControl::scale_automation_callback, this, _1, list_ratio));
|
||||
|
@ -220,10 +220,10 @@ VCA::assign (std::shared_ptr<VCA> v)
|
||||
Slavable::assign (v);
|
||||
}
|
||||
|
||||
SlavableControlList
|
||||
SlavableAutomationControlList
|
||||
VCA::slavables () const
|
||||
{
|
||||
SlavableControlList rv;
|
||||
SlavableAutomationControlList rv;
|
||||
rv.push_back (_gain_control);
|
||||
rv.push_back (_mute_control);
|
||||
rv.push_back (_solo_control);
|
||||
|
@ -339,7 +339,7 @@ FaderPort8::button_solo_clear ()
|
||||
cancel_all_solo (); // AccessAction ("Main", "cancel-solo");
|
||||
} else {
|
||||
/* restore solo */
|
||||
std::shared_ptr<ControlList> cl (new ControlList);
|
||||
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
|
||||
for (std::vector <std::weak_ptr<AutomationControl> >::const_iterator i = _solo_state.begin(); i != _solo_state.end(); ++i) {
|
||||
std::shared_ptr<AutomationControl> ac = (*i).lock();
|
||||
if (!ac) {
|
||||
@ -363,7 +363,7 @@ FaderPort8::button_mute_clear ()
|
||||
_mute_state = session->cancel_all_mute ();
|
||||
} else {
|
||||
/* restore mute */
|
||||
std::shared_ptr<ControlList> cl (new ControlList);
|
||||
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
|
||||
for (std::vector <std::weak_ptr<AutomationControl> >::const_iterator i = _mute_state.begin(); i != _mute_state.end(); ++i) {
|
||||
std::shared_ptr<AutomationControl> ac = (*i).lock();
|
||||
if (!ac) {
|
||||
|
Loading…
Reference in New Issue
Block a user