2007-09-06 02:30:39 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02:00
|
|
|
* Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
|
|
|
|
|
* Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
* Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
|
|
|
|
|
* Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
|
* Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*/
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2014-11-16 17:04:27 -05:00
|
|
|
#include <cmath>
|
|
|
|
|
#include <list>
|
2007-09-06 02:30:39 +00:00
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
|
|
2014-01-10 12:08:17 -05:00
|
|
|
#include "gtkmm2ext/gtk_ui.h"
|
|
|
|
|
|
|
|
|
|
#include "pbd/compose.h"
|
|
|
|
|
#include "canvas/debug.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/midi_region.h"
|
|
|
|
|
#include "ardour/midi_source.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
|
|
|
|
|
#include "automation_region_view.h"
|
2014-12-16 00:05:45 -05:00
|
|
|
#include "automation_streamview.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
#include "automation_time_axis.h"
|
2014-12-16 00:05:45 -05:00
|
|
|
#include "gui_thread.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
#include "public_editor.h"
|
2014-12-16 00:05:45 -05:00
|
|
|
#include "region_selection.h"
|
|
|
|
|
#include "region_view.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
#include "rgb_macros.h"
|
2014-12-16 00:05:45 -05:00
|
|
|
#include "selection.h"
|
2015-01-02 21:44:54 +07:00
|
|
|
#include "ui_config.h"
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2014-12-17 19:43:09 -05:00
|
|
|
|
2007-09-06 02:30:39 +00:00
|
|
|
using namespace std;
|
|
|
|
|
using namespace ARDOUR;
|
2014-12-16 00:05:45 -05:00
|
|
|
using namespace ARDOUR_UI_UTILS;
|
2007-09-06 02:30:39 +00:00
|
|
|
using namespace PBD;
|
|
|
|
|
using namespace Editing;
|
|
|
|
|
|
2009-07-09 17:58:13 +00:00
|
|
|
AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
|
2014-01-10 12:08:17 -05:00
|
|
|
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
|
2017-07-01 18:42:24 +02:00
|
|
|
tv.canvas_display())
|
2007-09-06 02:30:39 +00:00
|
|
|
, _automation_view(tv)
|
2010-06-25 20:47:09 +00:00
|
|
|
, _pending_automation_state (Off)
|
2007-09-06 02:30:39 +00:00
|
|
|
{
|
2014-01-10 12:08:17 -05:00
|
|
|
CANVAS_DEBUG_NAME (_canvas_group, string_compose ("SV canvas group auto %1", tv.name()));
|
|
|
|
|
CANVAS_DEBUG_NAME (canvas_rect, string_compose ("SV canvas rectangle auto %1", tv.name()));
|
|
|
|
|
|
2014-12-16 00:05:45 -05:00
|
|
|
color_handler ();
|
|
|
|
|
|
2015-01-02 21:44:54 +07:00
|
|
|
UIConfiguration::instance().ColorsChanged.connect(sigc::mem_fun(*this, &AutomationStreamView::color_handler));
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AutomationStreamView::~AutomationStreamView ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RegionView*
|
2023-02-16 16:33:28 -07:00
|
|
|
AutomationStreamView::add_region_view_internal (std::shared_ptr<Region> region, bool /*wait_for_data*/, bool /*recording*/)
|
2007-09-06 02:30:39 +00:00
|
|
|
{
|
2014-12-17 19:43:09 -05:00
|
|
|
if (!region) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
const std::shared_ptr<AutomationControl> control = std::dynamic_pointer_cast<AutomationControl> (
|
2011-02-17 16:18:27 +00:00
|
|
|
region->control (_automation_view.parameter(), true)
|
2010-06-25 20:47:09 +00:00
|
|
|
);
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<AutomationList> list;
|
2008-09-19 06:30:49 +00:00
|
|
|
if (control) {
|
2023-02-16 16:33:28 -07:00
|
|
|
list = std::dynamic_pointer_cast<AutomationList>(control->list());
|
2014-12-17 19:43:09 -05:00
|
|
|
if (control->list() && !list) {
|
|
|
|
|
error << _("unable to display automation region for control without list") << endmsg;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2008-09-19 06:30:49 +00:00
|
|
|
}
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2022-12-18 20:58:05 -07:00
|
|
|
RegionView *region_view;
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2023-01-08 09:52:20 -07:00
|
|
|
for (auto const & rv : region_views) {
|
|
|
|
|
if (rv->region() == region) {
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2023-01-08 09:52:20 -07:00
|
|
|
/* great. we already have an AutomationRegionView for this Region. use it again. */
|
|
|
|
|
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*>(rv);;
|
2007-09-06 02:30:39 +00:00
|
|
|
|
2023-01-08 09:52:20 -07:00
|
|
|
if (arv->line()) {
|
|
|
|
|
arv->line()->set_list (list);
|
2011-07-10 15:28:36 +00:00
|
|
|
}
|
2023-01-08 09:52:20 -07:00
|
|
|
rv->set_valid (true);
|
|
|
|
|
display_region (arv);
|
2022-12-18 20:58:05 -07:00
|
|
|
|
2023-01-08 09:52:20 -07:00
|
|
|
return 0;
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
2022-12-18 20:58:05 -07:00
|
|
|
}
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2023-01-08 09:52:20 -07:00
|
|
|
region_view = new AutomationRegionView (
|
|
|
|
|
_canvas_group, _automation_view, region,
|
|
|
|
|
_automation_view.parameter (), list,
|
|
|
|
|
_samples_per_pixel, region_color
|
|
|
|
|
);
|
|
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
region_view->init (false);
|
2007-09-06 02:30:39 +00:00
|
|
|
region_views.push_front (region_view);
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2007-09-06 02:30:39 +00:00
|
|
|
/* follow global waveform setting */
|
|
|
|
|
|
2014-01-10 12:08:17 -05:00
|
|
|
display_region (region_view);
|
2007-09-06 02:30:39 +00:00
|
|
|
|
|
|
|
|
/* catch regionview going away */
|
2023-02-16 16:33:28 -07:00
|
|
|
region->DropReferences.connect (*this, invalidator (*this), boost::bind (&AutomationStreamView::remove_region_view, this, std::weak_ptr<Region>(region)), gui_context());
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2010-06-25 20:47:09 +00:00
|
|
|
/* setup automation state for this region */
|
2022-12-18 20:58:05 -07:00
|
|
|
if (_automation_view.parameter().type() != MidiVelocityAutomation) {
|
|
|
|
|
std::shared_ptr<AutomationLine> line = dynamic_cast<AutomationRegionView*>(region_view)->line ();
|
|
|
|
|
if (line && line->the_list()) {
|
|
|
|
|
line->the_list()->set_automation_state (automation_state ());
|
|
|
|
|
}
|
2010-06-25 20:47:09 +00:00
|
|
|
}
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2007-09-06 02:30:39 +00:00
|
|
|
RegionViewAdded (region_view);
|
|
|
|
|
|
|
|
|
|
return region_view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2022-12-18 20:58:05 -07:00
|
|
|
AutomationStreamView::display_region (RegionView* region_view)
|
2007-09-06 02:30:39 +00:00
|
|
|
{
|
2022-12-18 20:58:05 -07:00
|
|
|
if (_automation_view.parameter().type() != MidiVelocityAutomation) {
|
|
|
|
|
dynamic_cast<AutomationRegionView*>(region_view)->line().reset();
|
|
|
|
|
}
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
2008-09-21 16:17:02 +00:00
|
|
|
void
|
|
|
|
|
AutomationStreamView::set_automation_state (AutoState state)
|
|
|
|
|
{
|
2010-08-09 22:23:23 +00:00
|
|
|
/* Setting the automation state for this view sets the state of all regions' lists to the same thing */
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2010-06-25 20:47:09 +00:00
|
|
|
if (region_views.empty()) {
|
|
|
|
|
_pending_automation_state = state;
|
|
|
|
|
} else {
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines = get_lines ();
|
2010-08-05 13:35:43 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
for (list<std::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
|
2010-08-05 13:35:43 +00:00
|
|
|
if ((*i)->the_list()) {
|
|
|
|
|
(*i)->the_list()->set_automation_state (state);
|
2010-06-25 20:47:09 +00:00
|
|
|
}
|
2010-05-22 01:33:13 +00:00
|
|
|
}
|
2008-09-21 16:17:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-06 02:30:39 +00:00
|
|
|
void
|
2010-04-21 20:42:22 +00:00
|
|
|
AutomationStreamView::redisplay_track ()
|
2007-09-06 02:30:39 +00:00
|
|
|
{
|
2022-03-30 16:44:04 -06:00
|
|
|
vector<RegionView::DisplaySuspender> vds;
|
2009-02-15 20:31:05 +00:00
|
|
|
// Flag region views as invalid and disable drawing
|
2011-02-17 16:18:15 +00:00
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2007-09-06 02:30:39 +00:00
|
|
|
(*i)->set_valid (false);
|
2022-03-30 16:44:04 -06:00
|
|
|
vds.push_back (RegionView::DisplaySuspender (**i));
|
|
|
|
|
|
2009-01-28 04:55:31 +00:00
|
|
|
}
|
2009-02-15 20:31:05 +00:00
|
|
|
|
|
|
|
|
// Add and display region views, and flag them as valid
|
2009-07-09 17:58:13 +00:00
|
|
|
if (_trackview.is_track()) {
|
2010-04-21 20:42:22 +00:00
|
|
|
_trackview.track()->playlist()->foreach_region (
|
2009-06-08 19:28:51 +00:00
|
|
|
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
|
2009-06-03 00:23:34 +00:00
|
|
|
);
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2009-02-15 20:31:05 +00:00
|
|
|
// Stack regions by layer, and remove invalid regions
|
|
|
|
|
layer_regions();
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
AutomationStreamView::setup_rec_box ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
AutomationStreamView::color_handler ()
|
|
|
|
|
{
|
2014-12-16 00:05:45 -05:00
|
|
|
if (_trackview.is_midi_track()) {
|
2015-01-02 21:44:54 +07:00
|
|
|
canvas_rect->set_fill_color (UIConfiguration::instance().color_mod ("midi track base", "midi track base"));
|
2014-12-16 00:05:45 -05:00
|
|
|
} else {
|
2015-01-02 21:44:54 +07:00
|
|
|
canvas_rect->set_fill_color (UIConfiguration::instance().color ("midi bus base"));
|
2009-10-14 16:10:01 +00:00
|
|
|
}
|
2007-09-06 02:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
2010-05-22 01:33:13 +00:00
|
|
|
AutoState
|
|
|
|
|
AutomationStreamView::automation_state () const
|
|
|
|
|
{
|
|
|
|
|
if (region_views.empty()) {
|
2010-06-25 20:47:09 +00:00
|
|
|
return _pending_automation_state;
|
2010-05-22 01:33:13 +00:00
|
|
|
}
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<AutomationLine> line = ((AutomationRegionView*) region_views.front())->line ();
|
2010-05-22 01:33:13 +00:00
|
|
|
if (!line || !line->the_list()) {
|
|
|
|
|
return Off;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return line->the_list()->automation_state ();
|
|
|
|
|
}
|
2010-05-25 15:51:32 +00:00
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
AutomationStreamView::has_automation () const
|
|
|
|
|
{
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines = get_lines ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
for (list<std::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
|
2010-08-05 13:35:43 +00:00
|
|
|
if ((*i)->npoints() > 0) {
|
2010-05-25 15:51:32 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-14 00:58:15 +00:00
|
|
|
/** Our parent AutomationTimeAxisView calls this when the user requests a particular
|
|
|
|
|
* InterpolationStyle; tell the AutomationLists in our regions.
|
|
|
|
|
*/
|
2010-05-25 16:40:35 +00:00
|
|
|
void
|
|
|
|
|
AutomationStreamView::set_interpolation (AutomationList::InterpolationStyle s)
|
|
|
|
|
{
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines = get_lines ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
for (list<std::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
|
2010-08-05 13:35:43 +00:00
|
|
|
(*i)->the_list()->set_interpolation (s);
|
2010-07-14 00:58:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AutomationList::InterpolationStyle
|
|
|
|
|
AutomationStreamView::interpolation () const
|
|
|
|
|
{
|
|
|
|
|
if (region_views.empty()) {
|
|
|
|
|
return AutomationList::Linear;
|
2010-05-25 16:40:35 +00:00
|
|
|
}
|
2010-07-14 00:58:15 +00:00
|
|
|
|
|
|
|
|
AutomationRegionView* v = dynamic_cast<AutomationRegionView*> (region_views.front());
|
2013-01-19 07:00:43 +00:00
|
|
|
if (v) {
|
|
|
|
|
return v->line()->the_list()->interpolation ();
|
|
|
|
|
}
|
2013-01-19 08:55:19 +00:00
|
|
|
return AutomationList::Linear;
|
2010-05-25 16:40:35 +00:00
|
|
|
}
|
2010-07-31 00:44:26 +00:00
|
|
|
|
|
|
|
|
/** Clear all automation displayed in this view */
|
|
|
|
|
void
|
|
|
|
|
AutomationStreamView::clear ()
|
|
|
|
|
{
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines = get_lines ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
for (list<std::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
|
2010-08-05 13:35:43 +00:00
|
|
|
(*i)->clear ();
|
2010-07-31 00:44:26 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-08-04 15:41:55 +00:00
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
/** @param start Start position in session samples.
|
|
|
|
|
* @param end End position in session samples.
|
2010-08-06 23:28:44 +00:00
|
|
|
* @param bot Bottom position expressed as a fraction of track height where 0 is the bottom of the track.
|
|
|
|
|
* @param top Top position expressed as a fraction of track height where 0 is the bottom of the track.
|
|
|
|
|
* NOTE: this y system is different to that for the StreamView method that this overrides, which is a little
|
|
|
|
|
* confusing.
|
2010-08-05 13:36:38 +00:00
|
|
|
*/
|
2010-08-04 15:41:55 +00:00
|
|
|
void
|
2020-10-02 21:26:17 -06:00
|
|
|
AutomationStreamView::get_selectables (timepos_t const & start, timepos_t const & end, double botfrac, double topfrac, list<Selectable*>& results, bool /*within*/)
|
2010-08-04 15:41:55 +00:00
|
|
|
{
|
|
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
|
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
|
2014-12-17 19:43:09 -05:00
|
|
|
if (arv) {
|
|
|
|
|
arv->line()->get_selectables (start, end, botfrac, topfrac, results);
|
|
|
|
|
}
|
2010-08-04 15:41:55 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
AutomationStreamView::set_selected_points (PointSelection& ps)
|
|
|
|
|
{
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines = get_lines ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
for (list<std::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
|
2010-08-05 13:35:43 +00:00
|
|
|
(*i)->set_selected_points (ps);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> >
|
2010-08-05 13:35:43 +00:00
|
|
|
AutomationStreamView::get_lines () const
|
|
|
|
|
{
|
2023-02-16 16:33:28 -07:00
|
|
|
list<std::shared_ptr<AutomationLine> > lines;
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2010-08-05 13:35:43 +00:00
|
|
|
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2010-08-04 15:41:55 +00:00
|
|
|
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
|
2014-12-17 19:43:09 -05:00
|
|
|
if (arv) {
|
|
|
|
|
lines.push_back (arv->line());
|
|
|
|
|
}
|
2010-08-04 15:41:55 +00:00
|
|
|
}
|
2010-08-05 13:35:43 +00:00
|
|
|
|
|
|
|
|
return lines;
|
2010-08-04 15:41:55 +00:00
|
|
|
}
|
2010-08-05 13:36:38 +00:00
|
|
|
|
2014-11-16 17:04:27 -05:00
|
|
|
bool
|
2020-09-26 09:14:59 -06:00
|
|
|
AutomationStreamView::paste (timepos_t const & pos,
|
2014-11-16 17:04:27 -05:00
|
|
|
unsigned paste_count,
|
|
|
|
|
float times,
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<ARDOUR::AutomationList> alist)
|
2010-08-05 13:36:38 +00:00
|
|
|
{
|
|
|
|
|
/* XXX: not sure how best to pick this; for now, just use the last region which starts before pos */
|
|
|
|
|
|
|
|
|
|
if (region_views.empty()) {
|
2014-11-16 17:04:27 -05:00
|
|
|
return false;
|
2010-08-05 13:36:38 +00:00
|
|
|
}
|
|
|
|
|
|
2014-12-16 14:37:40 -05:00
|
|
|
region_views.sort (RegionView::PositionOrder());
|
2010-08-05 13:36:38 +00:00
|
|
|
|
|
|
|
|
list<RegionView*>::const_iterator prev = region_views.begin ();
|
|
|
|
|
|
|
|
|
|
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2020-11-30 10:59:17 -07:00
|
|
|
if ((*i)->region()->position() > pos) {
|
2010-08-05 13:36:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
prev = i;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<Region> r = (*prev)->region ();
|
2010-08-05 13:36:38 +00:00
|
|
|
|
|
|
|
|
/* If *prev doesn't cover pos, it's no good */
|
2020-11-30 10:59:17 -07:00
|
|
|
if (r->position() > pos || ((r->position() + r->length()) < pos)) {
|
2014-12-06 12:19:52 -05:00
|
|
|
return false;
|
2010-08-05 13:36:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*prev);
|
2014-11-16 17:04:27 -05:00
|
|
|
return arv ? arv->paste(pos, paste_count, times, alist) : false;
|
2010-08-05 13:36:38 +00:00
|
|
|
}
|