convert codebase to use Temporal for various time types

This commit is contained in:
Paul Davis 2017-09-24 12:03:54 -04:00
parent 9283bee867
commit 7db12f6b12
114 changed files with 567 additions and 598 deletions

View file

@ -124,7 +124,7 @@
#undef check #undef check
#endif #endif
#include "timecode/time.h" #include "temporal/time.h"
typedef uint64_t microseconds_t; typedef uint64_t microseconds_t;

View file

@ -120,8 +120,8 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n)
int test_channel = (*_events.begin())->note()->channel (); int test_channel = (*_events.begin())->note()->channel ();
int test_pitch = (*_events.begin())->note()->note (); int test_pitch = (*_events.begin())->note()->note ();
int test_velocity = (*_events.begin())->note()->velocity (); int test_velocity = (*_events.begin())->note()->velocity ();
Evoral::Beats test_time = (*_events.begin())->note()->time (); Temporal::Beats test_time = (*_events.begin())->note()->time ();
Evoral::Beats test_length = (*_events.begin())->note()->length (); Temporal::Beats test_length = (*_events.begin())->note()->length ();
for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) { for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) {
if ((*i)->note()->channel() != test_channel) { 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()); 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 ()) { if (!_time_all.get_sensitive() || _time_all.get_active ()) {
for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) { for (set<NoteBase*>::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 ()) { if (!_length_all.get_sensitive() || _length_all.get_active ()) {
for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) { for (set<NoteBase*>::iterator i = _events.begin(); i != _events.end(); ++i) {
samplepos_t const note_end_sample = region_samples + _length_clock.current_duration (_time_clock.current_time()); 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()) { if (d != (*i)->note()->length()) {
_region_view->change_note_length (*i, d); _region_view->change_note_length (*i, d);
had_change = true; had_change = true;

View file

@ -4090,23 +4090,23 @@ Editor::get_grid_music_divisions (uint32_t event_state)
return 0; return 0;
} }
Evoral::Beats Temporal::Beats
Editor::get_grid_type_as_beats (bool& success, samplepos_t position) Editor::get_grid_type_as_beats (bool& success, samplepos_t position)
{ {
success = true; success = true;
const unsigned divisions = get_grid_beat_divisions(position); const unsigned divisions = get_grid_beat_divisions(position);
if (divisions) { 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) { switch (_snap_type) {
case SnapToBeat: 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: case SnapToBar:
if (_session) { if (_session) {
const Meter& m = _session->tempo_map().meter_at_sample (position); 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; break;
default: default:
@ -4114,7 +4114,7 @@ Editor::get_grid_type_as_beats (bool& success, samplepos_t position)
break; break;
} }
return Evoral::Beats(); return Temporal::Beats();
} }
samplecnt_t samplecnt_t
@ -5021,7 +5021,7 @@ Editor::get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) cons
} }
void void
Editor::get_per_region_note_selection (list<pair<PBD::ID, set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > > &selection) const Editor::get_per_region_note_selection (list<pair<PBD::ID, set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > > &selection) const
{ {
for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) { for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {

View file

@ -334,7 +334,7 @@ public:
samplecnt_t get_nudge_distance (samplepos_t pos, samplecnt_t& next); 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); samplecnt_t get_paste_offset (samplepos_t pos, unsigned paste_count, samplecnt_t duration);
unsigned get_grid_beat_divisions(samplepos_t position); 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); int32_t get_grid_music_divisions (uint32_t event_state);
@ -451,7 +451,7 @@ public:
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison); void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison);
void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const; void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const;
void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const; void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const;
void center_screen (samplepos_t); void center_screen (samplepos_t);
@ -1221,7 +1221,7 @@ private:
void cut_copy (Editing::CutCopyOp); void cut_copy (Editing::CutCopyOp);
bool can_cut_copy () const; 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_regions (Editing::CutCopyOp, RegionSelection&);
void cut_copy_ranges (Editing::CutCopyOp); void cut_copy_ranges (Editing::CutCopyOp);
void cut_copy_midi (Editing::CutCopyOp); void cut_copy_midi (Editing::CutCopyOp);

View file

@ -6646,8 +6646,8 @@ samplecnt_t
NoteCreateDrag::grid_samples (samplepos_t t) const NoteCreateDrag::grid_samples (samplepos_t t) const
{ {
const Evoral::Beats grid_beats = _region_view->get_grid_beats (t); const Temporal::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 t_beats = _region_view->region_samples_to_region_beats (t);
return _region_view->region_beats_to_region_samples (t_beats + grid_beats) return _region_view->region_beats_to_region_samples (t_beats + grid_beats)
- _region_view->region_beats_to_region_samples (t_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 samplepos_t pf = _drags->current_pointer_sample ();
const int32_t divisions = _editor->get_grid_music_divisions (event->button.state); 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); double eqaf = map.exact_qn_at_sample (pf, divisions);
@ -6706,7 +6706,7 @@ NoteCreateDrag::motion (GdkEvent* event, bool)
if (divisions != 0) { 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); 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 /* 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()); TempoMap& map (_editor->session()->tempo_map());
const double qn_length = map.quarter_notes_between_samples (start_sess_rel, start_sess_rel + length); 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")); _editor->begin_reversible_command (_("Create Note"));
_region_view->clear_editor_note_selection(); _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(); 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")); _editor->begin_reversible_command (_("Create Hit"));
_region_view->clear_editor_note_selection(); _region_view->clear_editor_note_selection();
@ -6826,7 +6826,7 @@ HitCreateDrag::motion (GdkEvent* event, bool)
return; return;
} }
Evoral::Beats length = _region_view->get_grid_beats (pf); Temporal::Beats length = _region_view->get_grid_beats (pf);
boost::shared_ptr<MidiRegion> mr = _region_view->midi_region(); boost::shared_ptr<MidiRegion> mr = _region_view->midi_region();

View file

@ -4247,7 +4247,7 @@ struct PointsSelectionPositionSorter {
* @param op Operation (Cut, Copy or Clear) * @param op Operation (Cut, Copy or Clear)
*/ */
void 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 ()) { if (selection->points.empty ()) {
return; 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); lists[al].copy->fast_simple_add ((*ctrl_evt)->when, (*ctrl_evt)->value);
if (midi) { if (midi) {
/* Update earliest MIDI start time in beats */ /* 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 { } else {
/* Update earliest session start time in samples */ /* Update earliest session start time in samples */
start.sample = std::min(start.sample, (*sel_point)->line().session_position(ctrl_evt)); 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. */ /* Snap start time backwards, so copy/paste is snap aligned. */
if (midi) { if (midi) {
if (earliest == std::numeric_limits<Evoral::Beats>::max()) { if (earliest == std::numeric_limits<Temporal::Beats>::max()) {
earliest = Evoral::Beats(); // Weird... don't offset earliest = Temporal::Beats(); // Weird... don't offset
} }
earliest.round_down_to_beat(); earliest.round_down_to_beat();
} else { } else {
@ -4369,7 +4369,7 @@ Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool mid
void void
Editor::cut_copy_midi (CutCopyOp op) Editor::cut_copy_midi (CutCopyOp op)
{ {
Evoral::Beats earliest = std::numeric_limits<Evoral::Beats>::max(); Temporal::Beats earliest = std::numeric_limits<Temporal::Beats>::max();
for (MidiRegionSelection::iterator i = selection->midi_regions.begin(); i != selection->midi_regions.end(); ++i) { for (MidiRegionSelection::iterator i = selection->midi_regions.begin(); i != selection->midi_regions.end(); ++i) {
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i); MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
if (mrv) { if (mrv) {
@ -5322,13 +5322,13 @@ Editor::strip_region_silence ()
Command* Command*
Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv) Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv)
{ {
Evoral::Sequence<Evoral::Beats>::Notes selected; Evoral::Sequence<Temporal::Beats>::Notes selected;
mrv.selection_as_notelist (selected, true); mrv.selection_as_notelist (selected, true);
vector<Evoral::Sequence<Evoral::Beats>::Notes> v; vector<Evoral::Sequence<Temporal::Beats>::Notes> v;
v.push_back (selected); 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); return op (mrv.midi_region()->model(), pos_beats, v);
} }
@ -5543,7 +5543,7 @@ Editor::insert_patch_change (bool from_context)
*/ */
MidiRegionView* first = dynamic_cast<MidiRegionView*> (rs.front ()); MidiRegionView* first = dynamic_cast<MidiRegionView*> (rs.front ());
Evoral::PatchChange<Evoral::Beats> empty (Evoral::Beats(), 0, 0, 0); Evoral::PatchChange<Temporal::Beats> empty (Temporal::Beats(), 0, 0, 0);
PatchChangeDialog d (0, _session, empty, first->instrument_info(), Gtk::Stock::ADD); PatchChangeDialog d (0, _session, empty, first->instrument_info(), Gtk::Stock::ADD);
if (d.run() == RESPONSE_CANCEL) { if (d.run() == RESPONSE_CANCEL) {

View file

@ -250,11 +250,11 @@ Editor::do_ptimport (std::string ptpath,
for (vector<PTFFormat::midi_ev_t>::iterator for (vector<PTFFormat::midi_ev_t>::iterator
j = a->midi.begin(); j = a->midi.begin();
j != a->midi.end(); ++j) { j != a->midi.end(); ++j) {
Evoral::Beats start = (Evoral::Beats)(j->pos/960000.); Temporal::Beats start = (Temporal::Beats)(j->pos/960000.);
Evoral::Beats len = (Evoral::Beats)(j->length/960000.); Temporal::Beats len = (Temporal::Beats)(j->length/960000.);
// PT C-2 = 0, Ardour C-1 = 0, subtract twelve to convert... // PT C-2 = 0, Ardour C-1 = 0, subtract twelve to convert...
midicmd->add(boost::shared_ptr<Evoral::Note<Evoral::Beats> > midicmd->add(boost::shared_ptr<Evoral::Note<Temporal::Beats> >
(new Evoral::Note<Evoral::Beats>( (uint8_t)1, start, len, j->note - 12, j->velocity ))); (new Evoral::Note<Temporal::Beats>( (uint8_t)1, start, len, j->note - 12, j->velocity )));
} }
mm->apply_command (_session, midicmd); mm->apply_command (_session, midicmd);
boost::shared_ptr<Region> copy (RegionFactory::create (mr, true)); boost::shared_ptr<Region> copy (RegionFactory::create (mr, true));

View file

@ -127,7 +127,7 @@ private:
ArdourCanvas::Polygon* _tmp_poly; ArdourCanvas::Polygon* _tmp_poly;
MidiRegionView& parent_mrv; MidiRegionView& parent_mrv;
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
MidiGhostRegion::GhostEvent* find_event (boost::shared_ptr<NoteType>); MidiGhostRegion::GhostEvent* find_event (boost::shared_ptr<NoteType>);
typedef boost::unordered_map<boost::shared_ptr<NoteType>, MidiGhostRegion::GhostEvent* > EventList; typedef boost::unordered_map<boost::shared_ptr<NoteType>, MidiGhostRegion::GhostEvent* > EventList;

View file

@ -17,7 +17,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Note.hpp" #include "evoral/Note.hpp"
#include "canvas/polygon.h" #include "canvas/polygon.h"

View file

@ -30,7 +30,7 @@ namespace ArdourCanvas {
class Hit : public NoteBase class Hit : public NoteBase
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
Hit (MidiRegionView& region, Hit (MidiRegionView& region,
ArdourCanvas::Item* parent, ArdourCanvas::Item* parent,

View file

@ -25,7 +25,7 @@
#include <pbd/windows_timer_utils.h> #include <pbd/windows_timer_utils.h>
#endif #endif
#include "timecode/time.h" #include "temporal/time.h"
#include "idleometer.h" #include "idleometer.h"
#include "pbd/i18n.h" #include "pbd/i18n.h"

View file

@ -21,7 +21,7 @@
using namespace ARDOUR; using namespace ARDOUR;
MidiCutBuffer::MidiCutBuffer (Session* s) MidiCutBuffer::MidiCutBuffer (Session* s)
: AutomatableSequence<Evoral::Beats> (*s) : AutomatableSequence<Temporal::Beats> (*s)
, _origin (0) , _origin (0)
{ {

View file

@ -19,7 +19,7 @@
#ifndef __gtk_ardour_midi_cut_buffer_h__ #ifndef __gtk_ardour_midi_cut_buffer_h__
#define __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" #include "ardour/automatable_sequence.h"
@ -27,10 +27,10 @@ namespace ARDOUR {
class Session; class Session;
} }
class MidiCutBuffer : public ARDOUR::AutomatableSequence<Evoral::Beats> class MidiCutBuffer : public ARDOUR::AutomatableSequence<Temporal::Beats>
{ {
public: public:
typedef Evoral::Beats TimeType; typedef Temporal::Beats TimeType;
MidiCutBuffer (ARDOUR::Session*); MidiCutBuffer (ARDOUR::Session*);
~MidiCutBuffer(); ~MidiCutBuffer();

View file

@ -292,7 +292,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
if (note->time() + fdelta >= 0) { if (note->time() + fdelta >= 0) {
cmd->change (note, prop, note->time() + fdelta); cmd->change (note, prop, note->time() + fdelta);
} else { } else {
cmd->change (note, prop, Evoral::Beats()); cmd->change (note, prop, Temporal::Beats());
} }
break; break;
case MidiModel::NoteDiffCommand::Velocity: case MidiModel::NoteDiffCommand::Velocity:
@ -300,10 +300,10 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
break; break;
case MidiModel::NoteDiffCommand::Length: case MidiModel::NoteDiffCommand::Length:
if (note->length().to_double() + fdelta >= if (note->length().to_double() + fdelta >=
Evoral::Beats::tick().to_double()) { Temporal::Beats::tick().to_double()) {
cmd->change (note, prop, note->length() + fdelta); cmd->change (note, prop, note->length() + fdelta);
} else { } else {
cmd->change (note, prop, Evoral::Beats::tick()); cmd->change (note, prop, Temporal::Beats::tick());
} }
break; break;
case MidiModel::NoteDiffCommand::Channel: case MidiModel::NoteDiffCommand::Channel:
@ -335,7 +335,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
if (note->time() + fdelta >= 0) { if (note->time() + fdelta >= 0) {
cmd->change (note, prop, note->time() + fdelta); cmd->change (note, prop, note->time() + fdelta);
} else { } else {
cmd->change (note, prop, Evoral::Beats()); cmd->change (note, prop, Temporal::Beats());
} }
break; break;
case MidiModel::NoteDiffCommand::Velocity: case MidiModel::NoteDiffCommand::Velocity:
@ -343,10 +343,10 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
break; break;
case MidiModel::NoteDiffCommand::Length: case MidiModel::NoteDiffCommand::Length:
if (note->length() + fdelta >= if (note->length() + fdelta >=
Evoral::Beats::tick().to_double()) { Temporal::Beats::tick().to_double()) {
cmd->change (note, prop, note->length() + fdelta); cmd->change (note, prop, note->length() + fdelta);
} else { } else {
cmd->change (note, prop, Evoral::Beats::tick()); cmd->change (note, prop, Temporal::Beats::tick());
} }
break; break;
case MidiModel::NoteDiffCommand::Channel: case MidiModel::NoteDiffCommand::Channel:
@ -778,7 +778,7 @@ MidiListEditor::redisplay_model ()
row[columns.start] = ss.str(); row[columns.start] = ss.str();
bbt.bars = 0; 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.beats = dur.get_beats ();
bbt.ticks = dur.get_ticks (); bbt.ticks = dur.get_ticks ();

View file

@ -44,7 +44,7 @@ namespace ARDOUR {
class MidiListEditor : public ArdourWindow class MidiListEditor : public ArdourWindow
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
MidiListEditor(ARDOUR::Session*, boost::shared_ptr<ARDOUR::MidiRegion>, MidiListEditor(ARDOUR::Session*, boost::shared_ptr<ARDOUR::MidiRegion>,
boost::shared_ptr<ARDOUR::MidiTrack>); boost::shared_ptr<ARDOUR::MidiTrack>);

View file

@ -748,7 +748,7 @@ MidiRegionView::key_press (GdkEventKey* ev)
bool shorter = Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier); bool shorter = Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier);
bool fine = Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier); 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; return true;
@ -923,7 +923,7 @@ MidiRegionView::show_list_editor ()
* \param snap_t true to snap t to the grid, otherwise false. * \param snap_t true to snap t to the grid, otherwise false.
*/ */
void 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) { if (length < 2 * DBL_EPSILON) {
return; 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 // Start of note in samples relative to region start
const int32_t divisions = trackview.editor().get_grid_music_divisions (state); 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 double note = view->y_to_note(y);
const uint8_t chan = mtv->get_channel_for_add(); const uint8_t chan = mtv->get_channel_for_add();
@ -1043,7 +1043,7 @@ MidiRegionView::note_diff_add_change (NoteBase* ev,
void void
MidiRegionView::note_diff_add_change (NoteBase* ev, MidiRegionView::note_diff_add_change (NoteBase* ev,
MidiModel::NoteDiffCommand::Property property, MidiModel::NoteDiffCommand::Property property,
Evoral::Beats val) Temporal::Beats val)
{ {
if (_note_diff_command) { if (_note_diff_command) {
_note_diff_command->change (ev->note(), property, val); _note_diff_command->change (ev->note(), property, val);
@ -1157,7 +1157,7 @@ MidiRegionView::find_canvas_sys_ex (MidiModel::SysExPtr s)
} }
void void
MidiRegionView::get_events (Events& e, Evoral::Sequence<Evoral::Beats>::NoteOperator op, uint8_t val, int chan_mask) MidiRegionView::get_events (Events& e, Evoral::Sequence<Temporal::Beats>::NoteOperator op, uint8_t val, int chan_mask)
{ {
MidiModel::Notes notes; MidiModel::Notes notes;
_model->get_notes (notes, op, val, chan_mask); _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) { for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) {
MidiModel::SysExPtr sysex_ptr = *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 ((*i)->is_spp() || (*i)->is_mtc_quarter() || (*i)->is_mtc_full()) {
if (!display_periodic_messages) { if (!display_periodic_messages) {
@ -1424,7 +1424,7 @@ MidiRegionView::display_sysexes()
} }
// Show unless message is beyond the region bounds // 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 #warning paul fix this
// if (time - _region->start() >= _region->length() || time < _region->start()) { // if (time - _region->start() >= _region->length() || time < _region->start()) {
// sysex->hide(); // sysex->hide();
@ -1610,7 +1610,7 @@ MidiRegionView::end_write()
/** Resolve an active MIDI note (while recording). /** Resolve an active MIDI note (while recording).
*/ */
void 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) { if (midi_view()->note_mode() != Sustained) {
return; return;
@ -1890,7 +1890,7 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible)
void void
MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity, 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<NoteType> new_note (new NoteType (channel, pos, len, number, velocity)); boost::shared_ptr<NoteType> 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 void
MidiRegionView::step_sustain (Evoral::Beats beats) MidiRegionView::step_sustain (Temporal::Beats beats)
{ {
change_note_lengths (false, false, beats, false, true); 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. /// Return true iff @p pc applies to the given time on the given channel.
static bool 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; return pc->time() <= time && pc->channel() == channel;
} }
void 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 // The earliest event not before time
MidiModel::PatchChanges::iterator i = _model->patch_change_lower_bound (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 void
MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange<Evoral::Beats> & new_change) MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const Evoral::PatchChange<Temporal::Beats> & new_change)
{ {
string name = _("alter patch change"); string name = _("alter patch change");
trackview.editor().begin_reversible_command (name); trackview.editor().begin_reversible_command (name);
@ -2082,14 +2082,14 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const
* MidiTimeAxisView::get_channel_for_add()) * MidiTimeAxisView::get_channel_for_add())
*/ */
void void
MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange<Evoral::Beats> const & patch) MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange<Temporal::Beats> const & patch)
{ {
string name = _("add patch change"); string name = _("add patch change");
trackview.editor().begin_reversible_command (name); trackview.editor().begin_reversible_command (name);
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name); MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (name);
c->add (MidiModel::PatchChangePtr ( c->add (MidiModel::PatchChangePtr (
new Evoral::PatchChange<Evoral::Beats> ( new Evoral::PatchChange<Temporal::Beats> (
absolute_samples_to_source_beats (_region->position() + t), absolute_samples_to_source_beats (_region->position() + t),
patch.channel(), patch.program(), patch.bank() patch.channel(), patch.program(), patch.bank()
) )
@ -2103,7 +2103,7 @@ MidiRegionView::add_patch_change (samplecnt_t t, Evoral::PatchChange<Evoral::Bea
} }
void void
MidiRegionView::move_patch_change (PatchChange& pc, Evoral::Beats t) MidiRegionView::move_patch_change (PatchChange& pc, Temporal::Beats t)
{ {
trackview.editor().begin_reversible_command (_("move patch change")); trackview.editor().begin_reversible_command (_("move patch change"));
MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("move patch change")); MidiModel::PatchChangeDiffCommand* c = _model->new_patch_change_diff_command (_("move patch change"));
@ -2397,8 +2397,8 @@ MidiRegionView::note_selected (NoteBase* ev, bool add, bool extend)
} else { } else {
/* find end of latest note selected, select all between that and the start of "ev" */ /* find end of latest note selected, select all between that and the start of "ev" */
Evoral::Beats earliest = std::numeric_limits<Evoral::Beats>::max(); Temporal::Beats earliest = std::numeric_limits<Temporal::Beats>::max();
Evoral::Beats latest = Evoral::Beats(); Temporal::Beats latest = Temporal::Beats();
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
if ((*i)->note()->end_time() > latest) { if ((*i)->note()->end_time() > latest) {
@ -2550,10 +2550,10 @@ MidiRegionView::add_to_selection (NoteBase* ev)
} }
} }
Evoral::Beats Temporal::Beats
MidiRegionView::earliest_in_selection () MidiRegionView::earliest_in_selection ()
{ {
Evoral::Beats earliest = std::numeric_limits<Evoral::Beats>::max(); Temporal::Beats earliest = std::numeric_limits<Temporal::Beats>::max();
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
if ((*i)->note()->time() < earliest) { if ((*i)->note()->time() < earliest) {
@ -2571,7 +2571,7 @@ MidiRegionView::move_selection(double dx_qn, double dy, double cumulative_dy)
Editor* editor = dynamic_cast<Editor*> (&trackview.editor()); Editor* editor = dynamic_cast<Editor*> (&trackview.editor());
TempoMap& tmap (editor->session()->tempo_map()); TempoMap& tmap (editor->session()->tempo_map());
PossibleChord to_play; 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) { for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
NoteBase* n = *i; NoteBase* n = *i;
@ -2668,7 +2668,7 @@ MidiRegionView::move_copies (double dx_qn, double dy, double cumulative_dy)
Editor* editor = dynamic_cast<Editor*> (&trackview.editor()); Editor* editor = dynamic_cast<Editor*> (&trackview.editor());
TempoMap& tmap (editor->session()->tempo_map()); TempoMap& tmap (editor->session()->tempo_map());
PossibleChord to_play; 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) { for (CopyDragEvents::iterator i = _copy_drag_events.begin(); i != _copy_drag_events.end(); ++i) {
NoteBase* n = *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) { 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) { if (new_time < 0) {
continue; 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) { for (CopyDragEvents::iterator i = _copy_drag_events.begin(); i != _copy_drag_events.end() ; ++i) {
/* update time */ /* 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) { if (new_time < 0) {
continue; continue;
@ -2871,7 +2871,7 @@ MidiRegionView::get_end_position_pixels()
} }
samplepos_t 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' /* the time converter will return the sample corresponding to `beats'
relative to the start of the source. The start of the source 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); return source_start + _source_relative_time_converter.to (beats);
} }
Evoral::Beats Temporal::Beats
MidiRegionView::absolute_samples_to_source_beats(samplepos_t samples) const MidiRegionView::absolute_samples_to_source_beats(samplepos_t samples) const
{ {
/* the `samples' argument needs to be converted into a sample count /* 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 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); return _region_relative_time_converter.to(beats);
} }
Evoral::Beats Temporal::Beats
MidiRegionView::region_samples_to_region_beats(samplepos_t samples) const MidiRegionView::region_samples_to_region_beats(samplepos_t samples) const
{ {
return _region_relative_time_converter.from(samples); return _region_relative_time_converter.from(samples);
@ -3035,10 +3035,10 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
} else { } else {
snapped_x = trackview.editor ().pixel_to_sample (current_x); 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(); - midi_region()->beat()) + midi_region()->start_beats();
Evoral::Beats len = Evoral::Beats(); Temporal::Beats len = Temporal::Beats();
if (at_front) { if (at_front) {
if (beats < canvas_note->note()->end_time()) { 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]; char buf[16];
snprintf (buf, sizeof (buf), "%.3g beats", len.to_double()); 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 */ /* and then to beats */
const double e_qaf = tmap.exact_qn_at_sample (current_fr + midi_region()->position(), divisions); 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 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()) { 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)); 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(); len += canvas_note->note()->length();
if (!!len) { if (!!len) {
@ -3145,7 +3145,7 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
} }
if (!at_front) { 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)); x_beats - canvas_note->note()->time() - (sign * snap_delta_beats));
note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len); 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 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_start = false;
bool change_length = false; bool change_length = false;
Evoral::Beats new_start; Temporal::Beats new_start;
Evoral::Beats new_length; Temporal::Beats new_length;
/* NOTE: the semantics of the two delta arguments are slightly subtle: /* 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 (front_delta < 0) {
if (event->note()->time() < -front_delta) { if (event->note()->time() < -front_delta) {
new_start = Evoral::Beats(); new_start = Temporal::Beats();
} else { } else {
new_start = event->note()->time() + front_delta; // moves earlier 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 { } 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()) { if (new_pos < event->note()->end_time()) {
new_start = event->note()->time() + front_delta; new_start = event->note()->time() + front_delta;
@ -3296,14 +3296,14 @@ MidiRegionView::change_note_channel (NoteBase* event, int8_t chn, bool relative)
} }
void 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 (relative) {
if (delta < 0.0) { if (delta < 0.0) {
if (event->note()->time() < -delta) { if (event->note()->time() < -delta) {
new_time = Evoral::Beats(); new_time = Temporal::Beats();
} else { } else {
new_time = event->note()->time() + delta; new_time = event->note()->time() + delta;
} }
@ -3318,7 +3318,7 @@ MidiRegionView::change_note_time (NoteBase* event, Evoral::Beats delta, bool rel
} }
void 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); note_diff_add_change (event, MidiModel::NoteDiffCommand::Length, t);
} }
@ -3430,11 +3430,11 @@ MidiRegionView::transpose (bool up, bool fine, bool allow_smush)
} }
void 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 (!delta) {
if (fine) { if (fine) {
delta = Evoral::Beats(1.0/128.0); delta = Temporal::Beats(1.0/128.0);
} else { } else {
/* grab the current grid distance */ /* grab the current grid distance */
delta = get_grid_beats(_region->position()); 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 */ /* note the negation of the delta for start */
trim_note (*i, trim_note (*i,
(start ? -delta : Evoral::Beats()), (start ? -delta : Temporal::Beats()),
(end ? delta : Evoral::Beats())); (end ? delta : Temporal::Beats()));
i = next; 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()); const samplepos_t ref_point = source_beats_to_absolute_samples ((*(_selection.begin()))->note()->time());
Evoral::Beats delta; Temporal::Beats delta;
if (!fine) { if (!fine) {
/* non-fine, move by 1 bar regardless of snap */ /* 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) { } 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")); start_note_diff_command (_("paste"));
const Evoral::Beats snap_beats = get_grid_beats(pos); const Temporal::Beats snap_beats = get_grid_beats(pos);
const Evoral::Beats first_time = (*mcb.notes().begin())->time(); const Temporal::Beats first_time = (*mcb.notes().begin())->time();
const Evoral::Beats last_time = (*mcb.notes().rbegin())->end_time(); const Temporal::Beats last_time = (*mcb.notes().rbegin())->end_time();
const Evoral::Beats duration = last_time - first_time; const Temporal::Beats duration = last_time - first_time;
const Evoral::Beats snap_duration = duration.snap_to(snap_beats); const Temporal::Beats snap_duration = duration.snap_to(snap_beats);
const Evoral::Beats paste_offset = snap_duration * paste_count; const Temporal::Beats paste_offset = snap_duration * paste_count;
const Evoral::Beats quarter_note = absolute_samples_to_source_beats(pos) + paste_offset; const Temporal::Beats quarter_note = absolute_samples_to_source_beats(pos) + paste_offset;
Evoral::Beats end_point = Evoral::Beats(); 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", 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, 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 int32_t divisions = editor.get_grid_music_divisions (state);
const bool shift_snap = midi_view()->note_mode() != Percussive; 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 */ /* prevent Percussive mode from displaying a ghost hit at region end */
if (!shift_snap && snapped_beats >= midi_region()->start_beats() + midi_region()->length_beats()) { 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 */ /* 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_time (snapped_beats);
_ghost_note->note()->set_length (length); _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(); uint16_t chn_mask = mtv->midi_track()->get_playback_channel_mask();
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
get_events (e, Evoral::Sequence<Evoral::Beats>::PitchGreaterThanOrEqual, (uint8_t) floor (note), chn_mask); get_events (e, Evoral::Sequence<Temporal::Beats>::PitchGreaterThanOrEqual, (uint8_t) floor (note), chn_mask);
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
get_events (e, Evoral::Sequence<Evoral::Beats>::PitchLessThanOrEqual, (uint8_t) floor (note), chn_mask); get_events (e, Evoral::Sequence<Temporal::Beats>::PitchLessThanOrEqual, (uint8_t) floor (note), chn_mask);
} else { } else {
return; return;
} }
@ -4106,7 +4106,7 @@ MidiRegionView::enable_display (bool yn)
} }
void void
MidiRegionView::show_step_edit_cursor (Evoral::Beats pos) MidiRegionView::show_step_edit_cursor (Temporal::Beats pos)
{ {
if (_step_edit_cursor == 0) { if (_step_edit_cursor == 0) {
ArdourCanvas::Item* const group = get_canvas_group(); ArdourCanvas::Item* const group = get_canvas_group();
@ -4123,7 +4123,7 @@ MidiRegionView::show_step_edit_cursor (Evoral::Beats pos)
} }
void void
MidiRegionView::move_step_edit_cursor (Evoral::Beats pos) MidiRegionView::move_step_edit_cursor (Temporal::Beats pos)
{ {
_step_edit_cursor_position = pos; _step_edit_cursor_position = pos;
@ -4143,7 +4143,7 @@ MidiRegionView::hide_step_edit_cursor ()
} }
void void
MidiRegionView::set_step_edit_cursor_width (Evoral::Beats beats) MidiRegionView::set_step_edit_cursor_width (Temporal::Beats beats)
{ {
_step_edit_cursor_width = beats; _step_edit_cursor_width = beats;
@ -4189,12 +4189,12 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w)
} }
/* convert from session samples to source beats */ /* 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()); ev.time() - src->timeline_position() + _region->start());
if (ev.type() == MIDI_CMD_NOTE_ON) { if (ev.type() == MIDI_CMD_NOTE_ON) {
boost::shared_ptr<NoteType> note ( boost::shared_ptr<NoteType> 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); 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. * 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. * @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 MidiRegionView::snap_sample_to_grid_underneath (samplepos_t p, int32_t divisions, bool shift_snap) const
{ {
TempoMap& map (trackview.session()->tempo_map()); 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 /* 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. 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; const double rem = eqaf - qaf;
if (rem >= 0.0) { if (rem >= 0.0) {
eqaf -= grid_beats.to_double(); 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(); 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 ChannelMode
@ -4390,14 +4390,14 @@ MidiRegionView::get_selected_channels () const
} }
Evoral::Beats Temporal::Beats
MidiRegionView::get_grid_beats(samplepos_t pos) const MidiRegionView::get_grid_beats(samplepos_t pos) const
{ {
PublicEditor& editor = trackview.editor(); PublicEditor& editor = trackview.editor();
bool success = false; 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) { if (!success) {
beats = Evoral::Beats(1); beats = Temporal::Beats(1);
} }
return beats; return beats;
} }

View file

@ -65,8 +65,8 @@ class CursorContext;
class MidiRegionView : public RegionView class MidiRegionView : public RegionView
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
typedef Evoral::Sequence<Evoral::Beats>::Notes Notes; typedef Evoral::Sequence<Temporal::Beats>::Notes Notes;
MidiRegionView (ArdourCanvas::Container* parent, MidiRegionView (ArdourCanvas::Container* parent,
RouteTimeAxisView& tv, RouteTimeAxisView& tv,
@ -99,8 +99,8 @@ public:
{ return midi_view()->midi_view(); } { return midi_view()->midi_view(); }
void step_add_note (uint8_t channel, uint8_t number, uint8_t velocity, void step_add_note (uint8_t channel, uint8_t number, uint8_t velocity,
Evoral::Beats pos, Evoral::Beats len); Temporal::Beats pos, Temporal::Beats len);
void step_sustain (Evoral::Beats beats); void step_sustain (Temporal::Beats beats);
void set_height (double); void set_height (double);
void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false); void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false);
@ -109,17 +109,17 @@ public:
uint32_t get_fill_color() const; uint32_t get_fill_color() const;
void color_handler (); void color_handler ();
void show_step_edit_cursor (Evoral::Beats pos); void show_step_edit_cursor (Temporal::Beats pos);
void move_step_edit_cursor (Evoral::Beats pos); void move_step_edit_cursor (Temporal::Beats pos);
void hide_step_edit_cursor (); 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(); void redisplay_model();
GhostRegion* add_ghost (TimeAxisView&); GhostRegion* add_ghost (TimeAxisView&);
NoteBase* add_note(const boost::shared_ptr<NoteType> note, bool visible); NoteBase* add_note(const boost::shared_ptr<NoteType> 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); void cut_copy_clear (Editing::CutCopyOp);
bool paste (samplepos_t pos, const ::Selection& selection, PasteContext& ctx, const int32_t sub_num); 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 * @key a reference to an instance of MIDI::Name::PatchPrimaryKey whose fields will
* will be set according to the result of the lookup * 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 /** Convert a given PatchChange into a PatchPrimaryKey
*/ */
@ -145,10 +145,10 @@ public:
* @param new_patch new patch * @param new_patch new patch
*/ */
void change_patch_change (PatchChange& old_patch, const MIDI::Name::PatchPrimaryKey& new_patch); void change_patch_change (PatchChange& old_patch, const MIDI::Name::PatchPrimaryKey& new_patch);
void change_patch_change (ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange<Evoral::Beats> const &); void change_patch_change (ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange<Temporal::Beats> const &);
void add_patch_change (samplecnt_t, Evoral::PatchChange<Evoral::Beats> const &); void add_patch_change (samplecnt_t, Evoral::PatchChange<Temporal::Beats> const &);
void move_patch_change (PatchChange &, Evoral::Beats); void move_patch_change (PatchChange &, Temporal::Beats);
void delete_patch_change (PatchChange *); void delete_patch_change (PatchChange *);
void edit_patch_change (PatchChange *); void edit_patch_change (PatchChange *);
@ -176,7 +176,7 @@ public:
void start_note_diff_command (std::string name = "midi edit"); 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, 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<NoteType> note, bool selected, bool show_velocity = false); void note_diff_add_note (const boost::shared_ptr<NoteType> note, bool selected, bool show_velocity = false);
void note_diff_remove_note (NoteBase* ev); void note_diff_remove_note (NoteBase* ev);
@ -200,7 +200,7 @@ public:
void select_range(samplepos_t start, samplepos_t end); void select_range(samplepos_t start, samplepos_t end);
void invert_selection (); void invert_selection ();
Evoral::Beats earliest_in_selection (); Temporal::Beats earliest_in_selection ();
void move_selection(double dx, double dy, double cumulative_dy); void move_selection(double dx, double dy, double cumulative_dy);
void note_dropped (NoteBase* ev, double d_qn, int8_t d_note, bool copy); void note_dropped (NoteBase* ev, double d_qn, int8_t d_note, bool copy);
NoteBase* copy_selection (NoteBase* primary); NoteBase* copy_selection (NoteBase* primary);
@ -268,23 +268,23 @@ public:
samplepos_t snap_pixel_to_sample(double x, bool ensure_snap = false); samplepos_t snap_pixel_to_sample(double x, bool ensure_snap = false);
/** Convert a timestamp in beats into samples (both relative to region position) */ /** 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 */ /** 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); return _region->position() + region_beats_to_region_samples (beats);
} }
/** Convert a timestamp in samples to beats (both relative to region position) */ /** 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; double region_samples_to_region_beats_double(samplepos_t) const;
/** Convert a timestamp in beats measured from source start into absolute samples */ /** 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 */ /** 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(); return source_beats_to_absolute_samples (beats) - _region->position();
} }
/** Convert a timestamp in absolute samples to beats measured from source start*/ /** 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 { ARDOUR::BeatsSamplesConverter const & region_relative_time_converter () const {
return _region_relative_time_converter; return _region_relative_time_converter;
@ -302,7 +302,7 @@ public:
void goto_previous_note (bool add_to_selection); void goto_previous_note (bool add_to_selection);
void goto_next_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 change_velocities (bool up, bool fine, bool allow_smush, bool all_together);
void transpose (bool up, bool fine, bool allow_smush); void transpose (bool up, bool fine, bool allow_smush);
void nudge_notes (bool forward, bool fine); void nudge_notes (bool forward, bool fine);
@ -333,7 +333,7 @@ public:
* \param state the keyboard modifier mask for the canvas event (click). * \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). * \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 /** An external request to clear the note selection, remove MRV from editor
* selection. * selection.
@ -436,8 +436,8 @@ private:
double _last_ghost_x; double _last_ghost_x;
double _last_ghost_y; double _last_ghost_y;
ArdourCanvas::Rectangle* _step_edit_cursor; ArdourCanvas::Rectangle* _step_edit_cursor;
Evoral::Beats _step_edit_cursor_width; Temporal::Beats _step_edit_cursor_width;
Evoral::Beats _step_edit_cursor_position; Temporal::Beats _step_edit_cursor_position;
NoteBase* _channel_selection_scoped_note; NoteBase* _channel_selection_scoped_note;
MouseState _mouse_state; MouseState _mouse_state;
@ -495,7 +495,7 @@ private:
void drop_down_keys (); void drop_down_keys ();
void maybe_select_by_position (GdkEventButton* ev, double x, double y); void maybe_select_by_position (GdkEventButton* ev, double x, double y);
void get_events (Events& e, Evoral::Sequence<Evoral::Beats>::NoteOperator op, uint8_t val, int chan_mask = 0); void get_events (Events& e, Evoral::Sequence<Temporal::Beats>::NoteOperator op, uint8_t val, int chan_mask = 0);
void display_patch_changes_on_channel (uint8_t, bool); void display_patch_changes_on_channel (uint8_t, bool);
@ -503,7 +503,7 @@ private:
void data_recorded (boost::weak_ptr<ARDOUR::MidiSource>); void data_recorded (boost::weak_ptr<ARDOUR::MidiSource>);
/** Get grid type as beats, or default to 1 if not snapped to beats. */ /** 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 remove_ghost_note ();
void mouse_mode_changed (); void mouse_mode_changed ();
@ -524,7 +524,7 @@ private:
Gtkmm2ext::Color _patch_change_outline; Gtkmm2ext::Color _patch_change_outline;
Gtkmm2ext::Color _patch_change_fill; 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; PBD::ScopedConnection _mouse_mode_connection;

View file

@ -1418,7 +1418,7 @@ MidiTimeAxisView::toggle_note_selection (uint8_t note)
} }
void void
MidiTimeAxisView::get_per_region_note_selection (list<pair<PBD::ID, set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >& selection) MidiTimeAxisView::get_per_region_note_selection (list<pair<PBD::ID, set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >& selection)
{ {
_view->foreach_regionview ( _view->foreach_regionview (
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::get_per_region_note_selection_region_view), sigc::ref(selection))); 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 void
MidiTimeAxisView::get_per_region_note_selection_region_view (RegionView* rv, list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > > &selection) MidiTimeAxisView::get_per_region_note_selection_region_view (RegionView* rv, list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > > &selection)
{ {
Evoral::Sequence<Evoral::Beats>::Notes selected; Evoral::Sequence<Temporal::Beats>::Notes selected;
dynamic_cast<MidiRegionView*>(rv)->selection_as_notelist (selected, false); dynamic_cast<MidiRegionView*>(rv)->selection_as_notelist (selected, false);
std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > notes; std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > notes;
Evoral::Sequence<Evoral::Beats>::Notes::iterator sel_it; Evoral::Sequence<Temporal::Beats>::Notes::iterator sel_it;
for (sel_it = selected.begin(); sel_it != selected.end(); ++sel_it) { for (sel_it = selected.begin(); sel_it != selected.end(); ++sel_it) {
notes.insert (*sel_it); notes.insert (*sel_it);
} }

View file

@ -108,7 +108,7 @@ public:
uint8_t get_channel_for_add () const; uint8_t get_channel_for_add () const;
void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&); void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&);
protected: protected:
void start_step_editing (); 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 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 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 toggle_note_selection_region_view (RegionView*, uint8_t note, uint16_t chn_mask);
void get_per_region_note_selection_region_view (RegionView*, std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&); void get_per_region_note_selection_region_view (RegionView*, std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&);
void ensure_step_editor (); void ensure_step_editor ();

View file

@ -32,7 +32,7 @@ namespace ArdourCanvas {
class Note : public NoteBase class Note : public NoteBase
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
Note (MidiRegionView& region, Note (MidiRegionView& region,
ArdourCanvas::Item* parent, ArdourCanvas::Item* parent,

View file

@ -22,6 +22,7 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "temporal/beats.h"
#include "canvas/types.h" #include "canvas/types.h"
#include "rgb_macros.h" #include "rgb_macros.h"
@ -53,7 +54,7 @@ namespace ArdourCanvas {
class NoteBase : public sigc::trackable class NoteBase : public sigc::trackable
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
NoteBase (MidiRegionView& region, bool, const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>()); NoteBase (MidiRegionView& region, bool, const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>());
virtual ~NoteBase (); virtual ~NoteBase ();

View file

@ -31,7 +31,7 @@ namespace ARDOUR {
class NotePlayer : public sigc::trackable { class NotePlayer : public sigc::trackable {
public: public:
typedef Evoral::Note<Evoral::Beats> NoteType; typedef Evoral::Note<Temporal::Beats> NoteType;
NotePlayer (boost::shared_ptr<ARDOUR::MidiTrack>); NotePlayer (boost::shared_ptr<ARDOUR::MidiTrack>);
~NotePlayer (); ~NotePlayer ();

View file

@ -43,7 +43,7 @@ using namespace Gtkmm2ext;
PatchChangeDialog::PatchChangeDialog ( PatchChangeDialog::PatchChangeDialog (
const ARDOUR::BeatsSamplesConverter* tc, const ARDOUR::BeatsSamplesConverter* tc,
ARDOUR::Session* session, ARDOUR::Session* session,
Evoral::PatchChange<Evoral::Beats> const & patch, Evoral::PatchChange<Temporal::Beats> const & patch,
ARDOUR::InstrumentInfo& info, ARDOUR::InstrumentInfo& info,
const Gtk::BuiltinStockID& ok, const Gtk::BuiltinStockID& ok,
bool allow_delete, bool allow_delete,
@ -168,16 +168,16 @@ PatchChangeDialog::instrument_info_changed ()
fill_patch_combo (); fill_patch_combo ();
} }
Evoral::PatchChange<Evoral::Beats> Evoral::PatchChange<Temporal::Beats>
PatchChangeDialog::patch () const PatchChangeDialog::patch () const
{ {
Evoral::Beats t = Evoral::Beats(); Temporal::Beats t = Temporal::Beats();
if (_time_converter) { if (_time_converter) {
t = _time_converter->from (_time.current_time ()); t = _time_converter->from (_time.current_time ());
} }
return Evoral::PatchChange<Evoral::Beats> ( return Evoral::PatchChange<Temporal::Beats> (
t, t,
_channel.get_value_as_int() - 1, _channel.get_value_as_int() - 1,
_program.get_value_as_int() - 1, _program.get_value_as_int() - 1,

View file

@ -43,14 +43,14 @@ public:
PatchChangeDialog ( PatchChangeDialog (
const ARDOUR::BeatsSamplesConverter *, const ARDOUR::BeatsSamplesConverter *,
ARDOUR::Session *, ARDOUR::Session *,
Evoral::PatchChange<Evoral::Beats> const &, Evoral::PatchChange<Temporal::Beats> const &,
ARDOUR::InstrumentInfo&, ARDOUR::InstrumentInfo&,
const Gtk::BuiltinStockID &, const Gtk::BuiltinStockID &,
bool allow_delete = false, bool allow_delete = false,
bool modal = true bool modal = true
); );
Evoral::PatchChange<Evoral::Beats> patch () const; Evoral::PatchChange<Temporal::Beats> patch () const;
protected: protected:
void on_response (int); void on_response (int);

View file

@ -35,7 +35,7 @@
#include <gtkmm/notebook.h> #include <gtkmm/notebook.h>
#include <sigc++/signal.h> #include <sigc++/signal.h>
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Note.hpp" #include "evoral/Note.hpp"
#include "pbd/statefuldestructible.h" #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_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 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 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 int32_t get_grid_music_divisions (uint32_t event_state) = 0;
virtual void edit_notes (MidiRegionView*) = 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 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 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_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const = 0; virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
virtual void mouse_add_new_tempo_event (samplepos_t where) = 0; virtual void mouse_add_new_tempo_event (samplepos_t where) = 0;
virtual void mouse_add_new_meter_event (samplepos_t where) = 0; virtual void mouse_add_new_meter_event (samplepos_t where) = 0;

View file

@ -147,7 +147,7 @@ QuantizeDialog::grid_size_to_musical_time (const string& txt) const
if (txt == _("main grid")) { if (txt == _("main grid")) {
bool success; 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) { if (!success) {
return 1.0; return 1.0;
} }

View file

@ -1159,15 +1159,15 @@ Selection::get_state () const
} }
/* midi region views have thir own internal selection. */ /* midi region views have thir own internal selection. */
list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > > rid_notes; list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > > rid_notes;
editor->get_per_region_note_selection (rid_notes); editor->get_per_region_note_selection (rid_notes);
list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >::iterator rn_it; list<pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >::iterator rn_it;
for (rn_it = rid_notes.begin(); rn_it != rid_notes.end(); ++rn_it) { for (rn_it = rid_notes.begin(); rn_it != rid_notes.end(); ++rn_it) {
XMLNode* n = node->add_child (X_("MIDINotes")); XMLNode* n = node->add_child (X_("MIDINotes"));
n->set_property (X_("region-id"), (*rn_it).first); n->set_property (X_("region-id"), (*rn_it).first);
for (std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > >::iterator i = (*rn_it).second.begin(); i != (*rn_it).second.end(); ++i) { for (std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > >::iterator i = (*rn_it).second.begin(); i != (*rn_it).second.end(); ++i) {
XMLNode* nc = n->add_child(X_("note")); XMLNode* nc = n->add_child(X_("note"));
nc->set_property(X_("note-id"), (*i)->id()); nc->set_property(X_("note-id"), (*i)->id());
} }

View file

@ -41,7 +41,7 @@ StepEditor::StepEditor (PublicEditor& e, boost::shared_ptr<MidiTrack> t, MidiTim
step_edit_insert_position = 0; step_edit_insert_position = 0;
_step_edit_triplet_countdown = 0; _step_edit_triplet_countdown = 0;
_step_edit_within_chord = 0; _step_edit_within_chord = 0;
_step_edit_chord_duration = Evoral::Beats(); _step_edit_chord_duration = Temporal::Beats();
step_edit_region_view = 0; step_edit_region_view = 0;
_track->PlaylistChanged.connect (*this, invalidator (*this), _track->PlaylistChanged.connect (*this, invalidator (*this),
@ -60,11 +60,11 @@ StepEditor::start_step_editing ()
{ {
_step_edit_triplet_countdown = 0; _step_edit_triplet_countdown = 0;
_step_edit_within_chord = 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.reset ();
step_edit_region_view = 0; step_edit_region_view = 0;
last_added_pitch = -1; last_added_pitch = -1;
last_added_end = Evoral::Beats(); last_added_end = Temporal::Beats();
resync_step_edit_position (); resync_step_edit_position ();
prepare_step_edit_region (); prepare_step_edit_region ();
@ -201,7 +201,7 @@ StepEditor::check_step_edit ()
incoming.read_contents (size, buf); incoming.read_contents (size, buf);
if ((buf[0] & 0xf0) == MIDI_CMD_NOTE_ON) { 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 void
StepEditor::step_edit_sustain (Evoral::Beats beats) StepEditor::step_edit_sustain (Temporal::Beats beats)
{ {
if (step_edit_region_view) { if (step_edit_region_view) {
step_edit_region_view->step_sustain (beats); step_edit_region_view->step_sustain (beats);
@ -227,7 +227,7 @@ StepEditor::step_edit_sustain (Evoral::Beats beats)
} }
void void
StepEditor::move_step_edit_beat_pos (Evoral::Beats beats) StepEditor::move_step_edit_beat_pos (Temporal::Beats beats)
{ {
if (!step_edit_region_view) { if (!step_edit_region_view) {
return; return;
@ -239,14 +239,14 @@ StepEditor::move_step_edit_beat_pos (Evoral::Beats beats)
if (-beats < step_edit_beat_pos) { if (-beats < step_edit_beat_pos) {
step_edit_beat_pos += beats; // its negative, remember step_edit_beat_pos += beats; // its negative, remember
} else { } 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); step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos);
} }
int 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 /* 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)); _editor.reset_x_origin (fpos - (_editor.current_page_samples()/4));
} }
Evoral::Beats at = step_edit_beat_pos; Temporal::Beats at = step_edit_beat_pos;
Evoral::Beats len = beat_duration; Temporal::Beats len = beat_duration;
if ((last_added_pitch >= 0) && (pitch == last_added_pitch) && (last_added_end == step_edit_beat_pos)) { 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 up by 1 tick from where the last note ended
*/ */
at += Evoral::Beats::ticks(1); at += Temporal::Beats::ticks(1);
len -= Evoral::Beats::ticks(1); len -= Temporal::Beats::ticks(1);
} }
step_edit_region_view->step_add_note (channel, pitch, velocity, at, len); 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_beat_pos += beat_duration;
step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos); step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos);
} else { } 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); _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 void
StepEditor::set_step_edit_cursor_width (Evoral::Beats beats) StepEditor::set_step_edit_cursor_width (Temporal::Beats beats)
{ {
if (step_edit_region_view) { if (step_edit_region_view) {
step_edit_region_view->set_step_edit_cursor_width (beats); step_edit_region_view->set_step_edit_cursor_width (beats);
@ -375,7 +375,7 @@ StepEditor::step_edit_toggle_chord ()
} }
void void
StepEditor::step_edit_rest (Evoral::Beats beats) StepEditor::step_edit_rest (Temporal::Beats beats)
{ {
bool success; bool success;
@ -437,7 +437,7 @@ StepEditor::region_removed (boost::weak_ptr<Region> wr)
step_edit_region.reset(); step_edit_region.reset();
step_edit_region_view = 0; step_edit_region_view = 0;
// force a recompute of the insert position // force a recompute of the insert position
step_edit_beat_pos = Evoral::Beats(-1); step_edit_beat_pos = Temporal::Beats(-1);
} }
} }

View file

@ -25,7 +25,7 @@
#include <sigc++/trackable.h> #include <sigc++/trackable.h>
#include "pbd/signals.h" #include "pbd/signals.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
namespace ARDOUR { namespace ARDOUR {
class MidiTrack; class MidiTrack;
@ -44,22 +44,22 @@ public:
virtual ~StepEditor (); virtual ~StepEditor ();
void check_step_edit (); 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_beat_sync ();
void step_edit_bar_sync (); void step_edit_bar_sync ();
int step_add_bank_change (uint8_t channel, uint8_t bank); 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_program_change (uint8_t channel, uint8_t program);
int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity,
Evoral::Beats beat_duration); Temporal::Beats beat_duration);
void step_edit_sustain (Evoral::Beats beats); void step_edit_sustain (Temporal::Beats beats);
bool step_edit_within_triplet () const; bool step_edit_within_triplet () const;
void step_edit_toggle_triplet (); void step_edit_toggle_triplet ();
bool step_edit_within_chord () const; bool step_edit_within_chord () const;
void step_edit_toggle_chord (); void step_edit_toggle_chord ();
void reset_step_edit_beat_pos (); void reset_step_edit_beat_pos ();
void resync_step_edit_to_edit_point (); void resync_step_edit_to_edit_point ();
void move_step_edit_beat_pos (Evoral::Beats beats); void move_step_edit_beat_pos (Temporal::Beats beats);
void set_step_edit_cursor_width (Evoral::Beats beats); void set_step_edit_cursor_width (Temporal::Beats beats);
std::string name() const; std::string name() const;
@ -68,19 +68,19 @@ public:
private: private:
ARDOUR::samplepos_t step_edit_insert_position; ARDOUR::samplepos_t step_edit_insert_position;
Evoral::Beats step_edit_beat_pos; Temporal::Beats step_edit_beat_pos;
boost::shared_ptr<ARDOUR::MidiRegion> step_edit_region; boost::shared_ptr<ARDOUR::MidiRegion> step_edit_region;
MidiRegionView* step_edit_region_view; MidiRegionView* step_edit_region_view;
uint8_t _step_edit_triplet_countdown; uint8_t _step_edit_triplet_countdown;
bool _step_edit_within_chord; bool _step_edit_within_chord;
Evoral::Beats _step_edit_chord_duration; Temporal::Beats _step_edit_chord_duration;
PBD::ScopedConnection step_edit_region_connection; PBD::ScopedConnection step_edit_region_connection;
PublicEditor& _editor; PublicEditor& _editor;
boost::shared_ptr<ARDOUR::MidiTrack> _track; boost::shared_ptr<ARDOUR::MidiTrack> _track;
StepEntry* step_editor; StepEntry* step_editor;
MidiTimeAxisView& _mtv; MidiTimeAxisView& _mtv;
int8_t last_added_pitch; int8_t last_added_pitch;
Evoral::Beats last_added_end; Temporal::Beats last_added_end;
void region_removed (boost::weak_ptr<ARDOUR::Region>); void region_removed (boost::weak_ptr<ARDOUR::Region>);
void playlist_changed (); void playlist_changed ();

View file

@ -520,10 +520,10 @@ StepEntry::on_key_release_event (GdkEventKey* ev)
void void
StepEntry::rest_event_handler () StepEntry::rest_event_handler ()
{ {
se->step_edit_rest (Evoral::Beats()); se->step_edit_rest (Temporal::Beats());
} }
Evoral::Beats Temporal::Beats
StepEntry::note_length () StepEntry::note_length ()
{ {
double base_time = 4.0 / (double) length_divisor_adjustment.get_value(); 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); base_time *= 1 + ((dots - 1.0)/dots);
} }
return Evoral::Beats(base_time); return Temporal::Beats(base_time);
} }
uint8_t uint8_t
@ -780,7 +780,7 @@ StepEntry::insert_rest ()
void void
StepEntry::insert_grid_rest () StepEntry::insert_grid_rest ()
{ {
se->step_edit_rest (Evoral::Beats()); se->step_edit_rest (Temporal::Beats());
} }
void void

View file

@ -41,14 +41,14 @@ public:
void note_off_event_handler (int note); void note_off_event_handler (int note);
void rest_event_handler (); void rest_event_handler ();
Evoral::Beats note_length(); Temporal::Beats note_length();
uint8_t note_velocity() const; uint8_t note_velocity() const;
uint8_t note_channel() const; uint8_t note_channel() const;
int current_octave () const { return (int) floor (octave_adjustment.get_value()); } int current_octave () const { return (int) floor (octave_adjustment.get_value()); }
private: private:
Evoral::Beats _current_note_length; Temporal::Beats _current_note_length;
uint8_t _current_note_velocity; uint8_t _current_note_velocity;
Gtk::VBox packer; Gtk::VBox packer;

View file

@ -80,7 +80,7 @@ TempoLines::draw_ticks (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
/* draw line with alpha corresponding to coarsest level */ /* 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 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 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) { if (f > leftmost_sample) {
lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c); lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c);

View file

@ -168,7 +168,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
item_duration = duration; item_duration = duration;
name_connected = false; name_connected = false;
position_locked = false; position_locked = false;
max_item_duration = ARDOUR::max_samplepos; max_item_duration = Temporal::max_samplepos;
min_item_duration = 0; min_item_duration = 0;
visibility = vis; visibility = vis;
_sensitive = true; _sensitive = true;

View file

@ -467,7 +467,7 @@ VideoMonitor::get_custom_setting (const std::string k)
return (xjadeo_settings[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 void
VideoMonitor::srsupdate () VideoMonitor::srsupdate ()
{ {

View file

@ -496,7 +496,7 @@ def build(bld):
'libpbd', 'libpbd',
'libardour', 'libardour',
'libardour_cp', 'libardour_cp',
'libtimecode', 'libtemporal',
'libmidipp', 'libmidipp',
'libgtkmm2ext', 'libgtkmm2ext',
'libcanvas', 'libcanvas',
@ -536,7 +536,7 @@ def build(bld):
# 'libpbd', # 'libpbd',
# 'libardour', # 'libardour',
# 'libardour_cp', # 'libardour_cp',
# 'libtimecode', # 'libtemporal',
# 'libmidipp', # 'libmidipp',
# 'libgtkmm2ext', # 'libgtkmm2ext',
# 'libcanvas', # 'libcanvas',
@ -568,7 +568,7 @@ def build(bld):
'libmidipp', 'libmidipp',
'libardour', 'libardour',
'libardour_cp', 'libardour_cp',
'libtimecode', 'libtemporal',
'libmidipp', 'libmidipp',
'libgtk2_ardour', 'libgtk2_ardour',
'libgtkmm2ext', 'libgtkmm2ext',
@ -616,7 +616,7 @@ def build(bld):
obj.use = [ 'libpbd', obj.use = [ 'libpbd',
'libardour', 'libardour',
'libardour_cp', 'libardour_cp',
'libtimecode', 'libtemporal',
'libmidipp', 'libmidipp',
'libgtkmm2ext', 'libgtkmm2ext',
'libcanvas', 'libcanvas',

View file

@ -47,7 +47,7 @@ def build(bld):
obj.use = [ 'libpbd', obj.use = [ 'libpbd',
'libardour', 'libardour',
'libardour_cp', 'libardour_cp',
'libtimecode', 'libtemporal',
'libmidipp', 'libmidipp',
] ]

View file

@ -21,7 +21,7 @@
#include "ardour/route.h" #include "ardour/route.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "audiographer/process_context.h" #include "audiographer/process_context.h"
#include "audiographer/general/chunker.h" #include "audiographer/general/chunker.h"

View file

@ -19,7 +19,7 @@
$Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $ $Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $
*/ */
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/TimeConverter.hpp" #include "evoral/TimeConverter.hpp"
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
@ -37,15 +37,15 @@ class TempoMap;
* them to the opposite unit, taking tempo changes into account. * them to the opposite unit, taking tempo changes into account.
*/ */
class LIBARDOUR_API BeatsSamplesConverter class LIBARDOUR_API BeatsSamplesConverter
: public Evoral::TimeConverter<Evoral::Beats,samplepos_t> { : public Evoral::TimeConverter<Temporal::Beats,samplepos_t> {
public: public:
BeatsSamplesConverter (const TempoMap& tempo_map, samplepos_t origin) BeatsSamplesConverter (const TempoMap& tempo_map, samplepos_t origin)
: Evoral::TimeConverter<Evoral::Beats, samplepos_t> (origin) : Evoral::TimeConverter<Temporal::Beats, samplepos_t> (origin)
, _tempo_map(tempo_map) , _tempo_map(tempo_map)
{} {}
samplepos_t to (Evoral::Beats beats) const; samplepos_t to (Temporal::Beats beats) const;
Evoral::Beats from (samplepos_t samples) const; Temporal::Beats from (samplepos_t samples) const;
private: private:
const TempoMap& _tempo_map; const TempoMap& _tempo_map;

View file

@ -22,7 +22,7 @@
#include "pbd/enum_convert.h" #include "pbd/enum_convert.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/ControlList.hpp" #include "evoral/ControlList.hpp"
namespace PBD { namespace PBD {
@ -30,24 +30,24 @@ namespace PBD {
DEFINE_ENUM_CONVERT(Evoral::ControlList::InterpolationStyle) DEFINE_ENUM_CONVERT(Evoral::ControlList::InterpolationStyle)
template <> 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); return double_to_string (beats.to_double (), str);
} }
template <> 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; double tmp;
if (!string_to_double (str, tmp)) { if (!string_to_double (str, tmp)) {
return false; return false;
} }
beats = Evoral::Beats(tmp); beats = Temporal::Beats(tmp);
return true; return true;
} }
template <> template <>
inline std::string to_string (Evoral::Beats beats) inline std::string to_string (Temporal::Beats beats)
{ {
std::string tmp; std::string tmp;
double_to_string (beats.to_double (), tmp); double_to_string (beats.to_double (), tmp);
@ -55,11 +55,11 @@ inline std::string to_string (Evoral::Beats beats)
} }
template <> template <>
inline Evoral::Beats string_to (const std::string& str) inline Temporal::Beats string_to (const std::string& str)
{ {
double tmp; double tmp;
string_to_double (str, tmp); string_to_double (str, tmp);
return Evoral::Beats (tmp); return Temporal::Beats (tmp);
} }
} // namespace PBD } // namespace PBD

View file

@ -39,10 +39,10 @@ public:
Legatize(bool shrink_only); Legatize(bool shrink_only);
~Legatize(); ~Legatize();
typedef Evoral::Sequence<Evoral::Beats>::Notes Notes; typedef Evoral::Sequence<Temporal::Beats>::Notes Notes;
Command* operator()(boost::shared_ptr<ARDOUR::MidiModel> model, Command* operator()(boost::shared_ptr<ARDOUR::MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Notes>& seqs); std::vector<Notes>& seqs);
std::string name () const { return (_shrink_only ? std::string ("remove overlap") : std::string ("legatize")); } std::string name () const { return (_shrink_only ? std::string ("remove overlap") : std::string ("legatize")); }

View file

@ -298,10 +298,10 @@ namespace ARDOUR { namespace LuaAPI {
}; };
boost::shared_ptr<Evoral::Note<Evoral::Beats> > boost::shared_ptr<Evoral::Note<Temporal::Beats> >
new_noteptr (uint8_t, Evoral::Beats, Evoral::Beats, uint8_t, uint8_t); new_noteptr (uint8_t, Temporal::Beats, Temporal::Beats, uint8_t, uint8_t);
std::list<boost::shared_ptr< Evoral::Note<Evoral::Beats> > > std::list<boost::shared_ptr< Evoral::Note<Temporal::Beats> > >
note_list (boost::shared_ptr<ARDOUR::MidiModel>); note_list (boost::shared_ptr<ARDOUR::MidiModel>);
} } /* namespace */ } } /* namespace */

View file

@ -25,7 +25,7 @@
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include "ardour/types.h" #include "ardour/types.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Sequence.hpp" #include "evoral/Sequence.hpp"
#include "pbd/signals.h" #include "pbd/signals.h"
@ -45,8 +45,8 @@ struct MidiCursor : public boost::noncopyable {
last_read_end = 0; last_read_end = 0;
} }
Evoral::Sequence<Evoral::Beats>::const_iterator iter; Evoral::Sequence<Temporal::Beats>::const_iterator iter;
std::set<Evoral::Sequence<Evoral::Beats>::WeakNotePtr> active_notes; std::set<Evoral::Sequence<Temporal::Beats>::WeakNotePtr> active_notes;
samplepos_t last_read_end; samplepos_t last_read_end;
PBD::ScopedConnectionList connections; PBD::ScopedConnectionList connections;
}; };

View file

@ -52,9 +52,9 @@ class MidiSource;
* Because of this MIDI controllers and automatable controllers/widgets/etc * Because of this MIDI controllers and automatable controllers/widgets/etc
* are easily interchangeable. * are easily interchangeable.
*/ */
class LIBARDOUR_API MidiModel : public AutomatableSequence<Evoral::Beats> { class LIBARDOUR_API MidiModel : public AutomatableSequence<Temporal::Beats> {
public: public:
typedef Evoral::Beats TimeType; typedef Temporal::Beats TimeType;
MidiModel (boost::shared_ptr<MidiSource>); MidiModel (boost::shared_ptr<MidiSource>);
@ -265,8 +265,8 @@ public:
bool write_section_to(boost::shared_ptr<MidiSource> source, bool write_section_to(boost::shared_ptr<MidiSource> source,
const Glib::Threads::Mutex::Lock& source_lock, const Glib::Threads::Mutex::Lock& source_lock,
Evoral::Beats begin = Evoral::Beats(), Temporal::Beats begin = Temporal::Beats(),
Evoral::Beats end = std::numeric_limits<Evoral::Beats>::max(), Temporal::Beats end = std::numeric_limits<Temporal::Beats>::max(),
bool offset_events = false); bool offset_events = false);
// MidiModel doesn't use the normal AutomationList serialisation code // MidiModel doesn't use the normal AutomationList serialisation code

View file

@ -23,7 +23,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Sequence.hpp" #include "evoral/Sequence.hpp"
class Command; class Command;
@ -38,8 +38,8 @@ class LIBARDOUR_API MidiOperator {
virtual ~MidiOperator() {} virtual ~MidiOperator() {}
virtual Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>, virtual Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>,
Evoral::Beats, Temporal::Beats,
std::vector<Evoral::Sequence<Evoral::Beats>::Notes>&) = 0; std::vector<Evoral::Sequence<Temporal::Beats>::Notes>&) = 0;
virtual std::string name() const = 0; virtual std::string name() const = 0;
}; };

View file

@ -117,7 +117,7 @@ protected:
void region_going_away (boost::weak_ptr<Region> region); void region_going_away (boost::weak_ptr<Region> region);
private: private:
typedef Evoral::Note<Evoral::Beats> Note; typedef Evoral::Note<Temporal::Beats> Note;
typedef Evoral::Event<samplepos_t> Event; typedef Evoral::Event<samplepos_t> Event;
struct RegionTracker : public boost::noncopyable { struct RegionTracker : public boost::noncopyable {

View file

@ -45,7 +45,7 @@ public:
XMLNode& get_state (); XMLNode& get_state ();
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
void append_event_beats(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<Evoral::Beats>& ev); void append_event_beats(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<Temporal::Beats>& ev);
void append_event_samples(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<samplepos_t>& ev, samplepos_t source_start); void append_event_samples(const Glib::Threads::Mutex::Lock& lock, const Evoral::Event<samplepos_t>& ev, samplepos_t source_start);
void load_model(const Glib::Threads::Mutex::Lock& lock, bool force_reload=false); void load_model(const Glib::Threads::Mutex::Lock& lock, bool force_reload=false);
void destroy_model(const Glib::Threads::Mutex::Lock& lock); void destroy_model(const Glib::Threads::Mutex::Lock& lock);

View file

@ -23,7 +23,7 @@
#include <vector> #include <vector>
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Range.hpp" #include "evoral/Range.hpp"
#include "pbd/string_convert.h" #include "pbd/string_convert.h"

View file

@ -46,7 +46,7 @@ template<typename T> class MidiRingBuffer;
class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_shared_from_this<MidiSource> class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_shared_from_this<MidiSource>
{ {
public: public:
typedef Evoral::Beats TimeType; typedef Temporal::Beats TimeType;
MidiSource (Session& session, std::string name, Source::Flag flags = Source::Flag(0)); MidiSource (Session& session, std::string name, Source::Flag flags = Source::Flag(0));
MidiSource (Session& session, const XMLNode&); 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, int write_to (const Lock& lock,
boost::shared_ptr<MidiSource> newsrc, boost::shared_ptr<MidiSource> newsrc,
Evoral::Beats begin = Evoral::Beats(), Temporal::Beats begin = Temporal::Beats(),
Evoral::Beats end = std::numeric_limits<Evoral::Beats>::max()); Temporal::Beats end = std::numeric_limits<Temporal::Beats>::max());
/** Export the midi data in the given time range to another MidiSource /** Export the midi data in the given time range to another MidiSource
* \param newsrc MidiSource to which data will be written. Should be a * \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, int export_write_to (const Lock& lock,
boost::shared_ptr<MidiSource> newsrc, boost::shared_ptr<MidiSource> newsrc,
Evoral::Beats begin, Temporal::Beats begin,
Evoral::Beats end); Temporal::Beats end);
/** Read the data in a given time range from the MIDI source. /** 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). * 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. * Caller must ensure that the event is later than the last written event.
*/ */
virtual void append_event_beats(const Lock& lock, virtual void append_event_beats(const Lock& lock,
const Evoral::Event<Evoral::Beats>& ev) = 0; const Evoral::Event<Temporal::Beats>& ev) = 0;
/** Append a single event with a timestamp in samples. /** 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 ( virtual void mark_midi_streaming_write_completed (
const Lock& lock, const Lock& lock,
Evoral::Sequence<Evoral::Beats>::StuckNoteOption stuck_option, Evoral::Sequence<Temporal::Beats>::StuckNoteOption stuck_option,
Evoral::Beats when = Evoral::Beats()); Temporal::Beats when = Temporal::Beats());
virtual void session_saved(); virtual void session_saved();
@ -232,7 +232,7 @@ class LIBARDOUR_API MidiSource : virtual public Source, public boost::enable_sha
boost::shared_ptr<MidiModel> _model; boost::shared_ptr<MidiModel> _model;
bool _writing; bool _writing;
Evoral::Beats _length_beats; Temporal::Beats _length_beats;
/** The total duration of the current capture. */ /** The total duration of the current capture. */
samplepos_t _capture_length; samplepos_t _capture_length;

View file

@ -22,6 +22,7 @@
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "temporal/beats.h"
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
namespace Evoral { namespace Evoral {
@ -46,7 +47,7 @@ public:
void remove (uint8_t note, uint8_t chn); void remove (uint8_t note, uint8_t chn);
void resolve_notes (MidiBuffer& buffer, samplepos_t time); void resolve_notes (MidiBuffer& buffer, samplepos_t time);
void resolve_notes (Evoral::EventSink<samplepos_t>& buffer, samplepos_t time); void resolve_notes (Evoral::EventSink<samplepos_t>& 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 dump (std::ostream&);
void reset (); void reset ();
bool empty() const { return _on == 0; } bool empty() const { return _on == 0; }

View file

@ -26,7 +26,7 @@
#include "ardour/midi_model.h" #include "ardour/midi_model.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Note.hpp" #include "evoral/Note.hpp"
namespace Evoral { template<typename Time> class EventSink; } namespace Evoral { template<typename Time> class EventSink; }
@ -46,7 +46,7 @@ class TempoMap;
class NoteFixer : public boost::noncopyable class NoteFixer : public boost::noncopyable
{ {
public: public:
typedef Evoral::Note<Evoral::Beats> Note; typedef Evoral::Note<Temporal::Beats> Note;
~NoteFixer(); ~NoteFixer();
@ -85,7 +85,7 @@ private:
typedef std::list<Event*> Events; typedef std::list<Event*> Events;
/** Copy a beats event to a samples event with the given time stamp. */ /** Copy a beats event to a samples event with the given time stamp. */
Event* copy_event(samplepos_t time, const Evoral::Event<Evoral::Beats>& ev); Event* copy_event(samplepos_t time, const Evoral::Event<Temporal::Beats>& ev);
/** Return true iff `note` is active at `pos`. */ /** Return true iff `note` is active at `pos`. */
bool note_is_active(const BeatsSamplesConverter& converter, bool note_is_active(const BeatsSamplesConverter& converter,

View file

@ -35,8 +35,8 @@ public:
~Quantize (); ~Quantize ();
Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>, Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>,
Evoral::Beats position, Temporal::Beats position,
std::vector<Evoral::Sequence<Evoral::Beats>::Notes>&); std::vector<Evoral::Sequence<Temporal::Beats>::Notes>&);
std::string name() const { return std::string ("quantize"); } std::string name() const { return std::string ("quantize"); }
private: private:

View file

@ -55,7 +55,7 @@
#include "midi++/types.h" #include "midi++/types.h"
#include "midi++/mmc.h" #include "midi++/mmc.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "ardour/ardour.h" #include "ardour/ardour.h"
#include "ardour/chan_count.h" #include "ardour/chan_count.h"

View file

@ -28,7 +28,7 @@
#include "pbd/signals.h" #include "pbd/signals.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
#include "ardour/types.h" #include "ardour/types.h"

View file

@ -51,14 +51,14 @@ public:
return safe_midi_file_extension(path); return safe_midi_file_extension(path);
} }
void append_event_beats (const Lock& lock, const Evoral::Event<Evoral::Beats>& ev); void append_event_beats (const Lock& lock, const Evoral::Event<Temporal::Beats>& ev);
void append_event_samples (const Lock& lock, const Evoral::Event<samplepos_t>& ev, samplepos_t source_start); void append_event_samples (const Lock& lock, const Evoral::Event<samplepos_t>& ev, samplepos_t source_start);
void mark_streaming_midi_write_started (const Lock& lock, NoteMode mode); void mark_streaming_midi_write_started (const Lock& lock, NoteMode mode);
void mark_streaming_write_completed (const Lock& lock); void mark_streaming_write_completed (const Lock& lock);
void mark_midi_streaming_write_completed (const Lock& lock, void mark_midi_streaming_write_completed (const Lock& lock,
Evoral::Sequence<Evoral::Beats>::StuckNoteOption, Evoral::Sequence<Temporal::Beats>::StuckNoteOption,
Evoral::Beats when = Evoral::Beats()); Temporal::Beats when = Temporal::Beats());
XMLNode& get_state (); XMLNode& get_state ();
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
@ -78,7 +78,7 @@ public:
private: private:
bool _open; bool _open;
Evoral::Beats _last_ev_time_beats; Temporal::Beats _last_ev_time_beats;
samplepos_t _last_ev_time_samples; samplepos_t _last_ev_time_samples;
/** end time (start + duration) of last call to read_unlocked */ /** end time (start + duration) of last call to read_unlocked */
mutable samplepos_t _smf_last_read_end; mutable samplepos_t _smf_last_read_end;

View file

@ -32,7 +32,7 @@
#include "pbd/stateful.h" #include "pbd/stateful.h"
#include "pbd/statefuldestructible.h" #include "pbd/statefuldestructible.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "ardour/ardour.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. that align with the grid formed by tempo and meter sections.
They SHOULD NOT be used to determine the position of events 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; 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. when tempo matters but meter does not.
They SHOULD be used to determine the position of events 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; samplepos_t samplepos_plus_qn (samplepos_t, Temporal::Beats) const;
Evoral::Beats framewalk_to_qn (samplepos_t pos, samplecnt_t distance) 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 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 (const samplepos_t sample) const;
double quarter_note_at_sample_rt (const samplepos_t sample) const; double quarter_note_at_sample_rt (const samplepos_t sample) const;

View file

@ -19,6 +19,6 @@
#ifndef __libardour_timecode_h__ #ifndef __libardour_timecode_h__
#define __libardour_timecode_h__ #define __libardour_timecode_h__
#include "timecode/time.h" #include "temporal/time.h"
#endif // __libardour_timecode_h__ #endif // __libardour_timecode_h__

View file

@ -50,8 +50,8 @@ namespace ARDOUR {
*/ */
class LIBARDOUR_API Transform : public MidiOperator { class LIBARDOUR_API Transform : public MidiOperator {
public: public:
typedef Evoral::Sequence<Evoral::Beats>::NotePtr NotePtr; typedef Evoral::Sequence<Temporal::Beats>::NotePtr NotePtr;
typedef Evoral::Sequence<Evoral::Beats>::Notes Notes; typedef Evoral::Sequence<Temporal::Beats>::Notes Notes;
typedef ARDOUR::MidiModel::NoteDiffCommand::Property Property; typedef ARDOUR::MidiModel::NoteDiffCommand::Property Property;
/** Context while iterating over notes during transformation. */ /** Context while iterating over notes during transformation. */
@ -132,7 +132,7 @@ public:
Transform(const Program& prog); Transform(const Program& prog);
Command* operator()(boost::shared_ptr<ARDOUR::MidiModel> model, Command* operator()(boost::shared_ptr<ARDOUR::MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Notes>& seqs); std::vector<Notes>& seqs);
std::string name() const { return std::string ("transform"); } std::string name() const { return std::string ("transform"); }

View file

@ -28,13 +28,13 @@ namespace ARDOUR {
class LIBARDOUR_API Transpose : public MidiOperator { class LIBARDOUR_API Transpose : public MidiOperator {
public: public:
typedef Evoral::Sequence<Evoral::Beats>::NotePtr NotePtr; typedef Evoral::Sequence<Temporal::Beats>::NotePtr NotePtr;
typedef Evoral::Sequence<Evoral::Beats>::Notes Notes; typedef Evoral::Sequence<Temporal::Beats>::Notes Notes;
Transpose (int semitones); Transpose (int semitones);
Command* operator() (boost::shared_ptr<ARDOUR::MidiModel> model, Command* operator() (boost::shared_ptr<ARDOUR::MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Notes>& seqs); std::vector<Notes>& seqs);
std::string name () const { return std::string ("transpose"); } std::string name () const { return std::string ("transpose"); }

View file

@ -31,8 +31,9 @@
#include <inttypes.h> #include <inttypes.h>
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "temporal/types.h"
#include "pbd/id.h" #include "pbd/id.h"
@ -43,6 +44,9 @@
#include <map> #include <map>
using Temporal::max_samplepos;
using Temporal::max_samplecnt;
#if __GNUC__ < 3 #if __GNUC__ < 3
typedef int intptr_t; typedef int intptr_t;
#endif #endif
@ -65,23 +69,11 @@ namespace ARDOUR {
typedef uint64_t microseconds_t; typedef uint64_t microseconds_t;
typedef uint32_t pframes_t; typedef uint32_t pframes_t;
/* Any position measured in audio samples. /* rebind Temporal position types into ARDOUR namespace */
Assumed to be non-negative but not enforced. typedef Temporal::samplecnt_t samplecnt_t;
*/ typedef Temporal::samplepos_t samplepos_t;
typedef int64_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; 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 // 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 } // 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" */ /* for now, break the rules and use "using" to make this "global" */
using ARDOUR::samplepos_t; using ARDOUR::samplepos_t;
#endif /* __ardour_types_h__ */ #endif /* __ardour_types_h__ */

View file

@ -27,7 +27,7 @@
#include <stdexcept> #include <stdexcept>
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "pbd/compose.h" #include "pbd/compose.h"
namespace ARDOUR { namespace ARDOUR {
@ -57,7 +57,7 @@ public:
explicit Variant(int32_t value) : _type(INT) { _int = value; } explicit Variant(int32_t value) : _type(INT) { _int = value; }
explicit Variant(int64_t value) : _type(LONG) { _long = value; } explicit Variant(int64_t value) : _type(LONG) { _long = value; }
explicit Variant(const Evoral::Beats& beats) explicit Variant(const Temporal::Beats& beats)
: _type(BEATS) : _type(BEATS)
, _beats(beats) , _beats(beats)
{} {}
@ -94,7 +94,7 @@ public:
std::min(value, (double)INT64_MAX))); std::min(value, (double)INT64_MAX)));
break; break;
case BEATS: case BEATS:
_beats = Evoral::Beats(value); _beats = Temporal::Beats(value);
break; break;
default: default:
_type = NOTHING; _type = NOTHING;
@ -158,19 +158,19 @@ public:
return false; return false;
} }
bool operator==(const Evoral::Beats& v) const { bool operator==(const Temporal::Beats& v) const {
return _type == BEATS && _beats == v; return _type == BEATS && _beats == v;
} }
bool operator!() const { return _type == NOTHING; } bool operator!() const { return _type == NOTHING; }
Variant& operator=(Evoral::Beats v) { Variant& operator=(Temporal::Beats v) {
_type = BEATS; _type = BEATS;
_beats = v; _beats = v;
return *this; return *this;
} }
const Evoral::Beats& get_beats() const { const Temporal::Beats& get_beats() const {
ensure_type(BEATS); return _beats; ensure_type(BEATS); return _beats;
} }
@ -204,7 +204,7 @@ private:
Type _type; ///< Type tag Type _type; ///< Type tag
std::string _string; ///< PATH, STRING, URI std::string _string; ///< PATH, STRING, URI
Evoral::Beats _beats; ///< BEATS Temporal::Beats _beats; ///< BEATS
// Union of all primitive numeric types // Union of all primitive numeric types
union { union {

View file

@ -31,9 +31,9 @@ namespace ARDOUR {
* taking tempo changes into account. * taking tempo changes into account.
*/ */
samplepos_t 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; std::cerr << "negative beats passed to BFC: " << beats << std::endl;
PBD::stacktrace (std::cerr, 30); PBD::stacktrace (std::cerr, 30);
return 0; return 0;
@ -45,7 +45,7 @@ BeatsSamplesConverter::to (Evoral::Beats beats) const
* supplied to the constructor. Returns the equivalent number of quarter-note beats, * supplied to the constructor. Returns the equivalent number of quarter-note beats,
* taking tempo changes into account. * taking tempo changes into account.
*/ */
Evoral::Beats Temporal::Beats
BeatsSamplesConverter::from (samplepos_t samples) const BeatsSamplesConverter::from (samplepos_t samples) const
{ {
return _tempo_map.framewalk_to_qn (_origin_b, samples); return _tempo_map.framewalk_to_qn (_origin_b, samples);
@ -60,7 +60,7 @@ DoubleBeatsSamplesConverter::to (double beats) const
PBD::stacktrace (std::cerr, 30); PBD::stacktrace (std::cerr, 30);
return 0; 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). */ /** As above, but with quarter-note beats in double instead (for GUI). */

View file

@ -1265,14 +1265,14 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo
/* set length in beats to entire capture length */ /* set length in beats to entire capture length */
BeatsSamplesConverter converter (_session.tempo_map(), capture_info.front()->start); 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); _midi_write_source->set_length_beats (total_capture_beats);
/* flush to disk: this step differs from the audio path, /* flush to disk: this step differs from the audio path,
where all the data is already on disk. where all the data is already on disk.
*/ */
_midi_write_source->mark_midi_streaming_write_completed (source_lock, Evoral::Sequence<Evoral::Beats>::ResolveStuckNotes, total_capture_beats); _midi_write_source->mark_midi_streaming_write_completed (source_lock, Evoral::Sequence<Temporal::Beats>::ResolveStuckNotes, total_capture_beats);
} }
_last_capture_sources.insert (_last_capture_sources.end(), audio_srcs.begin(), audio_srcs.end()); _last_capture_sources.insert (_last_capture_sources.end(), audio_srcs.begin(), audio_srcs.end());

View file

@ -424,9 +424,9 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status,
smfs->append_event_beats( smfs->append_event_beats(
source_lock, source_lock,
Evoral::Event<Evoral::Beats>( Evoral::Event<Temporal::Beats>(
Evoral::MIDI_EVENT, Evoral::MIDI_EVENT,
Evoral::Beats::ticks_at_rate(t, source->ppqn()), Temporal::Beats::ticks_at_rate(t, source->ppqn()),
size, size,
buf)); buf));
@ -440,7 +440,7 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status,
/* we wrote something */ /* we wrote something */
const samplepos_t pos = 0; 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); BeatsSamplesConverter converter(smfs->session().tempo_map(), pos);
smfs->update_length(pos + converter.to(length_beats.round_up_to_beat())); smfs->update_length(pos + converter.to(length_beats.round_up_to_beat()));
smfs->mark_streaming_write_completed (source_lock); smfs->mark_streaming_write_completed (source_lock);

View file

@ -31,7 +31,7 @@ Legatize::~Legatize ()
Command* Command*
Legatize::operator()(boost::shared_ptr<ARDOUR::MidiModel> model, Legatize::operator()(boost::shared_ptr<ARDOUR::MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Legatize::Notes>& seqs) std::vector<Legatize::Notes>& seqs)
{ {
MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand(model, name ()); MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand(model, name ());
@ -43,10 +43,10 @@ Legatize::operator()(boost::shared_ptr<ARDOUR::MidiModel> model,
break; 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 || if ((*i)->end_time() > new_end ||
(!_shrink_only && (*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); cmd->change((*i), MidiModel::NoteDiffCommand::Length, new_length);
} }

View file

@ -29,7 +29,7 @@
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/failed_constructor.h" #include "pbd/failed_constructor.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "ardour/ltc_file_reader.h" #include "ardour/ltc_file_reader.h"
#include "pbd/i18n.h" #include "pbd/i18n.h"

View file

@ -815,16 +815,16 @@ LuaAPI::Vamp::process (const std::vector<float*>& d, ::Vamp::RealTime rt)
return _plugin->process (bufs, rt); return _plugin->process (bufs, rt);
} }
boost::shared_ptr<Evoral::Note<Evoral::Beats> > boost::shared_ptr<Evoral::Note<Temporal::Beats> >
LuaAPI::new_noteptr (uint8_t chan, Evoral::Beats beat_time, Evoral::Beats length, uint8_t note, uint8_t velocity) LuaAPI::new_noteptr (uint8_t chan, Temporal::Beats beat_time, Temporal::Beats length, uint8_t note, uint8_t velocity)
{ {
return boost::shared_ptr<Evoral::Note<Evoral::Beats> > (new Evoral::Note<Evoral::Beats>(chan, beat_time, length, note, velocity)); return boost::shared_ptr<Evoral::Note<Temporal::Beats> > (new Evoral::Note<Temporal::Beats>(chan, beat_time, length, note, velocity));
} }
std::list<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > std::list<boost::shared_ptr<Evoral::Note<Temporal::Beats> > >
LuaAPI::note_list (boost::shared_ptr<MidiModel> mm) LuaAPI::note_list (boost::shared_ptr<MidiModel> mm)
{ {
typedef boost::shared_ptr<Evoral::Note<Evoral::Beats> > NotePtr; typedef boost::shared_ptr<Evoral::Note<Temporal::Beats> > NotePtr;
std::list<NotePtr> note_ptr_list; std::list<NotePtr> note_ptr_list;

View file

@ -18,7 +18,7 @@
#include <glibmm.h> #include <glibmm.h>
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
#include "pbd/stateful_diff_command.h" #include "pbd/stateful_diff_command.h"
#include "pbd/openuri.h" #include "pbd/openuri.h"
#include "evoral/Control.hpp" #include "evoral/Control.hpp"
@ -206,7 +206,7 @@ CLASSKEYS(PBD::Configuration);
CLASSKEYS(PBD::PropertyChange); CLASSKEYS(PBD::PropertyChange);
CLASSKEYS(PBD::StatefulDestructible); CLASSKEYS(PBD::StatefulDestructible);
CLASSKEYS(Evoral::Beats); CLASSKEYS(Temporal::Beats);
CLASSKEYS(Evoral::Event<samplepos_t>); CLASSKEYS(Evoral::Event<samplepos_t>);
CLASSKEYS(Evoral::ControlEvent); CLASSKEYS(Evoral::ControlEvent);
@ -235,7 +235,7 @@ CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >);
CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>); CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>);
CLASSKEYS(boost::shared_ptr<ARDOUR::AudioSource>); CLASSKEYS(boost::shared_ptr<ARDOUR::AudioSource>);
CLASSKEYS(boost::shared_ptr<ARDOUR::Automatable>); CLASSKEYS(boost::shared_ptr<ARDOUR::Automatable>);
CLASSKEYS(boost::shared_ptr<ARDOUR::AutomatableSequence<Evoral::Beats> >); CLASSKEYS(boost::shared_ptr<ARDOUR::AutomatableSequence<Temporal::Beats> >);
CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>); CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
CLASSKEYS(boost::shared_ptr<ARDOUR::FileSource>); CLASSKEYS(boost::shared_ptr<ARDOUR::FileSource>);
CLASSKEYS(boost::shared_ptr<ARDOUR::MidiModel>); CLASSKEYS(boost::shared_ptr<ARDOUR::MidiModel>);
@ -247,8 +247,8 @@ CLASSKEYS(boost::shared_ptr<ARDOUR::Processor>);
CLASSKEYS(boost::shared_ptr<ARDOUR::Readable>); CLASSKEYS(boost::shared_ptr<ARDOUR::Readable>);
CLASSKEYS(boost::shared_ptr<ARDOUR::Region>); CLASSKEYS(boost::shared_ptr<ARDOUR::Region>);
CLASSKEYS(boost::shared_ptr<Evoral::ControlList>); CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
CLASSKEYS(boost::shared_ptr<Evoral::Note<Evoral::Beats> >); CLASSKEYS(boost::shared_ptr<Evoral::Note<Temporal::Beats> >);
CLASSKEYS(boost::shared_ptr<Evoral::Sequence<Evoral::Beats> >); CLASSKEYS(boost::shared_ptr<Evoral::Sequence<Temporal::Beats> >);
CLASSKEYS(boost::shared_ptr<ARDOUR::Playlist>); CLASSKEYS(boost::shared_ptr<ARDOUR::Playlist>);
CLASSKEYS(boost::shared_ptr<ARDOUR::Route>); CLASSKEYS(boost::shared_ptr<ARDOUR::Route>);
@ -516,9 +516,9 @@ LuaBindings::common (lua_State* L)
.addFunction ("time", (samplepos_t (Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::time) .addFunction ("time", (samplepos_t (Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::time)
.endClass () .endClass ()
.beginClass <Evoral::Beats> ("Beats") .beginClass <Temporal::Beats> ("Beats")
.addConstructor <void (*) (double)> () .addConstructor <void (*) (double)> ()
.addFunction ("to_double", &Evoral::Beats::to_double) .addFunction ("to_double", &Temporal::Beats::to_double)
.endClass () .endClass ()
.beginClass <Evoral::Parameter> ("Parameter") .beginClass <Evoral::Parameter> ("Parameter")
@ -570,16 +570,16 @@ LuaBindings::common (lua_State* L)
.addData ("to", &Evoral::Range<samplepos_t>::to) .addData ("to", &Evoral::Range<samplepos_t>::to)
.endClass () .endClass ()
.deriveWSPtrClass <Evoral::Sequence<Evoral::Beats>, Evoral::ControlSet> ("Sequence") .deriveWSPtrClass <Evoral::Sequence<Temporal::Beats>, Evoral::ControlSet> ("Sequence")
.endClass () .endClass ()
.beginWSPtrClass <Evoral::Note<Evoral::Beats> > ("NotePtr") .beginWSPtrClass <Evoral::Note<Temporal::Beats> > ("NotePtr")
.addFunction ("time", &Evoral::Note<Evoral::Beats>::time) .addFunction ("time", &Evoral::Note<Temporal::Beats>::time)
.addFunction ("note", &Evoral::Note<Evoral::Beats>::note) .addFunction ("note", &Evoral::Note<Temporal::Beats>::note)
.addFunction ("velocity", &Evoral::Note<Evoral::Beats>::velocity) .addFunction ("velocity", &Evoral::Note<Temporal::Beats>::velocity)
.addFunction ("off_velocity", &Evoral::Note<Evoral::Beats>::off_velocity) .addFunction ("off_velocity", &Evoral::Note<Temporal::Beats>::off_velocity)
.addFunction ("length", &Evoral::Note<Evoral::Beats>::length) .addFunction ("length", &Evoral::Note<Temporal::Beats>::length)
.addFunction ("channel", &Evoral::Note<Evoral::Beats>::channel) .addFunction ("channel", &Evoral::Note<Temporal::Beats>::channel)
.endClass () .endClass ()
/* libevoral enums */ /* libevoral enums */
@ -1267,11 +1267,11 @@ LuaBindings::common (lua_State* L)
//.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated) //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated)
.endClass () .endClass ()
.deriveWSPtrClass <AutomatableSequence<Evoral::Beats>, Automatable> ("AutomatableSequence") .deriveWSPtrClass <AutomatableSequence<Temporal::Beats>, Automatable> ("AutomatableSequence")
.addCast<Evoral::Sequence<Evoral::Beats> > ("to_sequence") .addCast<Evoral::Sequence<Temporal::Beats> > ("to_sequence")
.endClass () .endClass ()
.deriveWSPtrClass <MidiModel, AutomatableSequence<Evoral::Beats> > ("MidiModel") .deriveWSPtrClass <MidiModel, AutomatableSequence<Temporal::Beats> > ("MidiModel")
.addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command) .addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command)
.addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command) .addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command)
.endClass () .endClass ()
@ -1583,14 +1583,14 @@ LuaBindings::common (lua_State* L)
.addVoidPtrConstructor<std::list<boost::shared_ptr <AutomationControl> > > () .addVoidPtrConstructor<std::list<boost::shared_ptr <AutomationControl> > > ()
.endClass () .endClass ()
.beginStdList <boost::shared_ptr<Evoral::Note<Evoral::Beats> > > ("NotePtrList") .beginStdList <boost::shared_ptr<Evoral::Note<Temporal::Beats> > > ("NotePtrList")
.endClass () .endClass ()
.beginConstStdList <Evoral::ControlEvent*> ("EventList") .beginConstStdList <Evoral::ControlEvent*> ("EventList")
.endClass () .endClass ()
#if 0 // depends on Evoal:: Note, Beats see note_fixer.h #if 0 // depends on Evoal:: Note, Beats see note_fixer.h
// typedef Evoral::Note<Evoral::Beats> Note; // typedef Evoral::Note<Temporal::Beats> Note;
// std::set< boost::weak_ptr<Note> > // std::set< boost::weak_ptr<Note> >
.beginStdSet <boost::weak_ptr<Note> > ("WeakNoteSet") .beginStdSet <boost::weak_ptr<Note> > ("WeakNoteSet")
.endClass () .endClass ()

View file

@ -561,7 +561,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
} }
int old_val; int old_val;
Evoral::Beats old_time; Temporal::Beats old_time;
if ((change.property == StartTime || change.property == Length) && if ((change.property == StartTime || change.property == Length) &&
xml_change->get_property ("old", old_time)) { xml_change->get_property ("old", old_time)) {
change.old_value = old_time; change.old_value = old_time;
@ -573,7 +573,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
} }
int new_val; int new_val;
Evoral::Beats new_time; Temporal::Beats new_time;
if ((change.property == StartTime || change.property == Length) && if ((change.property == StartTime || change.property == Length) &&
xml_change->get_property ("new", new_time)) { xml_change->get_property ("new", new_time)) {
change.new_value = new_time; change.new_value = new_time;
@ -1113,7 +1113,7 @@ MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
assert(false); assert(false);
} }
Evoral::Beats time = Evoral::Beats(); Temporal::Beats time = Temporal::Beats();
if (!n->get_property ("time", time)) { if (!n->get_property ("time", time)) {
// warning?? // warning??
} }
@ -1832,7 +1832,7 @@ MidiModel::transpose (NoteDiffCommand* c, const NotePtr note_ptr, int semitones)
void void
MidiModel::control_list_marked_dirty () MidiModel::control_list_marked_dirty ()
{ {
AutomatableSequence<Evoral::Beats>::control_list_marked_dirty (); AutomatableSequence<Temporal::Beats>::control_list_marked_dirty ();
ContentsChanged (); /* EMIT SIGNAL */ ContentsChanged (); /* EMIT SIGNAL */
} }

View file

@ -152,7 +152,7 @@ MidiPlaylistSource::write_unlocked (const Lock&,
} }
void void
MidiPlaylistSource::append_event_beats(const Glib::Threads::Mutex::Lock& /*lock*/, const Evoral::Event<Evoral::Beats>& /*ev*/) MidiPlaylistSource::append_event_beats(const Glib::Threads::Mutex::Lock& /*lock*/, const Evoral::Event<Temporal::Beats>& /*ev*/)
{ {
fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_beats() called - should be impossible") << endmsg; fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_beats() called - should be impossible") << endmsg;
abort(); /*NOTREACHED*/ abort(); /*NOTREACHED*/

View file

@ -28,7 +28,7 @@
#include <glibmm/fileutils.h> #include <glibmm/fileutils.h>
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/basename.h" #include "pbd/basename.h"
@ -144,8 +144,8 @@ MidiRegion::do_export (string path) const
path, false, _session.sample_rate())); path, false, _session.sample_rate()));
BeatsSamplesConverter bfc (_session.tempo_map(), _position); BeatsSamplesConverter bfc (_session.tempo_map(), _position);
Evoral::Beats const bbegin = bfc.from (_start); Temporal::Beats const bbegin = bfc.from (_start);
Evoral::Beats const bend = bfc.from (_start + _length); Temporal::Beats const bend = bfc.from (_start + _length);
{ {
/* Lock our source since we'll be reading from it. write_to() will /* Lock our source since we'll be reading from it. write_to() will
@ -180,8 +180,8 @@ boost::shared_ptr<MidiRegion>
MidiRegion::clone (boost::shared_ptr<MidiSource> newsrc) const MidiRegion::clone (boost::shared_ptr<MidiSource> newsrc) const
{ {
BeatsSamplesConverter bfc (_session.tempo_map(), _position); BeatsSamplesConverter bfc (_session.tempo_map(), _position);
Evoral::Beats const bbegin = bfc.from (_start); Temporal::Beats const bbegin = bfc.from (_start);
Evoral::Beats const bend = bfc.from (_start + _length); Temporal::Beats const bend = bfc.from (_start + _length);
{ {
boost::shared_ptr<MidiSource> ms = midi_source(0); boost::shared_ptr<MidiSource> ms = midi_source(0);
@ -647,7 +647,7 @@ MidiRegion::fix_negative_start ()
_ignore_shift = true; _ignore_shift = true;
model()->insert_silence_at_start (Evoral::Beats (- _start_beats)); model()->insert_silence_at_start (Temporal::Beats (- _start_beats));
_start = 0; _start = 0;
_start_beats = 0.0; _start_beats = 0.0;

View file

@ -206,7 +206,7 @@ MidiSource::midi_read (const Lock& lm,
} }
// Find appropriate model iterator // Find appropriate model iterator
Evoral::Sequence<Evoral::Beats>::const_iterator& i = cursor.iter; Evoral::Sequence<Temporal::Beats>::const_iterator& i = cursor.iter;
const bool linear_read = cursor.last_read_end != 0 && start == cursor.last_read_end; const bool linear_read = cursor.last_read_end != 0 && start == cursor.last_read_end;
if (!linear_read || !i.valid()) { if (!linear_read || !i.valid()) {
/* Cached iterator is invalid, search for the first event past start. /* 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 sure if this is necessary here (channels are mapped later in
buffers anyway), but it preserves existing behaviour without buffers anyway), but it preserves existing behaviour without
destroying events in the model during read. */ destroying events in the model during read. */
Evoral::Event<Evoral::Beats> ev(*i, true); Evoral::Event<Temporal::Beats> ev(*i, true);
if (!filter->filter(ev.buffer(), ev.size())) { if (!filter->filter(ev.buffer(), ev.size())) {
dst.write(time_samples, ev.event_type(), ev.size(), ev.buffer()); dst.write(time_samples, ev.event_type(), ev.size(), ev.buffer());
} else { } else {
@ -356,8 +356,8 @@ MidiSource::mark_streaming_write_started (const Lock& lock)
void void
MidiSource::mark_midi_streaming_write_completed (const Lock& lock, MidiSource::mark_midi_streaming_write_completed (const Lock& lock,
Evoral::Sequence<Evoral::Beats>::StuckNoteOption option, Evoral::Sequence<Temporal::Beats>::StuckNoteOption option,
Evoral::Beats end) Temporal::Beats end)
{ {
if (_model) { if (_model) {
_model->end_write (option, end); _model->end_write (option, end);
@ -378,11 +378,11 @@ MidiSource::mark_midi_streaming_write_completed (const Lock&
void void
MidiSource::mark_streaming_write_completed (const Lock& lock) MidiSource::mark_streaming_write_completed (const Lock& lock)
{ {
mark_midi_streaming_write_completed (lock, Evoral::Sequence<Evoral::Beats>::DeleteStuckNotes); mark_midi_streaming_write_completed (lock, Evoral::Sequence<Temporal::Beats>::DeleteStuckNotes);
} }
int int
MidiSource::export_write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Evoral::Beats begin, Evoral::Beats end) MidiSource::export_write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Temporal::Beats begin, Temporal::Beats end)
{ {
Lock newsrc_lock (newsrc->mutex ()); Lock newsrc_lock (newsrc->mutex ());
@ -399,7 +399,7 @@ MidiSource::export_write_to (const Lock& lock, boost::shared_ptr<MidiSource> new
} }
int int
MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Evoral::Beats begin, Evoral::Beats end) MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Temporal::Beats begin, Temporal::Beats end)
{ {
Lock newsrc_lock (newsrc->mutex ()); Lock newsrc_lock (newsrc->mutex ());
@ -408,7 +408,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Ev
newsrc->copy_automation_state_from (this); newsrc->copy_automation_state_from (this);
if (_model) { if (_model) {
if (begin == Evoral::Beats() && end == std::numeric_limits<Evoral::Beats>::max()) { if (begin == Temporal::Beats() && end == std::numeric_limits<Temporal::Beats>::max()) {
_model->write_to (newsrc, newsrc_lock); _model->write_to (newsrc, newsrc_lock);
} else { } else {
_model->write_section_to (newsrc, newsrc_lock, begin, end); _model->write_section_to (newsrc, newsrc_lock, begin, end);
@ -422,7 +422,7 @@ MidiSource::write_to (const Lock& lock, boost::shared_ptr<MidiSource> newsrc, Ev
/* force a reload of the model if the range is partial */ /* force a reload of the model if the range is partial */
if (begin != Evoral::Beats() || end != std::numeric_limits<Evoral::Beats>::max()) { if (begin != Temporal::Beats() || end != std::numeric_limits<Temporal::Beats>::max()) {
newsrc->load_model (newsrc_lock, true); newsrc->load_model (newsrc_lock, true);
} else { } else {
newsrc->set_model (newsrc_lock, _model); newsrc->set_model (newsrc_lock, _model);

View file

@ -168,7 +168,7 @@ MidiStateTracker::resolve_notes (Evoral::EventSink<samplepos_t> &dst, samplepos_
} }
void 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)); 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 channel = 0; channel < 16; ++channel) {
for (int note = 0; note < 128; ++note) { for (int note = 0; note < 128; ++note) {
while (_active_notes[note + 128 * channel]) { while (_active_notes[note + 128 * channel]) {
Evoral::Event<Evoral::Beats> ev (Evoral::MIDI_EVENT, time, 3, 0, true); Evoral::Event<Temporal::Beats> ev (Evoral::MIDI_EVENT, time, 3, 0, true);
ev.set_type (MIDI_CMD_NOTE_OFF); ev.set_type (MIDI_CMD_NOTE_OFF);
ev.set_channel (channel); ev.set_channel (channel);
ev.set_note (note); ev.set_note (note);
@ -191,7 +191,7 @@ MidiStateTracker::resolve_notes (MidiSource& src, const MidiSource::Lock& lock,
this, (int) note, (int) channel, time)); this, (int) note, (int) channel, time));
_active_notes[note + 128 * channel]--; _active_notes[note + 128 * channel]--;
/* don't stack events up at the same time */ /* don't stack events up at the same time */
time += Evoral::Beats::tick(); time += Temporal::Beats::tick();
} }
} }
} }

View file

@ -108,7 +108,7 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress*)
new_model->append(ev, Evoral::next_event_id()); new_model->append(ev, Evoral::next_event_id());
} }
new_model->end_write (Evoral::Sequence<Evoral::Beats>::DeleteStuckNotes); new_model->end_write (Evoral::Sequence<Temporal::Beats>::DeleteStuckNotes);
new_model->set_edited (true); new_model->set_edited (true);
new_src->copy_interpolation_from (src); new_src->copy_interpolation_from (src);

View file

@ -380,7 +380,7 @@ MidiTrack::non_realtime_locate (samplepos_t pos)
boost::shared_ptr<Evoral::Control> rcontrol; boost::shared_ptr<Evoral::Control> rcontrol;
if ((tcontrol = boost::dynamic_pointer_cast<MidiTrack::MidiControl>(c->second)) && if ((tcontrol = boost::dynamic_pointer_cast<MidiTrack::MidiControl>(c->second)) &&
(rcontrol = region->control(tcontrol->parameter()))) { (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) { if (rcontrol->list()->size() > 0) {
tcontrol->set_value(rcontrol->list()->eval(pos_beats.to_double()), Controllable::NoGroup); tcontrol->set_value(rcontrol->list()->eval(pos_beats.to_double()), Controllable::NoGroup);
} }

View file

@ -126,7 +126,7 @@ NoteFixer::emit(Evoral::EventSink<samplepos_t>& dst,
} }
NoteFixer::Event* NoteFixer::Event*
NoteFixer::copy_event(samplepos_t time, const Evoral::Event<Evoral::Beats>& ev) NoteFixer::copy_event(samplepos_t time, const Evoral::Event<Temporal::Beats>& ev)
{ {
return new Event(ev.event_type(), time, ev.size(), ev.buffer()); return new Event(ev.event_type(), time, ev.size(), ev.buffer());
} }

View file

@ -111,8 +111,8 @@ swing_position (double pos, double grid, double swing, double offset)
Command* Command*
Quantize::operator () (boost::shared_ptr<MidiModel> model, Quantize::operator () (boost::shared_ptr<MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Evoral::Sequence<Evoral::Beats>::Notes>& seqs) std::vector<Evoral::Sequence<Temporal::Beats>::Notes>& seqs)
{ {
/* TODO: Rewrite this to be precise with fixed point? */ /* TODO: Rewrite this to be precise with fixed point? */
@ -125,7 +125,7 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model,
MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand (model, "quantize"); MidiModel::NoteDiffCommand* cmd = new MidiModel::NoteDiffCommand (model, "quantize");
for (std::vector<Evoral::Sequence<Evoral::Beats>::Notes>::iterator s = seqs.begin(); s != seqs.end(); ++s) { for (std::vector<Evoral::Sequence<Temporal::Beats>::Notes>::iterator s = seqs.begin(); s != seqs.end(); ++s) {
for (Evoral::Sequence<MidiModel::TimeType>::Notes::iterator i = (*s).begin(); i != (*s).end(); ++i) { for (Evoral::Sequence<MidiModel::TimeType>::Notes::iterator i = (*s).begin(); i != (*s).end(); ++i) {
@ -167,10 +167,10 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model,
delta = new_end - (*i)->end_time().to_double(); delta = new_end - (*i)->end_time().to_double();
if (fabs (delta) >= _threshold) { if (fabs (delta) >= _threshold) {
Evoral::Beats new_dur(new_end - new_start); Temporal::Beats new_dur(new_end - new_start);
if (!new_dur) { if (!new_dur) {
new_dur = Evoral::Beats(_end_grid); new_dur = Temporal::Beats(_end_grid);
} }
cmd->change ((*i), MidiModel::NoteDiffCommand::Length, new_dur); cmd->change ((*i), MidiModel::NoteDiffCommand::Length, new_dur);

View file

@ -18,7 +18,7 @@
*/ */
#include "timecode/time.h" #include "temporal/time.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/audio_port.h" #include "ardour/audio_port.h"

View file

@ -35,7 +35,7 @@
#include "pbd/timersub.h" #include "pbd/timersub.h"
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "ardour/audio_track.h" #include "ardour/audio_track.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"

View file

@ -1254,7 +1254,7 @@ Session::state (bool full_state, snapshot_t snapshot_type)
if (!ms->model()) { if (!ms->model()) {
ms->load_model (lm); ms->load_model (lm);
} }
if (ms->write_to (lm, newsrc, Evoral::Beats(), std::numeric_limits<Evoral::Beats>::max())) { if (ms->write_to (lm, newsrc, Temporal::Beats(), std::numeric_limits<Temporal::Beats>::max())) {
error << string_compose (_("Session-Save: Failed to copy MIDI Source '%1' for snapshot"), ancestor_name) << endmsg; error << string_compose (_("Session-Save: Failed to copy MIDI Source '%1' for snapshot"), ancestor_name) << endmsg;
} else { } else {
if (snapshot_type == SnapshotKeep) { if (snapshot_type == SnapshotKeep) {

View file

@ -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 /* Note that we add on the source start time (in session samples) here so that ev_sample_time
is in session samples. 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) { if (loop_range) {
loop_range->squish (ev_sample_time); loop_range->squish (ev_sample_time);
@ -393,7 +393,7 @@ SMFSource::write_unlocked (const Lock& lock,
/** Append an event with a timestamp in beats */ /** Append an event with a timestamp in beats */
void void
SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock, SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock,
const Evoral::Event<Evoral::Beats>& ev) const Evoral::Event<Temporal::Beats>& ev)
{ {
if (!_writing || ev.size() == 0) { if (!_writing || ev.size() == 0) {
return; 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"); for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");
#endif #endif
Evoral::Beats time = ev.time(); Temporal::Beats time = ev.time();
if (time < _last_ev_time_beats) { 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) { if (difference.to_double() / (double)ppqn() < 1.0) {
/* Close enough. This problem occurs because Sequence is not /* Close enough. This problem occurs because Sequence is not
actually ordered due to fuzzy time comparison. I'm pretty sure 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); _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()); 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); 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); 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; Evoral::event_id_t event_id;
if (ev.id() < 0) { if (ev.id() < 0) {
@ -477,7 +477,7 @@ SMFSource::append_event_samples (const Glib::Threads::Mutex::Lock& lock,
} }
if (_model) { if (_model) {
const Evoral::Event<Evoral::Beats> beat_ev (ev.event_type(), const Evoral::Event<Temporal::Beats> beat_ev (ev.event_type(),
ev_time_beats, ev_time_beats,
ev.size(), ev.size(),
const_cast<uint8_t*>(ev.buffer())); const_cast<uint8_t*>(ev.buffer()));
@ -486,8 +486,8 @@ SMFSource::append_event_samples (const Glib::Threads::Mutex::Lock& lock,
_length_beats = max(_length_beats, ev_time_beats); _length_beats = max(_length_beats, ev_time_beats);
const Evoral::Beats last_time_beats = converter.from (_last_ev_time_samples); const Temporal::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 delta_time_beats = ev_time_beats - last_time_beats;
const uint32_t delta_time_ticks = delta_time_beats.to_ticks(ppqn()); 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); 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); MidiSource::mark_streaming_midi_write_started (lock, mode);
Evoral::SMF::begin_write (); Evoral::SMF::begin_write ();
_last_ev_time_beats = Evoral::Beats(); _last_ev_time_beats = Temporal::Beats();
_last_ev_time_samples = 0; _last_ev_time_samples = 0;
} }
void void
SMFSource::mark_streaming_write_completed (const Lock& lock) SMFSource::mark_streaming_write_completed (const Lock& lock)
{ {
mark_midi_streaming_write_completed (lock, Evoral::Sequence<Evoral::Beats>::DeleteStuckNotes); mark_midi_streaming_write_completed (lock, Evoral::Sequence<Temporal::Beats>::DeleteStuckNotes);
} }
void void
SMFSource::mark_midi_streaming_write_completed (const Lock& lm, Evoral::Sequence<Evoral::Beats>::StuckNoteOption stuck_notes_option, Evoral::Beats when) SMFSource::mark_midi_streaming_write_completed (const Lock& lm, Evoral::Sequence<Temporal::Beats>::StuckNoteOption stuck_notes_option, Temporal::Beats when)
{ {
MidiSource::mark_midi_streaming_write_completed (lm, stuck_notes_option, 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 ( static bool compare_eventlist (
const std::pair< const Evoral::Event<Evoral::Beats>*, gint >& a, const std::pair< const Evoral::Event<Temporal::Beats>*, gint >& a,
const std::pair< const Evoral::Event<Evoral::Beats>*, gint >& b) { const std::pair< const Evoral::Event<Temporal::Beats>*, gint >& b) {
return ( a.first->time() < b.first->time() ); 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(); Evoral::SMF::seek_to_start();
uint64_t time = 0; /* in SMF ticks */ uint64_t time = 0; /* in SMF ticks */
Evoral::Event<Evoral::Beats> ev; Evoral::Event<Temporal::Beats> ev;
uint32_t scratch_size = 0; // keep track of scratch and minimize reallocs 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; bool have_event_id;
// TODO simplify event allocation // TODO simplify event allocation
std::list< std::pair< Evoral::Event<Evoral::Beats>*, gint > > eventlist; std::list< std::pair< Evoral::Event<Temporal::Beats>*, gint > > eventlist;
for (unsigned i = 1; i <= num_tracks(); ++i) { for (unsigned i = 1; i <= num_tracks(); ++i) {
if (seek_to_track(i)) continue; 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) { if (!have_event_id) {
event_id = Evoral::next_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 #ifndef NDEBUG
std::string ss; std::string ss;
@ -686,7 +686,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload
#endif #endif
eventlist.push_back(make_pair ( eventlist.push_back(make_pair (
new Evoral::Event<Evoral::Beats> ( new Evoral::Event<Temporal::Beats> (
Evoral::MIDI_EVENT, event_time, Evoral::MIDI_EVENT, event_time,
size, buf, true) size, buf, true)
, event_id)); , event_id));
@ -705,7 +705,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload
eventlist.sort(compare_eventlist); eventlist.sort(compare_eventlist);
std::list< std::pair< Evoral::Event<Evoral::Beats>*, gint > >::iterator it; std::list< std::pair< Evoral::Event<Temporal::Beats>*, gint > >::iterator it;
for (it=eventlist.begin(); it!=eventlist.end(); ++it) { for (it=eventlist.begin(); it!=eventlist.end(); ++it) {
_model->append (*it->first, it->second); _model->append (*it->first, it->second);
delete it->first; delete it->first;
@ -715,7 +715,7 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload
// _playback_buf->dump (cerr); // _playback_buf->dump (cerr);
// cerr << "----------------\n"; // cerr << "----------------\n";
_model->end_write (Evoral::Sequence<Evoral::Beats>::ResolveStuckNotes, _length_beats); _model->end_write (Evoral::Sequence<Temporal::Beats>::ResolveStuckNotes, _length_beats);
_model->set_edited (false); _model->set_edited (false);
invalidate(lock); invalidate(lock);

View file

@ -27,7 +27,7 @@
#include "pbd/enumwriter.h" #include "pbd/enumwriter.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "ardour/debug.h" #include "ardour/debug.h"
#include "ardour/lmath.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. * @param beat The BBT (meter-based) beat.
* @return The quarter-note position of the supplied 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 double
@ -2438,7 +2438,7 @@ TempoMap::quarter_note_at_beat (const double beat) const
* @param quarter_note The position in quarter-note beats. * @param quarter_note The position in quarter-note beats.
* @return the BBT (meter-based) beat position of the supplied 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 double
@ -4821,7 +4821,7 @@ TempoMap::remove_time (samplepos_t where, samplecnt_t amount)
* pos can be -ve, if required. * pos can be -ve, if required.
*/ */
samplepos_t 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); Glib::Threads::RWLock::ReaderLock lm (lock);
const double sample_qn = pulse_at_minute_locked (_metrics, minute_at_sample (sample)) * 4.0; 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, /** Count the number of beats that are equivalent to distance when going forward,
starting at pos. starting at pos.
*/ */
Evoral::Beats Temporal::Beats
TempoMap::framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const TempoMap::framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const
{ {
Glib::Threads::RWLock::ReaderLock lm (lock); 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 { struct bbtcmp {

View file

@ -2,7 +2,7 @@
#include <sigc++/sigc++.h> #include <sigc++/sigc++.h>
#include <cppunit/TestFixture.h> #include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
class BBTTest : public CppUnit::TestFixture class BBTTest : public CppUnit::TestFixture
{ {

View file

@ -1,6 +1,6 @@
#include "samplepos_minus_beats_test.h" #include "samplepos_minus_beats_test.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
CPPUNIT_TEST_SUITE_REGISTRATION (FrameposMinusBeatsTest); CPPUNIT_TEST_SUITE_REGISTRATION (FrameposMinusBeatsTest);

View file

@ -1,6 +1,6 @@
#include "samplepos_plus_beats_test.h" #include "samplepos_plus_beats_test.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
CPPUNIT_TEST_SUITE_REGISTRATION (FrameposPlusBeatsTest); CPPUNIT_TEST_SUITE_REGISTRATION (FrameposPlusBeatsTest);
@ -25,11 +25,11 @@ FrameposPlusBeatsTest::singleTempoTest ()
map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, AudioTime); map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, AudioTime);
/* Add 1 beat to beat 3 of the first bar */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (samples_per_beat * 3), r);
/* Add 4 beats to a -ve sample of 1 beat before zero */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (samples_per_beat * 3), r);
} }
@ -70,15 +70,15 @@ FrameposPlusBeatsTest::doubleTempoTest ()
/* Now some tests */ /* Now some tests */
/* Add 1 beat to 1|2 */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r);
/* Add 2 beats to 3|4 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
/* Add 2.5 beats to 3|3|960 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
} }
@ -125,15 +125,15 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
/* Now some tests */ /* Now some tests */
/* Add 1 beat to 1|2 */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r);
/* Add 2 beats to 3|4 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
/* Add 2.5 beats to 3|3|960 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
} }
@ -181,15 +181,15 @@ FrameposPlusBeatsTest::doubleTempoWithComplexMeterTest ()
/* Now some tests */ /* Now some tests */
/* Add 1 beat to 1|2 */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (48e3), r);
/* Add 2 beats to 5|1 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
/* Add 2.5 beats to 4|5 (over the tempo change) */ /* 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); CPPUNIT_ASSERT_EQUAL (samplepos_t (264e3 + 24e3 + 12e3), r);
} }

View file

@ -1,6 +1,6 @@
#include "samplewalk_to_beats_test.h" #include "samplewalk_to_beats_test.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
CPPUNIT_TEST_SUITE_REGISTRATION (FramewalkToBeatsTest); CPPUNIT_TEST_SUITE_REGISTRATION (FramewalkToBeatsTest);

View file

@ -121,7 +121,7 @@ Transform::Operation::eval(Context& ctx) const
Command* Command*
Transform::operator()(boost::shared_ptr<MidiModel> model, Transform::operator()(boost::shared_ptr<MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Notes>& seqs) std::vector<Notes>& seqs)
{ {
typedef MidiModel::NoteDiffCommand Command; typedef MidiModel::NoteDiffCommand Command;

View file

@ -27,7 +27,7 @@ Transpose::Transpose(int semitones)
Command* Command*
Transpose::operator()(boost::shared_ptr<MidiModel> model, Transpose::operator()(boost::shared_ptr<MidiModel> model,
Evoral::Beats position, Temporal::Beats position,
std::vector<Notes>& seqs) std::vector<Notes>& seqs)
{ {
typedef MidiModel::NoteDiffCommand Command; typedef MidiModel::NoteDiffCommand Command;

View file

@ -394,7 +394,7 @@ def build(bld):
'OSX','BOOST','CURL','TAGLIB','VAMPSDK','VAMPHOSTSDK','RUBBERBAND'] 'OSX','BOOST','CURL','TAGLIB','VAMPSDK','VAMPHOSTSDK','RUBBERBAND']
obj.use = ['libpbd','libmidipp','libevoral', obj.use = ['libpbd','libmidipp','libevoral',
'libaudiographer', 'libaudiographer',
'libtimecode', 'libtemporal',
'liblua', 'liblua',
] ]
if bld.env['build_target'] != 'mingw': if bld.env['build_target'] != 'mingw':
@ -478,7 +478,7 @@ def build(bld):
source = avx_sources, source = avx_sources,
cxxflags = avx_cxxflags, cxxflags = avx_cxxflags,
includes = [ '.' ], includes = [ '.' ],
use = [ 'libtimecode', 'libpbd', 'libevoral', 'liblua' ], use = [ 'libtemporal', 'libpbd', 'libevoral', 'liblua' ],
uselib = [ 'GLIBMM', 'XML' ], uselib = [ 'GLIBMM', 'XML' ],
target = 'sse_avx_functions') target = 'sse_avx_functions')

View file

@ -85,7 +85,7 @@ def build(bld):
audiographer.name = 'libaudiographer' audiographer.name = 'libaudiographer'
audiographer.target = 'audiographer' audiographer.target = 'audiographer'
audiographer.export_includes = ['.', './src'] 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.uselib = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE FFTW3F VAMPSDK VAMPHOSTSDK XML'
audiographer.use = 'libpbd' audiographer.use = 'libpbd'
audiographer.vnum = AUDIOGRAPHER_LIB_VERSION audiographer.vnum = AUDIOGRAPHER_LIB_VERSION

View file

@ -18,8 +18,8 @@
#include <glib.h> #include <glib.h>
#include "temporal/beats.h"
#include "evoral/Event.hpp" #include "evoral/Event.hpp"
#include "evoral/Beats.hpp"
namespace Evoral { namespace Evoral {
@ -162,7 +162,7 @@ Event<Timestamp>::set (const uint8_t* buf, uint32_t size, Timestamp t)
#endif // EVORAL_EVENT_ALLOC #endif // EVORAL_EVENT_ALLOC
template class Event<Evoral::Beats>; template class Event<Temporal::Beats>;
template class Event<double>; template class Event<double>;
template class Event<int64_t>; template class Event<int64_t>;

View file

@ -24,7 +24,7 @@
#include "evoral/Note.hpp" #include "evoral/Note.hpp"
#endif #endif
#include "evoral/Beats.hpp" #include "temporal/beats.h"
namespace Evoral { namespace Evoral {
@ -90,7 +90,7 @@ Note<Time>::set_id (event_id_t id)
_off_event.set_id (id); _off_event.set_id (id);
} }
template class Note<Evoral::Beats>; template class Note<Temporal::Beats>;
} // namespace Evoral } // namespace Evoral

View file

@ -364,6 +364,6 @@ SMF<Time>::write_var_len(uint32_t value)
return ret; return ret;
} }
template class SMF<Evoral::Beats>; template class SMF<Temporal::Beats>;
} // namespace Evoral } // namespace Evoral

View file

@ -31,7 +31,8 @@
#include "pbd/compose.h" #include "pbd/compose.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "evoral/Beats.hpp" #include "temporal/beats.h"
#include "evoral/Control.hpp" #include "evoral/Control.hpp"
#include "evoral/ControlList.hpp" #include "evoral/ControlList.hpp"
#include "evoral/ControlSet.hpp" #include "evoral/ControlSet.hpp"
@ -1408,6 +1409,6 @@ Sequence<Time>::dump (ostream& str) const
str << "--- dump\n"; str << "--- dump\n";
} }
template class Sequence<Evoral::Beats>; template class Sequence<Temporal::Beats>;
} // namespace Evoral } // namespace Evoral

View file

@ -1,4 +1,4 @@
/* This file is part of Evoral. /*
* Copyright (C) 2008 David Robillard <http://drobilla.net> * Copyright (C) 2008 David Robillard <http://drobilla.net>
* Copyright (C) 2000-2008 Paul Davis * Copyright (C) 2000-2008 Paul Davis
* *
@ -18,6 +18,9 @@
#include <stdint.h> #include <stdint.h>
#include "temporal/beats.h"
#include "temporal/types.h"
#include "evoral/TimeConverter.hpp" #include "evoral/TimeConverter.hpp"
#include "evoral/types.hpp" #include "evoral/types.hpp"
@ -43,8 +46,8 @@ IdentityConverter<A,B>::from(B b) const
return static_cast<A>(b); return static_cast<A>(b);
} }
template class IdentityConverter<double, framepos_t>; template class IdentityConverter<double, Temporal::samplepos_t>;
template class TimeConverter<double, framepos_t>; template class TimeConverter<double, Temporal::samplepos_t>;
template class TimeConverter<Evoral::Beats, framepos_t>; template class TimeConverter<Temporal::Beats, Temporal::samplepos_t>;
} // namespace Evoral } // namespace Evoral

View file

@ -80,6 +80,7 @@ def build(bld):
libsmf.name = 'libsmf' libsmf.name = 'libsmf'
libsmf.target = 'smf' libsmf.target = 'smf'
libsmf.uselib = 'GLIB' libsmf.uselib = 'GLIB'
libsmf.use = [ 'libtemporal' ]
libsmf.install_path = None libsmf.install_path = None
if bld.env['build_target'] != 'mingw': if bld.env['build_target'] != 'mingw':
libsmf.cxxflags = [ '-fPIC' ] libsmf.cxxflags = [ '-fPIC' ]

View file

@ -20,7 +20,7 @@
#ifndef __midipp_mmc_h_h__ #ifndef __midipp_mmc_h_h__
#define __midipp_mmc_h_h__ #define __midipp_mmc_h_h__
#include "timecode/time.h" #include "temporal/time.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "pbd/ringbuffer.h" #include "pbd/ringbuffer.h"

View file

@ -97,7 +97,7 @@ Patch::get_state (void)
node->set_property("Name", _name); node->set_property("Name", _name);
/* /*
typedef std::list< boost::shared_ptr< Evoral::Event<Evoral::Beats> > > PatchMidiCommands; typedef std::list< boost::shared_ptr< Evoral::Event<Temporal::Beats> > > PatchMidiCommands;
XMLNode* commands = node->add_child("PatchMIDICommands"); XMLNode* commands = node->add_child("PatchMIDICommands");
for (PatchMidiCommands::const_iterator event = _patch_midi_commands.begin(); for (PatchMidiCommands::const_iterator event = _patch_midi_commands.begin();
event != _patch_midi_commands.end(); event != _patch_midi_commands.end();

View file

@ -21,8 +21,8 @@
#include <fcntl.h> #include <fcntl.h>
#include <map> #include <map>
#include "timecode/time.h" #include "temporal/time.h"
#include "timecode/bbt_time.h" #include "temporal/bbt_time.h"
#include "pbd/error.h" #include "pbd/error.h"

View file

@ -70,7 +70,7 @@ def build(bld):
obj.name = 'libmidipp' obj.name = 'libmidipp'
obj.target = 'midipp' obj.target = 'midipp'
obj.uselib = 'GLIBMM SIGCPP XML OSX' obj.uselib = 'GLIBMM SIGCPP XML OSX'
obj.use = 'libpbd libevoral libtimecode' obj.use = 'libpbd libevoral libtemporal'
obj.vnum = LIBMIDIPP_LIB_VERSION obj.vnum = LIBMIDIPP_LIB_VERSION
obj.install_path = bld.env['LIBDIR'] obj.install_path = bld.env['LIBDIR']

View file

@ -29,7 +29,7 @@
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour/presentation_info.h" #include "ardour/presentation_info.h"
#include "timecode/time.h" #include "temporal/time.h"
#include "control_protocol/visibility.h" #include "control_protocol/visibility.h"

Some files were not shown because too many files have changed in this diff Show more