13
0

further preparation for MIDI cue editing in triggerbox code

This commit is contained in:
Paul Davis 2024-06-25 22:58:47 -06:00
parent 9060a32c34
commit 06d5496f70
2 changed files with 5 additions and 27 deletions

View File

@ -580,7 +580,7 @@ class LIBARDOUR_API MIDITrigger : public Trigger {
return midi_run<true> (bufs, start_sample, end_sample, start, end, nframes, dest_offset, bpm, quantize_offset);
}
void swap_model (std::shared_ptr<ARDOUR::MidiModel>, ARDOUR::MidiModel::DiffCommand*);
void edited ();
void set_start (timepos_t const &);
void set_end (timepos_t const &);
@ -659,16 +659,6 @@ class LIBARDOUR_API MIDITrigger : public Trigger {
int load_data (std::shared_ptr<MidiRegion>);
void compute_and_set_length ();
void _startup (BufferSet&, pframes_t dest_offset, Temporal::BBT_Offset const &);
struct ModelSwap {
std::shared_ptr<ARDOUR::MidiModel> model;
ARDOUR::MidiModel::DiffCommand* cmd;
ModelSwap (std::shared_ptr<ARDOUR::MidiModel> m, ARDOUR::MidiModel::DiffCommand* c)
: model (m), cmd (c) {}
};
std::atomic<ModelSwap*> model_swap;
};
class LIBARDOUR_API TriggerBoxThread

View File

@ -2205,7 +2205,6 @@ MIDITrigger::MIDITrigger (uint32_t n, TriggerBox& b)
, pending_rt_midibuffer (nullptr)
, old_rt_midibuffer (nullptr)
, map_change (false)
, model_swap (nullptr)
{
_channel_map.assign (16, -1);
}
@ -2214,14 +2213,6 @@ MIDITrigger::~MIDITrigger ()
{
}
void
MIDITrigger::check_edit_swap (bool playing)
{
if (model_swap != nullptr) {
std::cerr << "EDIT!\n";
}
}
void
MIDITrigger::set_used_channels (Evoral::SMF::UsedChannels used)
{
@ -2789,10 +2780,11 @@ MIDITrigger::tempo_map_changed ()
}
void
MIDITrigger::swap_model (std::shared_ptr<ARDOUR::MidiModel> model, ARDOUR::MidiModel::DiffCommand* cmd)
MIDITrigger::edited ()
{
ModelSwap* ms = new ModelSwap (model, cmd);
model_swap = ms;
// RTMidiBufferBase<Beats,Beats>* rtmb (new RTMidiBufferBase<Beats,Beats>);
MidiModel::ReadLock rl (model->read_lock());
/* render, then set pending rt */
}
template<bool in_process_context>
@ -4849,10 +4841,6 @@ TriggerBox::process_requests (BufferSet& bufs)
{
Request* r;
for (uint64_t n = 0; n < all_triggers.size(); ++n) {
all_triggers[n]->check_edit_swap (_currently_playing == all_triggers[n]);
}
while (requests.read (&r, 1) == 1) {
process_request (bufs, r);
}