13
0

actally stop doing clip recording visual stuff when disarmed (gui)

This commit is contained in:
Paul Davis 2024-10-18 09:50:31 -06:00
parent 837ea32898
commit 70b41d10b1
4 changed files with 28 additions and 8 deletions

View File

@ -318,11 +318,12 @@ MidiCueEditor::maybe_update ()
}
if (_track->rec_enable_control()->get_value()) {
/* data recorded will handle it */
/* ::data_captured() will handle it */
return;
}
ARDOUR::TriggerPtr trigger = _track->triggerbox()->currently_playing ();
if (!trigger) {
_playhead_cursor->set_position (0);
} else {
@ -503,14 +504,24 @@ MidiCueEditor::set_box (std::shared_ptr<ARDOUR::TriggerBox> b)
b->Captured.connect (capture_connections, invalidator (*this), boost::bind (&MidiCueEditor::data_captured, this, _1), gui_context());
/* Don't bind a shared_ptr<TriggerBox> within the lambda */
TriggerBox* tb (b.get());
b->RecEnableChanged.connect (capture_connections, invalidator (*this), [&, tb]() { rec_enable_change (tb); }, gui_context());
b->RecEnableChanged.connect (capture_connections, invalidator (*this), [&, tb]() { box_rec_enable_change (*tb); }, gui_context());
}
}
void
MidiCueEditor::rec_enable_change (ARDOUR::TriggerBox* b)
MidiCueEditor::box_rec_enable_change (ARDOUR::TriggerBox const & b)
{
if (b->record_enabled()) {
if (b.record_enabled()) {
view->begin_write();
} else {
view->end_write ();
}
}
void
MidiCueEditor::trigger_rec_enable_change (ARDOUR::Trigger const & t)
{
if (t.armed()) {
view->begin_write();
} else {
view->end_write ();

View File

@ -86,6 +86,9 @@ class MidiCueEditor : public CueEditor
Editing::MouseMode current_mouse_mode () const;
bool internal_editing() const;
void box_rec_enable_change (ARDOUR::TriggerBox const &);
void trigger_rec_enable_change (ARDOUR::Trigger const &);
double timebar_height;
size_t n_timebars;
@ -211,7 +214,6 @@ class MidiCueEditor : public CueEditor
void visual_changer (const VisualChange&);
void bindings_changed ();
void rec_enable_change (ARDOUR::TriggerBox*);
void data_captured (Temporal::timecnt_t);
bool idle_data_captured ();
std::atomic<int> idle_update_queued;

View File

@ -1560,9 +1560,8 @@ MidiView::apply_note_range (uint8_t min, uint8_t max, bool force)
void
MidiView::begin_write()
{
std::cerr << "MV::begin write\n";
if (_active_notes) {
delete[] _active_notes;
delete [] _active_notes;
}
_active_notes = new Note*[128];
for (unsigned i = 0; i < 128; ++i) {
@ -1577,7 +1576,6 @@ MidiView::begin_write()
void
MidiView::end_write()
{
std::cerr << "MV::end write\n";
delete [] _active_notes;
_active_notes = nullptr;
_marked_for_selection.clear();

View File

@ -386,6 +386,13 @@ TriggerPage::clear_selected_slot ()
void
TriggerPage::rec_enable_changed (Trigger const * trigger)
{
assert (trigger);
if (!trigger->armed()) {
_midi_editor->trigger_rec_enable_change (*trigger);
return;
}
/* hide everything */
_slot_prop_box.hide ();
@ -406,7 +413,9 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_audio_trig_box.set_trigger (ref);
_audio_trig_box.show ();
}
} else {
_midi_trig_box.set_trigger (ref);
_midi_trig_box.show ();