2006-08-11 03:24:57 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02:00
|
|
|
* Copyright (C) 2006-2016 David Robillard <d@drobilla.net>
|
|
|
|
|
* Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
|
* Copyright (C) 2007-2018 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
* Copyright (C) 2008-2012 Hans Baier <hansfbaier@googlemail.com>
|
|
|
|
|
* Copyright (C) 2013-2017 John Emmas <john@creativepost.co.uk>
|
|
|
|
|
* Copyright (C) 2014-2017 Nick Mainsbridge <mainsbridge@gmail.com>
|
|
|
|
|
* Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
|
* Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
|
* Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
|
* Copyright (C) 2015-2017 André Nusser <andre.nusser@googlemail.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.
|
|
|
|
|
*/
|
2006-08-11 03:24:57 +00:00
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
|
#include <algorithm>
|
2009-02-16 09:51:40 +00:00
|
|
|
#include <ostream>
|
2006-08-11 03:24:57 +00:00
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
|
|
2012-01-19 22:23:28 +00:00
|
|
|
#include "gtkmm2ext/gtk_ui.h"
|
2006-08-11 03:24:57 +00:00
|
|
|
|
2007-07-17 01:48:42 +00:00
|
|
|
#include <sigc++/signal.h>
|
|
|
|
|
|
2014-12-13 00:37:34 -05:00
|
|
|
#include "midi++/midnam_patch.h"
|
|
|
|
|
|
2010-03-02 18:05:26 +00:00
|
|
|
#include "pbd/stateful_diff_command.h"
|
2020-08-09 20:23:19 +02:00
|
|
|
#include "pbd/unwind.h"
|
2009-08-14 03:00:41 +00:00
|
|
|
|
2021-01-14 11:25:08 -07:00
|
|
|
#include "ardour/debug.h"
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/midi_model.h"
|
2015-03-01 13:33:25 -05:00
|
|
|
#include "ardour/midi_playlist.h"
|
2013-01-21 07:24:42 +00:00
|
|
|
#include "ardour/midi_region.h"
|
|
|
|
|
#include "ardour/midi_source.h"
|
|
|
|
|
#include "ardour/midi_track.h"
|
2014-11-15 16:32:08 -05:00
|
|
|
#include "ardour/operations.h"
|
2022-08-31 13:53:55 -06:00
|
|
|
#include "ardour/quantize.h"
|
2009-10-30 15:30:22 +00:00
|
|
|
#include "ardour/session.h"
|
2009-02-25 18:26:51 +00:00
|
|
|
|
2019-10-25 13:13:51 -06:00
|
|
|
#include "evoral/Parameter.h"
|
|
|
|
|
#include "evoral/Event.h"
|
|
|
|
|
#include "evoral/Control.h"
|
2010-05-20 22:38:12 +00:00
|
|
|
#include "evoral/midi_util.h"
|
2006-08-11 03:24:57 +00:00
|
|
|
|
2013-04-25 16:06:12 -04:00
|
|
|
#include "canvas/debug.h"
|
2013-04-04 00:32:52 -04:00
|
|
|
|
2009-08-10 19:29:29 +00:00
|
|
|
#include "automation_region_view.h"
|
|
|
|
|
#include "automation_time_axis.h"
|
2014-11-16 22:35:37 -05:00
|
|
|
#include "control_point.h"
|
2011-02-21 01:52:15 +00:00
|
|
|
#include "debug.h"
|
2010-09-21 15:15:06 +00:00
|
|
|
#include "editor.h"
|
2011-11-16 20:11:33 +00:00
|
|
|
#include "editor_drag.h"
|
2006-08-11 03:24:57 +00:00
|
|
|
#include "ghostregion.h"
|
|
|
|
|
#include "gui_thread.h"
|
2014-11-16 22:35:37 -05:00
|
|
|
#include "item_counts.h"
|
2007-08-05 00:50:54 +00:00
|
|
|
#include "keyboard.h"
|
2011-06-13 14:48:48 +00:00
|
|
|
#include "midi_channel_dialog.h"
|
2009-08-13 01:57:03 +00:00
|
|
|
#include "midi_cut_buffer.h"
|
2009-08-27 03:09:30 +00:00
|
|
|
#include "midi_list_editor.h"
|
2009-08-10 19:29:29 +00:00
|
|
|
#include "midi_region_view.h"
|
|
|
|
|
#include "midi_streamview.h"
|
|
|
|
|
#include "midi_time_axis.h"
|
|
|
|
|
#include "midi_util.h"
|
2012-06-06 13:17:53 +00:00
|
|
|
#include "midi_velocity_dialog.h"
|
2010-09-15 18:54:04 +00:00
|
|
|
#include "note_player.h"
|
2014-12-06 12:20:52 -05:00
|
|
|
#include "paste_context.h"
|
2009-08-10 19:29:29 +00:00
|
|
|
#include "public_editor.h"
|
2013-03-27 21:50:18 -04:00
|
|
|
#include "route_time_axis.h"
|
2010-08-11 19:11:14 +00:00
|
|
|
#include "rgb_macros.h"
|
2009-08-10 19:29:29 +00:00
|
|
|
#include "selection.h"
|
|
|
|
|
#include "streamview.h"
|
2010-12-28 18:19:40 +00:00
|
|
|
#include "patch_change_dialog.h"
|
2023-01-08 09:52:20 -07:00
|
|
|
#include "velocity_ghost_region.h"
|
2011-05-02 13:38:16 +00:00
|
|
|
#include "verbose_cursor.h"
|
2013-04-04 00:32:52 -04:00
|
|
|
#include "note.h"
|
|
|
|
|
#include "hit.h"
|
|
|
|
|
#include "patch_change.h"
|
|
|
|
|
#include "sys_ex.h"
|
2015-01-02 21:44:54 +07:00
|
|
|
#include "ui_config.h"
|
2006-08-11 03:24:57 +00:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2006-08-11 03:24:57 +00:00
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
|
|
|
|
using namespace PBD;
|
|
|
|
|
using namespace Editing;
|
2014-11-30 18:27:04 -05:00
|
|
|
using namespace std;
|
2020-12-07 17:59:55 -07:00
|
|
|
using namespace Temporal;
|
2009-12-04 22:51:32 +00:00
|
|
|
using Gtkmm2ext::Keyboard;
|
2006-08-11 03:24:57 +00:00
|
|
|
|
2011-08-03 11:15:01 +00:00
|
|
|
#define MIDI_BP_ZERO ((Config->get_first_midi_bank_is_zero())?0:1)
|
|
|
|
|
|
2014-11-20 17:36:09 -05:00
|
|
|
MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
2024-01-08 22:35:37 -07:00
|
|
|
EditingContext& ec,
|
2014-11-20 17:36:09 -05:00
|
|
|
RouteTimeAxisView& tv,
|
2024-01-08 22:35:37 -07:00
|
|
|
std::shared_ptr<MidiRegion> r,
|
2014-11-20 17:36:09 -05:00
|
|
|
double spu,
|
|
|
|
|
uint32_t basic_color)
|
2006-08-11 03:24:57 +00:00
|
|
|
: RegionView (parent, tv, r, spu, basic_color)
|
2024-01-10 15:16:15 -07:00
|
|
|
, MidiView (std::dynamic_pointer_cast<MidiTrack> (tv.stripable()), *group, ec, *dynamic_cast<MidiStreamView*>(tv.view()), basic_color)
|
2006-08-11 03:24:57 +00:00
|
|
|
{
|
2010-10-08 14:54:16 +00:00
|
|
|
connect_to_diskstream ();
|
2006-08-11 03:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-20 17:36:09 -05:00
|
|
|
MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
2024-01-08 22:35:37 -07:00
|
|
|
EditingContext& ec,
|
2014-11-20 17:36:09 -05:00
|
|
|
RouteTimeAxisView& tv,
|
2024-01-08 22:35:37 -07:00
|
|
|
std::shared_ptr<MidiRegion> r,
|
2014-11-20 17:36:09 -05:00
|
|
|
double spu,
|
|
|
|
|
uint32_t basic_color,
|
2014-12-17 02:34:30 -05:00
|
|
|
bool recording,
|
2014-11-20 17:36:09 -05:00
|
|
|
TimeAxisViewItem::Visibility visibility)
|
2014-12-17 02:34:30 -05:00
|
|
|
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
2024-01-10 15:16:15 -07:00
|
|
|
, MidiView (std::dynamic_pointer_cast<MidiTrack> (tv.stripable()), *group, ec, *dynamic_cast<MidiStreamView*>(tv.view()), basic_color)
|
2006-08-11 03:24:57 +00:00
|
|
|
{
|
2010-10-08 14:54:16 +00:00
|
|
|
connect_to_diskstream ();
|
2006-08-11 03:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
2008-09-26 17:18:22 +00:00
|
|
|
MidiRegionView::MidiRegionView (const MidiRegionView& other)
|
2009-02-26 00:58:35 +00:00
|
|
|
: sigc::trackable(other)
|
|
|
|
|
, RegionView (other)
|
2024-01-08 22:35:37 -07:00
|
|
|
, MidiView (other)
|
2008-09-26 17:18:22 +00:00
|
|
|
{
|
2014-06-09 23:28:32 -04:00
|
|
|
init (false);
|
2008-09-26 17:18:22 +00:00
|
|
|
}
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
MidiRegionView::MidiRegionView (const MidiRegionView& other, std::shared_ptr<MidiRegion> region)
|
|
|
|
|
: RegionView (other, std::shared_ptr<Region> (region))
|
2024-01-08 22:35:37 -07:00
|
|
|
, MidiView (other)
|
2008-09-26 17:18:22 +00:00
|
|
|
{
|
2014-06-09 23:28:32 -04:00
|
|
|
init (true);
|
2008-09-26 17:18:22 +00:00
|
|
|
}
|
|
|
|
|
|
2006-08-11 03:24:57 +00:00
|
|
|
void
|
2022-03-30 13:06:49 -06:00
|
|
|
MidiRegionView::init (bool /*wfd*/)
|
2006-08-11 03:24:57 +00:00
|
|
|
{
|
2023-09-24 18:41:51 -06:00
|
|
|
DisplaySuspender ds (*this, true);
|
2022-03-30 16:44:04 -06:00
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
RegionView::init (false);
|
2006-08-11 03:24:57 +00:00
|
|
|
|
2024-01-26 20:45:22 -07:00
|
|
|
CANVAS_DEBUG_NAME (_note_group, string_compose ("note group for %1", get_item_name()));
|
|
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
set_region (std::dynamic_pointer_cast<MidiRegion> (_region));
|
|
|
|
|
|
2016-04-13 05:38:31 +10:00
|
|
|
//set_height (trackview.current_height());
|
2006-08-11 03:24:57 +00:00
|
|
|
|
|
|
|
|
region_muted ();
|
2008-09-14 19:01:08 +00:00
|
|
|
region_sync_changed ();
|
2010-02-19 18:09:08 +00:00
|
|
|
region_resized (ARDOUR::bounds_change);
|
2016-04-13 05:38:31 +10:00
|
|
|
//region_locked ();
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2006-08-11 03:24:57 +00:00
|
|
|
set_colors ();
|
2012-06-12 18:02:03 +00:00
|
|
|
reset_width_dependent_items (_pixel_width);
|
2022-03-30 13:06:49 -06:00
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
_note_group->parent()->raise_to_top();
|
2013-03-27 21:50:18 -04:00
|
|
|
|
2024-10-19 01:51:44 +02:00
|
|
|
Config->ParameterChanged.connect (*this, invalidator (*this), std::bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
|
2024-01-09 14:36:19 -07:00
|
|
|
connect_to_diskstream ();
|
|
|
|
|
}
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::display_is_enabled () const
|
|
|
|
|
{
|
|
|
|
|
return RegionView::display_enabled ();
|
|
|
|
|
}
|
2010-05-25 23:14:41 +00:00
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
void
|
|
|
|
|
MidiRegionView::parameter_changed (std::string const & p)
|
|
|
|
|
{
|
|
|
|
|
RegionView::parameter_changed (p);
|
2010-10-08 14:54:16 +00:00
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
if (p == "display-first-midi-bank-as-zero") {
|
|
|
|
|
if (display_enabled()) {
|
|
|
|
|
view_changed ();
|
|
|
|
|
}
|
|
|
|
|
} else if (p == "color-regions-using-track-color") {
|
|
|
|
|
set_colors ();
|
|
|
|
|
} else if (p == "use-note-color-for-velocity") {
|
|
|
|
|
color_handler ();
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-12 20:22:16 -05:00
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
void
|
|
|
|
|
MidiRegionView::color_handler ()
|
|
|
|
|
{
|
|
|
|
|
RegionView::color_handler ();
|
|
|
|
|
MidiView::color_handler ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::region_resized (PBD::PropertyChange const & change)
|
|
|
|
|
{
|
|
|
|
|
RegionView::region_resized (change);
|
|
|
|
|
MidiView::region_resized (change);
|
2010-10-08 14:54:16 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-11 22:59:35 +00:00
|
|
|
InstrumentInfo&
|
|
|
|
|
MidiRegionView::instrument_info () const
|
|
|
|
|
{
|
|
|
|
|
RouteUI* route_ui = dynamic_cast<RouteUI*> (&trackview);
|
|
|
|
|
return route_ui->route()->instrument_info();
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-16 16:33:28 -07:00
|
|
|
const std::shared_ptr<ARDOUR::MidiRegion>
|
2011-10-19 21:53:09 +00:00
|
|
|
MidiRegionView::midi_region() const
|
|
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
return _midi_region;
|
2011-10-19 21:53:09 +00:00
|
|
|
}
|
|
|
|
|
|
2010-10-08 14:54:16 +00:00
|
|
|
void
|
|
|
|
|
MidiRegionView::connect_to_diskstream ()
|
|
|
|
|
{
|
2011-05-19 21:11:21 +00:00
|
|
|
midi_view()->midi_track()->DataRecorded.connect(
|
|
|
|
|
*this, invalidator(*this),
|
2024-10-19 01:51:44 +02:00
|
|
|
std::bind (&MidiRegionView::data_recorded, this, _1),
|
2011-05-19 21:11:21 +00:00
|
|
|
gui_context());
|
2007-07-15 01:56:11 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-25 15:25:29 -07:00
|
|
|
std::string
|
|
|
|
|
MidiRegionView::get_modifier_name () const
|
|
|
|
|
{
|
|
|
|
|
const bool opaque = _region->opaque() || trackview.layer_display () == Stacked;
|
|
|
|
|
|
|
|
|
|
std::string mod_name;
|
|
|
|
|
|
|
|
|
|
if (_dragging) {
|
|
|
|
|
mod_name = "dragging region";
|
2024-01-08 22:35:37 -07:00
|
|
|
} else if (_editing_context.internal_editing()) {
|
2023-11-25 15:25:29 -07:00
|
|
|
if (!opaque || _region->muted ()) {
|
|
|
|
|
mod_name = "editable region";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (!opaque || _region->muted ()) {
|
|
|
|
|
mod_name = "transparent region base";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mod_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GhostRegion*
|
|
|
|
|
MidiRegionView::add_ghost (TimeAxisView& tv)
|
|
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
double unit_position = _editing_context.time_to_pixel (_region->position ());
|
2023-11-25 15:25:29 -07:00
|
|
|
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv);
|
|
|
|
|
MidiGhostRegion* ghost;
|
|
|
|
|
|
|
|
|
|
if (mtv && mtv->midi_view()) {
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*>(&tv);
|
|
|
|
|
if (atv && atv->parameter() == Evoral::Parameter (MidiVelocityAutomation)) {
|
|
|
|
|
ghost = new VelocityGhostRegion (*this, tv, trackview, unit_position);
|
|
|
|
|
} else {
|
|
|
|
|
ghost = new MidiGhostRegion (*this, tv, trackview, unit_position);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ghost->set_colors ();
|
|
|
|
|
ghost->set_height ();
|
|
|
|
|
ghost->set_duration (_region->length().samples() / samples_per_pixel);
|
|
|
|
|
|
2024-09-16 18:19:40 -06:00
|
|
|
std::cerr << "Adding " << _events.size() << " notes to ghost\n";
|
2023-11-25 15:25:29 -07:00
|
|
|
for (auto const & i : _events) {
|
|
|
|
|
ghost->add_note (i.second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ghosts.push_back (ghost);
|
|
|
|
|
return ghost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-07-15 01:56:11 +00:00
|
|
|
bool
|
2013-04-25 16:06:12 -04:00
|
|
|
MidiRegionView::canvas_group_event(GdkEvent* ev)
|
2007-07-15 01:56:11 +00:00
|
|
|
{
|
2014-12-17 02:34:30 -05:00
|
|
|
if (in_destructor || _recregion) {
|
2014-11-15 15:56:56 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
if (!_editing_context.internal_editing()) {
|
2014-12-05 16:54:29 -05:00
|
|
|
// not in internal edit mode, so just act like a normal region
|
|
|
|
|
return RegionView::canvas_group_event (ev);
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-09 14:36:19 -07:00
|
|
|
return MidiView::canvas_group_event (ev);
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2009-08-17 15:58:47 +00:00
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::enter_notify (GdkEventCrossing* ev)
|
|
|
|
|
{
|
2016-08-31 03:27:35 +10:00
|
|
|
enter_internal (ev->state);
|
2010-05-27 15:07:15 +00:00
|
|
|
|
2014-12-06 19:56:36 -05:00
|
|
|
_entered = true;
|
2011-05-19 21:11:21 +00:00
|
|
|
return false;
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2009-09-10 22:20:37 +00:00
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
2011-09-30 17:55:14 +00:00
|
|
|
MidiRegionView::leave_notify (GdkEventCrossing*)
|
2010-05-27 15:07:15 +00:00
|
|
|
{
|
2020-05-01 22:28:21 -06:00
|
|
|
leave_internal ();
|
2011-08-17 12:46:42 +00:00
|
|
|
|
2014-12-06 19:56:36 -05:00
|
|
|
_entered = false;
|
2011-05-19 21:11:21 +00:00
|
|
|
return false;
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2009-08-27 03:09:30 +00:00
|
|
|
|
2010-11-21 23:54:57 +00:00
|
|
|
void
|
|
|
|
|
MidiRegionView::mouse_mode_changed ()
|
|
|
|
|
{
|
2019-04-08 21:40:33 +02:00
|
|
|
// Adjust frame colour (become more transparent for internal tools)
|
2019-04-08 20:00:02 +02:00
|
|
|
set_frame_color();
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiView::mouse_mode_changed ();
|
2014-12-06 19:56:36 -05:00
|
|
|
}
|
2011-08-17 12:46:42 +00:00
|
|
|
|
2014-12-06 19:56:36 -05:00
|
|
|
void
|
2016-08-31 03:27:35 +10:00
|
|
|
MidiRegionView::enter_internal (uint32_t state)
|
2014-12-06 19:56:36 -05:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
if (_editing_context.current_mouse_mode() == MouseDraw && _mouse_state != AddDragging) {
|
2014-12-06 19:56:36 -05:00
|
|
|
// Show ghost note under pencil
|
2016-08-31 03:27:35 +10:00
|
|
|
create_ghost_note(_last_event_x, _last_event_y, state);
|
2014-12-06 19:56:36 -05:00
|
|
|
}
|
|
|
|
|
|
2019-04-08 21:40:33 +02:00
|
|
|
// Lower frame handles below notes so they don't steal events
|
2018-11-25 21:24:32 -05:00
|
|
|
|
2019-04-08 20:25:05 +02:00
|
|
|
if (frame_handle_start) {
|
|
|
|
|
frame_handle_start->lower_to_bottom();
|
2014-12-28 17:45:24 -05:00
|
|
|
}
|
2019-04-08 20:25:05 +02:00
|
|
|
if (frame_handle_end) {
|
|
|
|
|
frame_handle_end->lower_to_bottom();
|
2014-12-28 17:45:24 -05:00
|
|
|
}
|
2014-12-06 19:56:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::leave_internal()
|
|
|
|
|
{
|
2015-08-15 05:13:14 +02:00
|
|
|
hide_verbose_cursor ();
|
2014-12-06 19:56:36 -05:00
|
|
|
remove_ghost_note ();
|
2016-11-19 21:40:41 +11:00
|
|
|
_entered_note = 0;
|
2014-12-06 19:56:36 -05:00
|
|
|
|
2019-04-09 00:31:29 +02:00
|
|
|
// Raise frame handles above notes so they catch events
|
2019-04-08 20:25:05 +02:00
|
|
|
if (frame_handle_start) {
|
|
|
|
|
frame_handle_start->raise_to_top();
|
2014-12-28 17:45:24 -05:00
|
|
|
}
|
2018-11-25 21:24:32 -05:00
|
|
|
|
2019-04-08 20:25:05 +02:00
|
|
|
if (frame_handle_end) {
|
|
|
|
|
frame_handle_end->raise_to_top();
|
2014-12-28 17:45:24 -05:00
|
|
|
}
|
2010-11-21 23:54:57 +00:00
|
|
|
}
|
|
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::button_press (GdkEventButton* ev)
|
|
|
|
|
{
|
2011-05-19 21:11:21 +00:00
|
|
|
if (ev->button != 1) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2011-03-04 15:16:21 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
MouseMode m = _editing_context.current_mouse_mode();
|
2012-01-20 02:54:23 +00:00
|
|
|
|
2014-12-08 23:00:00 -05:00
|
|
|
if (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
2024-01-08 22:35:37 -07:00
|
|
|
_press_cursor_ctx = CursorContext::create(_editing_context, _editing_context.cursors()->midi_pencil);
|
2014-11-14 02:28:15 -05:00
|
|
|
}
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2012-01-19 22:23:28 +00:00
|
|
|
if (_mouse_state != SelectTouchDragging) {
|
2015-10-05 16:17:49 +02:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
_pressed_button = ev->button;
|
2015-10-05 16:17:49 +02:00
|
|
|
|
2016-11-20 04:49:18 +11:00
|
|
|
if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
2016-11-21 04:02:21 +11:00
|
|
|
|
|
|
|
|
if (midi_view()->note_mode() == Percussive) {
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.drags()->set (new HitCreateDrag (_editing_context, group, this), (GdkEvent *) ev);
|
2016-11-21 04:02:21 +11:00
|
|
|
} else {
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.drags()->set (new NoteCreateDrag (_editing_context, group, this), (GdkEvent *) ev);
|
2016-11-21 04:02:21 +11:00
|
|
|
}
|
|
|
|
|
|
2016-11-20 04:49:18 +11:00
|
|
|
_mouse_state = AddDragging;
|
|
|
|
|
remove_ghost_note ();
|
|
|
|
|
hide_verbose_cursor ();
|
2016-11-21 04:02:21 +11:00
|
|
|
} else {
|
|
|
|
|
_mouse_state = Pressed;
|
2016-11-20 04:49:18 +11:00
|
|
|
}
|
|
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
_pressed_button = ev->button;
|
2015-01-11 04:07:31 +11:00
|
|
|
_mouse_changed_selection = false;
|
2010-05-27 15:07:15 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
return true;
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2007-08-01 21:59:07 +00:00
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::button_release (GdkEventButton* ev)
|
|
|
|
|
{
|
|
|
|
|
double event_x, event_y;
|
2008-05-22 01:02:04 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
if (ev->button != 1) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2011-03-04 15:16:21 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
event_x = ev->x;
|
|
|
|
|
event_y = ev->y;
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
group->canvas_to_item (event_x, event_y);
|
|
|
|
|
group->ungrab ();
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2014-12-20 01:11:28 -05:00
|
|
|
_press_cursor_ctx.reset();
|
2012-01-19 22:23:28 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
switch (_mouse_state) {
|
2011-06-01 17:00:29 +00:00
|
|
|
case Pressed: // Clicked
|
2010-12-29 16:34:51 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
switch (_editing_context.current_mouse_mode()) {
|
2012-01-20 02:54:23 +00:00
|
|
|
case MouseRange:
|
2016-02-22 21:01:23 +01:00
|
|
|
/* no motion occurred - simple click */
|
2020-04-16 12:13:53 -06:00
|
|
|
clear_selection_internal ();
|
2015-01-11 04:07:31 +11:00
|
|
|
_mouse_changed_selection = true;
|
2012-01-20 02:54:23 +00:00
|
|
|
break;
|
|
|
|
|
|
2014-12-08 23:00:00 -05:00
|
|
|
case MouseContent:
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.get_selection().set (this);
|
2022-05-10 11:45:10 -06:00
|
|
|
/* fallthru */
|
2011-05-19 21:11:21 +00:00
|
|
|
case MouseTimeFX:
|
2020-04-16 12:13:53 -06:00
|
|
|
_mouse_changed_selection = true;
|
|
|
|
|
clear_selection_internal ();
|
|
|
|
|
break;
|
2012-01-19 15:23:51 +00:00
|
|
|
case MouseDraw:
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.get_selection().set (this);
|
2016-11-20 04:49:18 +11:00
|
|
|
break;
|
|
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
default:
|
2010-12-29 16:34:51 +00:00
|
|
|
break;
|
2011-05-19 21:11:21 +00:00
|
|
|
}
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
_mouse_state = None;
|
|
|
|
|
break;
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2011-12-11 12:54:54 +00:00
|
|
|
case AddDragging:
|
2016-11-20 04:51:38 +11:00
|
|
|
/* Don't a ghost note when we added a note - wait until motion to avoid visual confusion.
|
|
|
|
|
we don't want one when we were drag-selecting either. */
|
2015-11-30 10:46:26 +01:00
|
|
|
case SelectRectDragging:
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.drags()->end_grab ((GdkEvent *) ev);
|
2011-05-19 21:11:21 +00:00
|
|
|
_mouse_state = None;
|
|
|
|
|
break;
|
2010-05-27 15:07:15 +00:00
|
|
|
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-05-27 15:07:15 +00:00
|
|
|
|
2015-01-12 02:05:19 -05:00
|
|
|
if (_mouse_changed_selection) {
|
2024-01-08 22:35:37 -07:00
|
|
|
_editing_context.begin_reversible_selection_op (X_("Mouse Selection Change"));
|
|
|
|
|
_editing_context.commit_reversible_selection_op ();
|
2015-01-11 04:07:31 +11:00
|
|
|
}
|
|
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
return false;
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2024-01-29 14:06:22 -07:00
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::motion (GdkEventMotion* ev)
|
|
|
|
|
{
|
2024-01-29 14:06:22 -07:00
|
|
|
MidiView::motion (ev);
|
2018-02-06 19:49:32 -06:00
|
|
|
return RegionView::canvas_group_event ((GdkEvent *) ev);
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2008-03-15 00:37:17 +00:00
|
|
|
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2010-05-27 15:07:15 +00:00
|
|
|
bool
|
|
|
|
|
MidiRegionView::scroll (GdkEventScroll* ev)
|
|
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
if (_editing_context.drags()->active()) {
|
2023-10-18 16:46:32 -06:00
|
|
|
return false;
|
|
|
|
|
}
|
2022-04-17 23:16:50 -06:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
if (!_editing_context.get_selection().selected (this)) {
|
2022-05-10 11:45:52 -06:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-30 16:32:20 -06:00
|
|
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier) ||
|
2022-08-31 12:15:51 -06:00
|
|
|
Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
|
|
|
|
|
/* XXX: bit of a hack; allow PrimaryModifier+TertiaryModifier scroll
|
2022-09-30 16:32:20 -06:00
|
|
|
* through so that it still works for navigation and zoom.
|
2023-10-22 17:15:04 -06:00
|
|
|
*/
|
2022-08-31 12:15:51 -06:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
if (_selection.empty()) {
|
2022-09-30 16:32:20 -06:00
|
|
|
const int step = 1;
|
|
|
|
|
const bool zoom = Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier);
|
|
|
|
|
const bool just_one_edge = Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier|Keyboard::PrimaryModifier);
|
2022-04-17 23:16:50 -06:00
|
|
|
|
|
|
|
|
switch (ev->direction) {
|
|
|
|
|
case GDK_SCROLL_UP:
|
2022-09-30 16:32:20 -06:00
|
|
|
if (just_one_edge) {
|
|
|
|
|
/* make higher notes visible aka expand higher pitch range */
|
|
|
|
|
midi_stream_view()->apply_note_range (midi_stream_view()->lowest_note(), min (127, midi_stream_view()->highest_note() + step), true);
|
|
|
|
|
} else if (zoom) {
|
|
|
|
|
/* zoom out to show more higher and lower pitches */
|
|
|
|
|
midi_stream_view()->apply_note_range (max (0, midi_stream_view()->lowest_note() - step), min (127, midi_stream_view()->highest_note() + step), true);
|
|
|
|
|
} else {
|
|
|
|
|
/* scroll towards higher pitches */
|
|
|
|
|
midi_stream_view()->apply_note_range (max (0, midi_stream_view()->lowest_note() + step), min (127, midi_stream_view()->highest_note() + step), true);
|
2022-04-17 23:16:50 -06:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
case GDK_SCROLL_DOWN:
|
2022-09-30 16:32:20 -06:00
|
|
|
if (just_one_edge) {
|
|
|
|
|
/* make lower notes visible aka expand lower pitch range */
|
|
|
|
|
midi_stream_view()->apply_note_range (max (0, midi_stream_view()->lowest_note() - step), midi_stream_view()->highest_note(), true);
|
|
|
|
|
} else if (zoom) {
|
|
|
|
|
/* zoom in to show less higher and lower pitches */
|
|
|
|
|
midi_stream_view()->apply_note_range (min (127, midi_stream_view()->lowest_note() + step), max (0, midi_stream_view()->highest_note() - step), true);
|
|
|
|
|
} else {
|
|
|
|
|
/* scroll towards lower pitches */
|
|
|
|
|
midi_stream_view()->apply_note_range (min (127, midi_stream_view()->lowest_note() - step), max (0, midi_stream_view()->highest_note() - step), true);
|
2022-04-17 23:16:50 -06:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-19 21:11:21 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2010-05-28 16:37:04 +00:00
|
|
|
|
2015-08-15 05:13:14 +02:00
|
|
|
hide_verbose_cursor ();
|
2010-05-28 16:37:04 +00:00
|
|
|
|
2023-10-22 17:14:45 -06:00
|
|
|
if (UIConfiguration::instance().get_scroll_velocity_editing()) {
|
|
|
|
|
bool fine = !Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier);
|
|
|
|
|
Keyboard::ModifierMask mask_together(Keyboard::PrimaryModifier|Keyboard::TertiaryModifier);
|
|
|
|
|
bool together = Keyboard::modifier_state_contains (ev->state, mask_together);
|
|
|
|
|
|
|
|
|
|
if (ev->direction == GDK_SCROLL_UP) {
|
|
|
|
|
change_velocities (true, fine, false, together);
|
|
|
|
|
} else if (ev->direction == GDK_SCROLL_DOWN) {
|
|
|
|
|
change_velocities (false, fine, false, together);
|
|
|
|
|
} else {
|
|
|
|
|
/* left, right: we don't use them */
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2011-06-01 17:00:29 +00:00
|
|
|
}
|
2012-06-22 17:35:41 +00:00
|
|
|
|
2023-10-22 17:14:45 -06:00
|
|
|
return false;
|
2010-05-27 15:07:15 +00:00
|
|
|
}
|
2007-07-30 16:33:10 +00:00
|
|
|
|
2011-06-13 14:48:48 +00:00
|
|
|
void
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::ghosts_view_changed ()
|
2011-06-13 14:48:48 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
for (auto & g : ghosts) {
|
|
|
|
|
MidiGhostRegion* gr = dynamic_cast<MidiGhostRegion*> (g);
|
|
|
|
|
if (gr && !gr->trackview.hidden()) {
|
|
|
|
|
gr->view_changed ();
|
|
|
|
|
}
|
2011-06-13 14:48:48 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-16 18:19:40 -06:00
|
|
|
void
|
|
|
|
|
MidiRegionView::clear_ghost_events()
|
|
|
|
|
{
|
|
|
|
|
for (auto & ghost : ghosts) {
|
|
|
|
|
|
|
|
|
|
MidiGhostRegion* gr;
|
|
|
|
|
|
|
|
|
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
|
|
|
|
gr->clear_events ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::ghosts_model_changed()
|
|
|
|
|
{
|
|
|
|
|
for (auto & ghost : ghosts) {
|
|
|
|
|
|
|
|
|
|
MidiGhostRegion* gr;
|
|
|
|
|
|
|
|
|
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
|
|
|
|
if (!gr->trackview.hidden()) {
|
|
|
|
|
gr->model_changed ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::ghost_remove_note (NoteBase* nb)
|
|
|
|
|
{
|
|
|
|
|
for (auto & ghost : ghosts) {
|
|
|
|
|
|
|
|
|
|
MidiGhostRegion* gr;
|
|
|
|
|
|
|
|
|
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
|
|
|
|
gr->remove_note (nb);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::ghost_add_note (NoteBase* nb)
|
|
|
|
|
{
|
|
|
|
|
for (auto & ghost : ghosts) {
|
|
|
|
|
|
|
|
|
|
MidiGhostRegion* gr;
|
|
|
|
|
|
|
|
|
|
std::cerr << "GAN on " << ghost << std::endl;
|
|
|
|
|
|
|
|
|
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
|
|
|
|
gr->add_note (nb);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::ghost_sync_selection (NoteBase* nb)
|
|
|
|
|
{
|
|
|
|
|
for (auto & ghost : ghosts) {
|
|
|
|
|
|
|
|
|
|
MidiGhostRegion* gr;
|
|
|
|
|
|
|
|
|
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
|
|
|
|
gr->note_selected (nb);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::~MidiRegionView ()
|
2012-06-06 13:17:53 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
in_destructor = true;
|
|
|
|
|
RegionViewGoingAway (this); /* EMIT_SIGNAL */
|
2009-08-27 03:09:30 +00:00
|
|
|
}
|
2007-06-09 06:10:30 +00:00
|
|
|
|
2007-07-30 16:33:10 +00:00
|
|
|
void
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::reset_width_dependent_items (double pixel_width)
|
2007-07-19 21:00:09 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
RegionView::reset_width_dependent_items(pixel_width);
|
2014-12-28 19:21:07 -05:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
view_changed ();
|
2008-03-15 00:37:17 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
bool hide_all = false;
|
|
|
|
|
PatchChanges::iterator x = _patch_changes.begin();
|
|
|
|
|
if (x != _patch_changes.end()) {
|
|
|
|
|
hide_all = x->second->width() >= _pixel_width;
|
2011-05-19 21:11:21 +00:00
|
|
|
}
|
2010-05-20 22:38:12 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
if (hide_all) {
|
|
|
|
|
for (; x != _patch_changes.end(); ++x) {
|
|
|
|
|
x->second->hide();
|
2008-02-10 18:16:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
move_step_edit_cursor (_step_edit_cursor_position);
|
|
|
|
|
set_step_edit_cursor_width (_step_edit_cursor_width);
|
2009-09-07 13:38:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::set_height (double height)
|
2009-09-06 18:11:55 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiView::set_height (height);
|
2024-01-10 15:49:36 -07:00
|
|
|
RegionView::set_height(height);
|
2009-09-06 18:11:55 +00:00
|
|
|
}
|
2009-08-27 03:09:30 +00:00
|
|
|
void
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::set_selected (bool selected)
|
2009-09-06 18:11:55 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
if (!selected) {
|
|
|
|
|
clear_selection_internal ();
|
2011-05-19 21:11:21 +00:00
|
|
|
}
|
2009-08-27 03:09:30 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
RegionView::set_selected (selected);
|
2009-08-27 03:09:30 +00:00
|
|
|
}
|
2008-05-22 01:02:04 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
uint32_t
|
|
|
|
|
MidiRegionView::get_fill_color() const
|
2017-02-02 03:34:21 +11:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
Gtkmm2ext::Color c;
|
|
|
|
|
if (_selected) {
|
|
|
|
|
c = UIConfiguration::instance().color ("selected region base");
|
|
|
|
|
} else if ((!UIConfiguration::instance().get_show_name_highlight() || high_enough_for_name) && !UIConfiguration::instance().get_color_regions_using_track_color()) {
|
|
|
|
|
c = UIConfiguration::instance().color (fill_color_name);
|
|
|
|
|
} else {
|
|
|
|
|
c = fill_color;
|
2017-02-02 03:34:21 +11:00
|
|
|
}
|
|
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
string mod_name = get_modifier_name();
|
2010-05-28 21:39:12 +00:00
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
if (mod_name.empty ()) {
|
|
|
|
|
return c;
|
|
|
|
|
} else {
|
|
|
|
|
return UIConfiguration::instance().color_mod (c, mod_name);
|
2011-05-19 21:11:21 +00:00
|
|
|
}
|
2010-05-28 21:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
2024-01-08 22:35:37 -07:00
|
|
|
double
|
|
|
|
|
MidiRegionView::height() const
|
2022-03-30 16:44:04 -06:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
return TimeAxisViewItem::height();
|
2022-03-30 16:44:04 -06:00
|
|
|
}
|
|
|
|
|
|
2007-07-31 02:16:46 +00:00
|
|
|
void
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiRegionView::redisplay (bool view_only)
|
2007-07-07 03:19:04 +00:00
|
|
|
{
|
2024-01-08 22:35:37 -07:00
|
|
|
MidiView::redisplay (view_only);
|
2023-11-21 17:07:28 -07:00
|
|
|
}
|
2024-01-09 14:36:19 -07:00
|
|
|
|
|
|
|
|
ArdourCanvas::Item*
|
|
|
|
|
MidiRegionView::drag_group () const
|
|
|
|
|
{
|
|
|
|
|
return get_canvas_group ();
|
|
|
|
|
}
|
2024-01-12 11:34:59 -07:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::select_self (bool add)
|
|
|
|
|
{
|
|
|
|
|
if (add) {
|
|
|
|
|
_editing_context.get_selection().add (this);
|
|
|
|
|
} else {
|
|
|
|
|
_editing_context.get_selection().set (this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::unselect_self ()
|
|
|
|
|
{
|
|
|
|
|
_editing_context.get_selection().remove (this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::begin_drag_edit (std::string const & why)
|
|
|
|
|
{
|
|
|
|
|
if (!_selected) {
|
|
|
|
|
/* unclear why gcc can't understand which version of
|
|
|
|
|
select_self() to use here, but so be it.
|
|
|
|
|
*/
|
|
|
|
|
MidiView::select_self ();
|
|
|
|
|
}
|
|
|
|
|
// start_note_diff_command (why);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::select_self_uniquely ()
|
|
|
|
|
{
|
|
|
|
|
_editing_context.set_selected_midi_region_view (*this);
|
|
|
|
|
}
|
2024-02-09 13:03:24 -07:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MidiRegionView::set_visibility_note_range (MidiViewBackground::VisibleNoteRange vnr, bool from_selection)
|
|
|
|
|
{
|
|
|
|
|
dynamic_cast<MidiTimeAxisView*>(&trackview)->set_visibility_note_range (vnr, from_selection);
|
|
|
|
|
}
|
2024-10-07 16:28:54 -06:00
|
|
|
|
|
|
|
|
MergeableLine*
|
|
|
|
|
MidiRegionView::make_merger ()
|
|
|
|
|
{
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|