mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 21:55:43 +01:00
rename Region pos_beats -> quarter_note
This commit is contained in:
parent
3816ee4e92
commit
d9dea0a3aa
7 changed files with 40 additions and 40 deletions
|
|
@ -5593,7 +5593,7 @@ NoteDrag::total_dx (const guint state) const
|
|||
frameoffset_t const dx = _editor->pixel_to_sample (_drags->current_pointer_x() - grab_x());
|
||||
|
||||
/* primary note time */
|
||||
double const quarter_note_start = _region->region()->pos_beats() - _region->midi_region()->start_beats();
|
||||
double const quarter_note_start = _region->region()->quarter_note() - _region->midi_region()->start_beats();
|
||||
frameoffset_t const n = map.frame_at_quarter_note (quarter_note_start + _primary->note()->time().to_double());
|
||||
|
||||
/* new time of the primary note in session frames */
|
||||
|
|
|
|||
|
|
@ -1711,7 +1711,7 @@ MidiRegionView::update_sustained (Note* ev, bool update_ghost_regions)
|
|||
const boost::shared_ptr<ARDOUR::MidiRegion> mr = midi_region();
|
||||
boost::shared_ptr<NoteType> note = ev->note();
|
||||
|
||||
const double session_source_start = _region->pos_beats() - mr->start_beats();
|
||||
const double session_source_start = _region->quarter_note() - mr->start_beats();
|
||||
const framepos_t note_start_frames = map.frame_at_quarter_note (note->time().to_double() + session_source_start) - _region->position();
|
||||
|
||||
const double x0 = trackview.editor().sample_to_pixel (note_start_frames);
|
||||
|
|
@ -1779,7 +1779,7 @@ MidiRegionView::update_hit (Hit* ev, bool update_ghost_regions)
|
|||
{
|
||||
boost::shared_ptr<NoteType> note = ev->note();
|
||||
|
||||
const double note_time_qn = note->time().to_double() + (_region->pos_beats() - midi_region()->start_beats());
|
||||
const double note_time_qn = note->time().to_double() + (_region->quarter_note() - midi_region()->start_beats());
|
||||
const framepos_t note_start_frames = trackview.session()->tempo_map().frame_at_quarter_note (note_time_qn) - _region->position();
|
||||
|
||||
const double x = trackview.editor().sample_to_pixel(note_start_frames);
|
||||
|
|
@ -2595,7 +2595,7 @@ MidiRegionView::note_dropped(NoteBase *, frameoffset_t dt, int8_t dnote)
|
|||
|
||||
for (Selection::iterator i = _selection.begin(); i != _selection.end() ; ++i) {
|
||||
|
||||
double const start_qn = _region->pos_beats() - midi_region()->start_beats();
|
||||
double const start_qn = _region->quarter_note() - midi_region()->start_beats();
|
||||
framepos_t new_frames = map.frame_at_quarter_note (start_qn + (*i)->note()->time().to_double()) + dt;
|
||||
Evoral::Beats new_time = Evoral::Beats (map.quarter_note_at_frame (new_frames) - start_qn);
|
||||
if (new_time < 0) {
|
||||
|
|
@ -2922,7 +2922,7 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
|
||||
/* and then to beats */
|
||||
const double e_qaf = tmap.exact_qn_at_frame (current_fr + midi_region()->position(), divisions);
|
||||
const double quarter_note_start = _region->pos_beats() - midi_region()->start_beats();
|
||||
const double quarter_note_start = _region->quarter_note() - midi_region()->start_beats();
|
||||
const Evoral::Beats x_beats = Evoral::Beats (e_qaf - quarter_note_start);
|
||||
|
||||
if (at_front && x_beats < canvas_note->note()->end_time()) {
|
||||
|
|
@ -3577,14 +3577,14 @@ MidiRegionView::paste_internal (framepos_t pos, unsigned paste_count, float time
|
|||
const Evoral::Beats duration = last_time - first_time;
|
||||
const Evoral::Beats snap_duration = duration.snap_to(snap_beats);
|
||||
const Evoral::Beats paste_offset = snap_duration * paste_count;
|
||||
const Evoral::Beats pos_beats = absolute_frames_to_source_beats(pos) + paste_offset;
|
||||
const Evoral::Beats quarter_note = absolute_frames_to_source_beats(pos) + paste_offset;
|
||||
Evoral::Beats end_point = Evoral::Beats();
|
||||
|
||||
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste data spans from %1 to %2 (%3) ; paste pos beats = %4 (based on %5 - %6)\n",
|
||||
first_time,
|
||||
last_time,
|
||||
duration, pos, _region->position(),
|
||||
pos_beats));
|
||||
quarter_note));
|
||||
|
||||
clear_editor_note_selection ();
|
||||
|
||||
|
|
@ -3593,7 +3593,7 @@ MidiRegionView::paste_internal (framepos_t pos, unsigned paste_count, float time
|
|||
for (Notes::const_iterator i = mcb.notes().begin(); i != mcb.notes().end(); ++i) {
|
||||
|
||||
boost::shared_ptr<NoteType> copied_note (new NoteType (*((*i).get())));
|
||||
copied_note->set_time (pos_beats + copied_note->time() - first_time);
|
||||
copied_note->set_time (quarter_note + copied_note->time() - first_time);
|
||||
copied_note->set_id (Evoral::next_event_id());
|
||||
|
||||
/* make all newly added notes selected */
|
||||
|
|
@ -4149,7 +4149,7 @@ MidiRegionView::snap_frame_to_grid_underneath (framepos_t p, int32_t divisions,
|
|||
eqaf -= grid_beats.to_double();
|
||||
}
|
||||
}
|
||||
const double session_start_off = _region->pos_beats() - midi_region()->start_beats();
|
||||
const double session_start_off = _region->quarter_note() - midi_region()->start_beats();
|
||||
|
||||
return Evoral::Beats (eqaf - session_start_off);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue