make an attempt to show note length with verbose cursor

Likely much more intelligent string formatting is needed to make this
actually useful to most people
This commit is contained in:
Paul Davis 2023-11-14 11:05:13 -07:00
parent f5af821aba
commit 7762fa47ea
1 changed files with 3 additions and 2 deletions

View File

@ -4563,11 +4563,12 @@ MidiRegionView::get_note_name (std::shared_ptr<NoteType> n, uint8_t note_value)
}
char buf[128];
snprintf (buf, sizeof (buf), "%s #%d\nCh %d Vel %d",
snprintf (buf, sizeof (buf), "%s #%d\nCh %d Vel %d\n%.3f beats",
name.empty() ? ParameterDescriptor::midi_note_name (note_value).c_str() : name.c_str(),
(int) note_value,
(int) n->channel() + 1,
(int) n->velocity()); //we display velocity 0-based; velocity 0 is a 'note-off' so the user just sees values 1..127 which 'looks' 1-based
(int) n->velocity(), //we display velocity 0-based; velocity 0 is a 'note-off' so the user just sees values 1..127 which 'looks' 1-based
n->length().get_beats() + (n->length().get_ticks()/(float)Temporal::ticks_per_beat));
return buf;
}