13
0

fix invisble notes in MidiRegionView after transport stopped-recording

MidiCueView needs an _active_notes array setup when it is assigned a track that is
already rec-enabled, because we can start clip recording without session record-enable
being active.

MidiRegionView does not need this; it uses session rec-enable status to create or delete
_active_notes (also transport stop, sometimes)
This commit is contained in:
Paul Davis 2024-10-26 21:03:55 -06:00
parent 34731250f4
commit 8986768731
3 changed files with 8 additions and 5 deletions

View File

@ -54,6 +54,8 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
{ {
CANVAS_DEBUG_NAME (_note_group, X_("note group for MIDI cue")); CANVAS_DEBUG_NAME (_note_group, X_("note group for MIDI cue"));
_needs_active_notes_for_rec_enabled_track = true;
/* Containers don't get canvas events, so we need an invisible rect /* Containers don't get canvas events, so we need an invisible rect
* that will. It will be resized as needed sothat it always covers the * that will. It will be resized as needed sothat it always covers the
* entire canvas/view. * entire canvas/view.

View File

@ -113,13 +113,14 @@ MidiView::MidiView (std::shared_ptr<MidiTrack> mt,
uint32_t basic_color) uint32_t basic_color)
: _editing_context (ec) : _editing_context (ec)
, _midi_context (bg) , _midi_context (bg)
, _active_notes (0) , _active_notes (nullptr)
, _note_group (new ArdourCanvas::Container (&parent)) , _note_group (new ArdourCanvas::Container (&parent))
, _note_diff_command (nullptr) , _note_diff_command (nullptr)
, _ghost_note(0) , _ghost_note(0)
, _step_edit_cursor (0) , _step_edit_cursor (0)
, _step_edit_cursor_width (1, 0) , _step_edit_cursor_width (1, 0)
, _channel_selection_scoped_note (0) , _channel_selection_scoped_note (0)
, _needs_active_notes_for_rec_enabled_track (false)
, _mouse_state(None) , _mouse_state(None)
, _pressed_button(0) , _pressed_button(0)
, _optimization_iterator (_events.end()) , _optimization_iterator (_events.end())
@ -139,19 +140,19 @@ MidiView::MidiView (std::shared_ptr<MidiTrack> mt,
init (mt); init (mt);
} }
MidiView::MidiView (MidiView const & other) MidiView::MidiView (MidiView const & other)
: sigc::trackable (other) : sigc::trackable (other)
, _editing_context (other.editing_context()) , _editing_context (other.editing_context())
, _midi_context (other.midi_context()) , _midi_context (other.midi_context())
, _midi_region (other.midi_region()) , _midi_region (other.midi_region())
, _active_notes(0) , _active_notes (nullptr)
, _note_group (new ArdourCanvas::Container (other._note_group->parent())) , _note_group (new ArdourCanvas::Container (other._note_group->parent()))
, _note_diff_command (0) , _note_diff_command (0)
, _ghost_note(0) , _ghost_note(0)
, _step_edit_cursor (0) , _step_edit_cursor (0)
, _step_edit_cursor_width (1, 0) , _step_edit_cursor_width (1, 0)
, _channel_selection_scoped_note (0) , _channel_selection_scoped_note (0)
, _needs_active_notes_for_rec_enabled_track (false)
, _mouse_state(None) , _mouse_state(None)
, _pressed_button(0) , _pressed_button(0)
, _optimization_iterator (_events.end()) , _optimization_iterator (_events.end())
@ -193,7 +194,7 @@ MidiView::set_track (std::shared_ptr<MidiTrack> mt)
if (_midi_track) { if (_midi_track) {
_midi_track->DropReferences.connect (track_going_away_connection, invalidator (*this), std::bind (&MidiView::track_going_away, this), gui_context()); _midi_track->DropReferences.connect (track_going_away_connection, invalidator (*this), std::bind (&MidiView::track_going_away, this), gui_context());
if (_midi_track->triggerbox()->record_enabled()) { if (_needs_active_notes_for_rec_enabled_track && _midi_track->triggerbox()->record_enabled()) {
begin_write (); begin_write ();
} else { } else {
end_write (); end_write ();

View File

@ -503,7 +503,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
Temporal::Beats _step_edit_cursor_width; Temporal::Beats _step_edit_cursor_width;
Temporal::Beats _step_edit_cursor_position; Temporal::Beats _step_edit_cursor_position;
NoteBase* _channel_selection_scoped_note; NoteBase* _channel_selection_scoped_note;
bool _needs_active_notes_for_rec_enabled_track;
MouseState _mouse_state; MouseState _mouse_state;
int _pressed_button; int _pressed_button;