13
0

Remove weird/pointless Automatable::data().

git-svn-id: svn://localhost/ardour2/branches/3.0@6637 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2010-02-05 20:03:57 +00:00
parent 249bc2f744
commit 8d64ce26c4
11 changed files with 23 additions and 25 deletions

View File

@ -283,7 +283,7 @@ AudioTimeAxisView::ensure_pan_views (bool show)
for (p = params.begin(); p != params.end(); ++p) {
boost::shared_ptr<ARDOUR::AutomationControl> pan_control
= boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
_route->panner()->data().control(*p));
_route->panner()->control(*p));
if (pan_control->parameter().type() == NullAutomation) {
error << "Pan control has NULL automation type!" << endmsg;

View File

@ -225,7 +225,7 @@ GenericPluginUI::build ()
boost::shared_ptr<ARDOUR::AutomationControl> c
= boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
insert->data().control(Evoral::Parameter(PluginAutomation, 0, i)));
insert->control(Evoral::Parameter(PluginAutomation, 0, i)));
if ((cui = build_control_ui (i, c)) == 0) {
error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;

View File

@ -915,7 +915,7 @@ MixerStrip::connect_to_pan ()
boost::shared_ptr<ARDOUR::AutomationControl> pan_control
= boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
_route->panner()->data().control(Evoral::Parameter(PanAutomation)));
_route->panner()->control(Evoral::Parameter(PanAutomation)));
if (pan_control) {
pan_control->alist()->automation_state_changed.connect (panstate_connection, boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());

View File

@ -1726,7 +1726,7 @@ RouteTimeAxisView::show_existing_automation ()
for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) {
for (vector<ProcessorAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
if ((*ii)->view != 0 && (*i)->processor->data().control((*ii)->what)->list()->size() > 0) {
if ((*ii)->view != 0 && (*i)->processor->control((*ii)->what)->list()->size() > 0) {
(*ii)->menu_item->set_active (true);
}
}
@ -1874,7 +1874,7 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor>
snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (processor->name()).c_str(), what.id());
boost::shared_ptr<AutomationControl> control
= boost::dynamic_pointer_cast<AutomationControl>(processor->data().control(what, true));
= boost::dynamic_pointer_cast<AutomationControl>(processor->control(what, true));
pan->view = boost::shared_ptr<AutomationTimeAxisView>(
new AutomationTimeAxisView (_session, _route, processor, control,

View File

@ -374,7 +374,7 @@ Amp::GainControl::get_value (void) const
void
Amp::setup_gain_automation (sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
{
Glib::Mutex::Lock am (data().control_lock(), Glib::TRY_LOCK);
Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK);
if (am.locked() && _session.transport_rolling() && _gain_control->automation_playback()) {
_apply_gain_automation = _gain_control->list()->curve().rt_safe_get_vector (

View File

@ -142,12 +142,12 @@ class AudioRegion : public Region
boost::shared_ptr<Evoral::Control>
control(const Evoral::Parameter& id, bool create=false) {
return _automatable.data().control(id, create);
return _automatable.control(id, create);
}
virtual boost::shared_ptr<const Evoral::Control>
control(const Evoral::Parameter& id) const {
return _automatable.data().control(id);
return _automatable.control(id);
}
/* export */

View File

@ -90,9 +90,6 @@ public:
typedef Evoral::ControlSet::Controls Controls;
Evoral::ControlSet& data() { return *dynamic_cast<Evoral::ControlSet*>(this); }
const Evoral::ControlSet& data() const { return *dynamic_cast<const Evoral::ControlSet*>(this); }
int set_automation_state (const XMLNode&, Evoral::Parameter default_param);
XMLNode& get_automation_state();

View File

@ -78,12 +78,12 @@ class MidiRegion : public Region
boost::shared_ptr<Evoral::Control>
control(const Evoral::Parameter& id, bool create=false) {
return model()->data().control(id, create);
return model()->control(id, create);
}
virtual boost::shared_ptr<const Evoral::Control>
control(const Evoral::Parameter& id) const {
return model()->data().control(id);
return model()->control(id);
}
/* export */

View File

@ -139,7 +139,7 @@ PluginInsert::auto_state_changed (Evoral::Parameter which)
return;
boost::shared_ptr<AutomationControl> c
= boost::dynamic_pointer_cast<AutomationControl>(data().control (which));
= boost::dynamic_pointer_cast<AutomationControl>(control (which));
if (c && ((AutomationList*)c->list().get())->automation_state() != Off) {
_plugins[0]->set_parameter (which.id(), c->list()->eval (_session.transport_frame()));
@ -289,7 +289,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
uint32_t n = 0;
for (Controls::iterator li = data().controls().begin(); li != data().controls().end(); ++li, ++n) {
for (Controls::iterator li = controls().begin(); li != controls().end(); ++li, ++n) {
boost::shared_ptr<AutomationControl> c
= boost::dynamic_pointer_cast<AutomationControl>(li->second);
@ -417,7 +417,7 @@ PluginInsert::set_parameter (Evoral::Parameter param, float val)
_plugins[0]->set_parameter (param.id(), val);
boost::shared_ptr<AutomationControl> ac
= boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
= boost::dynamic_pointer_cast<AutomationControl>(control(param));
if (ac) {
ac->set_value(val);
@ -448,14 +448,14 @@ PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
nframes_t end = now + nframes;
nframes_t offset = 0;
Glib::Mutex::Lock lm (data().control_lock(), Glib::TRY_LOCK);
Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
if (!lm.locked()) {
connect_and_run (bufs, nframes, offset, false);
return;
}
if (!data().find_next_event (now, end, next_event)) {
if (!find_next_event (now, end, next_event)) {
/* no events have a time within the relevant range */
@ -473,7 +473,7 @@ PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
offset += cnt;
now += cnt;
if (!data().find_next_event (now, end, next_event)) {
if (!find_next_event (now, end, next_event)) {
break;
}
}
@ -703,7 +703,8 @@ PluginInsert::state (bool full)
child->add_child_nocopy (automation_list (*x).state (full));
autonode->add_child_nocopy (*child);
*/
autonode->add_child_nocopy (((AutomationList*)data().control(*x)->list().get())->state (full));
AutomationList* list = dynamic_cast<AutomationList*>(control(*x)->list().get());
autonode->add_child_nocopy (list->state (full));
}
node.add_child_nocopy (*autonode);
@ -871,7 +872,7 @@ PluginInsert::set_parameter_state (const XMLNode& node, int version)
}
boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
data().control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
if (c) {
c->alist()->set_state (*child, version);
@ -928,7 +929,7 @@ PluginInsert::set_parameter_state_2X (const XMLNode& node, int version)
}
boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
data().control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
if (c) {
if (!child->children().empty()) {

View File

@ -3148,7 +3148,7 @@ Route::get_control (const Evoral::Parameter& param)
{
/* either we own the control or .... */
boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(data().control (param));
boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(control (param));
if (!c) {
@ -3156,7 +3156,7 @@ Route::get_control (const Evoral::Parameter& param)
Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((c = boost::dynamic_pointer_cast<AutomationControl>((*i)->data().control (param))) != 0) {
if ((c = boost::dynamic_pointer_cast<AutomationControl>((*i)->control (param))) != 0) {
break;
}
}

View File

@ -2757,7 +2757,7 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
if (p) {
c = boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
p->data().control(Evoral::Parameter(PluginAutomation, 0, parameter_index)));
p->control(Evoral::Parameter(PluginAutomation, 0, parameter_index)));
}
break;
}