- = boost::dynamic_pointer_cast<SlavableAutomationControl>(ac);
- if (sc) {
- got_curve = sc->get_masters_curve_locked (start, end, scratch, veclen);
- } else {
- got_curve = ac->list()->curve().rt_safe_get_vector (start, end, scratch, veclen);
- }
- if (got_curve) {
- // TODO use SSE/AVX methods, e.g. ARDOUR::apply_gain_to_buffer, mix_buffers_no_gain
- // which works as long as automation _types_ gain_t == ARDOUR::Sample type == float
- if (!rv) {
- // TODO optimize this, in case rv is false, direcly use "vec" above.
- rv = true;
- memcpy (vec, scratch, sizeof (float) * veclen);
- } else {
- for (framecnt_t i = 0; i < veclen; ++i) {
- vec[i] *= scratch[i];
- }
- }
- } else if (rv) {
- const float v = get_masters_value ();
- for (framecnt_t i = 0; i < veclen; ++i) {
- vec[i] *= v;
- }
- }
+ = boost::dynamic_pointer_cast<SlavableAutomationControl>(mr->second.master());
+ assert (sc);
+ rv |= sc->masters_curve_multiply (start, end, vec, veclen);