Only allow editing top-most MIDI region in layered view

NoteDrag (change pitch) only works correctly for the topmost
region when using Stacked LayerDisplay. Note-grid is also only
displayed for the top layer.
This commit is contained in:
Robin Gareus 2024-04-27 00:03:46 +02:00
parent 201580f7ba
commit dcb732f07c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 8 additions and 0 deletions

View File

@ -293,6 +293,14 @@ NoteBase::event_handler (GdkEvent* ev)
return false;
}
if (_region.get_time_axis_view ().layer_display () == Stacked) {
/* only allow edting notes in the topmost layer */
if (_region.region()->layer() != _region.region()->playlist()->top_layer ()) {
/* this stll allows the draw tool to work, and edit cursor is updated */
return false;
}
}
switch (ev->type) {
case GDK_ENTER_NOTIFY:
_region.note_entered (this);