diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1ff9fac509..fe31d5f4cb 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -124,7 +124,7 @@ #undef check #endif -#include "timecode/time.h" +#include "temporal/time.h" typedef uint64_t microseconds_t; diff --git a/gtk2_ardour/edit_note_dialog.cc b/gtk2_ardour/edit_note_dialog.cc index d538225b61..0c7d2a6113 100644 --- a/gtk2_ardour/edit_note_dialog.cc +++ b/gtk2_ardour/edit_note_dialog.cc @@ -120,8 +120,8 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set n) int test_channel = (*_events.begin())->note()->channel (); int test_pitch = (*_events.begin())->note()->note (); int test_velocity = (*_events.begin())->note()->velocity (); - Evoral::Beats test_time = (*_events.begin())->note()->time (); - Evoral::Beats test_length = (*_events.begin())->note()->length (); + Temporal::Beats test_time = (*_events.begin())->note()->time (); + Temporal::Beats test_length = (*_events.begin())->note()->length (); for (set::iterator i = _events.begin(); i != _events.end(); ++i) { if ((*i)->note()->channel() != test_channel) { @@ -198,7 +198,7 @@ EditNoteDialog::done (int r) } samplecnt_t const region_samples = _time_clock.current_time() - (_region_view->region()->position() - _region_view->region()->start()); - Evoral::Beats const t = _region_view->source_relative_time_converter().from (region_samples); + Temporal::Beats const t = _region_view->source_relative_time_converter().from (region_samples); if (!_time_all.get_sensitive() || _time_all.get_active ()) { for (set::iterator i = _events.begin(); i != _events.end(); ++i) { @@ -212,7 +212,7 @@ EditNoteDialog::done (int r) if (!_length_all.get_sensitive() || _length_all.get_active ()) { for (set::iterator i = _events.begin(); i != _events.end(); ++i) { samplepos_t const note_end_sample = region_samples + _length_clock.current_duration (_time_clock.current_time()); - Evoral::Beats const d = _region_view->source_relative_time_converter().from (note_end_sample) - (*i)->note()->time(); + Temporal::Beats const d = _region_view->source_relative_time_converter().from (note_end_sample) - (*i)->note()->time(); if (d != (*i)->note()->length()) { _region_view->change_note_length (*i, d); had_change = true; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cfc324efc6..7bcd197665 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4090,23 +4090,23 @@ Editor::get_grid_music_divisions (uint32_t event_state) return 0; } -Evoral::Beats +Temporal::Beats Editor::get_grid_type_as_beats (bool& success, samplepos_t position) { success = true; const unsigned divisions = get_grid_beat_divisions(position); if (divisions) { - return Evoral::Beats(1.0 / (double)get_grid_beat_divisions(position)); + return Temporal::Beats(1.0 / (double)get_grid_beat_divisions(position)); } switch (_snap_type) { case SnapToBeat: - return Evoral::Beats(4.0 / _session->tempo_map().meter_at_sample (position).note_divisor()); + return Temporal::Beats(4.0 / _session->tempo_map().meter_at_sample (position).note_divisor()); case SnapToBar: if (_session) { const Meter& m = _session->tempo_map().meter_at_sample (position); - return Evoral::Beats((4.0 * m.divisions_per_bar()) / m.note_divisor()); + return Temporal::Beats((4.0 * m.divisions_per_bar()) / m.note_divisor()); } break; default: @@ -4114,7 +4114,7 @@ Editor::get_grid_type_as_beats (bool& success, samplepos_t position) break; } - return Evoral::Beats(); + return Temporal::Beats(); } samplecnt_t @@ -5021,7 +5021,7 @@ Editor::get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) cons } void -Editor::get_per_region_note_selection (list > > > > &selection) const +Editor::get_per_region_note_selection (list > > > > &selection) const { for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 3eed94ddcf..78496c4ca4 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -334,7 +334,7 @@ public: samplecnt_t get_nudge_distance (samplepos_t pos, samplecnt_t& next); samplecnt_t get_paste_offset (samplepos_t pos, unsigned paste_count, samplecnt_t duration); unsigned get_grid_beat_divisions(samplepos_t position); - Evoral::Beats get_grid_type_as_beats (bool& success, samplepos_t position); + Temporal::Beats get_grid_type_as_beats (bool& success, samplepos_t position); int32_t get_grid_music_divisions (uint32_t event_state); @@ -451,7 +451,7 @@ public: void get_regions_corresponding_to (boost::shared_ptr region, std::vector& regions, bool src_comparison); void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const; - void get_per_region_note_selection (std::list > > > >&) const; + void get_per_region_note_selection (std::list > > > >&) const; void center_screen (samplepos_t); @@ -1221,7 +1221,7 @@ private: void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; - void cut_copy_points (Editing::CutCopyOp, Evoral::Beats earliest=Evoral::Beats(), bool midi=false); + void cut_copy_points (Editing::CutCopyOp, Temporal::Beats earliest=Temporal::Beats(), bool midi=false); void cut_copy_regions (Editing::CutCopyOp, RegionSelection&); void cut_copy_ranges (Editing::CutCopyOp); void cut_copy_midi (Editing::CutCopyOp); diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index aad1778972..dc0a109d88 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6646,8 +6646,8 @@ samplecnt_t NoteCreateDrag::grid_samples (samplepos_t t) const { - const Evoral::Beats grid_beats = _region_view->get_grid_beats (t); - const Evoral::Beats t_beats = _region_view->region_samples_to_region_beats (t); + const Temporal::Beats grid_beats = _region_view->get_grid_beats (t); + const Temporal::Beats t_beats = _region_view->region_samples_to_region_beats (t); return _region_view->region_beats_to_region_samples (t_beats + grid_beats) - _region_view->region_beats_to_region_samples (t_beats); @@ -6664,7 +6664,7 @@ NoteCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) const samplepos_t pf = _drags->current_pointer_sample (); const int32_t divisions = _editor->get_grid_music_divisions (event->button.state); - const Evoral::Beats grid_beats = _region_view->get_grid_beats (pf); + const Temporal::Beats grid_beats = _region_view->get_grid_beats (pf); double eqaf = map.exact_qn_at_sample (pf, divisions); @@ -6706,7 +6706,7 @@ NoteCreateDrag::motion (GdkEvent* event, bool) if (divisions != 0) { - const Evoral::Beats grid_beats = _region_view->get_grid_beats (pf); + const Temporal::Beats grid_beats = _region_view->get_grid_beats (pf); const double qaf = map.quarter_note_at_sample (pf); /* Hack so that we always snap to the note that we are over, instead of snapping @@ -6743,7 +6743,7 @@ NoteCreateDrag::finished (GdkEvent* ev, bool had_movement) TempoMap& map (_editor->session()->tempo_map()); const double qn_length = map.quarter_notes_between_samples (start_sess_rel, start_sess_rel + length); - Evoral::Beats qn_length_beats = max (Evoral::Beats::ticks(1), Evoral::Beats (qn_length)); + Temporal::Beats qn_length_beats = max (Temporal::Beats::ticks(1), Temporal::Beats (qn_length)); _editor->begin_reversible_command (_("Create Note")); _region_view->clear_editor_note_selection(); @@ -6798,7 +6798,7 @@ HitCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) } const samplepos_t start = map.sample_at_quarter_note (eqaf) - _region_view->region()->position(); - Evoral::Beats length = _region_view->get_grid_beats (pf); + Temporal::Beats length = _region_view->get_grid_beats (pf); _editor->begin_reversible_command (_("Create Hit")); _region_view->clear_editor_note_selection(); @@ -6826,7 +6826,7 @@ HitCreateDrag::motion (GdkEvent* event, bool) return; } - Evoral::Beats length = _region_view->get_grid_beats (pf); + Temporal::Beats length = _region_view->get_grid_beats (pf); boost::shared_ptr mr = _region_view->midi_region(); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4bd853002c..1f678d31f4 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4247,7 +4247,7 @@ struct PointsSelectionPositionSorter { * @param op Operation (Cut, Copy or Clear) */ void -Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool midi) +Editor::cut_copy_points (Editing::CutCopyOp op, Temporal::Beats earliest, bool midi) { if (selection->points.empty ()) { return; @@ -4292,7 +4292,7 @@ Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool mid lists[al].copy->fast_simple_add ((*ctrl_evt)->when, (*ctrl_evt)->value); if (midi) { /* Update earliest MIDI start time in beats */ - earliest = std::min(earliest, Evoral::Beats((*ctrl_evt)->when)); + earliest = std::min(earliest, Temporal::Beats((*ctrl_evt)->when)); } else { /* Update earliest session start time in samples */ start.sample = std::min(start.sample, (*sel_point)->line().session_position(ctrl_evt)); @@ -4301,8 +4301,8 @@ Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool mid /* Snap start time backwards, so copy/paste is snap aligned. */ if (midi) { - if (earliest == std::numeric_limits::max()) { - earliest = Evoral::Beats(); // Weird... don't offset + if (earliest == std::numeric_limits::max()) { + earliest = Temporal::Beats(); // Weird... don't offset } earliest.round_down_to_beat(); } else { @@ -4369,7 +4369,7 @@ Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool mid void Editor::cut_copy_midi (CutCopyOp op) { - Evoral::Beats earliest = std::numeric_limits::max(); + Temporal::Beats earliest = std::numeric_limits::max(); for (MidiRegionSelection::iterator i = selection->midi_regions.begin(); i != selection->midi_regions.end(); ++i) { MidiRegionView* mrv = dynamic_cast(*i); if (mrv) { @@ -5322,13 +5322,13 @@ Editor::strip_region_silence () Command* Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv) { - Evoral::Sequence::Notes selected; + Evoral::Sequence::Notes selected; mrv.selection_as_notelist (selected, true); - vector::Notes> v; + vector::Notes> v; v.push_back (selected); - Evoral::Beats pos_beats = Evoral::Beats (mrv.midi_region()->beat()) - mrv.midi_region()->start_beats(); + Temporal::Beats pos_beats = Temporal::Beats (mrv.midi_region()->beat()) - mrv.midi_region()->start_beats(); return op (mrv.midi_region()->model(), pos_beats, v); } @@ -5543,7 +5543,7 @@ Editor::insert_patch_change (bool from_context) */ MidiRegionView* first = dynamic_cast (rs.front ()); - Evoral::PatchChange empty (Evoral::Beats(), 0, 0, 0); + Evoral::PatchChange empty (Temporal::Beats(), 0, 0, 0); PatchChangeDialog d (0, _session, empty, first->instrument_info(), Gtk::Stock::ADD); if (d.run() == RESPONSE_CANCEL) { diff --git a/gtk2_ardour/editor_pt_import.cc b/gtk2_ardour/editor_pt_import.cc index 3f6a337569..79dfa22f3a 100644 --- a/gtk2_ardour/editor_pt_import.cc +++ b/gtk2_ardour/editor_pt_import.cc @@ -250,11 +250,11 @@ Editor::do_ptimport (std::string ptpath, for (vector::iterator j = a->midi.begin(); j != a->midi.end(); ++j) { - Evoral::Beats start = (Evoral::Beats)(j->pos/960000.); - Evoral::Beats len = (Evoral::Beats)(j->length/960000.); + Temporal::Beats start = (Temporal::Beats)(j->pos/960000.); + Temporal::Beats len = (Temporal::Beats)(j->length/960000.); // PT C-2 = 0, Ardour C-1 = 0, subtract twelve to convert... - midicmd->add(boost::shared_ptr > - (new Evoral::Note( (uint8_t)1, start, len, j->note - 12, j->velocity ))); + midicmd->add(boost::shared_ptr > + (new Evoral::Note( (uint8_t)1, start, len, j->note - 12, j->velocity ))); } mm->apply_command (_session, midicmd); boost::shared_ptr copy (RegionFactory::create (mr, true)); diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index d8cff83143..5c57289151 100644 --- a/gtk2_ardour/ghostregion.h +++ b/gtk2_ardour/ghostregion.h @@ -127,7 +127,7 @@ private: ArdourCanvas::Polygon* _tmp_poly; MidiRegionView& parent_mrv; - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; MidiGhostRegion::GhostEvent* find_event (boost::shared_ptr); typedef boost::unordered_map, MidiGhostRegion::GhostEvent* > EventList; diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc index e3a227d3c4..3aae30fa0f 100644 --- a/gtk2_ardour/hit.cc +++ b/gtk2_ardour/hit.cc @@ -17,7 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Note.hpp" #include "canvas/polygon.h" diff --git a/gtk2_ardour/hit.h b/gtk2_ardour/hit.h index ea3e91bf2d..81a0868734 100644 --- a/gtk2_ardour/hit.h +++ b/gtk2_ardour/hit.h @@ -30,7 +30,7 @@ namespace ArdourCanvas { class Hit : public NoteBase { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; Hit (MidiRegionView& region, ArdourCanvas::Item* parent, diff --git a/gtk2_ardour/idleometer.cc b/gtk2_ardour/idleometer.cc index 913d07e391..ef22f90f36 100644 --- a/gtk2_ardour/idleometer.cc +++ b/gtk2_ardour/idleometer.cc @@ -25,7 +25,7 @@ #include #endif -#include "timecode/time.h" +#include "temporal/time.h" #include "idleometer.h" #include "pbd/i18n.h" diff --git a/gtk2_ardour/midi_cut_buffer.cc b/gtk2_ardour/midi_cut_buffer.cc index 171eea823e..3739f54909 100644 --- a/gtk2_ardour/midi_cut_buffer.cc +++ b/gtk2_ardour/midi_cut_buffer.cc @@ -21,7 +21,7 @@ using namespace ARDOUR; MidiCutBuffer::MidiCutBuffer (Session* s) - : AutomatableSequence (*s) + : AutomatableSequence (*s) , _origin (0) { diff --git a/gtk2_ardour/midi_cut_buffer.h b/gtk2_ardour/midi_cut_buffer.h index 0f6ab74667..41580643be 100644 --- a/gtk2_ardour/midi_cut_buffer.h +++ b/gtk2_ardour/midi_cut_buffer.h @@ -19,7 +19,7 @@ #ifndef __gtk_ardour_midi_cut_buffer_h__ #define __gtk_ardour_midi_cut_buffer_h__ -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "ardour/automatable_sequence.h" @@ -27,10 +27,10 @@ namespace ARDOUR { class Session; } -class MidiCutBuffer : public ARDOUR::AutomatableSequence +class MidiCutBuffer : public ARDOUR::AutomatableSequence { public: - typedef Evoral::Beats TimeType; + typedef Temporal::Beats TimeType; MidiCutBuffer (ARDOUR::Session*); ~MidiCutBuffer(); diff --git a/gtk2_ardour/midi_list_editor.cc b/gtk2_ardour/midi_list_editor.cc index 4c0903fddd..2310f57442 100644 --- a/gtk2_ardour/midi_list_editor.cc +++ b/gtk2_ardour/midi_list_editor.cc @@ -292,7 +292,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) if (note->time() + fdelta >= 0) { cmd->change (note, prop, note->time() + fdelta); } else { - cmd->change (note, prop, Evoral::Beats()); + cmd->change (note, prop, Temporal::Beats()); } break; case MidiModel::NoteDiffCommand::Velocity: @@ -300,10 +300,10 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) break; case MidiModel::NoteDiffCommand::Length: if (note->length().to_double() + fdelta >= - Evoral::Beats::tick().to_double()) { + Temporal::Beats::tick().to_double()) { cmd->change (note, prop, note->length() + fdelta); } else { - cmd->change (note, prop, Evoral::Beats::tick()); + cmd->change (note, prop, Temporal::Beats::tick()); } break; case MidiModel::NoteDiffCommand::Channel: @@ -335,7 +335,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) if (note->time() + fdelta >= 0) { cmd->change (note, prop, note->time() + fdelta); } else { - cmd->change (note, prop, Evoral::Beats()); + cmd->change (note, prop, Temporal::Beats()); } break; case MidiModel::NoteDiffCommand::Velocity: @@ -343,10 +343,10 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) break; case MidiModel::NoteDiffCommand::Length: if (note->length() + fdelta >= - Evoral::Beats::tick().to_double()) { + Temporal::Beats::tick().to_double()) { cmd->change (note, prop, note->length() + fdelta); } else { - cmd->change (note, prop, Evoral::Beats::tick()); + cmd->change (note, prop, Temporal::Beats::tick()); } break; case MidiModel::NoteDiffCommand::Channel: @@ -778,7 +778,7 @@ MidiListEditor::redisplay_model () row[columns.start] = ss.str(); bbt.bars = 0; - const Evoral::Beats dur = (*i)->end_time() - (*i)->time(); + const Temporal::Beats dur = (*i)->end_time() - (*i)->time(); bbt.beats = dur.get_beats (); bbt.ticks = dur.get_ticks (); diff --git a/gtk2_ardour/midi_list_editor.h b/gtk2_ardour/midi_list_editor.h index 1bf56f6459..764dc5696a 100644 --- a/gtk2_ardour/midi_list_editor.h +++ b/gtk2_ardour/midi_list_editor.h @@ -44,7 +44,7 @@ namespace ARDOUR { class MidiListEditor : public ArdourWindow { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; MidiListEditor(ARDOUR::Session*, boost::shared_ptr, boost::shared_ptr); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 081315dcef..34b879ce11 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -748,7 +748,7 @@ MidiRegionView::key_press (GdkEventKey* ev) bool shorter = Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier); bool fine = Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier); - change_note_lengths (fine, shorter, Evoral::Beats(), start, end); + change_note_lengths (fine, shorter, Temporal::Beats(), start, end); return true; @@ -923,7 +923,7 @@ MidiRegionView::show_list_editor () * \param snap_t true to snap t to the grid, otherwise false. */ void -MidiRegionView::create_note_at (samplepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap) +MidiRegionView::create_note_at (samplepos_t t, double y, Temporal::Beats length, uint32_t state, bool shift_snap) { if (length < 2 * DBL_EPSILON) { return; @@ -939,7 +939,7 @@ MidiRegionView::create_note_at (samplepos_t t, double y, Evoral::Beats length, u // Start of note in samples relative to region start const int32_t divisions = trackview.editor().get_grid_music_divisions (state); - Evoral::Beats beat_time = snap_sample_to_grid_underneath (t, divisions, shift_snap); + Temporal::Beats beat_time = snap_sample_to_grid_underneath (t, divisions, shift_snap); const double note = view->y_to_note(y); const uint8_t chan = mtv->get_channel_for_add(); @@ -1043,7 +1043,7 @@ MidiRegionView::note_diff_add_change (NoteBase* ev, void MidiRegionView::note_diff_add_change (NoteBase* ev, MidiModel::NoteDiffCommand::Property property, - Evoral::Beats val) + Temporal::Beats val) { if (_note_diff_command) { _note_diff_command->change (ev->note(), property, val); @@ -1157,7 +1157,7 @@ MidiRegionView::find_canvas_sys_ex (MidiModel::SysExPtr s) } void -MidiRegionView::get_events (Events& e, Evoral::Sequence::NoteOperator op, uint8_t val, int chan_mask) +MidiRegionView::get_events (Events& e, Evoral::Sequence::NoteOperator op, uint8_t val, int chan_mask) { MidiModel::Notes notes; _model->get_notes (notes, op, val, chan_mask); @@ -1388,7 +1388,7 @@ MidiRegionView::display_sysexes() for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) { MidiModel::SysExPtr sysex_ptr = *i; - Evoral::Beats time = sysex_ptr->time(); + Temporal::Beats time = sysex_ptr->time(); if ((*i)->is_spp() || (*i)->is_mtc_quarter() || (*i)->is_mtc_full()) { if (!display_periodic_messages) { @@ -1424,7 +1424,7 @@ MidiRegionView::display_sysexes() } // Show unless message is beyond the region bounds -// XXX REQUIRES APPROPRIATE OPERATORS FOR Evoral::Beats and samplepos? say what? +// XXX REQUIRES APPROPRIATE OPERATORS FOR Temporal::Beats and samplepos? say what? #warning paul fix this // if (time - _region->start() >= _region->length() || time < _region->start()) { // sysex->hide(); @@ -1610,7 +1610,7 @@ MidiRegionView::end_write() /** Resolve an active MIDI note (while recording). */ void -MidiRegionView::resolve_note(uint8_t note, Evoral::Beats end_time) +MidiRegionView::resolve_note(uint8_t note, Temporal::Beats end_time) { if (midi_view()->note_mode() != Sustained) { return; @@ -1890,7 +1890,7 @@ MidiRegionView::add_note(const boost::shared_ptr note, bool visible) void MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity, - Evoral::Beats pos, Evoral::Beats len) + Temporal::Beats pos, Temporal::Beats len) { boost::shared_ptr new_note (new NoteType (channel, pos, len, number, velocity)); @@ -1922,7 +1922,7 @@ MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity } void -MidiRegionView::step_sustain (Evoral::Beats beats) +MidiRegionView::step_sustain (Temporal::Beats beats) { change_note_lengths (false, false, beats, false, true); } @@ -1989,13 +1989,13 @@ MidiRegionView::patch_change_to_patch_key (MidiModel::PatchChangePtr p) /// Return true iff @p pc applies to the given time on the given channel. static bool -patch_applies (const ARDOUR::MidiModel::constPatchChangePtr pc, Evoral::Beats time, uint8_t channel) +patch_applies (const ARDOUR::MidiModel::constPatchChangePtr pc, Temporal::Beats time, uint8_t channel) { return pc->time() <= time && pc->channel() == channel; } void -MidiRegionView::get_patch_key_at (Evoral::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const +MidiRegionView::get_patch_key_at (Temporal::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const { // The earliest event not before time MidiModel::PatchChanges::iterator i = _model->patch_change_lower_bound (time); @@ -2041,7 +2041,7 @@ MidiRegionView::change_patch_change (PatchChange& pc, const MIDI::Name::PatchPri } void -MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange & new_change) +MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange & new_change) { string name = _("alter patch change"); trackview.editor().begin_reversible_command (name); @@ -2082,14 +2082,14 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const * MidiTimeAxisView::get_channel_for_add()) */ void -MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange const & patch) +MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange const & patch) { string name = _("add patch change"); trackview.editor().begin_reversible_command (name); MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name); c->add (MidiModel::PatchChangePtr ( - new Evoral::PatchChange ( + new Evoral::PatchChange ( absolute_samples_to_source_beats (_region->position() + t), patch.channel(), patch.program(), patch.bank() ) @@ -2103,7 +2103,7 @@ MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChangenew_patch_change_diff_command (_("move patch change")); @@ -2397,8 +2397,8 @@ MidiRegionView::note_selected (NoteBase* ev, bool add, bool extend) } else { /* find end of latest note selected, select all between that and the start of "ev" */ - Evoral::Beats earliest = std::numeric_limits::max(); - Evoral::Beats latest = Evoral::Beats(); + Temporal::Beats earliest = std::numeric_limits::max(); + Temporal::Beats latest = Temporal::Beats(); for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { if ((*i)->note()->end_time() > latest) { @@ -2550,10 +2550,10 @@ MidiRegionView::add_to_selection (NoteBase* ev) } } -Evoral::Beats +Temporal::Beats MidiRegionView::earliest_in_selection () { - Evoral::Beats earliest = std::numeric_limits::max(); + Temporal::Beats earliest = std::numeric_limits::max(); for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { if ((*i)->note()->time() < earliest) { @@ -2571,7 +2571,7 @@ MidiRegionView::move_selection(double dx_qn, double dy, double cumulative_dy) Editor* editor = dynamic_cast (&trackview.editor()); TempoMap& tmap (editor->session()->tempo_map()); PossibleChord to_play; - Evoral::Beats earliest = earliest_in_selection(); + Temporal::Beats earliest = earliest_in_selection(); for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { NoteBase* n = *i; @@ -2668,7 +2668,7 @@ MidiRegionView::move_copies (double dx_qn, double dy, double cumulative_dy) Editor* editor = dynamic_cast (&trackview.editor()); TempoMap& tmap (editor->session()->tempo_map()); PossibleChord to_play; - Evoral::Beats earliest = earliest_in_selection(); + Temporal::Beats earliest = earliest_in_selection(); for (CopyDragEvents::iterator i = _copy_drag_events.begin(); i != _copy_drag_events.end(); ++i) { NoteBase* n = *i; @@ -2757,7 +2757,7 @@ MidiRegionView::note_dropped(NoteBase *, double d_qn, int8_t dnote, bool copy) for (Selection::iterator i = _selection.begin(); i != _selection.end() ; ++i) { - Evoral::Beats new_time = Evoral::Beats ((*i)->note()->time().to_double() + d_qn); + Temporal::Beats new_time = Temporal::Beats ((*i)->note()->time().to_double() + d_qn); if (new_time < 0) { continue; @@ -2796,7 +2796,7 @@ MidiRegionView::note_dropped(NoteBase *, double d_qn, int8_t dnote, bool copy) for (CopyDragEvents::iterator i = _copy_drag_events.begin(); i != _copy_drag_events.end() ; ++i) { /* update time */ - Evoral::Beats new_time = Evoral::Beats ((*i)->note()->time().to_double() + d_qn); + Temporal::Beats new_time = Temporal::Beats ((*i)->note()->time().to_double() + d_qn); if (new_time < 0) { continue; @@ -2871,7 +2871,7 @@ MidiRegionView::get_end_position_pixels() } samplepos_t -MidiRegionView::source_beats_to_absolute_samples(Evoral::Beats beats) const +MidiRegionView::source_beats_to_absolute_samples(Temporal::Beats beats) const { /* the time converter will return the sample corresponding to `beats' relative to the start of the source. The start of the source @@ -2881,7 +2881,7 @@ MidiRegionView::source_beats_to_absolute_samples(Evoral::Beats beats) const return source_start + _source_relative_time_converter.to (beats); } -Evoral::Beats +Temporal::Beats MidiRegionView::absolute_samples_to_source_beats(samplepos_t samples) const { /* the `samples' argument needs to be converted into a sample count @@ -2893,12 +2893,12 @@ MidiRegionView::absolute_samples_to_source_beats(samplepos_t samples) const } samplepos_t -MidiRegionView::region_beats_to_region_samples(Evoral::Beats beats) const +MidiRegionView::region_beats_to_region_samples(Temporal::Beats beats) const { return _region_relative_time_converter.to(beats); } -Evoral::Beats +Temporal::Beats MidiRegionView::region_samples_to_region_beats(samplepos_t samples) const { return _region_relative_time_converter.from(samples); @@ -3035,10 +3035,10 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_ } else { snapped_x = trackview.editor ().pixel_to_sample (current_x); } - const Evoral::Beats beats = Evoral::Beats (tmap.exact_beat_at_sample (snapped_x + midi_region()->position(), divisions) + const Temporal::Beats beats = Temporal::Beats (tmap.exact_beat_at_sample (snapped_x + midi_region()->position(), divisions) - midi_region()->beat()) + midi_region()->start_beats(); - Evoral::Beats len = Evoral::Beats(); + Temporal::Beats len = Temporal::Beats(); if (at_front) { if (beats < canvas_note->note()->end_time()) { @@ -3051,7 +3051,7 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_ } } - len = std::max(Evoral::Beats(1 / 512.0), len); + len = std::max(Temporal::Beats(1 / 512.0), len); char buf[16]; snprintf (buf, sizeof (buf), "%.3g beats", len.to_double()); @@ -3132,11 +3132,11 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_ /* and then to beats */ const double e_qaf = tmap.exact_qn_at_sample (current_fr + midi_region()->position(), divisions); const double quarter_note_start = _region->quarter_note() - midi_region()->start_beats(); - const Evoral::Beats x_beats = Evoral::Beats (e_qaf - quarter_note_start); + const Temporal::Beats x_beats = Temporal::Beats (e_qaf - quarter_note_start); if (at_front && x_beats < canvas_note->note()->end_time()) { note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::StartTime, x_beats - (sign * snap_delta_beats)); - Evoral::Beats len = canvas_note->note()->time() - x_beats + (sign * snap_delta_beats); + Temporal::Beats len = canvas_note->note()->time() - x_beats + (sign * snap_delta_beats); len += canvas_note->note()->length(); if (!!len) { @@ -3145,7 +3145,7 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_ } if (!at_front) { - Evoral::Beats len = std::max(Evoral::Beats(1 / 512.0), + Temporal::Beats len = std::max(Temporal::Beats(1 / 512.0), x_beats - canvas_note->note()->time() - (sign * snap_delta_beats)); note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len); } @@ -3202,12 +3202,12 @@ MidiRegionView::change_note_note (NoteBase* event, int8_t note, bool relative) } void -MidiRegionView::trim_note (NoteBase* event, Evoral::Beats front_delta, Evoral::Beats end_delta) +MidiRegionView::trim_note (NoteBase* event, Temporal::Beats front_delta, Temporal::Beats end_delta) { bool change_start = false; bool change_length = false; - Evoral::Beats new_start; - Evoral::Beats new_length; + Temporal::Beats new_start; + Temporal::Beats new_length; /* NOTE: the semantics of the two delta arguments are slightly subtle: @@ -3222,7 +3222,7 @@ MidiRegionView::trim_note (NoteBase* event, Evoral::Beats front_delta, Evoral::B if (front_delta < 0) { if (event->note()->time() < -front_delta) { - new_start = Evoral::Beats(); + new_start = Temporal::Beats(); } else { new_start = event->note()->time() + front_delta; // moves earlier } @@ -3237,7 +3237,7 @@ MidiRegionView::trim_note (NoteBase* event, Evoral::Beats front_delta, Evoral::B } else { - Evoral::Beats new_pos = event->note()->time() + front_delta; + Temporal::Beats new_pos = event->note()->time() + front_delta; if (new_pos < event->note()->end_time()) { new_start = event->note()->time() + front_delta; @@ -3296,14 +3296,14 @@ MidiRegionView::change_note_channel (NoteBase* event, int8_t chn, bool relative) } void -MidiRegionView::change_note_time (NoteBase* event, Evoral::Beats delta, bool relative) +MidiRegionView::change_note_time (NoteBase* event, Temporal::Beats delta, bool relative) { - Evoral::Beats new_time; + Temporal::Beats new_time; if (relative) { if (delta < 0.0) { if (event->note()->time() < -delta) { - new_time = Evoral::Beats(); + new_time = Temporal::Beats(); } else { new_time = event->note()->time() + delta; } @@ -3318,7 +3318,7 @@ MidiRegionView::change_note_time (NoteBase* event, Evoral::Beats delta, bool rel } void -MidiRegionView::change_note_length (NoteBase* event, Evoral::Beats t) +MidiRegionView::change_note_length (NoteBase* event, Temporal::Beats t) { note_diff_add_change (event, MidiModel::NoteDiffCommand::Length, t); } @@ -3430,11 +3430,11 @@ MidiRegionView::transpose (bool up, bool fine, bool allow_smush) } void -MidiRegionView::change_note_lengths (bool fine, bool shorter, Evoral::Beats delta, bool start, bool end) +MidiRegionView::change_note_lengths (bool fine, bool shorter, Temporal::Beats delta, bool start, bool end) { if (!delta) { if (fine) { - delta = Evoral::Beats(1.0/128.0); + delta = Temporal::Beats(1.0/128.0); } else { /* grab the current grid distance */ delta = get_grid_beats(_region->position()); @@ -3454,8 +3454,8 @@ MidiRegionView::change_note_lengths (bool fine, bool shorter, Evoral::Beats delt /* note the negation of the delta for start */ trim_note (*i, - (start ? -delta : Evoral::Beats()), - (end ? delta : Evoral::Beats())); + (start ? -delta : Temporal::Beats()), + (end ? delta : Temporal::Beats())); i = next; } @@ -3476,12 +3476,12 @@ MidiRegionView::nudge_notes (bool forward, bool fine) */ const samplepos_t ref_point = source_beats_to_absolute_samples ((*(_selection.begin()))->note()->time()); - Evoral::Beats delta; + Temporal::Beats delta; if (!fine) { /* non-fine, move by 1 bar regardless of snap */ - delta = Evoral::Beats(trackview.session()->tempo_map().meter_at_sample (ref_point).divisions_per_bar()); + delta = Temporal::Beats(trackview.session()->tempo_map().meter_at_sample (ref_point).divisions_per_bar()); } else if (trackview.editor().snap_mode() == Editing::SnapOff) { @@ -3779,14 +3779,14 @@ MidiRegionView::paste_internal (samplepos_t pos, unsigned paste_count, float tim start_note_diff_command (_("paste")); - const Evoral::Beats snap_beats = get_grid_beats(pos); - const Evoral::Beats first_time = (*mcb.notes().begin())->time(); - const Evoral::Beats last_time = (*mcb.notes().rbegin())->end_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 quarter_note = absolute_samples_to_source_beats(pos) + paste_offset; - Evoral::Beats end_point = Evoral::Beats(); + const Temporal::Beats snap_beats = get_grid_beats(pos); + const Temporal::Beats first_time = (*mcb.notes().begin())->time(); + const Temporal::Beats last_time = (*mcb.notes().rbegin())->end_time(); + const Temporal::Beats duration = last_time - first_time; + const Temporal::Beats snap_duration = duration.snap_to(snap_beats); + const Temporal::Beats paste_offset = snap_duration * paste_count; + const Temporal::Beats quarter_note = absolute_samples_to_source_beats(pos) + paste_offset; + Temporal::Beats end_point = Temporal::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, @@ -3963,7 +3963,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state) const int32_t divisions = editor.get_grid_music_divisions (state); const bool shift_snap = midi_view()->note_mode() != Percussive; - const Evoral::Beats snapped_beats = snap_sample_to_grid_underneath (unsnapped_sample, divisions, shift_snap); + const Temporal::Beats snapped_beats = snap_sample_to_grid_underneath (unsnapped_sample, divisions, shift_snap); /* prevent Percussive mode from displaying a ghost hit at region end */ if (!shift_snap && snapped_beats >= midi_region()->start_beats() + midi_region()->length_beats()) { @@ -3982,7 +3982,7 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state) } /* calculate time in beats relative to start of source */ - const Evoral::Beats length = get_grid_beats(unsnapped_sample + _region->position()); + const Temporal::Beats length = get_grid_beats(unsnapped_sample + _region->position()); _ghost_note->note()->set_time (snapped_beats); _ghost_note->note()->set_length (length); @@ -4059,9 +4059,9 @@ MidiRegionView::maybe_select_by_position (GdkEventButton* ev, double /*x*/, doub uint16_t chn_mask = mtv->midi_track()->get_playback_channel_mask(); if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { - get_events (e, Evoral::Sequence::PitchGreaterThanOrEqual, (uint8_t) floor (note), chn_mask); + get_events (e, Evoral::Sequence::PitchGreaterThanOrEqual, (uint8_t) floor (note), chn_mask); } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - get_events (e, Evoral::Sequence::PitchLessThanOrEqual, (uint8_t) floor (note), chn_mask); + get_events (e, Evoral::Sequence::PitchLessThanOrEqual, (uint8_t) floor (note), chn_mask); } else { return; } @@ -4106,7 +4106,7 @@ MidiRegionView::enable_display (bool yn) } void -MidiRegionView::show_step_edit_cursor (Evoral::Beats pos) +MidiRegionView::show_step_edit_cursor (Temporal::Beats pos) { if (_step_edit_cursor == 0) { ArdourCanvas::Item* const group = get_canvas_group(); @@ -4123,7 +4123,7 @@ MidiRegionView::show_step_edit_cursor (Evoral::Beats pos) } void -MidiRegionView::move_step_edit_cursor (Evoral::Beats pos) +MidiRegionView::move_step_edit_cursor (Temporal::Beats pos) { _step_edit_cursor_position = pos; @@ -4143,7 +4143,7 @@ MidiRegionView::hide_step_edit_cursor () } void -MidiRegionView::set_step_edit_cursor_width (Evoral::Beats beats) +MidiRegionView::set_step_edit_cursor_width (Temporal::Beats beats) { _step_edit_cursor_width = beats; @@ -4189,12 +4189,12 @@ MidiRegionView::data_recorded (boost::weak_ptr w) } /* convert from session samples to source beats */ - Evoral::Beats const time_beats = _source_relative_time_converter.from( + Temporal::Beats const time_beats = _source_relative_time_converter.from( ev.time() - src->timeline_position() + _region->start()); if (ev.type() == MIDI_CMD_NOTE_ON) { boost::shared_ptr note ( - new NoteType (ev.channel(), time_beats, Evoral::Beats(), ev.note(), ev.velocity())); + new NoteType (ev.channel(), time_beats, Temporal::Beats(), ev.note(), ev.velocity())); add_note (note, true); @@ -4353,7 +4353,7 @@ MidiRegionView::get_velocity_for_add (MidiModel::TimeType time) const * bar is -1, 0 is audio samples and a positive integer is beat subdivisions. * @return beat duration of p snapped to the grid subdivision underneath it. */ -Evoral::Beats +Temporal::Beats MidiRegionView::snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const { TempoMap& map (trackview.session()->tempo_map()); @@ -4364,7 +4364,7 @@ MidiRegionView::snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions /* Hack so that we always snap to the note that we are over, instead of snapping to the next one if we're more than halfway through the one we're over. */ - const Evoral::Beats grid_beats = get_grid_beats (p + _region->position()); + const Temporal::Beats grid_beats = get_grid_beats (p + _region->position()); const double rem = eqaf - qaf; if (rem >= 0.0) { eqaf -= grid_beats.to_double(); @@ -4372,7 +4372,7 @@ MidiRegionView::snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions } const double session_start_off = _region->quarter_note() - midi_region()->start_beats(); - return Evoral::Beats (eqaf - session_start_off); + return Temporal::Beats (eqaf - session_start_off); } ChannelMode @@ -4390,14 +4390,14 @@ MidiRegionView::get_selected_channels () const } -Evoral::Beats +Temporal::Beats MidiRegionView::get_grid_beats(samplepos_t pos) const { PublicEditor& editor = trackview.editor(); bool success = false; - Evoral::Beats beats = editor.get_grid_type_as_beats (success, pos); + Temporal::Beats beats = editor.get_grid_type_as_beats (success, pos); if (!success) { - beats = Evoral::Beats(1); + beats = Temporal::Beats(1); } return beats; } diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index d08e0177b7..84f7ab9a84 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -65,8 +65,8 @@ class CursorContext; class MidiRegionView : public RegionView { public: - typedef Evoral::Note NoteType; - typedef Evoral::Sequence::Notes Notes; + typedef Evoral::Note NoteType; + typedef Evoral::Sequence::Notes Notes; MidiRegionView (ArdourCanvas::Container* parent, RouteTimeAxisView& tv, @@ -99,8 +99,8 @@ public: { return midi_view()->midi_view(); } void step_add_note (uint8_t channel, uint8_t number, uint8_t velocity, - Evoral::Beats pos, Evoral::Beats len); - void step_sustain (Evoral::Beats beats); + Temporal::Beats pos, Temporal::Beats len); + void step_sustain (Temporal::Beats beats); void set_height (double); void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false); @@ -109,17 +109,17 @@ public: uint32_t get_fill_color() const; void color_handler (); - void show_step_edit_cursor (Evoral::Beats pos); - void move_step_edit_cursor (Evoral::Beats pos); + void show_step_edit_cursor (Temporal::Beats pos); + void move_step_edit_cursor (Temporal::Beats pos); void hide_step_edit_cursor (); - void set_step_edit_cursor_width (Evoral::Beats beats); + void set_step_edit_cursor_width (Temporal::Beats beats); void redisplay_model(); GhostRegion* add_ghost (TimeAxisView&); NoteBase* add_note(const boost::shared_ptr note, bool visible); - void resolve_note(uint8_t note_num, Evoral::Beats end_time); + void resolve_note(uint8_t note_num, Temporal::Beats end_time); void cut_copy_clear (Editing::CutCopyOp); bool paste (samplepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num); @@ -134,7 +134,7 @@ public: * @key a reference to an instance of MIDI::Name::PatchPrimaryKey whose fields will * will be set according to the result of the lookup */ - void get_patch_key_at (Evoral::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const; + void get_patch_key_at (Temporal::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const; /** Convert a given PatchChange into a PatchPrimaryKey */ @@ -145,10 +145,10 @@ public: * @param new_patch new patch */ void change_patch_change (PatchChange& old_patch, const MIDI::Name::PatchPrimaryKey& new_patch); - void change_patch_change (ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange const &); + void change_patch_change (ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange const &); - void add_patch_change (samplecnt_t, Evoral::PatchChange const &); - void move_patch_change (PatchChange &, Evoral::Beats); + void add_patch_change (samplecnt_t, Evoral::PatchChange const &); + void move_patch_change (PatchChange &, Temporal::Beats); void delete_patch_change (PatchChange *); void edit_patch_change (PatchChange *); @@ -176,7 +176,7 @@ public: void start_note_diff_command (std::string name = "midi edit"); void note_diff_add_change (NoteBase* ev, ARDOUR::MidiModel::NoteDiffCommand::Property, uint8_t val); - void note_diff_add_change (NoteBase* ev, ARDOUR::MidiModel::NoteDiffCommand::Property, Evoral::Beats val); + void note_diff_add_change (NoteBase* ev, ARDOUR::MidiModel::NoteDiffCommand::Property, Temporal::Beats val); void note_diff_add_note (const boost::shared_ptr note, bool selected, bool show_velocity = false); void note_diff_remove_note (NoteBase* ev); @@ -200,7 +200,7 @@ public: void select_range(samplepos_t start, samplepos_t end); void invert_selection (); - Evoral::Beats earliest_in_selection (); + Temporal::Beats earliest_in_selection (); void move_selection(double dx, double dy, double cumulative_dy); void note_dropped (NoteBase* ev, double d_qn, int8_t d_note, bool copy); NoteBase* copy_selection (NoteBase* primary); @@ -268,23 +268,23 @@ public: samplepos_t snap_pixel_to_sample(double x, bool ensure_snap = false); /** Convert a timestamp in beats into samples (both relative to region position) */ - samplepos_t region_beats_to_region_samples(Evoral::Beats beats) const; + samplepos_t region_beats_to_region_samples(Temporal::Beats beats) const; /** Convert a timestamp in beats into absolute samples */ - samplepos_t region_beats_to_absolute_samples(Evoral::Beats beats) const { + samplepos_t region_beats_to_absolute_samples(Temporal::Beats beats) const { return _region->position() + region_beats_to_region_samples (beats); } /** Convert a timestamp in samples to beats (both relative to region position) */ - Evoral::Beats region_samples_to_region_beats(samplepos_t) const; + Temporal::Beats region_samples_to_region_beats(samplepos_t) const; double region_samples_to_region_beats_double(samplepos_t) const; /** Convert a timestamp in beats measured from source start into absolute samples */ - samplepos_t source_beats_to_absolute_samples(Evoral::Beats beats) const; + samplepos_t source_beats_to_absolute_samples(Temporal::Beats beats) const; /** Convert a timestamp in beats measured from source start into region-relative samples */ - samplepos_t source_beats_to_region_samples(Evoral::Beats beats) const { + samplepos_t source_beats_to_region_samples(Temporal::Beats beats) const { return source_beats_to_absolute_samples (beats) - _region->position(); } /** Convert a timestamp in absolute samples to beats measured from source start*/ - Evoral::Beats absolute_samples_to_source_beats(samplepos_t) const; + Temporal::Beats absolute_samples_to_source_beats(samplepos_t) const; ARDOUR::BeatsSamplesConverter const & region_relative_time_converter () const { return _region_relative_time_converter; @@ -302,7 +302,7 @@ public: void goto_previous_note (bool add_to_selection); void goto_next_note (bool add_to_selection); - void change_note_lengths (bool, bool, Evoral::Beats beats, bool start, bool end); + void change_note_lengths (bool, bool, Temporal::Beats beats, bool start, bool end); void change_velocities (bool up, bool fine, bool allow_smush, bool all_together); void transpose (bool up, bool fine, bool allow_smush); void nudge_notes (bool forward, bool fine); @@ -333,7 +333,7 @@ public: * \param state the keyboard modifier mask for the canvas event (click). * \param shift_snap true alters snap behavior to round down always (false if the gui has already done that). */ - void create_note_at (samplepos_t t, double y, Evoral::Beats length, uint32_t state, bool shift_snap); + void create_note_at (samplepos_t t, double y, Temporal::Beats length, uint32_t state, bool shift_snap); /** An external request to clear the note selection, remove MRV from editor * selection. @@ -436,8 +436,8 @@ private: double _last_ghost_x; double _last_ghost_y; ArdourCanvas::Rectangle* _step_edit_cursor; - Evoral::Beats _step_edit_cursor_width; - Evoral::Beats _step_edit_cursor_position; + Temporal::Beats _step_edit_cursor_width; + Temporal::Beats _step_edit_cursor_position; NoteBase* _channel_selection_scoped_note; MouseState _mouse_state; @@ -495,7 +495,7 @@ private: void drop_down_keys (); void maybe_select_by_position (GdkEventButton* ev, double x, double y); - void get_events (Events& e, Evoral::Sequence::NoteOperator op, uint8_t val, int chan_mask = 0); + void get_events (Events& e, Evoral::Sequence::NoteOperator op, uint8_t val, int chan_mask = 0); void display_patch_changes_on_channel (uint8_t, bool); @@ -503,7 +503,7 @@ private: void data_recorded (boost::weak_ptr); /** Get grid type as beats, or default to 1 if not snapped to beats. */ - Evoral::Beats get_grid_beats(samplepos_t pos) const; + Temporal::Beats get_grid_beats(samplepos_t pos) const; void remove_ghost_note (); void mouse_mode_changed (); @@ -524,7 +524,7 @@ private: Gtkmm2ext::Color _patch_change_outline; Gtkmm2ext::Color _patch_change_fill; - Evoral::Beats snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const; + Temporal::Beats snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const; PBD::ScopedConnection _mouse_mode_connection; diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 17a5feff29..f64caaf271 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1418,7 +1418,7 @@ MidiTimeAxisView::toggle_note_selection (uint8_t note) } void -MidiTimeAxisView::get_per_region_note_selection (list > > > >& selection) +MidiTimeAxisView::get_per_region_note_selection (list > > > >& selection) { _view->foreach_regionview ( sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::get_per_region_note_selection_region_view), sigc::ref(selection))); @@ -1449,14 +1449,14 @@ MidiTimeAxisView::toggle_note_selection_region_view (RegionView* rv, uint8_t not } void -MidiTimeAxisView::get_per_region_note_selection_region_view (RegionView* rv, list > > > > &selection) +MidiTimeAxisView::get_per_region_note_selection_region_view (RegionView* rv, list > > > > &selection) { - Evoral::Sequence::Notes selected; + Evoral::Sequence::Notes selected; dynamic_cast(rv)->selection_as_notelist (selected, false); - std::set > > notes; + std::set > > notes; - Evoral::Sequence::Notes::iterator sel_it; + Evoral::Sequence::Notes::iterator sel_it; for (sel_it = selected.begin(); sel_it != selected.end(); ++sel_it) { notes.insert (*sel_it); } diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index 8af67421be..24b66a9253 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -108,7 +108,7 @@ public: uint8_t get_channel_for_add () const; - void get_per_region_note_selection (std::list > > > >&); + void get_per_region_note_selection (std::list > > > >&); protected: void start_step_editing (); @@ -182,7 +182,7 @@ private: void add_note_selection_region_view (RegionView* rv, uint8_t note, uint16_t chn_mask); void extend_note_selection_region_view (RegionView*, uint8_t note, uint16_t chn_mask); void toggle_note_selection_region_view (RegionView*, uint8_t note, uint16_t chn_mask); - void get_per_region_note_selection_region_view (RegionView*, std::list > > > >&); + void get_per_region_note_selection_region_view (RegionView*, std::list > > > >&); void ensure_step_editor (); diff --git a/gtk2_ardour/note.h b/gtk2_ardour/note.h index c294962c74..c002f9d3c1 100644 --- a/gtk2_ardour/note.h +++ b/gtk2_ardour/note.h @@ -32,7 +32,7 @@ namespace ArdourCanvas { class Note : public NoteBase { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; Note (MidiRegionView& region, ArdourCanvas::Item* parent, diff --git a/gtk2_ardour/note_base.h b/gtk2_ardour/note_base.h index b7be36ada8..ebc00cbfa4 100644 --- a/gtk2_ardour/note_base.h +++ b/gtk2_ardour/note_base.h @@ -22,6 +22,7 @@ #include +#include "temporal/beats.h" #include "canvas/types.h" #include "rgb_macros.h" @@ -53,7 +54,7 @@ namespace ArdourCanvas { class NoteBase : public sigc::trackable { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; NoteBase (MidiRegionView& region, bool, const boost::shared_ptr note = boost::shared_ptr()); virtual ~NoteBase (); diff --git a/gtk2_ardour/note_player.h b/gtk2_ardour/note_player.h index 9127842732..76eced31d6 100644 --- a/gtk2_ardour/note_player.h +++ b/gtk2_ardour/note_player.h @@ -31,7 +31,7 @@ namespace ARDOUR { class NotePlayer : public sigc::trackable { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; NotePlayer (boost::shared_ptr); ~NotePlayer (); diff --git a/gtk2_ardour/patch_change_dialog.cc b/gtk2_ardour/patch_change_dialog.cc index 9a7b746b89..63aa9eac7b 100644 --- a/gtk2_ardour/patch_change_dialog.cc +++ b/gtk2_ardour/patch_change_dialog.cc @@ -43,7 +43,7 @@ using namespace Gtkmm2ext; PatchChangeDialog::PatchChangeDialog ( const ARDOUR::BeatsSamplesConverter* tc, ARDOUR::Session* session, - Evoral::PatchChange const & patch, + Evoral::PatchChange const & patch, ARDOUR::InstrumentInfo& info, const Gtk::BuiltinStockID& ok, bool allow_delete, @@ -168,16 +168,16 @@ PatchChangeDialog::instrument_info_changed () fill_patch_combo (); } -Evoral::PatchChange +Evoral::PatchChange PatchChangeDialog::patch () const { - Evoral::Beats t = Evoral::Beats(); + Temporal::Beats t = Temporal::Beats(); if (_time_converter) { t = _time_converter->from (_time.current_time ()); } - return Evoral::PatchChange ( + return Evoral::PatchChange ( t, _channel.get_value_as_int() - 1, _program.get_value_as_int() - 1, diff --git a/gtk2_ardour/patch_change_dialog.h b/gtk2_ardour/patch_change_dialog.h index 9a35778986..8e322a736f 100644 --- a/gtk2_ardour/patch_change_dialog.h +++ b/gtk2_ardour/patch_change_dialog.h @@ -43,14 +43,14 @@ public: PatchChangeDialog ( const ARDOUR::BeatsSamplesConverter *, ARDOUR::Session *, - Evoral::PatchChange const &, + Evoral::PatchChange const &, ARDOUR::InstrumentInfo&, const Gtk::BuiltinStockID &, bool allow_delete = false, bool modal = true ); - Evoral::PatchChange patch () const; + Evoral::PatchChange patch () const; protected: void on_response (int); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 9a3f68da71..ed66f27bd8 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -35,7 +35,7 @@ #include #include -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Note.hpp" #include "pbd/statefuldestructible.h" @@ -339,7 +339,7 @@ public: virtual samplecnt_t get_nudge_distance (samplepos_t pos, samplecnt_t& next) = 0; virtual samplecnt_t get_paste_offset (samplepos_t pos, unsigned paste_count, samplecnt_t duration) = 0; virtual unsigned get_grid_beat_divisions(samplepos_t position) = 0; - virtual Evoral::Beats get_grid_type_as_beats (bool& success, samplepos_t position) = 0; + virtual Temporal::Beats get_grid_type_as_beats (bool& success, samplepos_t position) = 0; virtual int32_t get_grid_music_divisions (uint32_t event_state) = 0; virtual void edit_notes (MidiRegionView*) = 0; @@ -470,7 +470,7 @@ public: virtual void get_regions_after (RegionSelection&, samplepos_t where, const TrackViewList& ts) const = 0; virtual RegionSelection get_regions_from_selection_and_mouse (samplepos_t) = 0; virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0; - virtual void get_per_region_note_selection (std::list > > > >&) const = 0; + virtual void get_per_region_note_selection (std::list > > > >&) const = 0; virtual void mouse_add_new_tempo_event (samplepos_t where) = 0; virtual void mouse_add_new_meter_event (samplepos_t where) = 0; diff --git a/gtk2_ardour/quantize_dialog.cc b/gtk2_ardour/quantize_dialog.cc index dd7bd1affc..a70750ae8d 100644 --- a/gtk2_ardour/quantize_dialog.cc +++ b/gtk2_ardour/quantize_dialog.cc @@ -147,7 +147,7 @@ QuantizeDialog::grid_size_to_musical_time (const string& txt) const if (txt == _("main grid")) { bool success; - Evoral::Beats b = editor.get_grid_type_as_beats (success, 0); + Temporal::Beats b = editor.get_grid_type_as_beats (success, 0); if (!success) { return 1.0; } diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index da68450d7b..05255a13cb 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1159,15 +1159,15 @@ Selection::get_state () const } /* midi region views have thir own internal selection. */ - list > > > > rid_notes; + list > > > > rid_notes; editor->get_per_region_note_selection (rid_notes); - list > > > >::iterator rn_it; + list > > > >::iterator rn_it; for (rn_it = rid_notes.begin(); rn_it != rid_notes.end(); ++rn_it) { XMLNode* n = node->add_child (X_("MIDINotes")); n->set_property (X_("region-id"), (*rn_it).first); - for (std::set > >::iterator i = (*rn_it).second.begin(); i != (*rn_it).second.end(); ++i) { + for (std::set > >::iterator i = (*rn_it).second.begin(); i != (*rn_it).second.end(); ++i) { XMLNode* nc = n->add_child(X_("note")); nc->set_property(X_("note-id"), (*i)->id()); } diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc index 14327cd72d..94b0894bd5 100644 --- a/gtk2_ardour/step_editor.cc +++ b/gtk2_ardour/step_editor.cc @@ -41,7 +41,7 @@ StepEditor::StepEditor (PublicEditor& e, boost::shared_ptr t, MidiTim step_edit_insert_position = 0; _step_edit_triplet_countdown = 0; _step_edit_within_chord = 0; - _step_edit_chord_duration = Evoral::Beats(); + _step_edit_chord_duration = Temporal::Beats(); step_edit_region_view = 0; _track->PlaylistChanged.connect (*this, invalidator (*this), @@ -60,11 +60,11 @@ StepEditor::start_step_editing () { _step_edit_triplet_countdown = 0; _step_edit_within_chord = 0; - _step_edit_chord_duration = Evoral::Beats(); + _step_edit_chord_duration = Temporal::Beats(); step_edit_region.reset (); step_edit_region_view = 0; last_added_pitch = -1; - last_added_end = Evoral::Beats(); + last_added_end = Temporal::Beats(); resync_step_edit_position (); prepare_step_edit_region (); @@ -201,7 +201,7 @@ StepEditor::check_step_edit () incoming.read_contents (size, buf); if ((buf[0] & 0xf0) == MIDI_CMD_NOTE_ON) { - step_add_note (buf[0] & 0xf, buf[1], buf[2], Evoral::Beats()); + step_add_note (buf[0] & 0xf, buf[1], buf[2], Temporal::Beats()); } } } @@ -219,7 +219,7 @@ StepEditor::step_add_program_change (uint8_t /*channel*/, uint8_t /*program*/) } void -StepEditor::step_edit_sustain (Evoral::Beats beats) +StepEditor::step_edit_sustain (Temporal::Beats beats) { if (step_edit_region_view) { step_edit_region_view->step_sustain (beats); @@ -227,7 +227,7 @@ StepEditor::step_edit_sustain (Evoral::Beats beats) } void -StepEditor::move_step_edit_beat_pos (Evoral::Beats beats) +StepEditor::move_step_edit_beat_pos (Temporal::Beats beats) { if (!step_edit_region_view) { return; @@ -239,14 +239,14 @@ StepEditor::move_step_edit_beat_pos (Evoral::Beats beats) if (-beats < step_edit_beat_pos) { step_edit_beat_pos += beats; // its negative, remember } else { - step_edit_beat_pos = Evoral::Beats(); + step_edit_beat_pos = Temporal::Beats(); } } step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos); } int -StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evoral::Beats beat_duration) +StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Temporal::Beats beat_duration) { /* do these things in case undo removed the step edit region */ @@ -289,8 +289,8 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo _editor.reset_x_origin (fpos - (_editor.current_page_samples()/4)); } - Evoral::Beats at = step_edit_beat_pos; - Evoral::Beats len = beat_duration; + Temporal::Beats at = step_edit_beat_pos; + Temporal::Beats len = beat_duration; if ((last_added_pitch >= 0) && (pitch == last_added_pitch) && (last_added_end == step_edit_beat_pos)) { @@ -298,8 +298,8 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo up by 1 tick from where the last note ended */ - at += Evoral::Beats::ticks(1); - len -= Evoral::Beats::ticks(1); + at += Temporal::Beats::ticks(1); + len -= Temporal::Beats::ticks(1); } step_edit_region_view->step_add_note (channel, pitch, velocity, at, len); @@ -319,7 +319,7 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo step_edit_beat_pos += beat_duration; step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos); } else { - step_edit_beat_pos += Evoral::Beats::ticks(1); // tiny, but no longer overlapping + step_edit_beat_pos += Temporal::Beats::ticks(1); // tiny, but no longer overlapping _step_edit_chord_duration = max (_step_edit_chord_duration, beat_duration); } @@ -329,7 +329,7 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo } void -StepEditor::set_step_edit_cursor_width (Evoral::Beats beats) +StepEditor::set_step_edit_cursor_width (Temporal::Beats beats) { if (step_edit_region_view) { step_edit_region_view->set_step_edit_cursor_width (beats); @@ -375,7 +375,7 @@ StepEditor::step_edit_toggle_chord () } void -StepEditor::step_edit_rest (Evoral::Beats beats) +StepEditor::step_edit_rest (Temporal::Beats beats) { bool success; @@ -437,7 +437,7 @@ StepEditor::region_removed (boost::weak_ptr wr) step_edit_region.reset(); step_edit_region_view = 0; // force a recompute of the insert position - step_edit_beat_pos = Evoral::Beats(-1); + step_edit_beat_pos = Temporal::Beats(-1); } } diff --git a/gtk2_ardour/step_editor.h b/gtk2_ardour/step_editor.h index cecd39f2a3..99a6112b5a 100644 --- a/gtk2_ardour/step_editor.h +++ b/gtk2_ardour/step_editor.h @@ -25,7 +25,7 @@ #include #include "pbd/signals.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" namespace ARDOUR { class MidiTrack; @@ -44,22 +44,22 @@ public: virtual ~StepEditor (); void check_step_edit (); - void step_edit_rest (Evoral::Beats beats); + void step_edit_rest (Temporal::Beats beats); void step_edit_beat_sync (); void step_edit_bar_sync (); int step_add_bank_change (uint8_t channel, uint8_t bank); int step_add_program_change (uint8_t channel, uint8_t program); int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, - Evoral::Beats beat_duration); - void step_edit_sustain (Evoral::Beats beats); + Temporal::Beats beat_duration); + void step_edit_sustain (Temporal::Beats beats); bool step_edit_within_triplet () const; void step_edit_toggle_triplet (); bool step_edit_within_chord () const; void step_edit_toggle_chord (); void reset_step_edit_beat_pos (); void resync_step_edit_to_edit_point (); - void move_step_edit_beat_pos (Evoral::Beats beats); - void set_step_edit_cursor_width (Evoral::Beats beats); + void move_step_edit_beat_pos (Temporal::Beats beats); + void set_step_edit_cursor_width (Temporal::Beats beats); std::string name() const; @@ -68,19 +68,19 @@ public: private: ARDOUR::samplepos_t step_edit_insert_position; - Evoral::Beats step_edit_beat_pos; + Temporal::Beats step_edit_beat_pos; boost::shared_ptr step_edit_region; MidiRegionView* step_edit_region_view; uint8_t _step_edit_triplet_countdown; bool _step_edit_within_chord; - Evoral::Beats _step_edit_chord_duration; + Temporal::Beats _step_edit_chord_duration; PBD::ScopedConnection step_edit_region_connection; PublicEditor& _editor; boost::shared_ptr _track; StepEntry* step_editor; MidiTimeAxisView& _mtv; int8_t last_added_pitch; - Evoral::Beats last_added_end; + Temporal::Beats last_added_end; void region_removed (boost::weak_ptr); void playlist_changed (); diff --git a/gtk2_ardour/step_entry.cc b/gtk2_ardour/step_entry.cc index 4184068eb4..992c0fd187 100644 --- a/gtk2_ardour/step_entry.cc +++ b/gtk2_ardour/step_entry.cc @@ -520,10 +520,10 @@ StepEntry::on_key_release_event (GdkEventKey* ev) void StepEntry::rest_event_handler () { - se->step_edit_rest (Evoral::Beats()); + se->step_edit_rest (Temporal::Beats()); } -Evoral::Beats +Temporal::Beats StepEntry::note_length () { double base_time = 4.0 / (double) length_divisor_adjustment.get_value(); @@ -543,7 +543,7 @@ StepEntry::note_length () base_time *= 1 + ((dots - 1.0)/dots); } - return Evoral::Beats(base_time); + return Temporal::Beats(base_time); } uint8_t @@ -780,7 +780,7 @@ StepEntry::insert_rest () void StepEntry::insert_grid_rest () { - se->step_edit_rest (Evoral::Beats()); + se->step_edit_rest (Temporal::Beats()); } void diff --git a/gtk2_ardour/step_entry.h b/gtk2_ardour/step_entry.h index 685f859302..b81ae89227 100644 --- a/gtk2_ardour/step_entry.h +++ b/gtk2_ardour/step_entry.h @@ -41,14 +41,14 @@ public: void note_off_event_handler (int note); void rest_event_handler (); - Evoral::Beats note_length(); + Temporal::Beats note_length(); uint8_t note_velocity() const; uint8_t note_channel() const; int current_octave () const { return (int) floor (octave_adjustment.get_value()); } private: - Evoral::Beats _current_note_length; + Temporal::Beats _current_note_length; uint8_t _current_note_velocity; Gtk::VBox packer; diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index 98de440e48..921c962d75 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -80,7 +80,7 @@ TempoLines::draw_ticks (std::vector& grid, /* draw line with alpha corresponding to coarsest level */ const uint8_t a = max(8, (int)rint(UINT_RGBA_A(base) / (0.8 * log2(level)))); const uint32_t c = UINT_RGBA_CHANGE_A(base, a); - const samplepos_t f = _bfc->to (Evoral::Beats (grid.begin()->qn + (l / (double) divisions))) + _bfc->origin_b(); + const samplepos_t f = _bfc->to (Temporal::Beats (grid.begin()->qn + (l / (double) divisions))) + _bfc->origin_b(); if (f > leftmost_sample) { lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c); diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index bba45d5a24..4f36eb7e6d 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -168,7 +168,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co item_duration = duration; name_connected = false; position_locked = false; - max_item_duration = ARDOUR::max_samplepos; + max_item_duration = Temporal::max_samplepos; min_item_duration = 0; visibility = vis; _sensitive = true; diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc index 9edc3d1d22..cb146e4ea5 100644 --- a/gtk2_ardour/video_monitor.cc +++ b/gtk2_ardour/video_monitor.cc @@ -467,7 +467,7 @@ VideoMonitor::get_custom_setting (const std::string k) return (xjadeo_settings[k]); } -#define NO_OFFSET (ARDOUR::max_samplepos) //< skip setting or modifying offset +#define NO_OFFSET (Temporal::max_samplepos) //< skip setting or modifying offset void VideoMonitor::srsupdate () { diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 51e3e549f0..e883f99cb9 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -496,7 +496,7 @@ def build(bld): 'libpbd', 'libardour', 'libardour_cp', - 'libtimecode', + 'libtemporal', 'libmidipp', 'libgtkmm2ext', 'libcanvas', @@ -536,7 +536,7 @@ def build(bld): # 'libpbd', # 'libardour', # 'libardour_cp', -# 'libtimecode', +# 'libtemporal', # 'libmidipp', # 'libgtkmm2ext', # 'libcanvas', @@ -568,7 +568,7 @@ def build(bld): 'libmidipp', 'libardour', 'libardour_cp', - 'libtimecode', + 'libtemporal', 'libmidipp', 'libgtk2_ardour', 'libgtkmm2ext', @@ -616,7 +616,7 @@ def build(bld): obj.use = [ 'libpbd', 'libardour', 'libardour_cp', - 'libtimecode', + 'libtemporal', 'libmidipp', 'libgtkmm2ext', 'libcanvas', diff --git a/headless/wscript b/headless/wscript index 675c76bbf8..80296a10de 100644 --- a/headless/wscript +++ b/headless/wscript @@ -47,7 +47,7 @@ def build(bld): obj.use = [ 'libpbd', 'libardour', 'libardour_cp', - 'libtimecode', + 'libtemporal', 'libmidipp', ] diff --git a/libs/ardour/analysis_graph.cc b/libs/ardour/analysis_graph.cc index fe5b1c9a3b..e85abba211 100644 --- a/libs/ardour/analysis_graph.cc +++ b/libs/ardour/analysis_graph.cc @@ -21,7 +21,7 @@ #include "ardour/route.h" #include "ardour/session.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "audiographer/process_context.h" #include "audiographer/general/chunker.h" diff --git a/libs/ardour/ardour/beats_samples_converter.h b/libs/ardour/ardour/beats_samples_converter.h index f9ca27f209..3323ee67c8 100644 --- a/libs/ardour/ardour/beats_samples_converter.h +++ b/libs/ardour/ardour/beats_samples_converter.h @@ -19,7 +19,7 @@ $Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $ */ -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/TimeConverter.hpp" #include "ardour/libardour_visibility.h" @@ -37,15 +37,15 @@ class TempoMap; * them to the opposite unit, taking tempo changes into account. */ class LIBARDOUR_API BeatsSamplesConverter - : public Evoral::TimeConverter { + : public Evoral::TimeConverter { public: BeatsSamplesConverter (const TempoMap& tempo_map, samplepos_t origin) - : Evoral::TimeConverter (origin) + : Evoral::TimeConverter (origin) , _tempo_map(tempo_map) {} - samplepos_t to (Evoral::Beats beats) const; - Evoral::Beats from (samplepos_t samples) const; + samplepos_t to (Temporal::Beats beats) const; + Temporal::Beats from (samplepos_t samples) const; private: const TempoMap& _tempo_map; diff --git a/libs/ardour/ardour/evoral_types_convert.h b/libs/ardour/ardour/evoral_types_convert.h index 38d6c61e99..bc2b989d44 100644 --- a/libs/ardour/ardour/evoral_types_convert.h +++ b/libs/ardour/ardour/evoral_types_convert.h @@ -22,7 +22,7 @@ #include "pbd/enum_convert.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/ControlList.hpp" namespace PBD { @@ -30,24 +30,24 @@ namespace PBD { DEFINE_ENUM_CONVERT(Evoral::ControlList::InterpolationStyle) template <> -inline bool to_string (Evoral::Beats beats, std::string& str) +inline bool to_string (Temporal::Beats beats, std::string& str) { return double_to_string (beats.to_double (), str); } template <> -inline bool string_to (const std::string& str, Evoral::Beats& beats) +inline bool string_to (const std::string& str, Temporal::Beats& beats) { double tmp; if (!string_to_double (str, tmp)) { return false; } - beats = Evoral::Beats(tmp); + beats = Temporal::Beats(tmp); return true; } template <> -inline std::string to_string (Evoral::Beats beats) +inline std::string to_string (Temporal::Beats beats) { std::string tmp; double_to_string (beats.to_double (), tmp); @@ -55,11 +55,11 @@ inline std::string to_string (Evoral::Beats beats) } template <> -inline Evoral::Beats string_to (const std::string& str) +inline Temporal::Beats string_to (const std::string& str) { double tmp; string_to_double (str, tmp); - return Evoral::Beats (tmp); + return Temporal::Beats (tmp); } } // namespace PBD diff --git a/libs/ardour/ardour/legatize.h b/libs/ardour/ardour/legatize.h index aba65682a6..74c4d112df 100644 --- a/libs/ardour/ardour/legatize.h +++ b/libs/ardour/ardour/legatize.h @@ -39,10 +39,10 @@ public: Legatize(bool shrink_only); ~Legatize(); - typedef Evoral::Sequence::Notes Notes; + typedef Evoral::Sequence::Notes Notes; Command* operator()(boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs); std::string name () const { return (_shrink_only ? std::string ("remove overlap") : std::string ("legatize")); } diff --git a/libs/ardour/ardour/lua_api.h b/libs/ardour/ardour/lua_api.h index 797577df00..6d1deeb5aa 100644 --- a/libs/ardour/ardour/lua_api.h +++ b/libs/ardour/ardour/lua_api.h @@ -298,10 +298,10 @@ namespace ARDOUR { namespace LuaAPI { }; - boost::shared_ptr > - new_noteptr (uint8_t, Evoral::Beats, Evoral::Beats, uint8_t, uint8_t); + boost::shared_ptr > + new_noteptr (uint8_t, Temporal::Beats, Temporal::Beats, uint8_t, uint8_t); - std::list > > + std::list > > note_list (boost::shared_ptr); } } /* namespace */ diff --git a/libs/ardour/ardour/midi_cursor.h b/libs/ardour/ardour/midi_cursor.h index 6748a48971..6504874990 100644 --- a/libs/ardour/ardour/midi_cursor.h +++ b/libs/ardour/ardour/midi_cursor.h @@ -25,7 +25,7 @@ #include #include "ardour/types.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Sequence.hpp" #include "pbd/signals.h" @@ -45,8 +45,8 @@ struct MidiCursor : public boost::noncopyable { last_read_end = 0; } - Evoral::Sequence::const_iterator iter; - std::set::WeakNotePtr> active_notes; + Evoral::Sequence::const_iterator iter; + std::set::WeakNotePtr> active_notes; samplepos_t last_read_end; PBD::ScopedConnectionList connections; }; diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 8f8fd5c2cf..81e60ecf93 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -52,9 +52,9 @@ class MidiSource; * Because of this MIDI controllers and automatable controllers/widgets/etc * are easily interchangeable. */ -class LIBARDOUR_API MidiModel : public AutomatableSequence { +class LIBARDOUR_API MidiModel : public AutomatableSequence { public: - typedef Evoral::Beats TimeType; + typedef Temporal::Beats TimeType; MidiModel (boost::shared_ptr); @@ -265,8 +265,8 @@ public: bool write_section_to(boost::shared_ptr source, const Glib::Threads::Mutex::Lock& source_lock, - Evoral::Beats begin = Evoral::Beats(), - Evoral::Beats end = std::numeric_limits::max(), + Temporal::Beats begin = Temporal::Beats(), + Temporal::Beats end = std::numeric_limits::max(), bool offset_events = false); // MidiModel doesn't use the normal AutomationList serialisation code diff --git a/libs/ardour/ardour/midi_operator.h b/libs/ardour/ardour/midi_operator.h index 589e93041d..24c5d80167 100644 --- a/libs/ardour/ardour/midi_operator.h +++ b/libs/ardour/ardour/midi_operator.h @@ -23,7 +23,7 @@ #include #include -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Sequence.hpp" class Command; @@ -38,8 +38,8 @@ class LIBARDOUR_API MidiOperator { virtual ~MidiOperator() {} virtual Command* operator() (boost::shared_ptr, - Evoral::Beats, - std::vector::Notes>&) = 0; + Temporal::Beats, + std::vector::Notes>&) = 0; virtual std::string name() const = 0; }; diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index 952b0ab00f..f784b73177 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -117,7 +117,7 @@ protected: void region_going_away (boost::weak_ptr region); private: - typedef Evoral::Note Note; + typedef Evoral::Note Note; typedef Evoral::Event Event; struct RegionTracker : public boost::noncopyable { diff --git a/libs/ardour/ardour/midi_playlist_source.h b/libs/ardour/ardour/midi_playlist_source.h index 0d140a9855..0e749e7840 100644 --- a/libs/ardour/ardour/midi_playlist_source.h +++ b/libs/ardour/ardour/midi_playlist_source.h @@ -45,7 +45,7 @@ public: XMLNode& get_state (); int set_state (const XMLNode&, int version); - void append_event_beats(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event& ev); + void append_event_beats(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event& ev); void append_event_samples(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event& ev, samplepos_t source_start); void load_model(const Glib::Threads::Mutex::Lock& lock, bool force_reload=false); void destroy_model(const Glib::Threads::Mutex::Lock& lock); diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 00a5f28a5e..d46f59a6aa 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -23,7 +23,7 @@ #include -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Range.hpp" #include "pbd/string_convert.h" diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index 5f59baab22..0bede7fe52 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -46,7 +46,7 @@ template class MidiRingBuffer; class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_shared_from_this { public: - typedef Evoral::Beats TimeType; + typedef Temporal::Beats TimeType; MidiSource (Session& session, std::string name, Source::Flag flags = Source::Flag(0)); MidiSource (Session& session, const XMLNode&); @@ -62,8 +62,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha */ int write_to (const Lock& lock, boost::shared_ptr newsrc, - Evoral::Beats begin = Evoral::Beats(), - Evoral::Beats end = std::numeric_limits::max()); + Temporal::Beats begin = Temporal::Beats(), + Temporal::Beats end = std::numeric_limits::max()); /** Export the midi data in the given time range to another MidiSource * \param newsrc MidiSource to which data will be written. Should be a @@ -75,8 +75,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha */ int export_write_to (const Lock& lock, boost::shared_ptr newsrc, - Evoral::Beats begin, - Evoral::Beats end); + Temporal::Beats begin, + Temporal::Beats end); /** Read the data in a given time range from the MIDI source. * All time stamps in parameters are in audio samples (even if the source has tempo time). @@ -116,7 +116,7 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha * Caller must ensure that the event is later than the last written event. */ virtual void append_event_beats(const Lock& lock, - const Evoral::Event& ev) = 0; + const Evoral::Event& ev) = 0; /** Append a single event with a timestamp in samples. * @@ -155,8 +155,8 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha */ virtual void mark_midi_streaming_write_completed ( const Lock& lock, - Evoral::Sequence::StuckNoteOption stuck_option, - Evoral::Beats when = Evoral::Beats()); + Evoral::Sequence::StuckNoteOption stuck_option, + Temporal::Beats when = Temporal::Beats()); virtual void session_saved(); @@ -232,7 +232,7 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha boost::shared_ptr _model; bool _writing; - Evoral::Beats _length_beats; + Temporal::Beats _length_beats; /** The total duration of the current capture. */ samplepos_t _capture_length; diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h index 7843ff7e1d..48f9837f94 100644 --- a/libs/ardour/ardour/midi_state_tracker.h +++ b/libs/ardour/ardour/midi_state_tracker.h @@ -22,6 +22,7 @@ #include +#include "temporal/beats.h" #include "ardour/midi_buffer.h" namespace Evoral { @@ -46,7 +47,7 @@ public: void remove (uint8_t note, uint8_t chn); void resolve_notes (MidiBuffer& buffer, samplepos_t time); void resolve_notes (Evoral::EventSink& buffer, samplepos_t time); - void resolve_notes (MidiSource& src, const Glib::Threads::Mutex::Lock& lock, Evoral::Beats time); + void resolve_notes (MidiSource& src, const Glib::Threads::Mutex::Lock& lock, Temporal::Beats time); void dump (std::ostream&); void reset (); bool empty() const { return _on == 0; } diff --git a/libs/ardour/ardour/note_fixer.h b/libs/ardour/ardour/note_fixer.h index 34582497d0..320c92bc71 100644 --- a/libs/ardour/ardour/note_fixer.h +++ b/libs/ardour/ardour/note_fixer.h @@ -26,7 +26,7 @@ #include "ardour/midi_model.h" #include "ardour/types.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "evoral/Note.hpp" namespace Evoral { template class EventSink; } @@ -46,7 +46,7 @@ class TempoMap; class NoteFixer : public boost::noncopyable { public: - typedef Evoral::Note Note; + typedef Evoral::Note Note; ~NoteFixer(); @@ -85,7 +85,7 @@ private: typedef std::list Events; /** Copy a beats event to a samples event with the given time stamp. */ - Event* copy_event(samplepos_t time, const Evoral::Event& ev); + Event* copy_event(samplepos_t time, const Evoral::Event& ev); /** Return true iff `note` is active at `pos`. */ bool note_is_active(const BeatsSamplesConverter& converter, diff --git a/libs/ardour/ardour/quantize.h b/libs/ardour/ardour/quantize.h index 639736b174..7255d4ce4f 100644 --- a/libs/ardour/ardour/quantize.h +++ b/libs/ardour/ardour/quantize.h @@ -35,8 +35,8 @@ public: ~Quantize (); Command* operator() (boost::shared_ptr, - Evoral::Beats position, - std::vector::Notes>&); + Temporal::Beats position, + std::vector::Notes>&); std::string name() const { return std::string ("quantize"); } private: diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 8af452cc88..bbd2fe56cf 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -55,7 +55,7 @@ #include "midi++/types.h" #include "midi++/mmc.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "ardour/ardour.h" #include "ardour/chan_count.h" diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 3c0f52d5ae..155e295cbf 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -28,7 +28,7 @@ #include "pbd/signals.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "ardour/libardour_visibility.h" #include "ardour/types.h" diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h index 5b121b4a52..68dd74e1c4 100644 --- a/libs/ardour/ardour/smf_source.h +++ b/libs/ardour/ardour/smf_source.h @@ -51,14 +51,14 @@ public: return safe_midi_file_extension(path); } - void append_event_beats (const Lock& lock, const Evoral::Event& ev); + void append_event_beats (const Lock& lock, const Evoral::Event& ev); void append_event_samples (const Lock& lock, const Evoral::Event& ev, samplepos_t source_start); void mark_streaming_midi_write_started (const Lock& lock, NoteMode mode); void mark_streaming_write_completed (const Lock& lock); void mark_midi_streaming_write_completed (const Lock& lock, - Evoral::Sequence::StuckNoteOption, - Evoral::Beats when = Evoral::Beats()); + Evoral::Sequence::StuckNoteOption, + Temporal::Beats when = Temporal::Beats()); XMLNode& get_state (); int set_state (const XMLNode&, int version); @@ -78,7 +78,7 @@ public: private: bool _open; - Evoral::Beats _last_ev_time_beats; + Temporal::Beats _last_ev_time_beats; samplepos_t _last_ev_time_samples; /** end time (start + duration) of last call to read_unlocked */ mutable samplepos_t _smf_last_read_end; diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 99c28b5748..c200eafadc 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -32,7 +32,7 @@ #include "pbd/stateful.h" #include "pbd/statefuldestructible.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "ardour/ardour.h" @@ -450,7 +450,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible that align with the grid formed by tempo and meter sections. They SHOULD NOT be used to determine the position of events - whose location is canonically defined in Evoral::Beats. + whose location is canonically defined in Temporal::Beats. */ double beat_at_sample (const samplecnt_t sample) const; @@ -482,14 +482,14 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible when tempo matters but meter does not. They SHOULD be used to determine the position of events - whose location is canonically defined in Evoral::Beats. + whose location is canonically defined in Temporal::Beats. */ - samplepos_t samplepos_plus_qn (samplepos_t, Evoral::Beats) const; - Evoral::Beats framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const; + samplepos_t samplepos_plus_qn (samplepos_t, Temporal::Beats) const; + Temporal::Beats framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const; /* quarter note related functions are also tempo-sensitive and ignore meter. - quarter notes may be compared with and assigned to Evoral::Beats. + quarter notes may be compared with and assigned to Temporal::Beats. */ double quarter_note_at_sample (const samplepos_t sample) const; double quarter_note_at_sample_rt (const samplepos_t sample) const; diff --git a/libs/ardour/ardour/timecode.h b/libs/ardour/ardour/timecode.h index 050cc22066..0ea5ceb4cb 100644 --- a/libs/ardour/ardour/timecode.h +++ b/libs/ardour/ardour/timecode.h @@ -19,6 +19,6 @@ #ifndef __libardour_timecode_h__ #define __libardour_timecode_h__ -#include "timecode/time.h" +#include "temporal/time.h" #endif // __libardour_timecode_h__ diff --git a/libs/ardour/ardour/transform.h b/libs/ardour/ardour/transform.h index df77244a17..89c135ab0a 100644 --- a/libs/ardour/ardour/transform.h +++ b/libs/ardour/ardour/transform.h @@ -50,8 +50,8 @@ namespace ARDOUR { */ class LIBARDOUR_API Transform : public MidiOperator { public: - typedef Evoral::Sequence::NotePtr NotePtr; - typedef Evoral::Sequence::Notes Notes; + typedef Evoral::Sequence::NotePtr NotePtr; + typedef Evoral::Sequence::Notes Notes; typedef ARDOUR::MidiModel::NoteDiffCommand::Property Property; /** Context while iterating over notes during transformation. */ @@ -132,7 +132,7 @@ public: Transform(const Program& prog); Command* operator()(boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs); std::string name() const { return std::string ("transform"); } diff --git a/libs/ardour/ardour/transpose.h b/libs/ardour/ardour/transpose.h index 17f83283f9..ad44e28de7 100644 --- a/libs/ardour/ardour/transpose.h +++ b/libs/ardour/ardour/transpose.h @@ -28,13 +28,13 @@ namespace ARDOUR { class LIBARDOUR_API Transpose : public MidiOperator { public: - typedef Evoral::Sequence::NotePtr NotePtr; - typedef Evoral::Sequence::Notes Notes; + typedef Evoral::Sequence::NotePtr NotePtr; + typedef Evoral::Sequence::Notes Notes; Transpose (int semitones); Command* operator() (boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs); std::string name () const { return std::string ("transpose"); } diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index d3ed94e552..44f24c2225 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -31,8 +31,9 @@ #include -#include "timecode/bbt_time.h" -#include "timecode/time.h" +#include "temporal/bbt_time.h" +#include "temporal/time.h" +#include "temporal/types.h" #include "pbd/id.h" @@ -43,6 +44,9 @@ #include +using Temporal::max_samplepos; +using Temporal::max_samplecnt; + #if __GNUC__ < 3 typedef int intptr_t; #endif @@ -65,23 +69,11 @@ namespace ARDOUR { typedef uint64_t microseconds_t; typedef uint32_t pframes_t; - /* Any position measured in audio samples. - Assumed to be non-negative but not enforced. - */ - typedef int64_t samplepos_t; + /* rebind Temporal position types into ARDOUR namespace */ + typedef Temporal::samplecnt_t samplecnt_t; + typedef Temporal::samplepos_t samplepos_t; + typedef Temporal::sampleoffset_t sampleoffset_t; - /* Any distance from a given samplepos_t. - Maybe positive or negative. - */ - typedef int64_t sampleoffset_t; - - /* Any count of audio samples. - Assumed to be positive but not enforced. - */ - typedef int64_t samplecnt_t; - - static const samplepos_t max_samplepos = INT64_MAX; - static const samplecnt_t max_samplecnt = INT64_MAX; static const layer_t max_layer = UINT32_MAX; // a set of (time) intervals: first of pair is the offset of the start within the region, second is the offset of the end @@ -720,38 +712,8 @@ namespace ARDOUR { } // namespace ARDOUR -static inline ARDOUR::samplepos_t -session_sample_to_track_sample (ARDOUR::samplepos_t session_sample, double speed) -{ - long double result = (long double) session_sample * (long double) speed; - - if (result >= (long double) ARDOUR::max_samplepos) { - return ARDOUR::max_samplepos; - } else if (result <= (long double) (ARDOUR::max_samplepos) * (ARDOUR::samplepos_t)(-1)) { - return (ARDOUR::max_samplepos * (ARDOUR::samplepos_t)(-1)); - } else { - return result; - } -} - -static inline ARDOUR::samplepos_t -track_sample_to_session_sample (ARDOUR::samplepos_t track_sample, double speed) -{ - /* NB - do we need a check for speed == 0 ??? */ - long double result = (long double) track_sample / (long double) speed; - - if (result >= (long double) ARDOUR::max_samplepos) { - return ARDOUR::max_samplepos; - } else if (result <= (long double) (ARDOUR::max_samplepos) * (ARDOUR::samplepos_t)(-1)) { - return (ARDOUR::max_samplepos * (ARDOUR::samplepos_t)(-1)); - } else { - return result; - } -} - /* for now, break the rules and use "using" to make this "global" */ using ARDOUR::samplepos_t; - #endif /* __ardour_types_h__ */ diff --git a/libs/ardour/ardour/variant.h b/libs/ardour/ardour/variant.h index 4cf1df5556..0c99543e4b 100644 --- a/libs/ardour/ardour/variant.h +++ b/libs/ardour/ardour/variant.h @@ -27,7 +27,7 @@ #include #include "ardour/libardour_visibility.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "pbd/compose.h" namespace ARDOUR { @@ -57,7 +57,7 @@ public: explicit Variant(int32_t value) : _type(INT) { _int = value; } explicit Variant(int64_t value) : _type(LONG) { _long = value; } - explicit Variant(const Evoral::Beats& beats) + explicit Variant(const Temporal::Beats& beats) : _type(BEATS) , _beats(beats) {} @@ -94,7 +94,7 @@ public: std::min(value, (double)INT64_MAX))); break; case BEATS: - _beats = Evoral::Beats(value); + _beats = Temporal::Beats(value); break; default: _type = NOTHING; @@ -158,19 +158,19 @@ public: return false; } - bool operator==(const Evoral::Beats& v) const { + bool operator==(const Temporal::Beats& v) const { return _type == BEATS && _beats == v; } bool operator!() const { return _type == NOTHING; } - Variant& operator=(Evoral::Beats v) { + Variant& operator=(Temporal::Beats v) { _type = BEATS; _beats = v; return *this; } - const Evoral::Beats& get_beats() const { + const Temporal::Beats& get_beats() const { ensure_type(BEATS); return _beats; } @@ -204,7 +204,7 @@ private: Type _type; ///< Type tag std::string _string; ///< PATH, STRING, URI - Evoral::Beats _beats; ///< BEATS + Temporal::Beats _beats; ///< BEATS // Union of all primitive numeric types union { diff --git a/libs/ardour/beats_samples_converter.cc b/libs/ardour/beats_samples_converter.cc index 67b13cd05f..ece97aed68 100644 --- a/libs/ardour/beats_samples_converter.cc +++ b/libs/ardour/beats_samples_converter.cc @@ -31,9 +31,9 @@ namespace ARDOUR { * taking tempo changes into account. */ samplepos_t -BeatsSamplesConverter::to (Evoral::Beats beats) const +BeatsSamplesConverter::to (Temporal::Beats beats) const { - if (beats < Evoral::Beats()) { + if (beats < Temporal::Beats()) { std::cerr << "negative beats passed to BFC: " << beats << std::endl; PBD::stacktrace (std::cerr, 30); return 0; @@ -45,7 +45,7 @@ BeatsSamplesConverter::to (Evoral::Beats beats) const * supplied to the constructor. Returns the equivalent number of quarter-note beats, * taking tempo changes into account. */ -Evoral::Beats +Temporal::Beats BeatsSamplesConverter::from (samplepos_t samples) const { return _tempo_map.framewalk_to_qn (_origin_b, samples); @@ -60,7 +60,7 @@ DoubleBeatsSamplesConverter::to (double beats) const PBD::stacktrace (std::cerr, 30); return 0; } - return _tempo_map.samplepos_plus_qn (_origin_b, Evoral::Beats(beats)) - _origin_b; + return _tempo_map.samplepos_plus_qn (_origin_b, Temporal::Beats(beats)) - _origin_b; } /** As above, but with quarter-note beats in double instead (for GUI). */ diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index fa05516665..b5dade0dc1 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -1265,14 +1265,14 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo /* set length in beats to entire capture length */ BeatsSamplesConverter converter (_session.tempo_map(), capture_info.front()->start); - const Evoral::Beats total_capture_beats = converter.from (total_capture); + const Temporal::Beats total_capture_beats = converter.from (total_capture); _midi_write_source->set_length_beats (total_capture_beats); /* flush to disk: this step differs from the audio path, where all the data is already on disk. */ - _midi_write_source->mark_midi_streaming_write_completed (source_lock, Evoral::Sequence::ResolveStuckNotes, total_capture_beats); + _midi_write_source->mark_midi_streaming_write_completed (source_lock, Evoral::Sequence::ResolveStuckNotes, total_capture_beats); } _last_capture_sources.insert (_last_capture_sources.end(), audio_srcs.begin(), audio_srcs.end()); diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 1a83bd39d7..d06496f684 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -424,9 +424,9 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status, smfs->append_event_beats( source_lock, - Evoral::Event( + Evoral::Event( Evoral::MIDI_EVENT, - Evoral::Beats::ticks_at_rate(t, source->ppqn()), + Temporal::Beats::ticks_at_rate(t, source->ppqn()), size, buf)); @@ -440,7 +440,7 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status, /* we wrote something */ const samplepos_t pos = 0; - const Evoral::Beats length_beats = Evoral::Beats::ticks_at_rate(t, source->ppqn()); + const Temporal::Beats length_beats = Temporal::Beats::ticks_at_rate(t, source->ppqn()); BeatsSamplesConverter converter(smfs->session().tempo_map(), pos); smfs->update_length(pos + converter.to(length_beats.round_up_to_beat())); smfs->mark_streaming_write_completed (source_lock); diff --git a/libs/ardour/legatize.cc b/libs/ardour/legatize.cc index 4d3d0f7d0e..b3c5775b41 100644 --- a/libs/ardour/legatize.cc +++ b/libs/ardour/legatize.cc @@ -31,7 +31,7 @@ Legatize::~Legatize () Command* Legatize::operator()(boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs) { MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand(model, name ()); @@ -43,10 +43,10 @@ Legatize::operator()(boost::shared_ptr model, break; } - const Evoral::Beats new_end = (*next)->time() - Evoral::Beats::tick(); + const Temporal::Beats new_end = (*next)->time() - Temporal::Beats::tick(); if ((*i)->end_time() > new_end || (!_shrink_only && (*i)->end_time() < new_end)) { - const Evoral::Beats new_length(new_end - (*i)->time()); + const Temporal::Beats new_length(new_end - (*i)->time()); cmd->change((*i), MidiModel::NoteDiffCommand::Length, new_length); } diff --git a/libs/ardour/ltc_file_reader.cc b/libs/ardour/ltc_file_reader.cc index 8ca97ee5b6..c402da9a68 100644 --- a/libs/ardour/ltc_file_reader.cc +++ b/libs/ardour/ltc_file_reader.cc @@ -29,7 +29,7 @@ #include "pbd/error.h" #include "pbd/failed_constructor.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "ardour/ltc_file_reader.h" #include "pbd/i18n.h" diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index edfbfd44fa..001ddc11bf 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -815,16 +815,16 @@ LuaAPI::Vamp::process (const std::vector& d, ::Vamp::RealTime rt) return _plugin->process (bufs, rt); } -boost::shared_ptr > -LuaAPI::new_noteptr (uint8_t chan, Evoral::Beats beat_time, Evoral::Beats length, uint8_t note, uint8_t velocity) +boost::shared_ptr > +LuaAPI::new_noteptr (uint8_t chan, Temporal::Beats beat_time, Temporal::Beats length, uint8_t note, uint8_t velocity) { - return boost::shared_ptr > (new Evoral::Note(chan, beat_time, length, note, velocity)); + return boost::shared_ptr > (new Evoral::Note(chan, beat_time, length, note, velocity)); } -std::list > > +std::list > > LuaAPI::note_list (boost::shared_ptr mm) { - typedef boost::shared_ptr > NotePtr; + typedef boost::shared_ptr > NotePtr; std::list note_ptr_list; diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index c64445b5b9..b8932d9301 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -18,7 +18,7 @@ #include -#include "timecode/bbt_time.h" +#include "temporal/bbt_time.h" #include "pbd/stateful_diff_command.h" #include "pbd/openuri.h" #include "evoral/Control.hpp" @@ -206,7 +206,7 @@ CLASSKEYS(PBD::Configuration); CLASSKEYS(PBD::PropertyChange); CLASSKEYS(PBD::StatefulDestructible); -CLASSKEYS(Evoral::Beats); +CLASSKEYS(Temporal::Beats); CLASSKEYS(Evoral::Event); CLASSKEYS(Evoral::ControlEvent); @@ -235,7 +235,7 @@ CLASSKEYS(boost::shared_ptr > >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); -CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); @@ -247,8 +247,8 @@ CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); -CLASSKEYS(boost::shared_ptr >); -CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); @@ -516,9 +516,9 @@ LuaBindings::common (lua_State* L) .addFunction ("time", (samplepos_t (Evoral::Event::*)())&Evoral::Event::time) .endClass () - .beginClass ("Beats") + .beginClass ("Beats") .addConstructor () - .addFunction ("to_double", &Evoral::Beats::to_double) + .addFunction ("to_double", &Temporal::Beats::to_double) .endClass () .beginClass ("Parameter") @@ -570,16 +570,16 @@ LuaBindings::common (lua_State* L) .addData ("to", &Evoral::Range::to) .endClass () - .deriveWSPtrClass , Evoral::ControlSet> ("Sequence") + .deriveWSPtrClass , Evoral::ControlSet> ("Sequence") .endClass () - .beginWSPtrClass > ("NotePtr") - .addFunction ("time", &Evoral::Note::time) - .addFunction ("note", &Evoral::Note::note) - .addFunction ("velocity", &Evoral::Note::velocity) - .addFunction ("off_velocity", &Evoral::Note::off_velocity) - .addFunction ("length", &Evoral::Note::length) - .addFunction ("channel", &Evoral::Note::channel) + .beginWSPtrClass > ("NotePtr") + .addFunction ("time", &Evoral::Note::time) + .addFunction ("note", &Evoral::Note::note) + .addFunction ("velocity", &Evoral::Note::velocity) + .addFunction ("off_velocity", &Evoral::Note::off_velocity) + .addFunction ("length", &Evoral::Note::length) + .addFunction ("channel", &Evoral::Note::channel) .endClass () /* libevoral enums */ @@ -1267,11 +1267,11 @@ LuaBindings::common (lua_State* L) //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated) .endClass () - .deriveWSPtrClass , Automatable> ("AutomatableSequence") - .addCast > ("to_sequence") + .deriveWSPtrClass , Automatable> ("AutomatableSequence") + .addCast > ("to_sequence") .endClass () - .deriveWSPtrClass > ("MidiModel") + .deriveWSPtrClass > ("MidiModel") .addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command) .addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command) .endClass () @@ -1583,14 +1583,14 @@ LuaBindings::common (lua_State* L) .addVoidPtrConstructor > > () .endClass () - .beginStdList > > ("NotePtrList") + .beginStdList > > ("NotePtrList") .endClass () .beginConstStdList ("EventList") .endClass () #if 0 // depends on Evoal:: Note, Beats see note_fixer.h - // typedef Evoral::Note Note; + // typedef Evoral::Note Note; // std::set< boost::weak_ptr > .beginStdSet > ("WeakNoteSet") .endClass () diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 13268cd84a..21bb0bb114 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -561,7 +561,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change) } int old_val; - Evoral::Beats old_time; + Temporal::Beats old_time; if ((change.property == StartTime || change.property == Length) && xml_change->get_property ("old", old_time)) { change.old_value = old_time; @@ -573,7 +573,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change) } int new_val; - Evoral::Beats new_time; + Temporal::Beats new_time; if ((change.property == StartTime || change.property == Length) && xml_change->get_property ("new", new_time)) { change.new_value = new_time; @@ -1113,7 +1113,7 @@ MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n) assert(false); } - Evoral::Beats time = Evoral::Beats(); + Temporal::Beats time = Temporal::Beats(); if (!n->get_property ("time", time)) { // warning?? } @@ -1832,7 +1832,7 @@ MidiModel::transpose (NoteDiffCommand* c, const NotePtr note_ptr, int semitones) void MidiModel::control_list_marked_dirty () { - AutomatableSequence::control_list_marked_dirty (); + AutomatableSequence::control_list_marked_dirty (); ContentsChanged (); /* EMIT SIGNAL */ } diff --git a/libs/ardour/midi_playlist_source.cc b/libs/ardour/midi_playlist_source.cc index 80219cb9a3..86bc2b6344 100644 --- a/libs/ardour/midi_playlist_source.cc +++ b/libs/ardour/midi_playlist_source.cc @@ -152,7 +152,7 @@ MidiPlaylistSource::write_unlocked (const Lock&, } void -MidiPlaylistSource::append_event_beats(const Glib::Threads::Mutex::Lock& /*lock*/, const Evoral::Event& /*ev*/) +MidiPlaylistSource::append_event_beats(const Glib::Threads::Mutex::Lock& /*lock*/, const Evoral::Event& /*ev*/) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_beats() called - should be impossible") << endmsg; abort(); /*NOTREACHED*/ diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index cbb9f2d935..ebadc9cd5e 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -28,7 +28,7 @@ #include #include -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "pbd/xml++.h" #include "pbd/basename.h" @@ -144,8 +144,8 @@ MidiRegion::do_export (string path) const path, false, _session.sample_rate())); BeatsSamplesConverter bfc (_session.tempo_map(), _position); - Evoral::Beats const bbegin = bfc.from (_start); - Evoral::Beats const bend = bfc.from (_start + _length); + Temporal::Beats const bbegin = bfc.from (_start); + Temporal::Beats const bend = bfc.from (_start + _length); { /* Lock our source since we'll be reading from it. write_to() will @@ -180,8 +180,8 @@ boost::shared_ptr MidiRegion::clone (boost::shared_ptr newsrc) const { BeatsSamplesConverter bfc (_session.tempo_map(), _position); - Evoral::Beats const bbegin = bfc.from (_start); - Evoral::Beats const bend = bfc.from (_start + _length); + Temporal::Beats const bbegin = bfc.from (_start); + Temporal::Beats const bend = bfc.from (_start + _length); { boost::shared_ptr ms = midi_source(0); @@ -647,7 +647,7 @@ MidiRegion::fix_negative_start () _ignore_shift = true; - model()->insert_silence_at_start (Evoral::Beats (- _start_beats)); + model()->insert_silence_at_start (Temporal::Beats (- _start_beats)); _start = 0; _start_beats = 0.0; diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index 02f24e730b..6cfd0b6f21 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -206,7 +206,7 @@ MidiSource::midi_read (const Lock& lm, } // Find appropriate model iterator - Evoral::Sequence::const_iterator& i = cursor.iter; + Evoral::Sequence::const_iterator& i = cursor.iter; const bool linear_read = cursor.last_read_end != 0 && start == cursor.last_read_end; if (!linear_read || !i.valid()) { /* Cached iterator is invalid, search for the first event past start. @@ -256,7 +256,7 @@ MidiSource::midi_read (const Lock& lm, sure if this is necessary here (channels are mapped later in buffers anyway), but it preserves existing behaviour without destroying events in the model during read. */ - Evoral::Event ev(*i, true); + Evoral::Event ev(*i, true); if (!filter->filter(ev.buffer(), ev.size())) { dst.write(time_samples, ev.event_type(), ev.size(), ev.buffer()); } else { @@ -356,8 +356,8 @@ MidiSource::mark_streaming_write_started (const Lock& lock) void MidiSource::mark_midi_streaming_write_completed (const Lock& lock, - Evoral::Sequence::StuckNoteOption option, - Evoral::Beats end) + Evoral::Sequence::StuckNoteOption option, + Temporal::Beats end) { if (_model) { _model->end_write (option, end); @@ -378,11 +378,11 @@ MidiSource::mark_midi_streaming_write_completed (const Lock& void MidiSource::mark_streaming_write_completed (const Lock& lock) { - mark_midi_streaming_write_completed (lock, Evoral::Sequence::DeleteStuckNotes); + mark_midi_streaming_write_completed (lock, Evoral::Sequence::DeleteStuckNotes); } int -MidiSource::export_write_to (const Lock& lock, boost::shared_ptr newsrc, Evoral::Beats begin, Evoral::Beats end) +MidiSource::export_write_to (const Lock& lock, boost::shared_ptr newsrc, Temporal::Beats begin, Temporal::Beats end) { Lock newsrc_lock (newsrc->mutex ()); @@ -399,7 +399,7 @@ MidiSource::export_write_to (const Lock& lock, boost::shared_ptr new } int -MidiSource::write_to (const Lock& lock, boost::shared_ptr newsrc, Evoral::Beats begin, Evoral::Beats end) +MidiSource::write_to (const Lock& lock, boost::shared_ptr newsrc, Temporal::Beats begin, Temporal::Beats end) { Lock newsrc_lock (newsrc->mutex ()); @@ -408,7 +408,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr newsrc, Ev newsrc->copy_automation_state_from (this); if (_model) { - if (begin == Evoral::Beats() && end == std::numeric_limits::max()) { + if (begin == Temporal::Beats() && end == std::numeric_limits::max()) { _model->write_to (newsrc, newsrc_lock); } else { _model->write_section_to (newsrc, newsrc_lock, begin, end); @@ -422,7 +422,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr newsrc, Ev /* force a reload of the model if the range is partial */ - if (begin != Evoral::Beats() || end != std::numeric_limits::max()) { + if (begin != Temporal::Beats() || end != std::numeric_limits::max()) { newsrc->load_model (newsrc_lock, true); } else { newsrc->set_model (newsrc_lock, _model); diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc index 05312cf8bb..10b312ea9b 100644 --- a/libs/ardour/midi_state_tracker.cc +++ b/libs/ardour/midi_state_tracker.cc @@ -168,7 +168,7 @@ MidiStateTracker::resolve_notes (Evoral::EventSink &dst, samplepos_ } void -MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock, Evoral::Beats time) +MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock, Temporal::Beats time) { DEBUG_TRACE (PBD::DEBUG::MidiTrackers, string_compose ("%1 MS-resolve notes @ %2 on = %3\n", this, time, _on)); @@ -181,7 +181,7 @@ MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock, for (int channel = 0; channel < 16; ++channel) { for (int note = 0; note < 128; ++note) { while (_active_notes[note + 128 * channel]) { - Evoral::Event ev (Evoral::MIDI_EVENT, time, 3, 0, true); + Evoral::Event ev (Evoral::MIDI_EVENT, time, 3, 0, true); ev.set_type (MIDI_CMD_NOTE_OFF); ev.set_channel (channel); ev.set_note (note); @@ -191,7 +191,7 @@ MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock, this, (int) note, (int) channel, time)); _active_notes[note + 128 * channel]--; /* don't stack events up at the same time */ - time += Evoral::Beats::tick(); + time += Temporal::Beats::tick(); } } } diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc index bf7fbd752b..d7facbb0f1 100644 --- a/libs/ardour/midi_stretch.cc +++ b/libs/ardour/midi_stretch.cc @@ -108,7 +108,7 @@ MidiStretch::run (boost::shared_ptr r, Progress*) new_model->append(ev, Evoral::next_event_id()); } - new_model->end_write (Evoral::Sequence::DeleteStuckNotes); + new_model->end_write (Evoral::Sequence::DeleteStuckNotes); new_model->set_edited (true); new_src->copy_interpolation_from (src); diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 4832ccce07..dc5f3f0a80 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -380,7 +380,7 @@ MidiTrack::non_realtime_locate (samplepos_t pos) boost::shared_ptr rcontrol; if ((tcontrol = boost::dynamic_pointer_cast(c->second)) && (rcontrol = region->control(tcontrol->parameter()))) { - const Evoral::Beats pos_beats = bfc.from(pos - origin); + const Temporal::Beats pos_beats = bfc.from(pos - origin); if (rcontrol->list()->size() > 0) { tcontrol->set_value(rcontrol->list()->eval(pos_beats.to_double()), Controllable::NoGroup); } diff --git a/libs/ardour/note_fixer.cc b/libs/ardour/note_fixer.cc index a2d943f775..2d7bb67f6e 100644 --- a/libs/ardour/note_fixer.cc +++ b/libs/ardour/note_fixer.cc @@ -126,7 +126,7 @@ NoteFixer::emit(Evoral::EventSink& dst, } NoteFixer::Event* -NoteFixer::copy_event(samplepos_t time, const Evoral::Event& ev) +NoteFixer::copy_event(samplepos_t time, const Evoral::Event& ev) { return new Event(ev.event_type(), time, ev.size(), ev.buffer()); } diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc index b60b63dcf4..27e40ae8f7 100644 --- a/libs/ardour/quantize.cc +++ b/libs/ardour/quantize.cc @@ -111,8 +111,8 @@ swing_position (double pos, double grid, double swing, double offset) Command* Quantize::operator () (boost::shared_ptr model, - Evoral::Beats position, - std::vector::Notes>& seqs) + Temporal::Beats position, + std::vector::Notes>& seqs) { /* TODO: Rewrite this to be precise with fixed point? */ @@ -125,7 +125,7 @@ Quantize::operator () (boost::shared_ptr model, MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand (model, "quantize"); - for (std::vector::Notes>::iterator s = seqs.begin(); s != seqs.end(); ++s) { + for (std::vector::Notes>::iterator s = seqs.begin(); s != seqs.end(); ++s) { for (Evoral::Sequence::Notes::iterator i = (*s).begin(); i != (*s).end(); ++i) { @@ -167,10 +167,10 @@ Quantize::operator () (boost::shared_ptr model, delta = new_end - (*i)->end_time().to_double(); if (fabs (delta) >= _threshold) { - Evoral::Beats new_dur(new_end - new_start); + Temporal::Beats new_dur(new_end - new_start); if (!new_dur) { - new_dur = Evoral::Beats(_end_grid); + new_dur = Temporal::Beats(_end_grid); } cmd->change ((*i), MidiModel::NoteDiffCommand::Length, new_dur); diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc index ae18c43ac9..6b3d8b2174 100644 --- a/libs/ardour/session_ltc.cc +++ b/libs/ardour/session_ltc.cc @@ -18,7 +18,7 @@ */ -#include "timecode/time.h" +#include "temporal/time.h" #include "ardour/audioengine.h" #include "ardour/audio_port.h" diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index b29cc0cd05..d4bb41b735 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -35,7 +35,7 @@ #include "pbd/timersub.h" #include "pbd/stacktrace.h" -#include "timecode/time.h" +#include "temporal/time.h" #include "ardour/audio_track.h" #include "ardour/audioengine.h" diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index e822c7bc14..e8e780d34a 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1254,7 +1254,7 @@ Session::state (bool full_state, snapshot_t snapshot_type) if (!ms->model()) { ms->load_model (lm); } - if (ms->write_to (lm, newsrc, Evoral::Beats(), std::numeric_limits::max())) { + if (ms->write_to (lm, newsrc, Temporal::Beats(), std::numeric_limits::max())) { error << string_compose (_("Session-Save: Failed to copy MIDI Source '%1' for snapshot"), ancestor_name) << endmsg; } else { if (snapshot_type == SnapshotKeep) { diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index d622c33978..1c994b6eb3 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -284,7 +284,7 @@ SMFSource::read_unlocked (const Lock& lock, /* Note that we add on the source start time (in session samples) here so that ev_sample_time is in session samples. */ - const samplepos_t ev_sample_time = converter.to(Evoral::Beats::ticks_at_rate(time, ppqn())) + source_start; + const samplepos_t ev_sample_time = converter.to(Temporal::Beats::ticks_at_rate(time, ppqn())) + source_start; if (loop_range) { loop_range->squish (ev_sample_time); @@ -393,7 +393,7 @@ SMFSource::write_unlocked (const Lock& lock, /** Append an event with a timestamp in beats */ void SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock, - const Evoral::Event& ev) + const Evoral::Event& ev) { if (!_writing || ev.size() == 0) { return; @@ -405,9 +405,9 @@ SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock, for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n"); #endif - Evoral::Beats time = ev.time(); + Temporal::Beats time = ev.time(); if (time < _last_ev_time_beats) { - const Evoral::Beats difference = _last_ev_time_beats - time; + const Temporal::Beats difference = _last_ev_time_beats - time; if (difference.to_double() / (double)ppqn() < 1.0) { /* Close enough. This problem occurs because Sequence is not actually ordered due to fuzzy time comparison. I'm pretty sure @@ -437,7 +437,7 @@ SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock, _length_beats = max(_length_beats, time); - const Evoral::Beats delta_time_beats = time - _last_ev_time_beats; + const Temporal::Beats delta_time_beats = time - _last_ev_time_beats; const uint32_t delta_time_ticks = delta_time_beats.to_ticks(ppqn()); Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id); @@ -467,7 +467,7 @@ SMFSource::append_event_samples (const Glib::Threads::Mutex::Lock& lock, } BeatsSamplesConverter converter(_session.tempo_map(), position); - const Evoral::Beats ev_time_beats = converter.from(ev.time()); + const Temporal::Beats ev_time_beats = converter.from(ev.time()); Evoral::event_id_t event_id; if (ev.id() < 0) { @@ -477,7 +477,7 @@ SMFSource::append_event_samples (const Glib::Threads::Mutex::Lock& lock, } if (_model) { - const Evoral::Event beat_ev (ev.event_type(), + const Evoral::Event beat_ev (ev.event_type(), ev_time_beats, ev.size(), const_cast(ev.buffer())); @@ -486,8 +486,8 @@ SMFSource::append_event_samples (const Glib::Threads::Mutex::Lock& lock, _length_beats = max(_length_beats, ev_time_beats); - const Evoral::Beats last_time_beats = converter.from (_last_ev_time_samples); - const Evoral::Beats delta_time_beats = ev_time_beats - last_time_beats; + const Temporal::Beats last_time_beats = converter.from (_last_ev_time_samples); + const Temporal::Beats delta_time_beats = ev_time_beats - last_time_beats; const uint32_t delta_time_ticks = delta_time_beats.to_ticks(ppqn()); Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id); @@ -532,18 +532,18 @@ SMFSource::mark_streaming_midi_write_started (const Lock& lock, NoteMode mode) MidiSource::mark_streaming_midi_write_started (lock, mode); Evoral::SMF::begin_write (); - _last_ev_time_beats = Evoral::Beats(); + _last_ev_time_beats = Temporal::Beats(); _last_ev_time_samples = 0; } void SMFSource::mark_streaming_write_completed (const Lock& lock) { - mark_midi_streaming_write_completed (lock, Evoral::Sequence::DeleteStuckNotes); + mark_midi_streaming_write_completed (lock, Evoral::Sequence::DeleteStuckNotes); } void -SMFSource::mark_midi_streaming_write_completed (const Lock& lm, Evoral::Sequence::StuckNoteOption stuck_notes_option, Evoral::Beats when) +SMFSource::mark_midi_streaming_write_completed (const Lock& lm, Evoral::Sequence::StuckNoteOption stuck_notes_option, Temporal::Beats when) { MidiSource::mark_midi_streaming_write_completed (lm, stuck_notes_option, when); @@ -601,8 +601,8 @@ SMFSource::safe_midi_file_extension (const string& file) } static bool compare_eventlist ( - const std::pair< const Evoral::Event*, gint >& a, - const std::pair< const Evoral::Event*, gint >& b) { + const std::pair< const Evoral::Event*, gint >& a, + const std::pair< const Evoral::Event*, gint >& b) { return ( a.first->time() < b.first->time() ); } @@ -633,7 +633,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload Evoral::SMF::seek_to_start(); uint64_t time = 0; /* in SMF ticks */ - Evoral::Event ev; + Evoral::Event ev; uint32_t scratch_size = 0; // keep track of scratch and minimize reallocs @@ -645,7 +645,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload bool have_event_id; // TODO simplify event allocation - std::list< std::pair< Evoral::Event*, gint > > eventlist; + std::list< std::pair< Evoral::Event*, gint > > eventlist; for (unsigned i = 1; i <= num_tracks(); ++i) { if (seek_to_track(i)) continue; @@ -671,7 +671,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload if (!have_event_id) { event_id = Evoral::next_event_id(); } - const Evoral::Beats event_time = Evoral::Beats::ticks_at_rate(time, ppqn()); + const Temporal::Beats event_time = Temporal::Beats::ticks_at_rate(time, ppqn()); #ifndef NDEBUG std::string ss; @@ -686,7 +686,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload #endif eventlist.push_back(make_pair ( - new Evoral::Event ( + new Evoral::Event ( Evoral::MIDI_EVENT, event_time, size, buf, true) , event_id)); @@ -705,7 +705,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload eventlist.sort(compare_eventlist); - std::list< std::pair< Evoral::Event*, gint > >::iterator it; + std::list< std::pair< Evoral::Event*, gint > >::iterator it; for (it=eventlist.begin(); it!=eventlist.end(); ++it) { _model->append (*it->first, it->second); delete it->first; @@ -715,7 +715,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload // _playback_buf->dump (cerr); // cerr << "----------------\n"; - _model->end_write (Evoral::Sequence::ResolveStuckNotes, _length_beats); + _model->end_write (Evoral::Sequence::ResolveStuckNotes, _length_beats); _model->set_edited (false); invalidate(lock); diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 4b9d2a9372..23a0553735 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -27,7 +27,7 @@ #include "pbd/enumwriter.h" #include "pbd/xml++.h" -#include "evoral/Beats.hpp" +#include "temporal/beats.h" #include "ardour/debug.h" #include "ardour/lmath.h" @@ -2423,7 +2423,7 @@ TempoMap::sample_at_quarter_note (const double quarter_note) const * @param beat The BBT (meter-based) beat. * @return The quarter-note position of the supplied BBT (meter-based) beat. * - * a quarter-note may be compared with and assigned to Evoral::Beats. + * a quarter-note may be compared with and assigned to Temporal::Beats. * */ double @@ -2438,7 +2438,7 @@ TempoMap::quarter_note_at_beat (const double beat) const * @param quarter_note The position in quarter-note beats. * @return the BBT (meter-based) beat position of the supplied quarter-note beats. * - * a quarter-note is the musical unit of Evoral::Beats. + * a quarter-note is the musical unit of Temporal::Beats. * */ double @@ -4821,7 +4821,7 @@ TempoMap::remove_time (samplepos_t where, samplecnt_t amount) * pos can be -ve, if required. */ samplepos_t -TempoMap::samplepos_plus_qn (samplepos_t sample, Evoral::Beats beats) const +TempoMap::samplepos_plus_qn (samplepos_t sample, Temporal::Beats beats) const { Glib::Threads::RWLock::ReaderLock lm (lock); const double sample_qn = pulse_at_minute_locked (_metrics, minute_at_sample (sample)) * 4.0; @@ -4856,12 +4856,12 @@ TempoMap::samplepos_plus_bbt (samplepos_t pos, BBT_Time op) const /** Count the number of beats that are equivalent to distance when going forward, starting at pos. */ -Evoral::Beats +Temporal::Beats TempoMap::framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const { Glib::Threads::RWLock::ReaderLock lm (lock); - return Evoral::Beats (quarter_notes_between_samples_locked (_metrics, pos, pos + distance)); + return Temporal::Beats (quarter_notes_between_samples_locked (_metrics, pos, pos + distance)); } struct bbtcmp { diff --git a/libs/ardour/test/bbt_test.h b/libs/ardour/test/bbt_test.h index 94a4d96c03..c0c658ab2c 100644 --- a/libs/ardour/test/bbt_test.h +++ b/libs/ardour/test/bbt_test.h @@ -2,7 +2,7 @@ #include #include #include -#include "timecode/bbt_time.h" +#include "temporal/bbt_time.h" class BBTTest : public CppUnit::TestFixture { diff --git a/libs/ardour/test/samplepos_minus_beats_test.cc b/libs/ardour/test/samplepos_minus_beats_test.cc index 5d2d95ac74..1e88de6283 100644 --- a/libs/ardour/test/samplepos_minus_beats_test.cc +++ b/libs/ardour/test/samplepos_minus_beats_test.cc @@ -1,6 +1,6 @@ #include "samplepos_minus_beats_test.h" #include "ardour/tempo.h" -#include "timecode/bbt_time.h" +#include "temporal/bbt_time.h" CPPUNIT_TEST_SUITE_REGISTRATION (FrameposMinusBeatsTest); diff --git a/libs/ardour/test/samplepos_plus_beats_test.cc b/libs/ardour/test/samplepos_plus_beats_test.cc index d567f4691c..4529e34899 100644 --- a/libs/ardour/test/samplepos_plus_beats_test.cc +++ b/libs/ardour/test/samplepos_plus_beats_test.cc @@ -1,6 +1,6 @@ #include "samplepos_plus_beats_test.h" #include "ardour/tempo.h" -#include "timecode/bbt_time.h" +#include "temporal/bbt_time.h" CPPUNIT_TEST_SUITE_REGISTRATION (FrameposPlusBeatsTest); @@ -25,11 +25,11 @@ FrameposPlusBeatsTest::singleTempoTest () map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, AudioTime); /* Add 1 beat to beat 3 of the first bar */ - samplepos_t r = map.samplepos_plus_qn (samples_per_beat * 2, Evoral::Beats(1)); + samplepos_t r = map.samplepos_plus_qn (samples_per_beat * 2, Temporal::Beats(1)); CPPUNIT_ASSERT_EQUAL (samplepos_t (samples_per_beat * 3), r); /* Add 4 beats to a -ve sample of 1 beat before zero */ - r = map.samplepos_plus_qn (-samples_per_beat * 1, Evoral::Beats(4)); + r = map.samplepos_plus_qn (-samples_per_beat * 1, Temporal::Beats(4)); CPPUNIT_ASSERT_EQUAL (samplepos_t (samples_per_beat * 3), r); } @@ -70,15 +70,15 @@ FrameposPlusBeatsTest::doubleTempoTest () /* Now some tests */ /* Add 1 beat to 1|2 */ - samplepos_t r = map.samplepos_plus_qn (24e3, Evoral::Beats(1)); + samplepos_t r = map.samplepos_plus_qn (24e3, Temporal::Beats(1)); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r); /* Add 2 beats to 3|4 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3, Evoral::Beats(2)); + r = map.samplepos_plus_qn (264e3, Temporal::Beats(2)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); /* Add 2.5 beats to 3|3|960 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3 - 12e3, Evoral::Beats(2.5)); + r = map.samplepos_plus_qn (264e3 - 12e3, Temporal::Beats(2.5)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); } @@ -125,15 +125,15 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest () /* Now some tests */ /* Add 1 beat to 1|2 */ - samplepos_t r = map.samplepos_plus_qn (24e3, Evoral::Beats(1)); + samplepos_t r = map.samplepos_plus_qn (24e3, Temporal::Beats(1)); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r); /* Add 2 beats to 3|4 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3, Evoral::Beats(2)); + r = map.samplepos_plus_qn (264e3, Temporal::Beats(2)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); /* Add 2.5 beats to 3|3|960 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3 - 12e3, Evoral::Beats(2.5)); + r = map.samplepos_plus_qn (264e3 - 12e3, Temporal::Beats(2.5)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); } @@ -181,15 +181,15 @@ FrameposPlusBeatsTest::doubleTempoWithComplexMeterTest () /* Now some tests */ /* Add 1 beat to 1|2 */ - samplepos_t r = map.samplepos_plus_qn (24e3, Evoral::Beats(1)); + samplepos_t r = map.samplepos_plus_qn (24e3, Temporal::Beats(1)); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r); /* Add 2 beats to 5|1 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3, Evoral::Beats(2)); + r = map.samplepos_plus_qn (264e3, Temporal::Beats(2)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); /* Add 2.5 beats to 4|5 (over the tempo change) */ - r = map.samplepos_plus_qn (264e3 - 12e3, Evoral::Beats(2.5)); + r = map.samplepos_plus_qn (264e3 - 12e3, Temporal::Beats(2.5)); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r); } diff --git a/libs/ardour/test/samplewalk_to_beats_test.cc b/libs/ardour/test/samplewalk_to_beats_test.cc index 3e396b25b6..3cb93672c3 100644 --- a/libs/ardour/test/samplewalk_to_beats_test.cc +++ b/libs/ardour/test/samplewalk_to_beats_test.cc @@ -1,6 +1,6 @@ #include "samplewalk_to_beats_test.h" #include "ardour/tempo.h" -#include "timecode/bbt_time.h" +#include "temporal/bbt_time.h" CPPUNIT_TEST_SUITE_REGISTRATION (FramewalkToBeatsTest); diff --git a/libs/ardour/transform.cc b/libs/ardour/transform.cc index 9f029829de..9f7169e61e 100644 --- a/libs/ardour/transform.cc +++ b/libs/ardour/transform.cc @@ -121,7 +121,7 @@ Transform::Operation::eval(Context& ctx) const Command* Transform::operator()(boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs) { typedef MidiModel::NoteDiffCommand Command; diff --git a/libs/ardour/transpose.cc b/libs/ardour/transpose.cc index ca0b7abf4e..ad5013d05d 100644 --- a/libs/ardour/transpose.cc +++ b/libs/ardour/transpose.cc @@ -27,7 +27,7 @@ Transpose::Transpose(int semitones) Command* Transpose::operator()(boost::shared_ptr model, - Evoral::Beats position, + Temporal::Beats position, std::vector& seqs) { typedef MidiModel::NoteDiffCommand Command; diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 0d7b08e368..df28255d5e 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -394,7 +394,7 @@ def build(bld): 'OSX','BOOST','CURL','TAGLIB','VAMPSDK','VAMPHOSTSDK','RUBBERBAND'] obj.use = ['libpbd','libmidipp','libevoral', 'libaudiographer', - 'libtimecode', + 'libtemporal', 'liblua', ] if bld.env['build_target'] != 'mingw': @@ -478,7 +478,7 @@ def build(bld): source = avx_sources, cxxflags = avx_cxxflags, includes = [ '.' ], - use = [ 'libtimecode', 'libpbd', 'libevoral', 'liblua' ], + use = [ 'libtemporal', 'libpbd', 'libevoral', 'liblua' ], uselib = [ 'GLIBMM', 'XML' ], target = 'sse_avx_functions') diff --git a/libs/audiographer/wscript b/libs/audiographer/wscript index 7ac9f8f4fa..ad4140d25e 100644 --- a/libs/audiographer/wscript +++ b/libs/audiographer/wscript @@ -85,7 +85,7 @@ def build(bld): audiographer.name = 'libaudiographer' audiographer.target = 'audiographer' audiographer.export_includes = ['.', './src'] - audiographer.includes = ['.', './src','../ardour','../timecode','../evoral'] + audiographer.includes = ['.', './src','../ardour','../temporal','../evoral'] audiographer.uselib = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE FFTW3F VAMPSDK VAMPHOSTSDK XML' audiographer.use = 'libpbd' audiographer.vnum = AUDIOGRAPHER_LIB_VERSION diff --git a/libs/evoral/src/Event.cpp b/libs/evoral/src/Event.cpp index 13d7c6c6ac..444ad4cdfb 100644 --- a/libs/evoral/src/Event.cpp +++ b/libs/evoral/src/Event.cpp @@ -18,8 +18,8 @@ #include +#include "temporal/beats.h" #include "evoral/Event.hpp" -#include "evoral/Beats.hpp" namespace Evoral { @@ -162,7 +162,7 @@ Event::set (const uint8_t* buf, uint32_t size, Timestamp t) #endif // EVORAL_EVENT_ALLOC -template class Event; +template class Event; template class Event; template class Event; diff --git a/libs/evoral/src/Note.cpp b/libs/evoral/src/Note.cpp index 631a995ab3..10b3b4314f 100644 --- a/libs/evoral/src/Note.cpp +++ b/libs/evoral/src/Note.cpp @@ -24,7 +24,7 @@ #include "evoral/Note.hpp" #endif -#include "evoral/Beats.hpp" +#include "temporal/beats.h" namespace Evoral { @@ -90,7 +90,7 @@ Note