Remove weird/pointless Automatable::data().
authorDavid Robillard <d@drobilla.net>
Fri, 5 Feb 2010 20:03:57 +0000 (20:03 +0000)
committerDavid Robillard <d@drobilla.net>
Fri, 5 Feb 2010 20:03:57 +0000 (20:03 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6637 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_time_axis.cc
gtk2_ardour/generic_pluginui.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/route_time_axis.cc
libs/ardour/amp.cc
libs/ardour/ardour/audioregion.h
libs/ardour/ardour/automatable.h
libs/ardour/ardour/midi_region.h
libs/ardour/plugin_insert.cc
libs/ardour/route.cc
libs/ardour/session_state.cc

index 7236c5dea63d2c77d0927a7cb38e88cc64982f74..af6cfda927a1ef9b006e03e4fb40e0bdf721f8b3 100644 (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;
index 974d16887cce7d1f89f4131b17feff01051702c5..58d89ea3ba939e0f690a3e44b0b4ae00cd142ae5 100644 (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;
index c2ce763b3bdfb41d36a033fd00054d20cf7c3a52..4cb78f3495daa3f6e036e8d0dd40f5e2c6600f08 100644 (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());
index f1e2b3168c504c2492dcc467532f603c1bb38086..dc1a463af92e56032a4048f4bb75fe8a7fca3805 100644 (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,
index 9f52a276f41a32836671b84d526e37bfcbccacbf..ddcb3f84db6a4d481b70dbe0bef904f15ebdc39b 100644 (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 (
index c2d13667dd7fc29e5fa99562256fbc2acac2c888..8b95881dc2ac74e7d0c67861c99057681ea6dcc6 100644 (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 */
index 7bfd43ec022be6297152d96d64c29fd036054e08..3236d816c315447725ae0e097ddf9d5648f8580a 100644 (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();
 
index 5bd338b39e4c801ead42ab9099005a99d8caa4a2..1c83c838a79d7007a77f10743bddb608ac0c798c 100644 (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 */
index 98583625669837027535c0d9900a6c81a4586b5e..2ad4d4b350ffed899ee11409ec3b806fff103a3a 100644 (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()) {
index 6e8b134cc970fa4c8e46e9269e3eff17bbe23ac3..1f670605c1309c508df35e6c7f2ee952a8ec7366 100644 (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;
                        }
                }
index e222de2221624a1df43ea398569179f483840b9a..483c9a08993bc0b719f0f384708bb4c66d14f3d2 100644 (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;
        }