13
0

add the concept of a length that is data-independent to MIDI files (GUI)

This commit is contained in:
Paul Davis 2024-10-24 11:44:36 -06:00
parent ebcc6b8250
commit c7192b4cc0
6 changed files with 12 additions and 10 deletions

View File

@ -2451,6 +2451,9 @@ EditingContext::reset_zoom (samplecnt_t spp)
pending_visual_change.add (VisualChange::ZoomLevel);
pending_visual_change.samples_per_pixel = spp;
if (spp == 0.0) {
PBD::stacktrace (std::cerr, 12);
}
ensure_visual_change_idle_handler ();
}

View File

@ -466,7 +466,7 @@ MidiCueEditor::toolbox ()
}
void
MidiCueEditor::data_captured (timecnt_t total_duration)
MidiCueEditor::data_captured (samplecnt_t total_duration)
{
data_capture_duration = total_duration;
@ -474,14 +474,13 @@ MidiCueEditor::data_captured (timecnt_t total_duration)
Glib::signal_idle().connect (sigc::mem_fun (*this, &MidiCueEditor::idle_data_captured));
}
samplepos_t pos = data_capture_duration.end().samples();
_playhead_cursor->set_position (pos);
_playhead_cursor->set_position (data_capture_duration);
}
bool
MidiCueEditor::idle_data_captured ()
{
double where = duration_to_pixels (data_capture_duration);
double where = sample_to_pixel_unrounded (data_capture_duration);
if (where > _visible_canvas_width * 0.80) {
set_samples_per_pixel (samples_per_pixel * 1.5);

View File

@ -217,10 +217,11 @@ class MidiCueEditor : public CueEditor
void visual_changer (const VisualChange&);
void bindings_changed ();
void data_captured (Temporal::timecnt_t);
void data_captured (samplecnt_t);
bool idle_data_captured ();
std::atomic<int> idle_update_queued;
Temporal::timecnt_t data_capture_duration;
PBD::ScopedConnectionList capture_connections;
samplecnt_t data_capture_duration;
};

View File

@ -4498,7 +4498,7 @@ MidiView::set_step_edit_cursor_width (Temporal::Beats beats)
}
void
MidiView::clip_data_recorded (timecnt_t const & total_duration)
MidiView::clip_data_recorded (samplecnt_t total_duration)
{
if (!_midi_track) {
return;
@ -4573,7 +4573,7 @@ MidiView::clip_data_recorded (timecnt_t const & total_duration)
}
}
active_note_end = total_duration;
active_note_end = timecnt_t (total_duration);
}
/** Called when a diskstream on our track has received some data. Update the view, if applicable.

View File

@ -341,7 +341,7 @@ class MidiView : public virtual sigc::trackable, public LineMerger
EditingContext& editing_context() const { return _editing_context; }
MidiViewBackground& midi_context() const { return _midi_context; }
void clip_data_recorded (Temporal::timecnt_t const &);
void clip_data_recorded (samplecnt_t);
virtual void select_self (bool add) {}
virtual void unselect_self () {}

View File

@ -797,7 +797,6 @@ TriggerUI::trigger_changed (PropertyChange const& what)
on_trigger_changed(what);
}
void
TriggerUI::set_trigger (ARDOUR::TriggerReference tr)
{