diff options
118 files changed, 1012 insertions, 1000 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 608e50466e..d770260907 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1457,7 +1457,7 @@ ARDOUR_UI::transport_goto_wallclock () time_t now; struct tm tmnow; - nframes64_t frames; + framepos_t frames; time (&now); localtime_r (&now, &tmnow); diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 7e3cf19ca5..3201583e11 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -668,7 +668,7 @@ AudioClock::set_bbt (nframes_t when, bool force) } if (bbt_upper_info_label) { - nframes64_t pos; + framepos_t pos; if (bbt_reference_time < 0) { pos = when; @@ -2078,7 +2078,7 @@ AudioClock::set_size_requests () } void -AudioClock::set_bbt_reference (nframes64_t pos) +AudioClock::set_bbt_reference (framepos_t pos) { bbt_reference_time = pos; } diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h index c51c321ba4..e5f0b0111a 100644 --- a/gtk2_ardour/audio_clock.h +++ b/gtk2_ardour/audio_clock.h @@ -54,7 +54,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr void set_from_playhead (); void locate (); void set_mode (Mode); - void set_bbt_reference (nframes64_t); + void set_bbt_reference (framepos_t); void set_widget_name (std::string); @@ -162,7 +162,7 @@ class AudioClock : public Gtk::HBox, public ARDOUR::SessionHandlePtr Gtk::EventBox clock_base; Gtk::Frame clock_frame; - nframes64_t bbt_reference_time; + framepos_t bbt_reference_time; nframes_t last_when; bool last_pdelta; bool last_sdelta; diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 7f1b84c227..c3e0bd0898 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -272,7 +272,7 @@ AudioRegionView::~AudioRegionView () delete *i; } - for (list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) { + for (list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) { delete ((*i).second); } @@ -411,7 +411,7 @@ AudioRegionView::region_resized (const PropertyChange& what_changed) /* hide transient lines that extend beyond the region end */ - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { if ((*l).first > _region->length()- 1){ @@ -447,7 +447,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width) AnalysisFeatureList analysis_features = _region->transients(); AnalysisFeatureList::const_iterator i; - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) { (*l).second->property_x1() = trackview.editor().frame_to_pixel (*i); @@ -529,7 +529,7 @@ AudioRegionView::set_height (gdouble height) reset_fade_shapes (); /* Update hights for any active feature lines */ - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { (*l).second->property_y2() = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1; @@ -1433,7 +1433,7 @@ AudioRegionView::show_region_editor () void -AudioRegionView::show_fade_line (nframes64_t pos) +AudioRegionView::show_fade_line (framepos_t pos) { fade_position_line->property_x1() = trackview.editor().frame_to_pixel (pos); fade_position_line->property_x2() = trackview.editor().frame_to_pixel (pos); @@ -1466,7 +1466,7 @@ AudioRegionView::transients_changed () } AnalysisFeatureList::const_iterator i; - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) { (*l).first = *i; @@ -1486,14 +1486,14 @@ void AudioRegionView::update_transient(float /*old_pos*/, float new_pos) { /* Find frame at old pos, calulate new frame then update region transients*/ - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { /* Simple line x1 has been updated in drag so we compare to new_pos */ if (rint(new_pos) == rint((*l).second->property_x1())) { - nframes64_t old_frame = (*l).first; - nframes64_t new_frame = trackview.editor().pixel_to_frame (new_pos); + framepos_t old_frame = (*l).first; + framepos_t new_frame = trackview.editor().pixel_to_frame (new_pos); _region->update_transient (old_frame, new_frame); @@ -1506,7 +1506,7 @@ void AudioRegionView::remove_transient(float pos) { /* Find frame at old pos, calulate new frame then update region transients*/ - list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> >::iterator l; + list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> >::iterator l; for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { /* Simple line x1 has been updated in drag so we compare to new_pos */ diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index eec6a0b2d6..8673b6901d 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -103,7 +103,7 @@ class AudioRegionView : public RegionView void reset_fade_in_shape_width (nframes_t); void reset_fade_out_shape_width (nframes_t); - void show_fade_line(nframes64_t pos); + void show_fade_line(framepos_t pos); void hide_fade_line(); void set_fade_visibility (bool); @@ -134,7 +134,7 @@ class AudioRegionView : public RegionView std::vector<ArdourCanvas::WaveView *> waves; std::vector<ArdourCanvas::WaveView *> tmp_waves; ///< see ::create_waves() - std::list<std::pair<nframes64_t, ArdourCanvas::SimpleLine*> > feature_lines; + std::list<std::pair<framepos_t, ArdourCanvas::SimpleLine*> > feature_lines; ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position ArdourCanvas::SimpleLine* zero_line; diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index e674fd4fff..d51a4fe1eb 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -55,11 +55,11 @@ using namespace PBD; using namespace Editing; using namespace Gnome; // for Canvas -static const Evoral::IdentityConverter<double, sframes_t> default_converter; +static const Evoral::IdentityConverter<double, framepos_t> default_converter; AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Group& parent, boost::shared_ptr<AutomationList> al, - const Evoral::TimeConverter<double, sframes_t>* converter) + const Evoral::TimeConverter<double, framepos_t>* converter) : trackview (tv) , _name (name) , alist (al) diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index fdace9a6e6..6fea1699cc 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -59,7 +59,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible public: AutomationLine (const std::string& name, TimeAxisView&, ArdourCanvas::Group&, boost::shared_ptr<ARDOUR::AutomationList>, - const Evoral::TimeConverter<double, ARDOUR::sframes_t>* converter = 0); + const Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter = 0); virtual ~AutomationLine (); void queue_reset (); @@ -134,7 +134,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible virtual MementoCommandBinder<ARDOUR::AutomationList>* memento_command_binder (); - const Evoral::TimeConverter<double, ARDOUR::sframes_t>& time_converter () const { + const Evoral::TimeConverter<double, ARDOUR::framepos_t>& time_converter () const { return _time_converter; } @@ -201,7 +201,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible double _last_drag_fraction; ///< last y position of the drag, as a fraction std::list<double> _always_in_view; - const Evoral::TimeConverter<double, ARDOUR::sframes_t>& _time_converter; + const Evoral::TimeConverter<double, ARDOUR::framepos_t>& _time_converter; void reset_line_coords (ControlPoint&); void add_visible_control_point (uint32_t, uint32_t, double, double, ARDOUR::AutomationList::iterator, uint32_t); diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index ca1e787f3a..1cda2051dd 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -179,7 +179,7 @@ AutomationRegionView::set_height (double h) } bool -AutomationRegionView::set_position (nframes64_t pos, void* src, double* ignored) +AutomationRegionView::set_position (framepos_t pos, void* src, double* ignored) { if (_line) { _line->set_maximum_time (_region->length ()); diff --git a/gtk2_ardour/automation_region_view.h b/gtk2_ardour/automation_region_view.h index 9654d6afa1..04dd308def 100644 --- a/gtk2_ardour/automation_region_view.h +++ b/gtk2_ardour/automation_region_view.h @@ -64,7 +64,7 @@ public: protected: void create_line(boost::shared_ptr<ARDOUR::AutomationList> list); - bool set_position(nframes64_t pos, void* src, double* ignored); + bool set_position(framepos_t pos, void* src, double* ignored); void region_resized (const PBD::PropertyChange&); bool canvas_event(GdkEvent* ev); void add_automation_event (GdkEvent* event, nframes_t when, double y); diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 760794dd1e..63c755139d 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -637,7 +637,7 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel XMLNode &before = alist->get_state(); /* convert time selection to automation list model coordinates */ - const Evoral::TimeConverter<double, ARDOUR::sframes_t>& tc = line.time_converter (); + const Evoral::TimeConverter<double, ARDOUR::framepos_t>& tc = line.time_converter (); double const start = tc.from (selection.time.front().start - tc.origin_b ()); double const end = tc.from (selection.time.front().end - tc.origin_b ()); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c134c4190c..a002d5428a 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -866,10 +866,10 @@ Editor::zoom_adjustment_changed () if (fpu < 1.0) { fpu = 1.0; - zoom_range_clock.set ((nframes64_t) floor (fpu * _canvas_width)); + zoom_range_clock.set ((framepos_t) floor (fpu * _canvas_width)); } else if (fpu > _session->current_end_frame() / _canvas_width) { fpu = _session->current_end_frame() / _canvas_width; - zoom_range_clock.set ((nframes64_t) floor (fpu * _canvas_width)); + zoom_range_clock.set ((framepos_t) floor (fpu * _canvas_width)); } temporal_zoom (fpu); @@ -889,7 +889,7 @@ Editor::control_scroll (float fraction) /* _control_scroll_target is an optional<T> - it acts like a pointer to an nframes64_t, with + it acts like a pointer to an framepos_t, with a operator conversion to boolean to check that it has a value could possibly use playhead_cursor->current_frame to store the @@ -902,12 +902,12 @@ Editor::control_scroll (float fraction) _dragging_playhead = true; } - if ((fraction < 0.0f) && (*_control_scroll_target < (nframes64_t) fabs(step))) { + if ((fraction < 0.0f) && (*_control_scroll_target < (framepos_t) fabs(step))) { *_control_scroll_target = 0; } else if ((fraction > 0.0f) && (max_framepos - *_control_scroll_target < step)) { *_control_scroll_target = max_framepos - (current_page_frames()*2); // allow room for slop in where the PH is on the screen } else { - *_control_scroll_target += (nframes64_t) floor (step); + *_control_scroll_target += (framepos_t) floor (step); } /* move visuals, we'll catch up with it later */ @@ -938,7 +938,7 @@ Editor::control_scroll (float fraction) } bool -Editor::deferred_control_scroll (nframes64_t /*target*/) +Editor::deferred_control_scroll (framepos_t /*target*/) { _session->request_locate (*_control_scroll_target, _session->transport_rolling()); // reset for next stream @@ -972,7 +972,7 @@ Editor::on_realize () } void -Editor::map_position_change (nframes64_t frame) +Editor::map_position_change (framepos_t frame) { ENSURE_GUI_THREAD (*this, &Editor::map_position_change, frame) @@ -988,7 +988,7 @@ Editor::map_position_change (nframes64_t frame) } void -Editor::center_screen (nframes64_t frame) +Editor::center_screen (framepos_t frame) { double page = _canvas_width * frames_per_unit; @@ -1001,12 +1001,12 @@ Editor::center_screen (nframes64_t frame) } void -Editor::center_screen_internal (nframes64_t frame, float page) +Editor::center_screen_internal (framepos_t frame, float page) { page /= 2; if (frame > page) { - frame -= (nframes64_t) page; + frame -= (framepos_t) page; } else { frame = 0; } @@ -1356,10 +1356,10 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i } void -Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, bool with_selection, nframes64_t frame) +Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, bool with_selection, framepos_t frame) { using namespace Menu_Helpers; - Menu* (Editor::*build_menu_function)(nframes64_t); + Menu* (Editor::*build_menu_function)(framepos_t); Menu *menu; switch (item_type) { @@ -1476,7 +1476,7 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, } Menu* -Editor::build_track_context_menu (nframes64_t) +Editor::build_track_context_menu (framepos_t) { using namespace Menu_Helpers; @@ -1488,7 +1488,7 @@ Editor::build_track_context_menu (nframes64_t) } Menu* -Editor::build_track_bus_context_menu (nframes64_t) +Editor::build_track_bus_context_menu (framepos_t) { using namespace Menu_Helpers; @@ -1500,7 +1500,7 @@ Editor::build_track_bus_context_menu (nframes64_t) } Menu* -Editor::build_track_region_context_menu (nframes64_t frame) +Editor::build_track_region_context_menu (framepos_t frame) { using namespace Menu_Helpers; MenuList& edit_items = track_region_context_menu.items(); @@ -1551,7 +1551,7 @@ Editor::build_track_region_context_menu (nframes64_t frame) } Menu* -Editor::build_track_crossfade_context_menu (nframes64_t frame) +Editor::build_track_crossfade_context_menu (framepos_t frame) { using namespace Menu_Helpers; MenuList& edit_items = track_crossfade_context_menu.items(); @@ -1641,7 +1641,7 @@ Editor::analyze_range_selection() } Menu* -Editor::build_track_selection_context_menu (nframes64_t) +Editor::build_track_selection_context_menu (framepos_t) { using namespace Menu_Helpers; MenuList& edit_items = track_selection_context_menu.items(); @@ -2327,7 +2327,7 @@ Editor::set_edit_point_preference (EditPoint ep, bool force) Glib::RefPtr<RadioAction>::cast_dynamic(act)->set_active (true); } - nframes64_t foo; + framepos_t foo; bool in_track_canvas; if (!mouse_frame (foo, in_track_canvas)) { @@ -2407,7 +2407,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) move (x, y); if (_session && (prop = node.property ("playhead"))) { - nframes64_t pos; + framepos_t pos; sscanf (prop->value().c_str(), "%" PRIi64, &pos); playhead_cursor->set_position (pos); } else { @@ -2444,7 +2444,7 @@ Editor::set_state (const XMLNode& node, int /*version*/) } if ((prop = node.property ("left-frame")) != 0){ - nframes64_t pos; + framepos_t pos; if (sscanf (prop->value().c_str(), "%" PRId64, &pos) == 1) { reset_x_origin (pos); } @@ -2677,7 +2677,7 @@ Editor::trackview_by_y_position (double y) * @param event Event to get current key modifier information from, or 0. */ void -Editor::snap_to_with_modifier (nframes64_t& start, GdkEvent const * event, int32_t direction, bool for_mark) +Editor::snap_to_with_modifier (framepos_t& start, GdkEvent const * event, int32_t direction, bool for_mark) { if (!_session || !event) { return; @@ -2695,7 +2695,7 @@ Editor::snap_to_with_modifier (nframes64_t& start, GdkEvent const * event, int32 } void -Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) +Editor::snap_to (framepos_t& start, int32_t direction, bool for_mark) { if (!_session || _snap_mode == SnapOff) { return; @@ -2705,17 +2705,17 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } void -Editor::timecode_snap_to_internal (nframes64_t& start, int32_t direction, bool /*for_mark*/) +Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /*for_mark*/) { - const nframes64_t one_timecode_second = (nframes64_t)(rint(_session->timecode_frames_per_second()) * _session->frames_per_timecode_frame()); - nframes64_t one_timecode_minute = (nframes64_t)(rint(_session->timecode_frames_per_second()) * _session->frames_per_timecode_frame() * 60); + const framepos_t one_timecode_second = (framepos_t)(rint(_session->timecode_frames_per_second()) * _session->frames_per_timecode_frame()); + framepos_t one_timecode_minute = (framepos_t)(rint(_session->timecode_frames_per_second()) * _session->frames_per_timecode_frame() * 60); switch (_snap_type) { case SnapToTimecodeFrame: if (((direction == 0) && (fmod((double)start, (double)_session->frames_per_timecode_frame()) > (_session->frames_per_timecode_frame() / 2))) || (direction > 0)) { - start = (nframes64_t) (ceil ((double) start / _session->frames_per_timecode_frame()) * _session->frames_per_timecode_frame()); + start = (framepos_t) (ceil ((double) start / _session->frames_per_timecode_frame()) * _session->frames_per_timecode_frame()); } else { - start = (nframes64_t) (floor ((double) start / _session->frames_per_timecode_frame()) * _session->frames_per_timecode_frame()); + start = (framepos_t) (floor ((double) start / _session->frames_per_timecode_frame()) * _session->frames_per_timecode_frame()); } break; @@ -2727,9 +2727,9 @@ Editor::timecode_snap_to_internal (nframes64_t& start, int32_t direction, bool / start -= _session->timecode_offset (); } if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) { - start = (nframes64_t) ceil ((double) start / one_timecode_second) * one_timecode_second; + start = (framepos_t) ceil ((double) start / one_timecode_second) * one_timecode_second; } else { - start = (nframes64_t) floor ((double) start / one_timecode_second) * one_timecode_second; + start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second; } if (_session->timecode_offset_negative()) @@ -2748,9 +2748,9 @@ Editor::timecode_snap_to_internal (nframes64_t& start, int32_t direction, bool / start -= _session->timecode_offset (); } if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) { - start = (nframes64_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute; + start = (framepos_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute; } else { - start = (nframes64_t) floor ((double) start / one_timecode_minute) * one_timecode_minute; + start = (framepos_t) floor ((double) start / one_timecode_minute) * one_timecode_minute; } if (_session->timecode_offset_negative()) { @@ -2766,13 +2766,13 @@ Editor::timecode_snap_to_internal (nframes64_t& start, int32_t direction, bool / } void -Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) +Editor::snap_to_internal (framepos_t& start, int32_t direction, bool for_mark) { - const nframes64_t one_second = _session->frame_rate(); - const nframes64_t one_minute = _session->frame_rate() * 60; - nframes64_t presnap = start; - nframes64_t before; - nframes64_t after; + const framepos_t one_second = _session->frame_rate(); + const framepos_t one_minute = _session->frame_rate() * 60; + framepos_t presnap = start; + framepos_t before; + framepos_t after; switch (_snap_type) { case SnapToTimecodeFrame: @@ -2782,25 +2782,25 @@ Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) case SnapToCDFrame: if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) { - start = (nframes64_t) ceil ((double) start / (one_second / 75)) * (one_second / 75); + start = (framepos_t) ceil ((double) start / (one_second / 75)) * (one_second / 75); } else { - start = (nframes64_t) floor ((double) start / (one_second / 75)) * (one_second / 75); + start = (framepos_t) floor ((double) start / (one_second / 75)) * (one_second / 75); } break; case SnapToSeconds: if (((direction == 0) && (start % one_second > one_second / 2)) || (direction > 0)) { - start = (nframes64_t) ceil ((double) start / one_second) * one_second; + start = (framepos_t) ceil ((double) start / one_second) * one_second; } else { - start = (nframes64_t) floor ((double) start / one_second) * one_second; + start = (framepos_t) floor ((double) start / one_second) * one_second; } break; case SnapToMinutes: if (((direction == 0) && (start % one_minute > one_minute / 2)) || (direction > 0)) { - start = (nframes64_t) ceil ((double) start / one_minute) * one_minute; + start = (framepos_t) ceil ((double) start / one_minute) * one_minute; } else { - start = (nframes64_t) floor ((double) start / one_minute) * one_minute; + start = (framepos_t) floor ((double) start / one_minute) * one_minute; } break; @@ -2886,8 +2886,8 @@ Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) case SnapToRegionBoundary: if (!region_boundary_cache.empty()) { - vector<nframes64_t>::iterator prev = region_boundary_cache.end (); - vector<nframes64_t>::iterator next = region_boundary_cache.end (); + vector<framepos_t>::iterator prev = region_boundary_cache.end (); + vector<framepos_t>::iterator next = region_boundary_cache.end (); if (direction > 0) { next = std::upper_bound (region_boundary_cache.begin(), region_boundary_cache.end(), start); @@ -2900,8 +2900,8 @@ Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) prev--; } - nframes64_t const p = (prev == region_boundary_cache.end()) ? region_boundary_cache.front () : *prev; - nframes64_t const n = (next == region_boundary_cache.end()) ? region_boundary_cache.back () : *next; + framepos_t const p = (prev == region_boundary_cache.end()) ? region_boundary_cache.front () : *prev; + framepos_t const n = (next == region_boundary_cache.end()) ? region_boundary_cache.back () : *next; if (start > (p + n) / 2) { start = n; @@ -4012,7 +4012,7 @@ Editor::playlist_selector () const } Evoral::MusicalTime -Editor::get_grid_type_as_beats (bool& success, nframes64_t position) +Editor::get_grid_type_as_beats (bool& success, framepos_t position) { success = true; @@ -4091,10 +4091,10 @@ Editor::get_grid_type_as_beats (bool& success, nframes64_t position) return 0.0; } -nframes64_t -Editor::get_nudge_distance (nframes64_t pos, nframes64_t& next) +framecnt_t +Editor::get_nudge_distance (framepos_t pos, framecnt_t& next) { - nframes64_t ret; + framecnt_t ret; ret = nudge_clock.current_duration (pos); next = ret + 1; /* XXXX fix me */ @@ -4139,7 +4139,7 @@ Editor::playlist_deletion_dialog (boost::shared_ptr<Playlist> pl) } bool -Editor::audio_region_selection_covers (nframes64_t where) +Editor::audio_region_selection_covers (framepos_t where) { for (RegionSelection::iterator a = selection->regions.begin(); a != selection->regions.end(); ++a) { if ((*a)->region()->covers (where)) { @@ -4370,7 +4370,7 @@ Editor::on_key_release_event (GdkEventKey* ev) * @param frame New x origin. */ void -Editor::reset_x_origin (nframes64_t frame) +Editor::reset_x_origin (framepos_t frame) { queue_visual_change (frame); } @@ -4388,7 +4388,7 @@ Editor::reset_zoom (double fpu) } void -Editor::reposition_and_zoom (nframes64_t frame, double fpu) +Editor::reposition_and_zoom (framepos_t frame, double fpu) { reset_x_origin (frame); reset_zoom (fpu); @@ -4522,7 +4522,7 @@ Editor::post_zoom () { // convert fpu to frame count - nframes64_t frames = (nframes64_t) floor (frames_per_unit * _canvas_width); + framepos_t frames = (framepos_t) floor (frames_per_unit * _canvas_width); if (frames_per_unit != zoom_range_clock.current_duration()) { zoom_range_clock.set (frames); @@ -4549,7 +4549,7 @@ Editor::post_zoom () } void -Editor::queue_visual_change (nframes64_t where) +Editor::queue_visual_change (framepos_t where) { pending_visual_change.add (VisualChange::TimeOrigin); pending_visual_change.time_origin = where; @@ -4641,11 +4641,11 @@ Editor::sort_track_selection (TrackViewList* sel) } } -nframes64_t +framepos_t Editor::get_preferred_edit_position (bool ignore_playhead) { bool ignored; - nframes64_t where = 0; + framepos_t where = 0; EditPoint ep = _edit_point; if (entered_marker) { @@ -4690,7 +4690,7 @@ Editor::get_preferred_edit_position (bool ignore_playhead) } void -Editor::set_loop_range (nframes64_t start, nframes64_t end, string cmd) +Editor::set_loop_range (framepos_t start, framepos_t end, string cmd) { if (!_session) return; @@ -4717,7 +4717,7 @@ Editor::set_loop_range (nframes64_t start, nframes64_t end, string cmd) } void -Editor::set_punch_range (nframes64_t start, nframes64_t end, string cmd) +Editor::set_punch_range (framepos_t start, framepos_t end, string cmd) { if (!_session) return; @@ -4750,7 +4750,7 @@ Editor::set_punch_range (nframes64_t start, nframes64_t end, string cmd) * @param ts Tracks to look on; if this is empty, all tracks are examined. */ void -Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackViewList& ts) const +Editor::get_regions_at (RegionSelection& rs, framepos_t where, const TrackViewList& ts) const { const TrackViewList* tracks; @@ -4769,7 +4769,7 @@ Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackViewL if ((tr = rtv->track()) && ((pl = tr->playlist()))) { Playlist::RegionList* regions = pl->regions_at ( - (nframes64_t) floor ( (double)where * tr->speed())); + (framepos_t) floor ( (double)where * tr->speed())); for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) { RegionView* rv = rtv->view()->find_view (*i); @@ -4785,7 +4785,7 @@ Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackViewL } void -Editor::get_regions_after (RegionSelection& rs, nframes64_t where, const TrackViewList& ts) const +Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackViewList& ts) const { const TrackViewList* tracks; @@ -4858,7 +4858,7 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered, bool al if (!tracks.empty()) { /* now find regions that are at the edit position on those tracks */ - nframes64_t const where = get_preferred_edit_position (); + framepos_t const where = get_preferred_edit_position (); get_regions_at (rs, where, tracks); } } @@ -5368,7 +5368,7 @@ Editor::horizontal_scroll_right_release () void Editor::reset_x_origin_to_follow_playhead () { - nframes64_t const frame = playhead_cursor->current_frame; + framepos_t const frame = playhead_cursor->current_frame; if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) { @@ -5384,7 +5384,7 @@ Editor::reset_x_origin_to_follow_playhead () if (frame < leftmost_frame) { /* moving left */ - nframes64_t l = 0; + framepos_t l = 0; if (_session->transport_rolling()) { /* rolling; end up with the playhead at the right of the page */ l = frame - current_page_frames (); @@ -5438,7 +5438,7 @@ Editor::super_rapid_screen_update () /* PLAYHEAD AND VIEWPORT */ - nframes64_t const frame = _session->audible_frame(); + framepos_t const frame = _session->audible_frame(); /* There are a few reasons why we might not update the playhead / viewport stuff: * diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 1c5a38bbb4..390b94664b 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -142,17 +142,17 @@ struct EditorCursor { Editor& editor; ArdourCanvas::Points points; ArdourCanvas::Line canvas_item; - nframes64_t current_frame; + framepos_t current_frame; double length; EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); ~EditorCursor (); - void set_position (nframes64_t); + void set_position (framepos_t); void set_length (double units); void set_y_axis (double position); - PBD::Signal1<void, nframes64_t> PositionChanged; + PBD::Signal1<void, framepos_t> PositionChanged; }; class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr @@ -167,10 +167,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void first_idle (); virtual bool have_idled () const { return _have_idled; } - nframes64_t leftmost_position() const { return leftmost_frame; } + framepos_t leftmost_position() const { return leftmost_frame; } - nframes64_t current_page_frames() const { - return (nframes64_t) floor (_canvas_width * frames_per_unit); + framecnt_t current_page_frames() const { + return (framecnt_t) floor (_canvas_width * frames_per_unit); } double canvas_height () const { @@ -236,11 +236,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* undo related */ - nframes64_t unit_to_frame (double unit) const { - return (nframes64_t) rint (unit * frames_per_unit); + framepos_t unit_to_frame (double unit) const { + return (framepos_t) rint (unit * frames_per_unit); } - double frame_to_unit (nframes64_t frame) const { + double frame_to_unit (framepos_t frame) const { return rint ((double) frame / (double) frames_per_unit); } @@ -255,7 +255,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD xscroll_adjustment. */ - nframes64_t pixel_to_frame (double pixel) const { + framepos_t pixel_to_frame (double pixel) const { /* pixel can be less than zero when motion events are processed. since we've already run the world->canvas @@ -264,13 +264,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ if (pixel >= 0) { - return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit); + return (framepos_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit); } else { return 0; } } - gulong frame_to_pixel (nframes64_t frame) const { + gulong frame_to_pixel (framepos_t frame) const { return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit))); } @@ -340,8 +340,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* nudge is initiated by transport controls owned by ARDOUR_UI */ - nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next); - Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position); + framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next); + Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position); void nudge_forward (bool next, bool force_playhead); void nudge_backward (bool next, bool force_playhead); @@ -394,13 +394,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maximise_editing_space(); void restore_editing_space(); - void reset_x_origin (nframes64_t); + void reset_x_origin (framepos_t); void reset_x_origin_to_follow_playhead (); void reset_y_origin (double); void reset_zoom (double); - void reposition_and_zoom (nframes64_t, double); + void reposition_and_zoom (framepos_t, double); - nframes64_t get_preferred_edit_position (bool ignore_playhead = false); + framepos_t get_preferred_edit_position (bool ignore_playhead = false); bool update_mouse_speed (); bool decelerate_mouse_speed (); @@ -422,23 +422,23 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>); - void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&); - void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&); + void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t&); + void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, framepos_t&); void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions); void show_verbose_canvas_cursor_with (const std::string& txt); void hide_verbose_canvas_cursor(); - void center_screen (nframes64_t); + void center_screen (framepos_t); TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const; Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; } Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; } - void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false); - void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false); - void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false); + void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false); + void snap_to_with_modifier (framepos_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false); + void snap_to (framepos_t& first, framepos_t& last, int32_t direction = 0, bool for_mark = false); void begin_reversible_command (std::string cmd_name); void commit_reversible_command (); @@ -476,7 +476,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD protected: void map_transport_state (); - void map_position_change (nframes64_t); + void map_position_change (framepos_t); void on_realize(); @@ -487,7 +487,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool constructed; // to keep track of the playhead position for control_scroll - boost::optional<nframes64_t> _control_scroll_target; + boost::optional<framepos_t> _control_scroll_target; PlaylistSelector* _playlist_selector; @@ -496,7 +496,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD struct VisualState { double y_position; double frames_per_unit; - nframes64_t leftmost_frame; + framepos_t leftmost_frame; Editing::ZoomFocus zoom_focus; std::list<TAVState> track_states; }; @@ -516,7 +516,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cancel_visual_state_op (uint32_t n); bool end_visual_state_op (uint32_t n); - nframes64_t leftmost_frame; + framepos_t leftmost_frame; double frames_per_unit; Editing::ZoomFocus zoom_focus; @@ -588,7 +588,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void hide(); void show (); void set_name (const std::string&); - void set_position (nframes64_t start, nframes64_t end = 0); + void set_position (framepos_t start, framepos_t end = 0); void set_color_rgba (uint32_t); }; @@ -601,7 +601,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); - void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false); + void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false); bool choose_new_marker_name(std::string &name); void update_cd_marker_display (); void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location); @@ -663,12 +663,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Menu * track_edit_playlist_submenu; Gtk::Menu * track_selection_edit_playlist_submenu; - void popup_track_context_menu (int, int, ItemType, bool, nframes64_t); - Gtk::Menu* build_track_context_menu (nframes64_t); - Gtk::Menu* build_track_bus_context_menu (nframes64_t); - Gtk::Menu* build_track_region_context_menu (nframes64_t frame); - Gtk::Menu* build_track_crossfade_context_menu (nframes64_t); - Gtk::Menu* build_track_selection_context_menu (nframes64_t); + void popup_track_context_menu (int, int, ItemType, bool, framepos_t); + Gtk::Menu* build_track_context_menu (framepos_t); + Gtk::Menu* build_track_bus_context_menu (framepos_t); + Gtk::Menu* build_track_region_context_menu (framepos_t frame); + Gtk::Menu* build_track_crossfade_context_menu (framepos_t); + Gtk::Menu* build_track_selection_context_menu (framepos_t); void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&); void add_bus_context_items (Gtk::Menu_Helpers::MenuList&); void add_region_context_items (StreamView*, std::list<boost::shared_ptr<ARDOUR::Region> >, Gtk::Menu_Helpers::MenuList&, @@ -784,7 +784,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers void update_fixed_rulers (); void update_tempo_based_rulers (); - void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem); + void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem); void update_ruler_visibility (); void set_ruler_visible (RulerType, bool); void toggle_ruler_visibility (RulerType rt); @@ -845,7 +845,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD gint bbt_nmarks; uint32_t bbt_bar_helper_on; uint32_t bbt_accent_modulo; - void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper); + void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper); gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint); gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint); @@ -895,7 +895,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD EditorCursor* playhead_cursor; ArdourCanvas::Group* cursor_group; - nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen); + framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen); void cursor_to_region_boundary (bool with_selection, int32_t dir); void cursor_to_next_region_boundary (bool with_selection); @@ -963,7 +963,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void control_scroll (float); void access_action (std::string,std::string); - bool deferred_control_scroll (nframes64_t); + bool deferred_control_scroll (framepos_t); sigc::connection control_scroll_connection; gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;} @@ -984,7 +984,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD }; Type pending; - nframes64_t time_origin; + framepos_t time_origin; double frames_per_unit; double y_origin; @@ -1002,7 +1002,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD static int _idle_visual_changer (void *arg); int idle_visual_changer (); - void queue_visual_change (nframes64_t); + void queue_visual_change (framepos_t); void queue_visual_change (double); void queue_visual_change_y (double); void ensure_visual_change_idle_handler (); @@ -1017,15 +1017,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD static void build_cursors (); sigc::connection super_rapid_screen_update_connection; - nframes64_t last_update_frame; - void center_screen_internal (nframes64_t, float); + framepos_t last_update_frame; + void center_screen_internal (framepos_t, float); void super_rapid_screen_update (); void session_going_away (); - nframes64_t cut_buffer_start; - nframes64_t cut_buffer_length; + framepos_t cut_buffer_start; + framecnt_t cut_buffer_length; bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType); bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); @@ -1040,7 +1040,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void register_actions (); - int ensure_cursor (nframes64_t* pos); + int ensure_cursor (framepos_t* pos); void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; @@ -1050,7 +1050,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cut_copy_midi (Editing::CutCopyOp); void mouse_paste (); - void paste_internal (nframes64_t position, float times); + void paste_internal (framepos_t position, float times); /* EDITING OPERATIONS */ @@ -1065,18 +1065,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void change_region_layering_order (ARDOUR::framepos_t); void lower_region (); void lower_region_to_bottom (); - void split_regions_at (nframes64_t, RegionSelection&); + void split_regions_at (framepos_t, RegionSelection&); void split_region_at_transients (); void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret); void crop_region_to_selection (); - void crop_region_to (nframes64_t start, nframes64_t end); - void set_sync_point (nframes64_t, const RegionSelection&); + void crop_region_to (framepos_t start, framepos_t end); + void set_sync_point (framepos_t, const RegionSelection&); void set_region_sync_from_edit_point (); void remove_region_sync(); - void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&); - void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&); - void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position); - void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position); + void align_selection (ARDOUR::RegionPoint, framepos_t position, const RegionSelection&); + void align_selection_relative (ARDOUR::RegionPoint point, framepos_t position, const RegionSelection&); + void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position); + void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position); void remove_selected_regions (); void remove_clicked_region (); void edit_region (); @@ -1100,14 +1100,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void fork_region (); void do_insert_time (); - void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool); + void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool); void tab_to_transient (bool forward); void use_region_as_bar (); void use_range_as_bar (); - void define_one_bar (nframes64_t start, nframes64_t end); + void define_one_bar (framepos_t start, framepos_t end); void audition_region_from_region_list (); void hide_region_from_region_list (); @@ -1152,8 +1152,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void zoom_to_region (bool both_axes); void temporal_zoom_session (); void temporal_zoom (gdouble scale); - void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op); - void temporal_zoom_to_frame (bool coarser, nframes64_t frame); + void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op); + void temporal_zoom_to_frame (bool coarser, framepos_t frame); void amplitude_zoom (gdouble scale); void amplitude_zoom_step (bool in); @@ -1174,19 +1174,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD SoundFileOmega* sfbrowser; - void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos); + void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos); - bool idle_drop_paths (std::vector<std::string> paths, nframes64_t frame, double ypos); - void drop_paths_part_two (const std::vector<std::string>& paths, nframes64_t frame, double ypos); + bool idle_drop_paths (std::vector<std::string> paths, framepos_t frame, double ypos); + void drop_paths_part_two (const std::vector<std::string>& paths, framepos_t frame, double ypos); - int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos, + int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool); int embed_sndfiles (std::vector<std::string> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, - nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&); + framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&); - int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode, + int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, framepos_t& pos, Editing::ImportMode, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix); - int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode, + int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode, boost::shared_ptr<ARDOUR::Track>& existing_track); boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const; @@ -1200,7 +1200,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD struct EditorImportStatus : public ARDOUR::ImportStatus { Editing::ImportMode mode; - nframes64_t pos; + framepos_t pos; int target_tracks; int target_regions; boost::shared_ptr<ARDOUR::Track> track; @@ -1257,7 +1257,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_selection_from_loop (); void set_selection_from_region (); - void add_location_mark (nframes64_t where); + void add_location_mark (framepos_t where); void add_location_from_audio_region (); void add_locations_from_audio_region (); void add_location_from_selection (); @@ -1269,8 +1269,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_loop_from_region (bool play); void set_punch_from_edit_range (); - void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd); - void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd); + void set_loop_range (framepos_t start, framepos_t end, std::string cmd); + void set_punch_range (framepos_t start, framepos_t end, std::string cmd); void add_location_from_playhead_cursor (); bool select_new_marker; @@ -1282,12 +1282,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int scrubbing_direction; int scrub_reversals; int scrub_reverse_distance; - void scrub (nframes64_t, double); + void scrub (framepos_t, double); void keyboard_selection_begin (); void keyboard_selection_finish (bool add); bool have_pending_keyboard_selection; - nframes64_t pending_keyboard_selection_start; + framepos_t pending_keyboard_selection_start; boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv); void extend_selection_to_end_of_region (bool next); @@ -1337,11 +1337,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*); void remove_control_point (ArdourCanvas::Item*, GdkEvent*); - void mouse_brush_insert_region (RegionView*, nframes64_t pos); - void brush (nframes64_t); + void mouse_brush_insert_region (RegionView*, framepos_t pos); + void brush (framepos_t); - void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1); - void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1); + void show_verbose_time_cursor (framepos_t frame, double offset = 0, double xpos=-1, double ypos=-1); + void show_verbose_duration_cursor (framepos_t start, framepos_t end, double offset = 0, double xpos=-1, double ypos=-1); double clamp_verbose_cursor_x (double); double clamp_verbose_cursor_y (double); @@ -1439,8 +1439,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void new_tempo_section (); - void mouse_add_new_tempo_event (nframes64_t where); - void mouse_add_new_meter_event (nframes64_t where); + void mouse_add_new_tempo_event (framepos_t where); + void mouse_add_new_meter_event (framepos_t where); void remove_tempo_marker (ArdourCanvas::Item*); void remove_meter_marker (ArdourCanvas::Item*); @@ -1623,7 +1623,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*); void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool); - bool audio_region_selection_covers (nframes64_t where); + bool audio_region_selection_covers (framepos_t where); /* transport range select process */ @@ -1651,14 +1651,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* object rubberband select process */ - bool select_all_within (nframes64_t, nframes64_t, double, double, TrackViewList const &, Selection::Operation, bool); + bool select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool); ArdourCanvas::SimpleRect *rubberband_rect; /* mouse zoom process */ ArdourCanvas::SimpleRect *zoom_rect; - void reposition_zoom_rect (nframes64_t start, nframes64_t end); + void reposition_zoom_rect (framepos_t start, framepos_t end); EditorRouteGroups* _route_groups; EditorRoutes* _routes; @@ -1685,7 +1685,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int last_autoscroll_x; int last_autoscroll_y; uint32_t autoscroll_cnt; - nframes64_t autoscroll_x_distance; + framecnt_t autoscroll_x_distance; double autoscroll_y_distance; static gint _autoscroll_canvas (void *); @@ -1694,10 +1694,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void stop_canvas_autoscroll (); /* trimming */ - void point_trim (GdkEvent *, nframes64_t); - void single_contents_trim (RegionView&, nframes64_t, bool, bool); - void single_start_trim (RegionView&, nframes64_t, bool); - void single_end_trim (RegionView&, nframes64_t, bool); + void point_trim (GdkEvent *, framepos_t); + void single_contents_trim (RegionView&, framepos_t, bool, bool); + void single_start_trim (RegionView&, framepos_t, bool); + void single_end_trim (RegionView&, framepos_t, bool); void thaw_region_after_trim (RegionView& rv); @@ -1808,11 +1808,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void duplicate_dialog (bool with_dialog); - nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const; + framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const; /* returns false if mouse pointer is not in track or marker canvas */ - bool mouse_frame (nframes64_t&, bool& in_track_canvas) const; + bool mouse_frame (framepos_t&, bool& in_track_canvas) const; /* "whats mine is yours" */ @@ -1975,10 +1975,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void selected_marker_moved (ARDOUR::Location*); - bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const; + bool get_edit_op_range (framepos_t& start, framepos_t& end) const; - void get_regions_at (RegionSelection&, nframes64_t where, const TrackViewList& ts) const; - void get_regions_after (RegionSelection&, nframes64_t where, const TrackViewList& ts) const; + void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const; + void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const; void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true); @@ -1989,8 +1989,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void select_next_route (); void select_prev_route (); - void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); - void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); + void snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false); + void timecode_snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false); RhythmFerret* rhythm_ferret; BundleManager* _bundle_manager; diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index db470fbe64..d3a2dd6608 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -156,7 +156,7 @@ Editor::external_audio_dialog () ImportPosition pos = sfbrowser->get_position (); ImportMode mode = sfbrowser->get_mode (); ImportDisposition chns = sfbrowser->get_channel_disposition (); - nframes64_t where; + framepos_t where; switch (pos) { case ImportAtEditPoint: @@ -325,7 +325,7 @@ Editor::get_nth_selected_midi_track (int nth) const } void -Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos) +Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, framepos_t& pos) { boost::shared_ptr<Track> track; vector<string> to_import; @@ -426,7 +426,7 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode } void -Editor::do_embed (vector<string> paths, ImportDisposition chns, ImportMode mode, nframes64_t& pos) +Editor::do_embed (vector<string> paths, ImportDisposition chns, ImportMode mode, framepos_t& pos) { boost::shared_ptr<Track> track; bool check_sample_rate = true; @@ -492,7 +492,7 @@ Editor::do_embed (vector<string> paths, ImportDisposition chns, ImportMode mode, } int -Editor::import_sndfiles (vector<string> paths, ImportMode mode, SrcQuality quality, nframes64_t& pos, +Editor::import_sndfiles (vector<string> paths, ImportMode mode, SrcQuality quality, framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool replace) { import_status.paths = paths; @@ -550,7 +550,7 @@ Editor::import_sndfiles (vector<string> paths, ImportMode mode, SrcQuality quali int Editor::embed_sndfiles (vector<string> paths, bool multifile, - bool& check_sample_rate, ImportMode mode, nframes64_t& pos, int target_regions, int target_tracks, + bool& check_sample_rate, ImportMode mode, framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<Track>& track) { boost::shared_ptr<AudioFileSource> source; @@ -717,7 +717,7 @@ Editor::embed_sndfiles (vector<string> paths, bool multifile, } int -Editor::add_sources (vector<string> paths, SourceList& sources, nframes64_t& pos, ImportMode mode, +Editor::add_sources (vector<string> paths, SourceList& sources, framepos_t& pos, ImportMode mode, int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool /*add_channel_suffix*/) { vector<boost::shared_ptr<Region> > regions; @@ -865,7 +865,7 @@ Editor::add_sources (vector<string> paths, SourceList& sources, nframes64_t& pos } int -Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, nframes64_t& pos, +Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos, ImportMode mode, boost::shared_ptr<Track>& existing_track) { boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 004c4a3fd2..5989cb7c92 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -57,7 +57,7 @@ using namespace Glib; using namespace Gtkmm2ext; using namespace Editing; -/* XXX this is a hack. it ought to be the maximum value of an nframes64_t */ +/* XXX this is a hack. it ought to be the maximum value of an framepos_t */ const double max_canvas_coordinate = (double) JACK_MAX_FRAMES; @@ -443,14 +443,14 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context } bool -Editor::idle_drop_paths (vector<string> paths, nframes64_t frame, double ypos) +Editor::idle_drop_paths (vector<string> paths, framepos_t frame, double ypos) { drop_paths_part_two (paths, frame, ypos); return false; } void -Editor::drop_paths_part_two (const vector<string>& paths, nframes64_t frame, double ypos) +Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos) { RouteTimeAxisView* tv; @@ -492,7 +492,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context, { vector<string> paths; GdkEvent ev; - nframes64_t frame; + framepos_t frame; double wx; double wy; double cy; @@ -538,7 +538,7 @@ Editor::drop_regions (const RefPtr<Gdk::DragContext>& /*context*/, void Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert) { - nframes64_t rightmost_frame = leftmost_frame + current_page_frames(); + framepos_t rightmost_frame = leftmost_frame + current_page_frames(); bool startit = false; double ty = _drags->current_pointer_y() - get_trackview_group_vertical_offset (); @@ -715,7 +715,7 @@ Editor::start_canvas_autoscroll (int dx, int dy) autoscroll_active = true; autoscroll_x = dx; autoscroll_y = dy; - autoscroll_x_distance = (nframes64_t) floor (current_page_frames()/50.0); + autoscroll_x_distance = (framepos_t) floor (current_page_frames()/50.0); autoscroll_y_distance = fabs (dy * 5); /* pixels */ autoscroll_cnt = 0; @@ -780,7 +780,7 @@ Editor::set_horizontal_position (double p) time_line_group->move (x_delta, 0); cursor_group->move (x_delta, 0); - leftmost_frame = (nframes64_t) floor (p * frames_per_unit); + leftmost_frame = (framepos_t) floor (p * frames_per_unit); update_fixed_rulers (); redisplay_tempo (true); diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index eb37d11282..d25492287d 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -61,7 +61,7 @@ using Gtkmm2ext::Keyboard; bool Editor::track_canvas_scroll (GdkEventScroll* ev) { - nframes64_t xdelta; + framepos_t xdelta; int direction = ev->direction; retry: @@ -1033,7 +1033,7 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & /*c*/, double px; double py; - nframes64_t const pos = event_frame (&event, &px, &py); + framepos_t const pos = event_frame (&event, &px, &py); std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py); if (tv.first == 0) { diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index 89d2fcbaa1..e2a04d939b 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -56,7 +56,7 @@ EditorCursor::~EditorCursor () } void -EditorCursor::set_position (nframes64_t frame) +EditorCursor::set_position (framepos_t frame) { PositionChanged (frame); diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc index 6aa43c8bcf..bab5d4c1e6 100644 --- a/gtk2_ardour/editor_export_audio.cc +++ b/gtk2_ardour/editor_export_audio.cc @@ -159,11 +159,11 @@ bool Editor::write_region (string path, boost::shared_ptr<AudioRegion> region) { boost::shared_ptr<AudioFileSource> fs; - const nframes64_t chunk_size = 4096; - nframes64_t to_read; + const framepos_t chunk_size = 4096; + framepos_t to_read; Sample buf[chunk_size]; gain_t gain_buffer[chunk_size]; - nframes64_t pos; + framepos_t pos; char s[PATH_MAX+1]; uint32_t cnt; vector<boost::shared_ptr<AudioFileSource> > sources; @@ -231,7 +231,7 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region) pos = region->position(); while (to_read) { - nframes64_t this_time; + framepos_t this_time; this_time = min (to_read, chunk_size); @@ -309,11 +309,11 @@ bool Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list<AudioRange>& range) { boost::shared_ptr<AudioFileSource> fs; - const nframes64_t chunk_size = 4096; - nframes64_t nframes; + const framepos_t chunk_size = 4096; + framepos_t nframes; Sample buf[chunk_size]; gain_t gain_buffer[chunk_size]; - nframes64_t pos; + framepos_t pos; char s[PATH_MAX+1]; uint32_t cnt; string path; @@ -369,7 +369,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list pos = (*i).start; while (nframes) { - nframes64_t this_time; + framepos_t this_time; this_time = min (nframes, chunk_size); @@ -401,7 +401,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list while (nframes) { - nframes64_t this_time = min (nframes, chunk_size); + framepos_t this_time = min (nframes, chunk_size); memset (buf, 0, sizeof (Sample) * this_time); for (uint32_t n=0; n < channels; ++n) { diff --git a/gtk2_ardour/editor_imageframe.cc b/gtk2_ardour/editor_imageframe.cc index bac689b48f..752e43a585 100644 --- a/gtk2_ardour/editor_imageframe.cc +++ b/gtk2_ardour/editor_imageframe.cc @@ -113,10 +113,10 @@ void Editor::scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) { // GTK2FIX - //nframes64_t offset = static_cast<nframes64_t>(frames_per_unit * (edit_hscroll_slider_width/2)) ; - nframes64_t offset = 0; + //framepos_t offset = static_cast<framepos_t>(frames_per_unit * (edit_hscroll_slider_width/2)) ; + framepos_t offset = 0; - nframes64_t x_pos = 0 ; + framepos_t x_pos = 0 ; if (item->get_position() < offset) { x_pos = 0 ; @@ -489,14 +489,14 @@ Editor::markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event) double cx, cy ; MarkerView* mv = reinterpret_cast<MarkerView*>(drag_info.data) ; - nframes64_t pending_region_position ; - nframes64_t pointer_frame ; + framepos_t pending_region_position ; + framepos_t pointer_frame ; pointer_frame = event_frame(event, &cx, &cy) ; snap_to(pointer_frame) ; - if (pointer_frame > (nframes64_t) drag_info.pointer_frame_offset) + if (pointer_frame > (framepos_t) drag_info.pointer_frame_offset) { pending_region_position = pointer_frame - drag_info.pointer_frame_offset ; snap_to(pending_region_position) ; @@ -537,14 +537,14 @@ Editor::imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event) ImageFrameView* ifv = reinterpret_cast<ImageFrameView*>(drag_info.data) ; - nframes64_t pending_region_position; - nframes64_t pointer_frame; + framepos_t pending_region_position; + framepos_t pointer_frame; pointer_frame = event_frame(event, &cx, &cy) ; snap_to(pointer_frame) ; - if (pointer_frame > (nframes64_t) drag_info.pointer_frame_offset) + if (pointer_frame > (framepos_t) drag_info.pointer_frame_offset) { pending_region_position = pointer_frame - drag_info.pointer_frame_offset ; snap_to(pending_region_position) ; @@ -572,7 +572,7 @@ Editor::imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent* event) void Editor::timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent* event) { - nframes64_t where ; + framepos_t where ; TimeAxisViewItem* tavi = reinterpret_cast<TimeAxisViewItem*>(drag_info.data) ; bool item_x_movement = (drag_info.last_frame_position != tavi->get_position()) ; @@ -670,9 +670,9 @@ Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* { ImageFrameView* ifv = reinterpret_cast<ImageFrameView*> (drag_info.data) ; - nframes64_t start = 0 ; - nframes64_t end = 0 ; - nframes64_t pointer_frame = event_frame(event) ; + framepos_t start = 0 ; + framepos_t end = 0 ; + framepos_t pointer_frame = event_frame(event) ; // chekc th eposition of the item is not locked if(!ifv->get_position_locked()) { @@ -689,7 +689,7 @@ Editor::imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* } // are we getting bigger or smaller? - nframes64_t new_dur_val = end - start ; + framepos_t new_dur_val = end - start ; // start handle, so a smaller pointer frame increases our component size if(pointer_frame <= drag_info.grab_frame) @@ -747,10 +747,10 @@ Editor::imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve } else { - nframes64_t temp = ifv->get_position() + ifv->get_duration() ; + framepos_t temp = ifv->get_position() + ifv->get_duration() ; - ifv->set_position((nframes64_t) (temp - drag_info.cumulative_x_drag), this) ; - ifv->set_duration((nframes64_t) drag_info.cumulative_x_drag, this) ; + ifv->set_position((framepos_t) (temp - drag_info.cumulative_x_drag), this) ; + ifv->set_duration((framepos_t) drag_info.cumulative_x_drag, this) ; } } @@ -759,10 +759,10 @@ Editor::imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev { ImageFrameView* ifv = reinterpret_cast<ImageFrameView *> (drag_info.data) ; - nframes64_t start = 0 ; - nframes64_t end = 0 ; - nframes64_t pointer_frame = event_frame(event) ; - nframes64_t new_dur_val = 0 ; + framepos_t start = 0 ; + framepos_t end = 0 ; + framepos_t pointer_frame = event_frame(event) ; + framepos_t new_dur_val = 0 ; snap_to(pointer_frame) ; @@ -824,7 +824,7 @@ Editor::imageframe_end_handle_end_trim (ArdourCanvas::Item* item, GdkEvent* even } else { - nframes64_t new_duration = (nframes64_t)drag_info.cumulative_x_drag ; + framepos_t new_duration = (framepos_t)drag_info.cumulative_x_drag ; if((new_duration <= ifv->get_max_duration()) && (new_duration >= ifv->get_min_duration())) { ifv->set_duration(new_duration, this) ; @@ -884,9 +884,9 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* { MarkerView* mv = reinterpret_cast<MarkerView*> (drag_info.data) ; - nframes64_t start = 0 ; - nframes64_t end = 0 ; - nframes64_t pointer_frame = event_frame(event) ; + framepos_t start = 0 ; + framepos_t end = 0 ; + framepos_t pointer_frame = event_frame(event) ; // chekc th eposition of the item is not locked if(!mv->get_position_locked()) @@ -907,7 +907,7 @@ Editor::markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* } // are we getting bigger or smaller? - nframes64_t new_dur_val = end - start ; + framepos_t new_dur_val = end - start ; if(pointer_frame <= drag_info.grab_frame) { @@ -964,10 +964,10 @@ Editor::markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* eve } else { - nframes64_t temp = mv->get_position() + mv->get_duration() ; + framepos_t temp = mv->get_position() + mv->get_duration() ; - mv->set_position((nframes64_t) (temp - drag_info.cumulative_x_drag), this) ; - mv->set_duration((nframes64_t) drag_info.cumulative_x_drag, this) ; + mv->set_position((framepos_t) (temp - drag_info.cumulative_x_drag), this) ; + mv->set_duration((framepos_t) drag_info.cumulative_x_drag, this) ; } } @@ -976,10 +976,10 @@ Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev { MarkerView* mv = reinterpret_cast<MarkerView*> (drag_info.data) ; - nframes64_t start = 0 ; - nframes64_t end = 0 ; - nframes64_t pointer_frame = event_frame(event) ; - nframes64_t new_dur_val = 0 ; + framepos_t start = 0 ; + framepos_t end = 0 ; + framepos_t pointer_frame = event_frame(event) ; + framepos_t new_dur_val = 0 ; snap_to(pointer_frame) ; @@ -1004,7 +1004,7 @@ Editor::markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* ev { // we cant extend beyond the item we are marking ImageFrameView* marked_item = mv->get_marked_item() ; - nframes64_t marked_end = marked_item->get_position() + marked_item->get_duration() ; + framepos_t marked_end = marked_item->get_position() + marked_item->get_duration() ; if(mv->get_max_duration_active() && (new_dur_val > mv->get_max_duration())) { @@ -1058,7 +1058,7 @@ Editor::markerview_end_handle_end_trim (ArdourCanvas::Item* item, GdkEvent* even } else { - nframes64_t new_duration = (nframes64_t)drag_info.cumulative_x_drag ; + framepos_t new_duration = (framepos_t)drag_info.cumulative_x_drag ; mv->set_duration(new_duration, this) ; } } diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc index 0d46665782..2ef22c8273 100644 --- a/gtk2_ardour/editor_keys.cc +++ b/gtk2_ardour/editor_keys.cc @@ -43,7 +43,7 @@ Editor::keyboard_selection_finish (bool add) { if (_session && have_pending_keyboard_selection) { - nframes64_t end; + framepos_t end; bool ignored; if (_session->transport_rolling()) { @@ -73,7 +73,7 @@ Editor::keyboard_selection_begin () have_pending_keyboard_selection = true; } else { bool ignored; - nframes64_t where; // XXX fix me + framepos_t where; // XXX fix me if (mouse_frame (where, ignored)) { pending_keyboard_selection_start = where; diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 8e486aa6cc..053080fb49 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -381,8 +381,8 @@ Editor::LocationMarkers::set_name (const string& str) } void -Editor::LocationMarkers::set_position (nframes64_t startf, - nframes64_t endf) +Editor::LocationMarkers::set_position (framepos_t startf, + framepos_t endf) { start->set_position (startf); if (end) { end->set_position (endf); } @@ -396,7 +396,7 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba) } void -Editor::mouse_add_new_marker (nframes64_t where, bool is_cd, bool is_xrun) +Editor::mouse_add_new_marker (framepos_t where, bool is_cd, bool is_xrun) { string markername, markerprefix; int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark); @@ -866,8 +866,8 @@ Editor::marker_menu_range_to_next () return; } - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; _session->locations()->marks_either_side (marker->position(), start, end); if (end != max_framepos) { diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 11c510716a..51064f87cc 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -84,7 +84,7 @@ using namespace Editing; using Gtkmm2ext::Keyboard; bool -Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const +Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const { int x, y; double wx, wy; @@ -117,7 +117,7 @@ Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const return true; } -nframes64_t +framepos_t Editor::event_frame (GdkEvent const * event, double* pcx, double* pcy) const { double cx, cy; @@ -1832,7 +1832,7 @@ Editor::left_automation_track () } void -Editor::scrub (nframes64_t frame, double current_x) +Editor::scrub (framepos_t frame, double current_x) { double delta; @@ -2065,34 +2065,34 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event) speed = rtv->track()->speed(); } - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); if (where >= 0) { if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) { - align_region (rv.region(), SyncPoint, (nframes64_t) (where * speed)); + align_region (rv.region(), SyncPoint, (framepos_t) (where * speed)); } else if (Keyboard::modifier_state_equals (event->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { - align_region (rv.region(), End, (nframes64_t) (where * speed)); + align_region (rv.region(), End, (framepos_t) (where * speed)); } else { - align_region (rv.region(), Start, (nframes64_t) (where * speed)); + align_region (rv.region(), Start, (framepos_t) (where * speed)); } } } } void -Editor::show_verbose_time_cursor (nframes64_t frame, double offset, double xpos, double ypos) +Editor::show_verbose_time_cursor (framepos_t frame, double offset, double xpos, double ypos) { char buf[128]; Timecode::Time timecode; BBT_Time bbt; int hours, mins; - nframes64_t frame_rate; + framepos_t frame_rate; float secs; if (_session == 0) { @@ -2143,14 +2143,14 @@ Editor::show_verbose_time_cursor (nframes64_t frame, double offset, double xpos, } void -Editor::show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset, double xpos, double ypos) +Editor::show_verbose_duration_cursor (framepos_t start, framepos_t end, double offset, double xpos, double ypos) { char buf[128]; Timecode::Time timecode; BBT_Time sbbt; BBT_Time ebbt; int hours, mins; - nframes64_t distance, frame_rate; + framepos_t distance, frame_rate; float secs; Meter meter_at_start(_session->tempo_map().meter_at(start)); @@ -2251,7 +2251,7 @@ Editor::cancel_selection () void -Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool swap_direction) +Editor::single_contents_trim (RegionView& rv, framepos_t frame_delta, bool left_direction, bool swap_direction) { boost::shared_ptr<Region> region (rv.region()); @@ -2259,7 +2259,7 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left return; } - nframes64_t new_bound; + framepos_t new_bound; double speed = 1.0; TimeAxisView* tvp = clicked_axisview; @@ -2271,24 +2271,24 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left if (left_direction) { if (swap_direction) { - new_bound = (nframes64_t) (region->position()/speed) + frame_delta; + new_bound = (framepos_t) (region->position()/speed) + frame_delta; } else { - new_bound = (nframes64_t) (region->position()/speed) - frame_delta; + new_bound = (framepos_t) (region->position()/speed) - frame_delta; } } else { if (swap_direction) { - new_bound = (nframes64_t) (region->position()/speed) - frame_delta; + new_bound = (framepos_t) (region->position()/speed) - frame_delta; } else { - new_bound = (nframes64_t) (region->position()/speed) + frame_delta; + new_bound = (framepos_t) (region->position()/speed) + frame_delta; } } - region->trim_start ((nframes64_t) (new_bound * speed), this); + region->trim_start ((framepos_t) (new_bound * speed), this); rv.region_changed (PropertyChange (ARDOUR::Properties::start)); } void -Editor::single_start_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap) +Editor::single_start_trim (RegionView& rv, framepos_t new_bound, bool no_overlap) { boost::shared_ptr<Region> region (rv.region()); @@ -2304,9 +2304,9 @@ Editor::single_start_trim (RegionView& rv, nframes64_t new_bound, bool no_overla speed = tv->track()->speed(); } - nframes64_t pre_trim_first_frame = region->first_frame(); + framepos_t pre_trim_first_frame = region->first_frame(); - region->trim_front ((nframes64_t) (new_bound * speed), this); + region->trim_front ((framepos_t) (new_bound * speed), this); if (no_overlap) { //Get the next region on the left of this region and shrink/expand it. @@ -2331,7 +2331,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t new_bound, bool no_overla } void -Editor::single_end_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap) +Editor::single_end_trim (RegionView& rv, framepos_t new_bound, bool no_overlap) { boost::shared_ptr<Region> region (rv.region()); @@ -2347,9 +2347,9 @@ Editor::single_end_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap) speed = tv->track()->speed(); } - nframes64_t pre_trim_last_frame = region->last_frame(); + framepos_t pre_trim_last_frame = region->last_frame(); - region->trim_end ((nframes64_t) (new_bound * speed), this); + region->trim_end ((framepos_t) (new_bound * speed), this); if (no_overlap) { //Get the next region on the right of this region and shrink/expand it. @@ -2378,7 +2378,7 @@ Editor::single_end_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap) void -Editor::point_trim (GdkEvent* event, nframes64_t new_bound) +Editor::point_trim (GdkEvent* event, framepos_t new_bound) { RegionView* rv = clicked_regionview; @@ -2479,7 +2479,7 @@ Editor::hide_marker (ArdourCanvas::Item* item, GdkEvent* /*event*/) void -Editor::reposition_zoom_rect (nframes64_t start, nframes64_t end) +Editor::reposition_zoom_rect (framepos_t start, framepos_t end) { double x1 = frame_to_pixel (start); double x2 = frame_to_pixel (end); @@ -2518,7 +2518,7 @@ Editor::mouse_rename_region (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/) void -Editor::mouse_brush_insert_region (RegionView* rv, nframes64_t pos) +Editor::mouse_brush_insert_region (RegionView* rv, framepos_t pos) { /* no brushing without a useful snap setting */ @@ -2554,7 +2554,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes64_t pos) playlist->clear_changes (); boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); - playlist->add_region (new_region, (nframes64_t) (pos * speed)); + playlist->add_region (new_region, (framepos_t) (pos * speed)); _session->add_command (new StatefulDiffCommand (playlist)); // playlist is frozen, so we have to update manually XXX this is disgusting diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 5d678da798..ce9aafb3fb 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -113,7 +113,7 @@ Editor::redo (uint32_t n) } void -Editor::split_regions_at (nframes64_t where, RegionSelection& regions) +Editor::split_regions_at (framepos_t where, RegionSelection& regions) { list <boost::shared_ptr<Playlist > > used_playlists; @@ -193,7 +193,7 @@ Editor::select_region_for_operation (int /*dir*/, TimeAxisView **tv) { RegionView* rv; boost::shared_ptr<Region> region; - nframes64_t start = 0; + framepos_t start = 0; if (selection->time.start () == selection->time.end_frame ()) { @@ -236,7 +236,7 @@ Editor::extend_selection_to_end_of_region (bool next) { TimeAxisView *tv; boost::shared_ptr<Region> region; - nframes64_t start; + framepos_t start; if ((region = select_region_for_operation (next ? 1 : 0, &tv)) == 0) { return; @@ -258,7 +258,7 @@ Editor::extend_selection_to_start_of_region (bool previous) { TimeAxisView *tv; boost::shared_ptr<Region> region; - nframes64_t end; + framepos_t end; if ((region = select_region_for_operation (previous ? -1 : 0, &tv)) == 0) { return; @@ -303,8 +303,8 @@ Editor::nudge_backward_release (GdkEventButton* ev) void Editor::nudge_forward (bool next, bool force_playhead) { - nframes64_t distance; - nframes64_t next_distance; + framepos_t distance; + framepos_t next_distance; RegionSelection rs; get_regions_for_action (rs); @@ -383,8 +383,8 @@ Editor::nudge_forward (bool next, bool force_playhead) void Editor::nudge_backward (bool next, bool force_playhead) { - nframes64_t distance; - nframes64_t next_distance; + framepos_t distance; + framepos_t next_distance; RegionSelection rs; get_regions_for_action (rs); @@ -476,7 +476,7 @@ Editor::nudge_backward (bool next, bool force_playhead) void Editor::nudge_forward_capture_offset () { - nframes64_t distance; + framepos_t distance; RegionSelection rs; get_regions_for_action (rs); @@ -505,7 +505,7 @@ Editor::nudge_forward_capture_offset () void Editor::nudge_backward_capture_offset () { - nframes64_t distance; + framepos_t distance; RegionSelection rs; get_regions_for_action (rs); @@ -798,8 +798,8 @@ Editor::get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, b void Editor::cursor_to_region_boundary (bool with_selection, int32_t dir) { - nframes64_t pos = playhead_cursor->current_frame; - nframes64_t target; + framepos_t pos = playhead_cursor->current_frame; + framepos_t target; if (!_session) { return; @@ -833,7 +833,7 @@ void Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t dir) { boost::shared_ptr<Region> r; - nframes64_t pos = cursor->current_frame; + framepos_t pos = cursor->current_frame; if (!_session) { return; @@ -912,7 +912,7 @@ Editor::cursor_to_previous_region_point (EditorCursor* cursor, RegionPoint point void Editor::cursor_to_selection_start (EditorCursor *cursor) { - nframes64_t pos = 0; + framepos_t pos = 0; RegionSelection rs; get_regions_for_action (rs); @@ -944,7 +944,7 @@ Editor::cursor_to_selection_start (EditorCursor *cursor) void Editor::cursor_to_selection_end (EditorCursor *cursor) { - nframes64_t pos = 0; + framepos_t pos = 0; RegionSelection rs; get_regions_for_action (rs); @@ -976,7 +976,7 @@ Editor::cursor_to_selection_end (EditorCursor *cursor) void Editor::selected_marker_to_region_boundary (bool with_selection, int32_t dir) { - nframes64_t target; + framepos_t target; Location* loc; bool ignored; @@ -985,7 +985,7 @@ Editor::selected_marker_to_region_boundary (bool with_selection, int32_t dir) } if (selection->markers.empty()) { - nframes64_t mouse; + framepos_t mouse; bool ignored; if (!mouse_frame (mouse, ignored)) { @@ -999,7 +999,7 @@ Editor::selected_marker_to_region_boundary (bool with_selection, int32_t dir) return; } - nframes64_t pos = loc->start(); + framepos_t pos = loc->start(); // so we don't find the current region again.. if (dir > 0 || pos > 0) { @@ -1029,7 +1029,7 @@ void Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir) { boost::shared_ptr<Region> r; - nframes64_t pos; + framepos_t pos; Location* loc; bool ignored; @@ -1105,7 +1105,7 @@ Editor::selected_marker_to_previous_region_point (RegionPoint point) void Editor::selected_marker_to_selection_start () { - nframes64_t pos = 0; + framepos_t pos = 0; Location* loc; bool ignored; @@ -1144,7 +1144,7 @@ Editor::selected_marker_to_selection_start () void Editor::selected_marker_to_selection_end () { - nframes64_t pos = 0; + framepos_t pos = 0; Location* loc; bool ignored; @@ -1216,8 +1216,8 @@ Editor::scroll_playhead (bool forward) void Editor::playhead_backward () { - nframes64_t pos; - nframes64_t cnt; + framepos_t pos; + framepos_t cnt; float prefix; bool was_floating; @@ -1225,15 +1225,15 @@ Editor::playhead_backward () cnt = 1; } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate ()); + cnt = (framepos_t) floor (prefix * _session->frame_rate ()); } else { - cnt = (nframes64_t) prefix; + cnt = (framepos_t) prefix; } } pos = playhead_cursor->current_frame; - if ((nframes64_t) pos < cnt) { + if ((framepos_t) pos < cnt) { pos = 0; } else { pos -= cnt; @@ -1250,8 +1250,8 @@ Editor::playhead_backward () void Editor::playhead_forward () { - nframes64_t pos; - nframes64_t cnt; + framepos_t pos; + framepos_t cnt; bool was_floating; float prefix; @@ -1259,9 +1259,9 @@ Editor::playhead_forward () cnt = 1; } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate ()); + cnt = (framepos_t) floor (prefix * _session->frame_rate ()); } else { - cnt = (nframes64_t) floor (prefix); + cnt = (framepos_t) floor (prefix); } } @@ -1311,8 +1311,8 @@ Editor::cursor_align (bool playhead_to_edit) void Editor::edit_cursor_backward () { - nframes64_t pos; - nframes64_t cnt; + framepos_t pos; + framepos_t cnt; float prefix; bool was_floating; @@ -1320,9 +1320,9 @@ Editor::edit_cursor_backward () cnt = 1; } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate ()); + cnt = (framepos_t) floor (prefix * _session->frame_rate ()); } else { - cnt = (nframes64_t) prefix; + cnt = (framepos_t) prefix; } } @@ -1342,8 +1342,8 @@ Editor::edit_cursor_backward () void Editor::edit_cursor_forward () { - //nframes64_t pos; - nframes64_t cnt; + //framepos_t pos; + framepos_t cnt; bool was_floating; float prefix; @@ -1351,9 +1351,9 @@ Editor::edit_cursor_forward () cnt = 1; } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate ()); + cnt = (framepos_t) floor (prefix * _session->frame_rate ()); } else { - cnt = (nframes64_t) floor (prefix); + cnt = (framepos_t) floor (prefix); } } @@ -1366,16 +1366,16 @@ Editor::goto_frame () { float prefix; bool was_floating; - nframes64_t frame; + framepos_t frame; if (get_prefix (prefix, was_floating)) { return; } if (was_floating) { - frame = (nframes64_t) floor (prefix * _session->frame_rate()); + frame = (framepos_t) floor (prefix * _session->frame_rate()); } else { - frame = (nframes64_t) floor (prefix); + frame = (framepos_t) floor (prefix); } _session->request_locate (frame); @@ -1384,19 +1384,19 @@ Editor::goto_frame () void Editor::scroll_backward (float pages) { - nframes64_t frame; - nframes64_t one_page = (nframes64_t) rint (_canvas_width * frames_per_unit); + framepos_t frame; + framepos_t one_page = (framepos_t) rint (_canvas_width * frames_per_unit); bool was_floating; float prefix; - nframes64_t cnt; + framepos_t cnt; if (get_prefix (prefix, was_floating)) { - cnt = (nframes64_t) floor (pages * one_page); + cnt = (framepos_t) floor (pages * one_page); } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate()); + cnt = (framepos_t) floor (prefix * _session->frame_rate()); } else { - cnt = (nframes64_t) floor (prefix * one_page); + cnt = (framepos_t) floor (prefix * one_page); } } @@ -1412,19 +1412,19 @@ Editor::scroll_backward (float pages) void Editor::scroll_forward (float pages) { - nframes64_t frame; - nframes64_t one_page = (nframes64_t) rint (_canvas_width * frames_per_unit); + framepos_t frame; + framepos_t one_page = (framepos_t) rint (_canvas_width * frames_per_unit); bool was_floating; float prefix; - nframes64_t cnt; + framepos_t cnt; if (get_prefix (prefix, was_floating)) { - cnt = (nframes64_t) floor (pages * one_page); + cnt = (framepos_t) floor (pages * one_page); } else { if (was_floating) { - cnt = (nframes64_t) floor (prefix * _session->frame_rate()); + cnt = (framepos_t) floor (prefix * _session->frame_rate()); } else { - cnt = (nframes64_t) floor (prefix * one_page); + cnt = (framepos_t) floor (prefix * one_page); } } @@ -1532,14 +1532,14 @@ Editor::temporal_zoom (gdouble fpu) { if (!_session) return; - nframes64_t current_page = current_page_frames(); - nframes64_t current_leftmost = leftmost_frame; - nframes64_t current_rightmost; - nframes64_t current_center; - nframes64_t new_page_size; - nframes64_t half_page_size; - nframes64_t leftmost_after_zoom = 0; - nframes64_t where; + framepos_t current_page = current_page_frames(); + framepos_t current_leftmost = leftmost_frame; + framepos_t current_rightmost; + framepos_t current_center; + framepos_t new_page_size; + framepos_t half_page_size; + framepos_t leftmost_after_zoom = 0; + framepos_t where; bool in_track_canvas; double nfpu; double l; @@ -1552,7 +1552,7 @@ Editor::temporal_zoom (gdouble fpu) nfpu = fpu; - new_page_size = (nframes64_t) floor (_canvas_width * nfpu); + new_page_size = (framepos_t) floor (_canvas_width * nfpu); half_page_size = new_page_size / 2; switch (zoom_focus) { @@ -1587,7 +1587,7 @@ Editor::temporal_zoom (gdouble fpu) } else if (l > max_framepos) { leftmost_after_zoom = max_framepos - new_page_size; } else { - leftmost_after_zoom = (nframes64_t) l; + leftmost_after_zoom = (framepos_t) l; } break; @@ -1613,7 +1613,7 @@ Editor::temporal_zoom (gdouble fpu) } else if (l > max_framepos) { leftmost_after_zoom = max_framepos - new_page_size; } else { - leftmost_after_zoom = (nframes64_t) l; + leftmost_after_zoom = (framepos_t) l; } } @@ -1632,7 +1632,7 @@ Editor::temporal_zoom (gdouble fpu) } else if (l > max_framepos) { leftmost_after_zoom = max_framepos - new_page_size; } else { - leftmost_after_zoom = (nframes64_t) l; + leftmost_after_zoom = (framepos_t) l; } } else { @@ -1690,9 +1690,9 @@ Editor::temporal_zoom_region (bool both_axes) return; } - nframes64_t range = end - start; + framepos_t range = end - start; double new_fpu = (double)range / (double)_canvas_width; - nframes64_t extra_samples = (nframes64_t) floor (one_centimeter_in_pixels * new_fpu); + framepos_t extra_samples = (framepos_t) floor (one_centimeter_in_pixels * new_fpu); if (start > extra_samples) { start -= extra_samples; @@ -1759,8 +1759,8 @@ Editor::temporal_zoom_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; temporal_zoom_by_frame (start, end, "zoom to selection"); } @@ -1782,7 +1782,7 @@ Editor::temporal_zoom_session () } void -Editor::temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string & /*op*/) +Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end, const string & /*op*/) { if (!_session) return; @@ -1790,13 +1790,13 @@ Editor::temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string return; } - nframes64_t range = end - start; + framepos_t range = end - start; double new_fpu = (double)range / (double)_canvas_width; - nframes64_t new_page = (nframes64_t) floor (_canvas_width * new_fpu); - nframes64_t middle = (nframes64_t) floor( (double)start + ((double)range / 2.0f )); - nframes64_t new_leftmost = (nframes64_t) floor( (double)middle - ((double)new_page/2.0f)); + framepos_t new_page = (framepos_t) floor (_canvas_width * new_fpu); + framepos_t middle = (framepos_t) floor( (double)start + ((double)range / 2.0f )); + framepos_t new_leftmost = (framepos_t) floor( (double)middle - ((double)new_page/2.0f)); if (new_leftmost > middle) { new_leftmost = 0; @@ -1806,7 +1806,7 @@ Editor::temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string } void -Editor::temporal_zoom_to_frame (bool coarser, nframes64_t frame) +Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame) { if (!_session) { return; @@ -1828,7 +1828,7 @@ Editor::temporal_zoom_to_frame (bool coarser, nframes64_t frame) return; } - nframes64_t new_leftmost = frame - (nframes64_t)range_before; + framepos_t new_leftmost = frame - (framepos_t)range_before; if (new_leftmost > frame) { new_leftmost = 0; @@ -1891,8 +1891,8 @@ Editor::add_location_from_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; _session->locations()->next_available_name(rangename,"selection"); Location *location = new Location (*_session, start, end, rangename, Location::IsRangeMarker); @@ -1906,7 +1906,7 @@ Editor::add_location_from_selection () } void -Editor::add_location_mark (nframes64_t where) +Editor::add_location_mark (framepos_t where) { string markername; @@ -2086,7 +2086,7 @@ Editor::jump_backward_to_mark () void Editor::set_mark () { - nframes64_t pos; + framepos_t pos; float prefix; bool was_floating; string markername; @@ -2095,9 +2095,9 @@ Editor::set_mark () pos = _session->audible_frame (); } else { if (was_floating) { - pos = (nframes64_t) floor (prefix * _session->frame_rate ()); + pos = (framepos_t) floor (prefix * _session->frame_rate ()); } else { - pos = (nframes64_t) floor (prefix); + pos = (framepos_t) floor (prefix); } } @@ -2183,7 +2183,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y) { double wx, wy; double cx, cy; - nframes64_t where; + framepos_t where; RouteTimeAxisView *rtv = 0; boost::shared_ptr<Playlist> playlist; @@ -2359,8 +2359,8 @@ Editor::play_from_edit_point () void Editor::play_from_edit_point_and_return () { - nframes64_t start_frame; - nframes64_t return_frame; + framepos_t start_frame; + framepos_t return_frame; start_frame = get_preferred_edit_position (true); @@ -2555,7 +2555,7 @@ Editor::audition_playlist_region_via_route (boost::shared_ptr<Region> region, Ro void Editor::play_edit_range () { - nframes64_t start, end; + framepos_t start, end; if (get_edit_op_range (start, end)) { _session->request_bounded_roll (start, end); @@ -2604,17 +2604,17 @@ Editor::region_from_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; TrackViewList tracks = get_tracks_for_range_action (); - nframes64_t selection_cnt = end - start + 1; + framepos_t selection_cnt = end - start + 1; for (TrackSelection::iterator i = tracks.begin(); i != tracks.end(); ++i) { boost::shared_ptr<Region> current; boost::shared_ptr<Playlist> pl; - nframes64_t internal_start; + framepos_t internal_start; string new_name; if ((pl = (*i)->playlist()) == 0) { @@ -2646,15 +2646,15 @@ Editor::create_region_from_selection (vector<boost::shared_ptr<Region> >& new_re return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; sort_track_selection (); for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { boost::shared_ptr<Region> current; boost::shared_ptr<Playlist> playlist; - nframes64_t internal_start; + framepos_t internal_start; string new_name; if ((playlist = (*i)->playlist()) == 0) { @@ -2792,8 +2792,8 @@ Editor::separate_regions_between (const TimeSelection& ts) latest_regionviews.clear (); - playlist->partition ((nframes64_t)((*t).start * speed), - (nframes64_t)((*t).end * speed), false); + playlist->partition ((framepos_t)((*t).start * speed), + (framepos_t)((*t).end * speed), false); c.disconnect (); @@ -2856,8 +2856,8 @@ Editor::separate_region_from_selection () } else { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (get_edit_op_range (start, end)) { @@ -2991,8 +2991,8 @@ Editor::crop_region_to_selection () } else { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (get_edit_op_range (start, end)) { crop_region_to (start, end); @@ -3002,7 +3002,7 @@ Editor::crop_region_to_selection () } void -Editor::crop_region_to (nframes64_t start, nframes64_t end) +Editor::crop_region_to (framepos_t start, framepos_t end) { vector<boost::shared_ptr<Playlist> > playlists; boost::shared_ptr<Playlist> playlist; @@ -3036,9 +3036,9 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end) return; } - nframes64_t the_start; - nframes64_t the_end; - nframes64_t cnt; + framepos_t the_start; + framepos_t the_end; + framepos_t cnt; begin_reversible_command (_("trim to selection")); @@ -3056,7 +3056,7 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end) if the selection extends beyond the region */ - the_start = max (the_start, (nframes64_t) region->position()); + the_start = max (the_start, (framepos_t) region->position()); if (max_framepos - the_start < region->length()) { the_end = the_start + region->length() - 1; } else { @@ -3076,7 +3076,7 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end) void Editor::region_fill_track () { - nframes64_t end; + framepos_t end; RegionSelection rs; get_regions_for_action (rs); @@ -3129,8 +3129,8 @@ Editor::region_fill_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; boost::shared_ptr<Playlist> playlist; @@ -3138,7 +3138,7 @@ Editor::region_fill_selection () return; } - nframes64_t selection_length = end - start; + framepos_t selection_length = end - start; float times = (float)selection_length / region->length(); begin_reversible_command (_("fill selection")); @@ -3160,14 +3160,14 @@ Editor::region_fill_selection () void Editor::set_region_sync_from_edit_point () { - nframes64_t where = get_preferred_edit_position (); + framepos_t where = get_preferred_edit_position (); RegionSelection rs; get_regions_for_action (rs); set_sync_point (where, rs); } void -Editor::set_sync_point (nframes64_t where, const RegionSelection& rs) +Editor::set_sync_point (framepos_t where, const RegionSelection& rs) { bool in_command = false; @@ -3242,7 +3242,7 @@ Editor::align (RegionPoint what) RegionSelection rs; get_regions_for_action (rs); - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); if (!rs.empty()) { align_selection (what, where, rs); @@ -3257,7 +3257,7 @@ Editor::align (RegionPoint what) void Editor::align_relative (RegionPoint what) { - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); RegionSelection rs; get_regions_for_action (rs); @@ -3274,14 +3274,14 @@ struct RegionSortByTime { }; void -Editor::align_selection_relative (RegionPoint point, nframes64_t position, const RegionSelection& rs) +Editor::align_selection_relative (RegionPoint point, framepos_t position, const RegionSelection& rs) { if (rs.empty()) { return; } - nframes64_t distance = 0; - nframes64_t pos = 0; + framepos_t distance = 0; + framepos_t pos = 0; int dir = 1; list<RegionView*> sorted; @@ -3358,7 +3358,7 @@ Editor::align_selection_relative (RegionPoint point, nframes64_t position, const } void -Editor::align_selection (RegionPoint point, nframes64_t position, const RegionSelection& rs) +Editor::align_selection (RegionPoint point, framepos_t position, const RegionSelection& rs) { if (rs.empty()) { return; @@ -3374,7 +3374,7 @@ Editor::align_selection (RegionPoint point, nframes64_t position, const RegionSe } void -Editor::align_region (boost::shared_ptr<Region> region, RegionPoint point, nframes64_t position) +Editor::align_region (boost::shared_ptr<Region> region, RegionPoint point, framepos_t position) { begin_reversible_command (_("align region")); align_region_internal (region, point, position); @@ -3382,7 +3382,7 @@ Editor::align_region (boost::shared_ptr<Region> region, RegionPoint point, nfram } void -Editor::align_region_internal (boost::shared_ptr<Region> region, RegionPoint point, nframes64_t position) +Editor::align_region_internal (boost::shared_ptr<Region> region, RegionPoint point, framepos_t position) { region->clear_changes (); @@ -3420,7 +3420,7 @@ Editor::trim_region_back () void Editor::trim_region (bool front) { - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); RegionSelection rs; get_regions_for_action (rs); @@ -3495,8 +3495,8 @@ Editor::trim_region_to_location (const Location& loc, const char* str) } float speed = 1.0; - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (tav->track() != 0) { speed = tav->track()->speed(); @@ -3520,7 +3520,7 @@ Editor::trim_region_to_edit_point () get_regions_for_action (rs); - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); begin_reversible_command (_("trim region start to edit point")); @@ -3558,7 +3558,7 @@ Editor::trim_region_from_edit_point () get_regions_for_action (rs); - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); begin_reversible_command (_("trim region end to edit point")); @@ -3646,7 +3646,7 @@ Editor::trim_to_region(bool forward) continue; } - region->trim_end((nframes64_t) ( (next_region->first_frame() - 1) * speed), this); + region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed), this); arv->region_changed (PropertyChange (ARDOUR::Properties::length)); } else { @@ -3657,7 +3657,7 @@ Editor::trim_to_region(bool forward) continue; } - region->trim_front((nframes64_t) ((next_region->last_frame() + 1) * speed), this); + region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed), this); arv->region_changed (ARDOUR::bounds_change); } @@ -3727,9 +3727,9 @@ Editor::bounce_range_selection (bool replace, bool enable_processing) TrackSelection views = selection->tracks; - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; - nframes64_t cnt = end - start + 1; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; + framepos_t cnt = end - start + 1; begin_reversible_command (_("bounce range")); @@ -3917,7 +3917,7 @@ Editor::cut_copy (CutCopyOp op) case MouseRange: if (selection->time.empty()) { - nframes64_t start, end; + framepos_t start, end; if (!get_edit_op_range (start, end)) { return; } @@ -4101,7 +4101,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { - first_position = min ((nframes64_t) (*x)->region()->position(), first_position); + first_position = min ((framepos_t) (*x)->region()->position(), first_position); if (op == Cut || op == Clear) { boost::shared_ptr<Playlist> pl = (*x)->region()->playlist(); @@ -4257,7 +4257,7 @@ Editor::paste (float times) void Editor::mouse_paste () { - nframes64_t where; + framepos_t where; bool ignored; if (!mouse_frame (where, ignored)) { @@ -4269,7 +4269,7 @@ Editor::mouse_paste () } void -Editor::paste_internal (nframes64_t position, float times) +Editor::paste_internal (framepos_t position, float times) { bool commit = false; @@ -4461,9 +4461,9 @@ void Editor::nudge_track (bool use_edit, bool forwards) { boost::shared_ptr<Playlist> playlist; - nframes64_t distance; - nframes64_t next_distance; - nframes64_t start; + framepos_t distance; + framepos_t next_distance; + framepos_t start; if (use_edit) { start = get_preferred_edit_position(); @@ -4954,7 +4954,7 @@ Editor::external_edit_region () } void -Editor::brush (nframes64_t pos) +Editor::brush (framepos_t pos) { RegionSelection sel; RegionSelection rs; @@ -5162,8 +5162,8 @@ Editor::set_fade_length (bool in) RegionView* rv = rs.front (); - nframes64_t pos = get_preferred_edit_position(); - nframes64_t len; + framepos_t pos = get_preferred_edit_position(); + framepos_t len; char const * cmd; if (pos > rv->region()->last_frame() || pos < rv->region()->first_frame()) { @@ -5482,7 +5482,7 @@ Editor::update_xfade_visibility () void Editor::set_edit_point () { - nframes64_t where; + framepos_t where; bool ignored; if (!mouse_frame (where, ignored)) { @@ -5512,7 +5512,7 @@ Editor::set_playhead_cursor () if (entered_marker) { _session->request_locate (entered_marker->position(), _session->transport_rolling()); } else { - nframes64_t where; + framepos_t where; bool ignored; if (!mouse_frame (where, ignored)) { @@ -5541,7 +5541,7 @@ Editor::split () get_regions_for_action (rs, true); - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); if (rs.empty()) { return; @@ -5675,8 +5675,8 @@ Editor::set_loop_from_selection (bool play) return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; set_loop_range (start, end, _("set loop range from selection")); @@ -5693,8 +5693,8 @@ Editor::set_loop_from_edit_range (bool play) return; } - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (!get_edit_op_range (start, end)) { return; @@ -5746,8 +5746,8 @@ Editor::set_punch_from_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; set_punch_range (start, end, _("set punch range from selection")); } @@ -5759,8 +5759,8 @@ Editor::set_punch_from_edit_range () return; } - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (!get_edit_op_range (start, end)) { return; @@ -5832,16 +5832,16 @@ Editor::use_region_as_bar () void Editor::use_range_as_bar () { - nframes64_t start, end; + framepos_t start, end; if (get_edit_op_range (start, end)) { define_one_bar (start, end); } } void -Editor::define_one_bar (nframes64_t start, nframes64_t end) +Editor::define_one_bar (framepos_t start, framepos_t end) { - nframes64_t length = end - start; + framepos_t length = end - start; const Meter& m (_session->tempo_map().meter_at (start)); @@ -6029,7 +6029,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList pl->freeze (); pl->remove_region (r); - nframes64_t pos = 0; + framepos_t pos = 0; while (x != positions.end()) { @@ -6042,12 +6042,12 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList /* file start = original start + how far we from the initial position ? */ - nframes64_t file_start = r->start() + pos; + framepos_t file_start = r->start() + pos; /* length = next position - current position */ - nframes64_t len = (*x) - pos; + framepos_t len = (*x) - pos; /* XXX we do we really want to allow even single-sample regions? shouldn't we have some kind of lower limit on region size? @@ -6115,7 +6115,7 @@ Editor::place_transient() return; } - nframes64_t where = get_preferred_edit_position(); + framepos_t where = get_preferred_edit_position(); _session->begin_reversible_command (_("place transient")); @@ -6223,8 +6223,8 @@ Editor::close_region_gaps() return; } - nframes64_t crossfade_len = spin_crossfade.get_value(); - nframes64_t pull_back_frames = spin_pullback.get_value(); + framepos_t crossfade_len = spin_crossfade.get_value(); + framepos_t pull_back_frames = spin_pullback.get_value(); crossfade_len = lrintf (crossfade_len * _session->frame_rate()/1000); pull_back_frames = lrintf (pull_back_frames * _session->frame_rate()/1000); @@ -6240,7 +6240,7 @@ Editor::close_region_gaps() for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { - nframes64_t position = (*r)->region()->position(); + framepos_t position = (*r)->region()->position(); if (idx == 0 || position < last_region->position()){ last_region = (*r)->region(); @@ -6268,7 +6268,7 @@ Editor::tab_to_transient (bool forward) return; } - nframes64_t pos = _session->audible_frame (); + framepos_t pos = _session->audible_frame (); if (!selection->tracks.empty()) { @@ -6281,7 +6281,7 @@ Editor::tab_to_transient (bool forward) if (tr) { boost::shared_ptr<Playlist> pl = tr->playlist (); if (pl) { - nframes64_t result = pl->find_next_transient (pos, forward ? 1 : -1); + framepos_t result = pl->find_next_transient (pos, forward ? 1 : -1); if (result >= 0) { positions.push_back (result); @@ -6353,7 +6353,7 @@ void Editor::playhead_backward_to_grid () { if (!_session) return; - nframes64_t pos = playhead_cursor->current_frame; + framepos_t pos = playhead_cursor->current_frame; if (pos > 2) { pos -= 2; snap_to_internal (pos, -1, false); @@ -6539,7 +6539,7 @@ Editor::do_insert_time () } void -Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt, +Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too) { bool commit = false; diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index ae5fef49ea..f55cf4d1fd 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -1130,7 +1130,7 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context, } if (_editor->convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) { - nframes64_t pos = 0; + framepos_t pos = 0; if (Profile->get_sae() || Config->get_only_copy_imported_files()) { _editor->do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsRegion, SrcBest, pos); } else { diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 6c789f25d9..f2ef742330 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -168,7 +168,7 @@ Editor::initialize_rulers () bool Editor::ruler_scroll (GdkEventScroll* event) { - nframes64_t xdelta; + framepos_t xdelta; int direction = event->direction; bool handled = false; @@ -274,7 +274,7 @@ Editor::ruler_button_release (GdkEventButton* ev) stop_canvas_autoscroll(); - nframes64_t where = leftmost_frame + pixel_to_frame (x); + framepos_t where = leftmost_frame + pixel_to_frame (x); snap_to (where); popup_ruler_menu (where); } @@ -317,7 +317,7 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev) void -Editor::popup_ruler_menu (nframes64_t where, ItemType t) +Editor::popup_ruler_menu (framepos_t where, ItemType t) { using namespace Menu_Helpers; @@ -774,7 +774,7 @@ Editor::update_just_timecode () return; } - nframes64_t rightmost_frame = leftmost_frame + current_page_frames(); + framepos_t rightmost_frame = leftmost_frame + current_page_frames(); if (ruler_timecode_action->get_active()) { gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_timecode_ruler), leftmost_frame, rightmost_frame, @@ -801,7 +801,7 @@ Editor::compute_fixed_ruler_scale () void Editor::update_fixed_rulers () { - nframes64_t rightmost_frame; + framepos_t rightmost_frame; if (_session == 0) { return; @@ -877,9 +877,9 @@ Editor::_metric_get_minsec (GtkCustomRulerMark **marks, gdouble lower, gdouble u void Editor::set_timecode_ruler_scale (gdouble lower, gdouble upper) { - nframes64_t range; - nframes64_t spacer; - nframes64_t fr; + framepos_t range; + framepos_t spacer; + framepos_t fr; if (_session == 0) { return; @@ -887,13 +887,13 @@ Editor::set_timecode_ruler_scale (gdouble lower, gdouble upper) fr = _session->frame_rate(); - if (lower > (spacer = (nframes64_t)(128 * Editor::get_current_zoom ()))) { + if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) { lower = lower - spacer; } else { lower = 0; } upper = upper + spacer; - range = (nframes64_t) floor (upper - lower); + range = (framepos_t) floor (upper - lower); if (range < (2 * _session->frames_per_timecode_frame())) { /* 0 - 2 frames */ timecode_ruler_scale = timecode_show_bits; @@ -902,19 +902,19 @@ Editor::set_timecode_ruler_scale (gdouble lower, gdouble upper) } else if (range <= (fr / 4)) { /* 2 frames - 0.250 second */ timecode_ruler_scale = timecode_show_frames; timecode_mark_modulo = 1; - timecode_nmarks = 2 + (range / (nframes64_t)_session->frames_per_timecode_frame()); + timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame()); } else if (range <= (fr / 2)) { /* 0.25-0.5 second */ timecode_ruler_scale = timecode_show_frames; timecode_mark_modulo = 2; - timecode_nmarks = 2 + (range / (nframes64_t)_session->frames_per_timecode_frame()); + timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame()); } else if (range <= fr) { /* 0.5-1 second */ timecode_ruler_scale = timecode_show_frames; timecode_mark_modulo = 5; - timecode_nmarks = 2 + (range / (nframes64_t)_session->frames_per_timecode_frame()); + timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame()); } else if (range <= 2 * fr) { /* 1-2 seconds */ timecode_ruler_scale = timecode_show_frames; timecode_mark_modulo = 10; - timecode_nmarks = 2 + (range / (nframes64_t)_session->frames_per_timecode_frame()); + timecode_nmarks = 2 + (range / (framepos_t)_session->frames_per_timecode_frame()); } else if (range <= 8 * fr) { /* 2-8 seconds */ timecode_ruler_scale = timecode_show_seconds; timecode_mark_modulo = 1; @@ -965,7 +965,7 @@ Editor::set_timecode_ruler_scale (gdouble lower, gdouble upper) timecode_nmarks = 2 + 24; } else { - /* not possible if nframes64_t is a 32 bit quantity */ + /* not possible if framepos_t is a 32 bit quantity */ timecode_ruler_scale = timecode_show_hours; timecode_mark_modulo = 4; @@ -1133,7 +1133,7 @@ Editor::metric_get_timecode (GtkCustomRulerMark **marks, gdouble lower, gdouble void -Editor::compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper) +Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper) { if (_session == 0) { return; @@ -1267,15 +1267,15 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp char buf[64]; gint n = 0; - nframes64_t pos; + framepos_t pos; BBT_Time next_beat; - nframes64_t next_beat_pos; + framepos_t next_beat_pos; uint32_t beats = 0; uint32_t tick = 0; uint32_t skip; uint32_t t; - nframes64_t frame_skip; + framepos_t frame_skip; double frame_skip_error; double bbt_position_of_helper; double accumulated_error; @@ -1378,7 +1378,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp next_beat_pos = _session->tempo_map().frame_time(next_beat); - frame_skip = (nframes64_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); + frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); frame_skip_error -= frame_skip; skip = (uint32_t) (Meter::ticks_per_beat / bbt_beat_subdivision); @@ -1396,7 +1396,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp snprintf (buf, sizeof(buf), " "); (*marks)[n].label = g_strdup (buf); - /* Error compensation for float to nframes64_t*/ + /* Error compensation for float to framepos_t*/ accumulated_error += frame_skip_error; if (accumulated_error > 1) { pos += 1; @@ -1470,7 +1470,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp next_beat_pos = _session->tempo_map().frame_time(next_beat); - frame_skip = (nframes64_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); + frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); frame_skip_error -= frame_skip; skip = (uint32_t) (Meter::ticks_per_beat / bbt_beat_subdivision); @@ -1493,7 +1493,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp (*marks)[n].label = g_strdup (buf); - /* Error compensation for float to nframes64_t*/ + /* Error compensation for float to framepos_t*/ accumulated_error += frame_skip_error; if (accumulated_error > 1) { pos += 1; @@ -1567,7 +1567,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp next_beat_pos = _session->tempo_map().frame_time(next_beat); - frame_skip = (nframes64_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); + frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute())); frame_skip_error -= frame_skip; skip = (uint32_t) (Meter::ticks_per_beat / bbt_beat_subdivision); @@ -1590,7 +1590,7 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp (*marks)[n].label = g_strdup (buf); - /* Error compensation for float to nframes64_t*/ + /* Error compensation for float to framepos_t*/ accumulated_error += frame_skip_error; if (accumulated_error > 1) { pos += 1; @@ -1731,10 +1731,10 @@ Editor::metric_get_bbt (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upp gint Editor::metric_get_frames (GtkCustomRulerMark **marks, gdouble lower, gdouble upper, gint /*maxchars*/) { - nframes64_t mark_interval; - nframes64_t pos; - nframes64_t ilower = (nframes64_t) floor (lower); - nframes64_t iupper = (nframes64_t) floor (upper); + framepos_t mark_interval; + framepos_t pos; + framepos_t ilower = (framepos_t) floor (lower); + framepos_t iupper = (framepos_t) floor (upper); gchar buf[16]; gint nmarks; gint n; @@ -1762,15 +1762,15 @@ Editor::metric_get_frames (GtkCustomRulerMark **marks, gdouble lower, gdouble up } static void -sample_to_clock_parts ( nframes64_t sample, - nframes64_t sample_rate, +sample_to_clock_parts ( framepos_t sample, + framepos_t sample_rate, long *hrs_p, long *mins_p, long *secs_p, long *millisecs_p) { - nframes64_t left; + framepos_t left; long hrs; long mins; long secs; @@ -1796,9 +1796,9 @@ sample_to_clock_parts ( nframes64_t sample, void Editor::set_minsec_ruler_scale (gdouble lower, gdouble upper) { - nframes64_t range; - nframes64_t fr; - nframes64_t spacer; + framepos_t range; + framepos_t fr; + framepos_t spacer; if (_session == 0) { return; @@ -1807,13 +1807,13 @@ Editor::set_minsec_ruler_scale (gdouble lower, gdouble upper) fr = _session->frame_rate(); /* to prevent 'flashing' */ - if (lower > (spacer = (nframes64_t)(128 * Editor::get_current_zoom ()))) { + if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) { lower -= spacer; } else { lower = 0; } upper += spacer; - range = (nframes64_t) (upper - lower); + range = (framepos_t) (upper - lower); if (range < (fr / 50)) { minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */ @@ -1885,7 +1885,7 @@ Editor::set_minsec_ruler_scale (gdouble lower, gdouble upper) minsec_mark_modulo = 2; } else { - /* not possible if nframes64_t is a 32 bit quantity */ + /* not possible if framepos_t is a 32 bit quantity */ minsec_mark_interval = 4 * 60 * 60 * fr; /* show 4 hrs */ } @@ -1895,8 +1895,8 @@ Editor::set_minsec_ruler_scale (gdouble lower, gdouble upper) gint Editor::metric_get_minsec (GtkCustomRulerMark **marks, gdouble lower, gdouble /*upper*/, gint /*maxchars*/) { - nframes64_t pos; - nframes64_t spacer; + framepos_t pos; + framepos_t spacer; long hrs, mins, secs, millisecs; gchar buf[16]; gint n; @@ -1906,14 +1906,14 @@ Editor::metric_get_minsec (GtkCustomRulerMark **marks, gdouble lower, gdouble /* } /* to prevent 'flashing' */ - if (lower > (spacer = (nframes64_t)(128 * Editor::get_current_zoom ()))) { + if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) { lower = lower - spacer; } else { lower = 0; } *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * minsec_nmarks); - pos = ((((nframes64_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval; + pos = ((((framepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval; switch (minsec_ruler_scale) { case minsec_show_seconds: for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 19166750cc..d17d230cf8 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1178,8 +1178,8 @@ Editor::select_all_selectables_using_time_selection () return; } - nframes64_t start = selection->time[clicked_selection].start; - nframes64_t end = selection->time[clicked_selection].end; + framepos_t start = selection->time[clicked_selection].start; + framepos_t end = selection->time[clicked_selection].end; if (end - start < 1) { return; @@ -1271,8 +1271,8 @@ Editor::select_all_selectables_using_loop() void Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after) { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; list<Selectable *> touched; if (after) { @@ -1311,8 +1311,8 @@ Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after) void Editor::select_all_selectables_using_edit (bool after) { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; list<Selectable *> touched; if (after) { @@ -1351,8 +1351,8 @@ Editor::select_all_selectables_using_edit (bool after) void Editor::select_all_selectables_between (bool /*within*/) { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; list<Selectable *> touched; if (!get_edit_op_range (start, end)) { @@ -1380,8 +1380,8 @@ Editor::select_all_selectables_between (bool /*within*/) void Editor::select_range_between () { - nframes64_t start; - nframes64_t end; + framepos_t start; + framepos_t end; if (mouse_mode == MouseRange && !selection->time.empty()) { selection->clear_time (); @@ -1396,9 +1396,9 @@ Editor::select_range_between () } bool -Editor::get_edit_op_range (nframes64_t& start, nframes64_t& end) const +Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const { - nframes64_t m; + framepos_t m; bool ignored; /* in range mode, use any existing selection */ diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 69dd3772cb..b75f228c52 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -713,7 +713,7 @@ EditorSummary::set_editor_y (pair<double, double> const & y) } void -EditorSummary::playhead_position_changed (nframes64_t p) +EditorSummary::playhead_position_changed (framepos_t p) { if (_session && int (p * _x_scale) != int (_last_playhead)) { set_overlays_dirty (); diff --git a/gtk2_ardour/editor_summary.h b/gtk2_ardour/editor_summary.h index cd01bbd946..e9258a88fd 100644 --- a/gtk2_ardour/editor_summary.h +++ b/gtk2_ardour/editor_summary.h @@ -74,7 +74,7 @@ private: void set_editor_x (std::pair<double, double> const &); void set_editor_y (double); void set_editor_y (std::pair<double, double> const &); - void playhead_position_changed (nframes64_t); + void playhead_position_changed (framepos_t); double summary_y_to_editor (double) const; double editor_y_to_summary (double) const; Position get_position (double, double) const; diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 65432c3754..ac6c572af4 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -197,7 +197,7 @@ Editor::draw_measures () } void -Editor::mouse_add_new_tempo_event (nframes64_t frame) +Editor::mouse_add_new_tempo_event (framepos_t frame) { if (_session == 0) { return; @@ -239,7 +239,7 @@ Editor::mouse_add_new_tempo_event (nframes64_t frame) } void -Editor::mouse_add_new_meter_event (nframes64_t frame) +Editor::mouse_add_new_meter_event (framepos_t frame) { if (_session == 0) { return; diff --git a/gtk2_ardour/imageframe_view.cc b/gtk2_ardour/imageframe_view.cc index 366c56e5e5..04dde574c6 100644 --- a/gtk2_ardour/imageframe_view.cc +++ b/gtk2_ardour/imageframe_view.cc @@ -169,9 +169,9 @@ ImageFrameView::~ImageFrameView() * @return true if the position change was a success, false otherwise */ bool -ImageFrameView::set_position(nframes64_t pos, void* src, double* delta) +ImageFrameView::set_position(framepos_t pos, void* src, double* delta) { - nframes64_t old_pos = frame_position; + framepos_t old_pos = frame_position; // do the standard stuff bool ret = TimeAxisViewItem::set_position(pos, src, delta); @@ -183,7 +183,7 @@ ImageFrameView::set_position(nframes64_t pos, void* src, double* delta) { // calculate the offset of the marker MarkerView* mv = (MarkerView*)*i; - nframes64_t marker_old_pos = mv->get_position(); + framepos_t marker_old_pos = mv->get_position(); mv->set_position(pos + (marker_old_pos - old_pos), src); } @@ -200,7 +200,7 @@ ImageFrameView::set_position(nframes64_t pos, void* src, double* delta) * @return true if the duration change was succesful, false otherwise */ bool -ImageFrameView::set_duration(nframes64_t dur, void* src) +ImageFrameView::set_duration(framepos_t dur, void* src) { /* do the standard stuff */ bool ret = TimeAxisViewItem::set_duration(dur, src); diff --git a/gtk2_ardour/imageframe_view.h b/gtk2_ardour/imageframe_view.h index 1ef2af980a..ac8a3b3bb0 100644 --- a/gtk2_ardour/imageframe_view.h +++ b/gtk2_ardour/imageframe_view.h @@ -90,7 +90,7 @@ class ImageFrameView : public TimeAxisViewItem * @param src the identity of the object that initiated the change * @return true if the position change was a success, false otherwise */ - virtual bool set_position(nframes64_t pos, void* src, double* delta = 0) ; + virtual bool set_position(framepos_t pos, void* src, double* delta = 0) ; /** * Sets the duration of this item @@ -99,7 +99,7 @@ class ImageFrameView : public TimeAxisViewItem * @param src the identity of the object that initiated the change * @return true if the duration change was succesful, false otherwise */ - virtual bool set_duration(nframes64_t dur, void* src) ; + virtual bool set_duration(framepos_t dur, void* src) ; //---------------------------------------------------------------------------------------// // Parent Component Methods diff --git a/gtk2_ardour/insert_time_dialog.cc b/gtk2_ardour/insert_time_dialog.cc index 869f01ed32..78be9c1826 100644 --- a/gtk2_ardour/insert_time_dialog.cc +++ b/gtk2_ardour/insert_time_dialog.cc @@ -35,7 +35,7 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e) { set_session (_editor.session ()); - nframes64_t const pos = _editor.get_preferred_edit_position (); + framepos_t const pos = _editor.get_preferred_edit_position (); get_vbox()->set_border_width (12); get_vbox()->set_spacing (4); @@ -138,7 +138,7 @@ InsertTimeDialog::move_locked_markers () const return _move_locked_markers.get_active (); } -nframes64_t +framepos_t InsertTimeDialog::distance () const { return _clock.current_duration (_editor.get_preferred_edit_position ()); diff --git a/gtk2_ardour/insert_time_dialog.h b/gtk2_ardour/insert_time_dialog.h index 450a8e9872..34630fa908 100644 --- a/gtk2_ardour/insert_time_dialog.h +++ b/gtk2_ardour/insert_time_dialog.h @@ -33,7 +33,7 @@ public: bool move_glued_markers () const; bool move_locked_markers () const; bool move_tempos () const; - nframes64_t distance () const; + framepos_t distance () const; private: void move_markers_toggled (); diff --git a/gtk2_ardour/latency_gui.cc b/gtk2_ardour/latency_gui.cc index 93b8be3ae7..87ca39326e 100644 --- a/gtk2_ardour/latency_gui.cc +++ b/gtk2_ardour/latency_gui.cc @@ -32,7 +32,7 @@ LatencyBarController::get_label (int&) std::stringstream s; if (nframes < (_latency_gui->sample_rate / 1000.0)) { - s << ((nframes64_t) rint (nframes)) << " samples"; + s << ((framepos_t) rint (nframes)) << " samples"; } else { s << std::fixed << std::setprecision (2) << (nframes / (_latency_gui->sample_rate / 1000.0)) << " msecs"; } @@ -40,7 +40,7 @@ LatencyBarController::get_label (int&) return s.str (); } -LatencyGUI::LatencyGUI (Latent& l, nframes64_t sr, nframes64_t psz) +LatencyGUI::LatencyGUI (Latent& l, framepos_t sr, framepos_t psz) : _latent (l), initial_value (_latent.signal_latency()), sample_rate (sr), @@ -95,7 +95,7 @@ LatencyGUI::LatencyGUI (Latent& l, nframes64_t sr, nframes64_t psz) void LatencyGUI::finish () { - nframes64_t new_value = (nframes64_t) adjustment.get_value(); + framepos_t new_value = (framepos_t) adjustment.get_value(); if (new_value != initial_value) { _latent.set_user_latency (new_value); } @@ -140,7 +140,7 @@ LatencyGUI::change_latency_from_button (int dir) } } -LatencyDialog::LatencyDialog (const std::string& title, Latent& l, nframes64_t sr, nframes64_t psz) +LatencyDialog::LatencyDialog (const std::string& title, Latent& l, framepos_t sr, framepos_t psz) : ArdourDialog (title, false, true), lwidget (l, sr, psz) { diff --git a/gtk2_ardour/latency_gui.h b/gtk2_ardour/latency_gui.h index edf2ff29e5..96aa6090d7 100644 --- a/gtk2_ardour/latency_gui.h +++ b/gtk2_ardour/latency_gui.h @@ -38,7 +38,7 @@ private: class LatencyGUI : public Gtk::VBox { public: - LatencyGUI (ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size); + LatencyGUI (ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size); ~LatencyGUI() { } void finish (); @@ -47,9 +47,9 @@ class LatencyGUI : public Gtk::VBox private: ARDOUR::Latent& _latent; - nframes64_t initial_value; - nframes64_t sample_rate; - nframes64_t period_size; + framepos_t initial_value; + framepos_t sample_rate; + framepos_t period_size; boost::shared_ptr<PBD::IgnorableControllable> ignored; Gtk::Adjustment adjustment; @@ -72,7 +72,7 @@ class LatencyGUI : public Gtk::VBox class LatencyDialog : public ArdourDialog { public: - LatencyDialog (const std::string& title, ARDOUR::Latent&, nframes64_t sample_rate, nframes64_t period_size); + LatencyDialog (const std::string& title, ARDOUR::Latent&, framepos_t sample_rate, framepos_t period_size); ~LatencyDialog() {} private: diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 866bed1640..46e184a1d4 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -365,7 +365,7 @@ Marker::set_name (const string& new_name) } void -Marker::set_position (nframes64_t frame) +Marker::set_position (framepos_t frame) { double new_unit_position = editor.frame_to_unit (frame); new_unit_position -= shift; diff --git a/gtk2_ardour/marker.h b/gtk2_ardour/marker.h index e9ff0501ed..623e624f9d 100644 --- a/gtk2_ardour/marker.h +++ b/gtk2_ardour/marker.h @@ -68,11 +68,11 @@ class Marker : public sigc::trackable void hide_line (); void set_line_vpos (double y_origin, double height); - void set_position (nframes64_t); + void set_position (framepos_t); void set_name (const std::string&); void set_color_rgba (uint32_t rgba); - nframes64_t position() const { return frame_position; } + framepos_t position() const { return frame_position; } ArdourCanvas::Group * get_parent() { return _parent; } void reparent (ArdourCanvas::Group & parent); @@ -96,7 +96,7 @@ class Marker : public sigc::trackable ArdourCanvas::Points *line_points; double unit_position; - nframes64_t frame_position; + framepos_t frame_position; unsigned char shift; /* should be double, but its always small and integral */ Type _type; int name_height; diff --git a/gtk2_ardour/midi_automation_line.cc b/gtk2_ardour/midi_automation_line.cc index b0d28ec8db..6599e8a966 100755 --- a/gtk2_ardour/midi_automation_line.cc +++ b/gtk2_ardour/midi_automation_line.cc @@ -29,7 +29,7 @@ MidiAutomationLine::MidiAutomationLine ( boost::shared_ptr<ARDOUR::AutomationList> list, boost::shared_ptr<ARDOUR::MidiRegion> region, Evoral::Parameter parameter, - const Evoral::TimeConverter<double, ARDOUR::sframes_t>* converter) + const Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter) : AutomationLine (name, tav, group, list, converter) , _region (region) , _parameter (parameter) diff --git a/gtk2_ardour/midi_automation_line.h b/gtk2_ardour/midi_automation_line.h index c632ddf25d..fb9171824a 100755 --- a/gtk2_ardour/midi_automation_line.h +++ b/gtk2_ardour/midi_automation_line.h @@ -30,7 +30,7 @@ public: boost::shared_ptr<ARDOUR::AutomationList>, boost::shared_ptr<ARDOUR::MidiRegion>, Evoral::Parameter, - const Evoral::TimeConverter<double, ARDOUR::sframes_t>* converter = 0); + const Evoral::TimeConverter<double, ARDOUR::framepos_t>* converter = 0); MementoCommandBinder<ARDOUR::AutomationList>* memento_command_binder (); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 9f2d859597..f5a0d98f20 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -328,7 +328,7 @@ bool MidiRegionView::button_release (GdkEventButton* ev) { double event_x, event_y; - nframes64_t event_frame = 0; + framepos_t event_frame = 0; event_x = ev->x; event_y = ev->y; @@ -398,7 +398,7 @@ bool MidiRegionView::motion (GdkEventMotion* ev) { double event_x, event_y; - nframes64_t event_frame = 0; + framepos_t event_frame = 0; event_x = ev->x; event_y = ev->y; @@ -665,7 +665,7 @@ MidiRegionView::create_note_at(double x, double y, double length, bool sh) assert(note <= 127.0); // Start of note in frames relative to region start - nframes64_t const start_frames = snap_frame_to_frame(trackview.editor().pixel_to_frame(x)); + framepos_t const start_frames = snap_frame_to_frame(trackview.editor().pixel_to_frame(x)); assert(start_frames >= 0); // Snap length @@ -1289,7 +1289,7 @@ MidiRegionView::resolve_note(uint8_t note, double end_time) } if (_active_notes && _active_notes[note]) { - const nframes64_t end_time_frames = beats_to_frames(end_time); + const framepos_t end_time_frames = beats_to_frames(end_time); _active_notes[note]->property_x2() = trackview.editor().frame_to_pixel(end_time_frames); _active_notes[note]->property_outline_what() = (guint32) 0xF; // all edges _active_notes[note] = 0; @@ -1358,7 +1358,7 @@ MidiRegionView::play_midi_chord (vector<boost::shared_ptr<NoteType> > notes) bool MidiRegionView::note_in_region_range(const boost::shared_ptr<NoteType> note, bool& visible) const { - const nframes64_t note_start_frames = beats_to_frames(note->time()); + const framepos_t note_start_frames = beats_to_frames(note->time()); bool outside = (note_start_frames - _region->start() >= _region->length()) || (note_start_frames < _region->start()); @@ -1374,10 +1374,10 @@ MidiRegionView::update_note (CanvasNote* ev) { boost::shared_ptr<NoteType> note = ev->note(); - const nframes64_t note_start_frames = beats_to_frames(note->time()); + const framepos_t note_start_frames = beats_to_frames(note->time()); /* trim note display to not overlap the end of its region */ - const nframes64_t note_end_frames = min (beats_to_frames (note->end_time()), _region->start() + _region->length()); + const framepos_t note_end_frames = min (beats_to_frames (note->end_time()), _region->start() + _region->length()); const double x = trackview.editor().frame_to_pixel(note_start_frames - _region->start()); const double y1 = midi_stream_view()->note_to_y(note->note()); @@ -1418,7 +1418,7 @@ MidiRegionView::update_hit (CanvasHit* ev) { boost::shared_ptr<NoteType> note = ev->note(); - const nframes64_t note_start_frames = beats_to_frames(note->time()); + const framepos_t note_start_frames = beats_to_frames(note->time()); const double x = trackview.editor().frame_to_pixel(note_start_frames - _region->start()); const double diamond_size = midi_stream_view()->note_height() / 2.0; const double y = midi_stream_view()->note_to_y(note->note()) + ((diamond_size-2) / 4.0); @@ -1499,8 +1499,8 @@ MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity /* potentially extend region to hold new note */ - nframes64_t end_frame = _region->position() + beats_to_frames (new_note->end_time()); - nframes64_t region_end = _region->position() + _region->length() - 1; + framepos_t end_frame = _region->position() + beats_to_frames (new_note->end_time()); + framepos_t region_end = _region->position() + _region->length() - 1; if (end_frame > region_end) { _region->set_length (end_frame - _region->position(), this); @@ -2090,22 +2090,22 @@ MidiRegionView::note_dropped(CanvasNoteEvent *, frameoffset_t dt, int8_t dnote) } } -nframes64_t +framepos_t MidiRegionView::snap_pixel_to_frame(double x) { PublicEditor& editor = trackview.editor(); // x is region relative, convert it to global absolute frames - nframes64_t frame = editor.pixel_to_frame(x) + _region->position(); + framepos_t frame = editor.pixel_to_frame(x) + _region->position(); editor.snap_to(frame); return frame - _region->position(); // convert back to region relative } -nframes64_t -MidiRegionView::snap_frame_to_frame(nframes64_t x) +framepos_t +MidiRegionView::snap_frame_to_frame(framepos_t x) { PublicEditor& editor = trackview.editor(); // x is region relative, convert it to global absolute frames - nframes64_t frame = x + _region->position(); + framepos_t frame = x + _region->position(); editor.snap_to(frame); return frame - _region->position(); // convert back to region relative } @@ -2119,25 +2119,25 @@ MidiRegionView::snap_to_pixel(double x) double MidiRegionView::get_position_pixels() { - nframes64_t region_frame = get_position(); + framepos_t region_frame = get_position(); return trackview.editor().frame_to_pixel(region_frame); } double MidiRegionView::get_end_position_pixels() { - nframes64_t frame = get_position() + get_duration (); + framepos_t frame = get_position() + get_duration (); return trackview.editor().frame_to_pixel(frame); } -nframes64_t +framepos_t MidiRegionView::beats_to_frames(double beats) const { return _time_converter.to(beats); } double -MidiRegionView::frames_to_beats(nframes64_t frames) const +MidiRegionView::frames_to_beats(framepos_t frames) const { return _time_converter.from(frames); } @@ -2596,9 +2596,9 @@ MidiRegionView::nudge_notes (bool forward) into a vector and sort before using the first one. */ - nframes64_t ref_point = _region->position() + beats_to_frames ((*(_selection.begin()))->note()->time()); - nframes64_t unused; - nframes64_t distance; + framepos_t ref_point = _region->position() + beats_to_frames ((*(_selection.begin()))->note()->time()); + framepos_t unused; + framepos_t distance; if (trackview.editor().snap_mode() == Editing::SnapOff) { @@ -2784,7 +2784,7 @@ MidiRegionView::selection_as_cut_buffer () const } void -MidiRegionView::paste (nframes64_t pos, float times, const MidiCutBuffer& mcb) +MidiRegionView::paste (framepos_t pos, float times, const MidiCutBuffer& mcb) { if (mcb.empty()) { return; @@ -2822,8 +2822,8 @@ MidiRegionView::paste (nframes64_t pos, float times, const MidiCutBuffer& mcb) /* if we pasted past the current end of the region, extend the region */ - nframes64_t end_frame = _region->position() + beats_to_frames (end_point); - nframes64_t region_end = _region->position() + _region->length() - 1; + framepos_t end_frame = _region->position() + beats_to_frames (end_point); + framepos_t region_end = _region->position() + _region->length() - 1; if (end_frame > region_end) { @@ -2859,7 +2859,7 @@ MidiRegionView::time_sort_events () void MidiRegionView::goto_next_note () { - // nframes64_t pos = -1; + // framepos_t pos = -1; bool use_next = false; if (_events.back()->selected()) { @@ -2888,7 +2888,7 @@ MidiRegionView::goto_next_note () void MidiRegionView::goto_previous_note () { - // nframes64_t pos = -1; + // framepos_t pos = -1; bool use_next = false; if (_events.front()->selected()) { @@ -2941,7 +2941,7 @@ MidiRegionView::update_ghost_note (double x, double y) _last_ghost_y = y; group->w2i (x, y); - nframes64_t f = trackview.editor().pixel_to_frame (x) + _region->position (); + framepos_t f = trackview.editor().pixel_to_frame (x) + _region->position (); trackview.editor().snap_to (f); f -= _region->position (); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index baf67928c8..4e4e9544c5 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -118,7 +118,7 @@ class MidiRegionView : public RegionView void resolve_note(uint8_t note_num, double end_time); void cut_copy_clear (Editing::CutCopyOp); - void paste (nframes64_t pos, float times, const MidiCutBuffer&); + void paste (framepos_t pos, float times, const MidiCutBuffer&); struct PCEvent { PCEvent(double a_time, uint8_t a_value, uint8_t a_channel) @@ -253,21 +253,21 @@ class MidiRegionView : public RegionView /** Snap a region relative pixel coordinate to frame units. * @param x a pixel coordinate relative to region start - * @return the snapped nframes64_t coordinate relative to region start + * @return the snapped framepos_t coordinate relative to region start */ - nframes64_t snap_pixel_to_frame(double x); + framepos_t snap_pixel_to_frame(double x); /** Snap a region relative frame coordinate to frame units. * @param x a pixel coordinate relative to region start - * @return the snapped nframes64_t coordinate relative to region start + * @return the snapped framepos_t coordinate relative to region start */ - nframes64_t snap_frame_to_frame(nframes64_t x); + framepos_t snap_frame_to_frame(framepos_t x); /** Convert a timestamp in beats to frames (both relative to region start) */ - nframes64_t beats_to_frames(double beats) const; + framepos_t beats_to_frames(double beats) const; /** Convert a timestamp in frames to beats (both relative to region start) */ - double frames_to_beats(nframes64_t) const; + double frames_to_beats(framepos_t) const; void goto_previous_note (); void goto_next_note (); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index a393b11e4c..9c7750adca 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -81,6 +81,9 @@ class ImageFrameTimeAxis; class MarkerView; class DragManager; +using ARDOUR::framepos_t; +using ARDOUR::framecnt_t; + /// Representation of the interface of the Editor class /** This class contains just the public interface of the Editor class, @@ -128,7 +131,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual void set_snap_threshold (double t) = 0; /** Snap a value according to the current snap setting. */ - virtual void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false) = 0; + virtual void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false) = 0; /** Undo some transactions. * @param n Number of transactions to undo. @@ -185,15 +188,15 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual void separate_region_from_selection () = 0; virtual void transition_to_rolling (bool fwd) = 0; - virtual nframes64_t unit_to_frame (double unit) const = 0; - // XXX remove me when libardour goes nframes64_t + virtual framepos_t unit_to_frame (double unit) const = 0; + // XXX remove me when libardour goes framepos_t double frame_to_unit (nframes_t frame) const { - return frame_to_unit ((nframes64_t) frame); + return frame_to_unit ((framepos_t) frame); } - virtual double frame_to_unit (nframes64_t frame) const = 0; + virtual double frame_to_unit (framepos_t frame) const = 0; virtual double frame_to_unit (double frame) const = 0; - virtual nframes64_t pixel_to_frame (double pixel) const = 0; - virtual gulong frame_to_pixel (nframes64_t frame) const = 0; + virtual framepos_t pixel_to_frame (double pixel) const = 0; + virtual gulong frame_to_pixel (framepos_t frame) const = 0; virtual Selection& get_selection () const = 0; virtual Selection& get_cut_buffer () const = 0; virtual bool extend_selection_to_track (TimeAxisView&) = 0; @@ -245,25 +248,25 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual bool dragging_playhead () const = 0; virtual void ensure_float (Gtk::Window&) = 0; virtual void show_window () = 0; - virtual nframes64_t leftmost_position() const = 0; - virtual nframes64_t current_page_frames() const = 0; + virtual framepos_t leftmost_position() const = 0; + virtual framecnt_t current_page_frames() const = 0; virtual void temporal_zoom_step (bool coarser) = 0; virtual void scroll_tracks_down_line () = 0; virtual void scroll_tracks_up_line () = 0; virtual void prepare_for_cleanup () = 0; virtual void finish_cleanup () = 0; - virtual void reset_x_origin (nframes64_t frame) = 0; + virtual void reset_x_origin (framepos_t frame) = 0; virtual void remove_last_capture () = 0; virtual void maximise_editing_space () = 0; virtual void restore_editing_space () = 0; - virtual nframes64_t get_preferred_edit_position (bool ignore_playhead = false) = 0; + virtual framepos_t get_preferred_edit_position (bool ignore_playhead = false) = 0; virtual void toggle_meter_updating() = 0; virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0; - virtual void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false) = 0; + virtual void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false) = 0; virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0; virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0; - virtual nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next) = 0; - virtual Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position) = 0; + virtual framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next) = 0; + virtual Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position) = 0; #ifdef WITH_CMT virtual void connect_to_image_compositor() = 0; @@ -281,7 +284,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { sigc::signal<void> ZoomChanged; sigc::signal<void> Resized; sigc::signal<void> Realized; - sigc::signal<void,nframes64_t> UpdateAllTransportClocks; + sigc::signal<void,framepos_t> UpdateAllTransportClocks; static sigc::signal<void> DropDownKeys; @@ -353,7 +356,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual void show_verbose_canvas_cursor_with (const std::string& txt) = 0; virtual void hide_verbose_canvas_cursor() = 0; - virtual void center_screen (nframes64_t) = 0; + virtual void center_screen (framepos_t) = 0; virtual TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const = 0; virtual TrackViewList const & get_track_views () = 0; diff --git a/gtk2_ardour/region_layering_order_editor.h b/gtk2_ardour/region_layering_order_editor.h index 10bcd989b7..32d0971e5c 100644 --- a/gtk2_ardour/region_layering_order_editor.h +++ b/gtk2_ardour/region_layering_order_editor.h @@ -32,7 +32,7 @@ class RegionLayeringOrderEditor : public ArdourDialog private: boost::shared_ptr<ARDOUR::Playlist> playlist; - nframes64_t position; + framepos_t position; bool in_row_change; uint32_t regions_at_position; diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index e4911a43da..c3518ca61a 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -324,7 +324,7 @@ RegionView::lower_to_bottom () } bool -RegionView::set_position (nframes64_t pos, void* /*src*/, double* ignored) +RegionView::set_position (framepos_t pos, void* /*src*/, double* ignored) { double delta; bool ret; @@ -360,7 +360,7 @@ RegionView::set_samples_per_unit (gdouble spu) } bool -RegionView::set_duration (nframes64_t frames, void *src) +RegionView::set_duration (framecnt_t frames, void *src) { if (!TimeAxisViewItem::set_duration (frames, src)) { return false; diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index 71c7e5383a..c65b81bc7b 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -63,14 +63,14 @@ class RegionView : public TimeAxisViewItem virtual void set_height (double); virtual void set_samples_per_unit (double); - virtual bool set_duration (nframes64_t, void*); + virtual bool set_duration (framecnt_t, void*); void move (double xdelta, double ydelta); void raise_to_top (); void lower_to_bottom (); - bool set_position(nframes64_t pos, void* src, double* delta = 0); + bool set_position(framepos_t pos, void* src, double* delta = 0); void fake_set_opaque (bool yn); virtual void show_region_editor (); diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index 956a012697..fbfcab6c49 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -212,7 +212,7 @@ RhythmFerret::run_analysis () } int -RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr<Readable> readable, nframes64_t /*offset*/, AnalysisFeatureList& results) +RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr<Readable> readable, framepos_t /*offset*/, AnalysisFeatureList& results) { TransientDetector t (_session->frame_rate()); @@ -265,7 +265,7 @@ RhythmFerret::get_note_onset_function () } int -RhythmFerret::run_note_onset_analysis (boost::shared_ptr<Readable> readable, nframes64_t /*offset*/, AnalysisFeatureList& results) +RhythmFerret::run_note_onset_analysis (boost::shared_ptr<Readable> readable, framepos_t /*offset*/, AnalysisFeatureList& results) { try { OnsetDetector t (_session->frame_rate()); diff --git a/gtk2_ardour/rhythm_ferret.h b/gtk2_ardour/rhythm_ferret.h index 043b9fe8a7..1d84645056 100644 --- a/gtk2_ardour/rhythm_ferret.h +++ b/gtk2_ardour/rhythm_ferret.h @@ -85,8 +85,8 @@ class RhythmFerret : public ArdourDialog { int get_note_onset_function (); void run_analysis (); - int run_percussion_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, nframes64_t offset, ARDOUR::AnalysisFeatureList& results); - int run_note_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, nframes64_t offset, ARDOUR::AnalysisFeatureList& results); + int run_percussion_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList& results); + int run_note_onset_analysis (boost::shared_ptr<ARDOUR::Readable> region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList& results); void do_action (); void do_split_action (); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index abc8101195..d4b67800bb 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1296,8 +1296,8 @@ RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t d return boost::shared_ptr<Region> (); } -nframes64_t -RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir) +framepos_t +RouteTimeAxisView::find_next_region_boundary (framepos_t pos, int32_t dir) { boost::shared_ptr<Playlist> pl = playlist (); diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 90cc4aa48c..7dd61ac72c 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -89,7 +89,7 @@ public: LayerDisplay layer_display () const; boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t pos, ARDOUR::RegionPoint, int32_t dir); - nframes64_t find_next_region_boundary (nframes64_t pos, int32_t dir); + framepos_t find_next_region_boundary (framepos_t pos, int32_t dir); /* Editing operations */ void cut_copy_clear (Selection&, Editing::CutCopyOp); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index a48fcd2767..a9bec00123 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -1099,7 +1099,7 @@ bool SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool& src_needed, bool& multichannel) { SoundFileInfo info; - nframes64_t sz = 0; + framepos_t sz = 0; bool err = false; string errmsg; diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index aa8b48fc2b..3fafe9bcd8 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -102,12 +102,12 @@ TempoLines::draw (ARDOUR::TempoMap::BBTPointList& points, double frames_per_unit return; } - xpos = rint(((nframes64_t)(*i).frame) / (double)frames_per_unit); + xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_unit); const double needed_right = xpos; i = points.begin(); - xpos = rint(((nframes64_t)(*i).frame) / (double)frames_per_unit); + xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_unit); const double needed_left = xpos; Lines::iterator left = _lines.lower_bound(xpos); // first line >= xpos @@ -145,7 +145,7 @@ TempoLines::draw (ARDOUR::TempoMap::BBTPointList& points, double frames_per_unit } } - xpos = rint(((nframes64_t)(*i).frame) / (double)frames_per_unit); + xpos = rint(((framepos_t)(*i).frame) / (double)frames_per_unit); if (inserted_last_time && !_lines.empty()) { li = _lines.lower_bound(xpos); // first line >= xpos diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 118f4033a6..a79b1033a9 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -94,7 +94,7 @@ TimeAxisViewItem::set_constant_heights () */ TimeAxisViewItem::TimeAxisViewItem( const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color, - nframes64_t start, nframes64_t duration, bool recording, bool automation, Visibility vis + framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis ) : trackview (tv) , _height (1.0) @@ -136,7 +136,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) void TimeAxisViewItem::init ( - const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool wide, bool high) + const string& it_name, double spu, Gdk::Color const & base_color, framepos_t start, framepos_t duration, Visibility vis, bool wide, bool high) { item_name = it_name; samples_per_unit = spu; @@ -241,7 +241,7 @@ TimeAxisViewItem::~TimeAxisViewItem() */ bool -TimeAxisViewItem::set_position(nframes64_t pos, void* src, double* delta) +TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta) { if (position_locked) { return false; @@ -277,7 +277,7 @@ TimeAxisViewItem::set_position(nframes64_t pos, void* src, double* delta) } /** @return position of this item on the timeline */ -nframes64_t +framepos_t TimeAxisViewItem::get_position() const { return frame_position; @@ -292,7 +292,7 @@ TimeAxisViewItem::get_position() const */ bool -TimeAxisViewItem::set_duration (nframes64_t dur, void* src) +TimeAxisViewItem::set_duration (framepos_t dur, void* src) { if ((dur > max_item_duration) || (dur < min_item_duration)) { warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur) @@ -313,7 +313,7 @@ TimeAxisViewItem::set_duration (nframes64_t dur, void* src) } /** @return duration of this item */ -nframes64_t +framepos_t TimeAxisViewItem::get_duration() const { return item_duration; @@ -326,14 +326,14 @@ TimeAxisViewItem::get_duration() const * @param src the identity of the object that initiated the change */ void -TimeAxisViewItem::set_max_duration(nframes64_t dur, void* src) +TimeAxisViewItem::set_max_duration(framecnt_t dur, void* src) { max_item_duration = dur; MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */ } /** @return the maximum duration that this item may have */ -nframes64_t +framecnt_t TimeAxisViewItem::get_max_duration() const { return max_item_duration; @@ -346,14 +346,14 @@ TimeAxisViewItem::get_max_duration() const * @param src the identity of the object that initiated the change */ void -TimeAxisViewItem::set_min_duration(nframes64_t dur, void* src) +TimeAxisViewItem::set_min_duration(framecnt_t dur, void* src) { min_item_duration = dur; MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */ } /** @return the minimum duration that this item mey have */ -nframes64_t +framecnt_t TimeAxisViewItem::get_min_duration() const { return min_item_duration; diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index d2930255af..d51bacc7cb 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -32,6 +32,9 @@ class TimeAxisView; +using ARDOUR::framepos_t; +using ARDOUR::framecnt_t; + /** * Base class for items that may appear upon a TimeAxisView. */ @@ -41,14 +44,14 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList public: virtual ~TimeAxisViewItem(); - virtual bool set_position(nframes64_t, void*, double* delta = 0); - nframes64_t get_position() const; - virtual bool set_duration(nframes64_t, void*); - nframes64_t get_duration() const; - virtual void set_max_duration(nframes64_t, void*); - nframes64_t get_max_duration() const; - virtual void set_min_duration(nframes64_t, void*); - nframes64_t get_min_duration() const; + virtual bool set_position(framepos_t, void*, double* delta = 0); + framepos_t get_position() const; + virtual bool set_duration(framecnt_t, void*); + framecnt_t get_duration() const; + virtual void set_max_duration(framecnt_t, void*); + framecnt_t get_max_duration() const; + virtual void set_min_duration(framecnt_t, void*); + framecnt_t get_min_duration() const; virtual void set_position_locked(bool, void*); bool get_position_locked() const; void set_max_duration_active(bool, void*); @@ -112,19 +115,19 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList sigc::signal<void,std::string,std::string,void*> NameChanged; /** Emiited when the position of this item changes */ - sigc::signal<void,nframes64_t,void*> PositionChanged; + sigc::signal<void,framepos_t,void*> PositionChanged; /** Emitted when the position lock of this item is changed */ sigc::signal<void,bool,void*> PositionLockChanged; /** Emitted when the duration of this item changes */ - sigc::signal<void,nframes64_t,void*> DurationChanged; + sigc::signal<void,framecnt_t,void*> DurationChanged; /** Emitted when the maximum item duration is changed */ - sigc::signal<void,nframes64_t,void*> MaxDurationChanged; + sigc::signal<void,framecnt_t,void*> MaxDurationChanged; /** Emitted when the mionimum item duration is changed */ - sigc::signal<void,nframes64_t,void*> MinDurationChanged; + sigc::signal<void,framecnt_t,void*> MinDurationChanged; enum Visibility { ShowFrame = 0x1, @@ -137,13 +140,13 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList FullWidthNameHighlight = 0x80 }; -protected: + protected: TimeAxisViewItem(const std::string &, ArdourCanvas::Group&, TimeAxisView&, double, Gdk::Color const &, - nframes64_t, nframes64_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); + framepos_t, framepos_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); TimeAxisViewItem (const TimeAxisViewItem&); - void init (const std::string&, double, Gdk::Color const &, nframes64_t, nframes64_t, Visibility, bool, bool); + void init (const std::string&, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool); virtual void compute_colors (Gdk::Color const &); virtual void set_colors(); @@ -163,16 +166,16 @@ protected: bool position_locked; /** position of this item on the timeline */ - nframes64_t frame_position; + framepos_t frame_position; /** duration of this item upon the timeline */ - nframes64_t item_duration; - + framecnt_t item_duration; + /** maximum duration that this item can have */ - nframes64_t max_item_duration; + framecnt_t max_item_duration; /** minimum duration that this item can have */ - nframes64_t min_item_duration; + framecnt_t min_item_duration; /** indicates whether the max duration constraint is active */ bool max_duration_active; diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 6002a2549d..1486353ca0 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -434,7 +434,7 @@ Amp::GainControl::get_value (void) const } void -Amp::setup_gain_automation (sframes_t start_frame, sframes_t end_frame, nframes_t nframes) +Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes) { Glib::Mutex::Lock am (control_lock(), Glib::TRY_LOCK); diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index 011fef13c0..0ec493e8ce 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -48,7 +48,7 @@ public: bool apply_gain() const { return _apply_gain; } void apply_gain(bool yn) { _apply_gain = yn; } - void setup_gain_automation (sframes_t start_frame, sframes_t end_frame, nframes_t nframes); + void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); bool apply_gain_automation() const { return _apply_gain_automation; } void apply_gain_automation(bool yn) { _apply_gain_automation = yn; } diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index ecd88b94e5..8e31db34fd 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -49,7 +49,7 @@ class AudioTrack : public Track return DataType::AUDIO; } - int export_stuff (BufferSet& bufs, sframes_t start_frame, nframes_t nframes, bool enable_processing = true); + int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes, bool enable_processing = true); void freeze_me (InterThreadInfo&); void unfreeze (); diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h index 627dc3f137..f16a2b1e49 100644 --- a/libs/ardour/ardour/audioanalyser.h +++ b/libs/ardour/ardour/audioanalyser.h @@ -56,8 +56,8 @@ class AudioAnalyser : public boost::noncopyable { AnalysisPlugin* plugin; AnalysisPluginKey plugin_key; - nframes64_t bufsize; - nframes64_t stepsize; + nframes_t bufsize; + nframes_t stepsize; int initialize_plugin (AnalysisPluginKey name, float sample_rate); int analyse (const std::string& path, Readable*, uint32_t channel); diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index bd3d223fc1..57b5ced93c 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -58,8 +58,8 @@ public: /* this block of methods do nothing for regular file sources, but are significant for files used in destructive recording. */ - virtual sframes_t last_capture_start_frame() const { return 0; } - virtual void mark_capture_start (sframes_t) {} + virtual framepos_t last_capture_start_frame() const { return 0; } + virtual void mark_capture_start (framepos_t) {} virtual void mark_capture_end () {} virtual void clear_capture_marks() {} virtual bool one_of_several_channels () const { return false; } diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 71a948c352..b294082273 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -177,12 +177,12 @@ class AudioRegion : public Region void resume_fade_in (); void resume_fade_out (); - void add_transient (nframes64_t where); - void remove_transient (nframes64_t where); + void add_transient (framepos_t where); + void remove_transient (framepos_t where); int set_transients (AnalysisFeatureList&); int get_transients (AnalysisFeatureList&, bool force_new = false); - int update_transient (nframes64_t old_position, nframes64_t new_position); - int adjust_transients (nframes64_t delta); + int update_transient (framepos_t old_position, framepos_t new_position); + int adjust_transients (framepos_t delta); std::list<std::pair<frameoffset_t, framecnt_t> > find_silence (Sample, framecnt_t, InterThreadInfo&) const; diff --git a/libs/ardour/ardour/beats_frames_converter.h b/libs/ardour/ardour/beats_frames_converter.h index b1e44adbef..816721ebad 100644 --- a/libs/ardour/ardour/beats_frames_converter.h +++ b/libs/ardour/ardour/beats_frames_converter.h @@ -29,15 +29,15 @@ namespace ARDOUR { class TempoMap; -class BeatsFramesConverter : public Evoral::TimeConverter<double,sframes_t> { +class BeatsFramesConverter : public Evoral::TimeConverter<double,framepos_t> { public: - BeatsFramesConverter(const TempoMap& tempo_map, sframes_t origin) - : Evoral::TimeConverter<double, sframes_t> (origin) + BeatsFramesConverter(const TempoMap& tempo_map, framepos_t origin) + : Evoral::TimeConverter<double, framepos_t> (origin) , _tempo_map(tempo_map) {} - sframes_t to(double beats) const; - double from(sframes_t frames) const; + framepos_t to(double beats) const; + double from(framepos_t frames) const; private: const TempoMap& _tempo_map; diff --git a/libs/ardour/ardour/caimportable.h b/libs/ardour/ardour/caimportable.h index dbf93dbb73..1fe94b8953 100644 --- a/libs/ardour/ardour/caimportable.h +++ b/libs/ardour/ardour/caimportable.h @@ -38,7 +38,7 @@ class CAImportableSource : public ImportableSource { nframes_t length() const; nframes_t samplerate() const; void seek (nframes_t pos); - nframes64_t natural_position() const { return 0; } + framepos_t natural_position() const { return 0; } protected: mutable CAAudioFile af; diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h index 649c57c3ca..c83b63934f 100644 --- a/libs/ardour/ardour/coreaudiosource.h +++ b/libs/ardour/ardour/coreaudiosource.h @@ -45,7 +45,7 @@ class CoreAudioSource : public AudioFileSource { static int get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg); protected: - nframes_t read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const; + nframes_t read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) const; nframes_t write_unlocked (Sample *dst, nframes_t cnt) { return 0; } private: diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index f7cbc29af7..c920fadc2c 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -66,15 +66,15 @@ public: bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); - void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); /* supplemental method used with MIDI */ - void flush_buffers (nframes_t nframes, nframes64_t time); + void flush_buffers (nframes_t nframes, framepos_t time); void no_outs_cuz_we_no_monitor(bool); void cycle_start (nframes_t); void increment_output_offset (nframes_t); - void transport_stopped (sframes_t frame); + void transport_stopped (framepos_t frame); BufferSet& output_buffers() { return *_output_buffers; } diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h index 49400a9363..f826e09bf5 100644 --- a/libs/ardour/ardour/export_handler.h +++ b/libs/ardour/ardour/export_handler.h @@ -141,7 +141,7 @@ class ExportHandler : public ExportElementFactory TimespanBounds timespan_bounds; PBD::ScopedConnection process_connection; - sframes_t process_position; + framepos_t process_position; /* CD Marker stuff */ @@ -161,13 +161,13 @@ class ExportHandler : public ExportElementFactory /* Track info */ uint32_t track_number; - sframes_t track_position; - sframes_t track_duration; - sframes_t track_start_frame; + framepos_t track_position; + framepos_t track_duration; + framepos_t track_start_frame; /* Index info */ uint32_t index_number; - sframes_t index_position; + framepos_t index_position; }; @@ -182,7 +182,7 @@ class ExportHandler : public ExportElementFactory void write_index_info_cue (CDMarkerStatus & status); void write_index_info_toc (CDMarkerStatus & status); - void frames_to_cd_frames_string (char* buf, sframes_t when); + void frames_to_cd_frames_string (char* buf, framepos_t when); int cue_tracknum; int cue_indexnum; diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 1facfb8ec2..6793072cba 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -163,7 +163,7 @@ class IO : public SessionObject, public Latent /* three utility functions - this just seems to be simplest place to put them */ void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset); - void process_input (boost::shared_ptr<Processor>, sframes_t start_frame, sframes_t end_frame, nframes_t nframes); + void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, nframes_t nframes); void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset); /* AudioTrack::deprecated_use_diskstream_connections() needs these */ diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index f3c322e2d4..c2da2c04cb 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -52,7 +52,7 @@ class Location : public SessionHandleRef, public PBD::StatefulDestructible }; Location (Session &); - Location (Session &, nframes64_t, nframes64_t, const std::string &, Flags bits = Flags(0)); + Location (Session &, framepos_t, framepos_t, const std::string &, Flags bits = Flags(0)); Location (const Location& other); Location (Session &, const XMLNode&); Location* operator= (const Location& other); @@ -61,15 +61,15 @@ class Location : public SessionHandleRef, public PBD::StatefulDestructible void lock (); void unlock (); - nframes64_t start() const { return _start; } - nframes64_t end() const { return _end; } - nframes64_t length() const { return _end - _start; } + framepos_t start() const { return _start; } + framepos_t end() const { return _end; } + framepos_t length() const { return _end - _start; } - int set_start (nframes64_t s, bool force = false, bool allow_bbt_recompute = true); - int set_end (nframes64_t e, bool force = false, bool allow_bbt_recompute = true); - int set (nframes64_t start, nframes64_t end, bool allow_bbt_recompute = true); + int set_start (framepos_t s, bool force = false, bool allow_bbt_recompute = true); + int set_end (framepos_t e, bool force = false, bool allow_bbt_recompute = true); + int set (framepos_t start, framepos_t end, bool allow_bbt_recompute = true); - int move_to (nframes64_t pos); + int move_to (framepos_t pos); const std::string& name() const { return _name; } void set_name (const std::string &str) { _name = str; name_changed(this); } @@ -116,9 +116,9 @@ class Location : public SessionHandleRef, public PBD::StatefulDestructible private: std::string _name; - nframes64_t _start; + framepos_t _start; BBT_Time _bbt_start; - nframes64_t _end; + framepos_t _end; BBT_Time _bbt_end; Flags _flags; bool _locked; @@ -159,12 +159,12 @@ class Locations : public SessionHandleRef, public PBD::StatefulDestructible int set_current (Location *, bool want_lock = true); Location *current () const { return current_location; } - Location* first_location_before (nframes64_t, bool include_special_ranges = false); - Location* first_location_after (nframes64_t, bool include_special_ranges = false); + Location* first_location_before (framepos_t, bool include_special_ranges = false); + Location* first_location_after (framepos_t, bool include_special_ranges = false); - void marks_either_side (nframes64_t const, nframes64_t &, nframes64_t &) const; + void marks_either_side (framepos_t const, framepos_t &, framepos_t &) const; - void find_all_between (nframes64_t start, nframes64_t, LocationList&, Location::Flags); + void find_all_between (framepos_t start, framepos_t, LocationList&, Location::Flags); enum Change { ADDITION, ///< a location was added, but nothing else changed diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h index 10d8c7b6ca..8b6095c470 100644 --- a/libs/ardour/ardour/midi_port.h +++ b/libs/ardour/ardour/midi_port.h @@ -41,7 +41,7 @@ class MidiPort : public Port { void cycle_end (nframes_t nframes); void cycle_split (); - void flush_buffers (nframes_t nframes, nframes64_t time, nframes_t offset = 0); + void flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset = 0); void transport_stopped (); size_t raw_buffer_size(jack_nframes_t nframes) const; diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index 71c4eaca6d..3bad6d6ddc 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -59,25 +59,25 @@ class MidiSource : virtual public Source * \param tracker an optional pointer to MidiStateTracker object, for note on/off tracking */ virtual nframes_t midi_read (Evoral::EventSink<nframes_t>& dst, - sframes_t source_start, - sframes_t start, nframes_t cnt, + framepos_t source_start, + framepos_t start, nframes_t cnt, MidiStateTracker*, std::set<Evoral::Parameter> const &) const; virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src, - sframes_t source_start, + framepos_t source_start, nframes_t cnt); virtual void append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& ev) = 0; virtual void append_event_unlocked_frames(const Evoral::Event<nframes_t>& ev, - sframes_t source_start) = 0; + framepos_t source_start) = 0; virtual bool empty () const; virtual framecnt_t length (framepos_t pos) const; virtual void update_length (framepos_t pos, framecnt_t cnt); - virtual void mark_streaming_midi_write_started (NoteMode mode, sframes_t start_time); + virtual void mark_streaming_midi_write_started (NoteMode mode, framepos_t start_time); virtual void mark_streaming_write_started (); virtual void mark_streaming_write_completed (); @@ -92,7 +92,7 @@ class MidiSource : virtual public Source static PBD::Signal1<void,MidiSource*> MidiSourceCreated; // Signal a range of recorded data is available for reading from model() - mutable PBD::Signal2<void,sframes_t,nframes_t> ViewDataRangeReady; + mutable PBD::Signal2<void,framepos_t,nframes_t> ViewDataRangeReady; XMLNode& get_state (); int set_state (const XMLNode&, int version); @@ -134,12 +134,12 @@ class MidiSource : virtual public Source virtual void flush_midi() = 0; virtual nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst, - sframes_t position, - sframes_t start, nframes_t cnt, + framepos_t position, + framepos_t start, nframes_t cnt, MidiStateTracker* tracker) const = 0; virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst, - sframes_t position, + framepos_t position, nframes_t cnt) = 0; std::string _captured_for; @@ -153,8 +153,8 @@ class MidiSource : virtual public Source mutable bool _model_iter_valid; mutable double _length_beats; - mutable sframes_t _last_read_end; - sframes_t _last_write_end; + mutable framepos_t _last_read_end; + framepos_t _last_write_end; /** Map of interpolation styles to use for Parameters; if they are not in this map, * the correct interpolation style can be obtained from EventTypeMap::interpolation_of () diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h index 5c65c1f018..9720649a10 100644 --- a/libs/ardour/ardour/midi_state_tracker.h +++ b/libs/ardour/ardour/midi_state_tracker.h @@ -41,8 +41,8 @@ public: void track (const MidiBuffer::iterator& from, const MidiBuffer::iterator& to, bool& looped); void add (uint8_t note, uint8_t chn); void remove (uint8_t note, uint8_t chn); - void resolve_notes (MidiBuffer& buffer, nframes64_t time); - void resolve_notes (Evoral::EventSink<nframes_t>& buffer, nframes64_t time); + void resolve_notes (MidiBuffer& buffer, framepos_t time); + void resolve_notes (Evoral::EventSink<nframes_t>& buffer, framepos_t time); void resolve_notes (MidiSource& src, Evoral::MusicalTime time); void dump (std::ostream&); void reset (); diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index ea2b0804f8..0475f3f5ea 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -54,7 +54,7 @@ public: void set_latency_delay (nframes_t); - int export_stuff (BufferSet& bufs, nframes_t nframes, sframes_t end_frame); + int export_stuff (BufferSet& bufs, nframes_t nframes, framepos_t end_frame); void freeze_me (InterThreadInfo&); void unfreeze (); @@ -110,7 +110,7 @@ protected: private: boost::shared_ptr<MidiDiskstream> midi_diskstream () const; - void write_out_of_band_data (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes); + void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes); void set_state_part_two (); void set_state_part_three (); @@ -122,7 +122,7 @@ private: uint8_t _default_channel; bool _midi_thru; - int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, + int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input); void push_midi_input_to_step_edit_ringbuffer (nframes_t nframes); }; diff --git a/libs/ardour/ardour/pi_controller.h b/libs/ardour/ardour/pi_controller.h index 250c943de9..a118fd739f 100644 --- a/libs/ardour/ardour/pi_controller.h +++ b/libs/ardour/ardour/pi_controller.h @@ -60,24 +60,24 @@ class PIChaser { PIChaser(); ~PIChaser(); - double get_ratio( nframes64_t chasetime_measured, nframes64_t chasetime, nframes64_t slavetime_measured, nframes64_t slavetime, bool in_control, int period_size ); + double get_ratio( framepos_t chasetime_measured, framepos_t chasetime, framepos_t slavetime_measured, framepos_t slavetime, bool in_control, int period_size ); void reset(); - nframes64_t want_locate() { return want_locate_val; } + framepos_t want_locate() { return want_locate_val; } private: PIController *pic; - nframes64_t realtime_stamps[ESTIMATOR_SIZE]; - nframes64_t chasetime_stamps[ESTIMATOR_SIZE]; + framepos_t realtime_stamps[ESTIMATOR_SIZE]; + framepos_t chasetime_stamps[ESTIMATOR_SIZE]; int array_index; - nframes64_t want_locate_val; + framepos_t want_locate_val; - void feed_estimator( nframes64_t realtime, nframes64_t chasetime ); + void feed_estimator( framepos_t realtime, framepos_t chasetime ); double get_estimate(); double speed; double speed_threshold; - nframes64_t pos_threshold; + framepos_t pos_threshold; }; diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 8b2b3dcbd3..23b42a55ea 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -109,7 +109,7 @@ public: virtual void cycle_end (nframes_t) = 0; virtual void cycle_split () = 0; virtual Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) = 0; - virtual void flush_buffers (nframes_t nframes, nframes64_t /*time*/, nframes_t offset = 0) { + virtual void flush_buffers (nframes_t nframes, framepos_t /*time*/, nframes_t offset = 0) { assert(offset < nframes); } virtual void transport_stopped () {} diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index b09e89d3a0..b78699d906 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -103,8 +103,8 @@ class Region * START: first frame of the region within its source(s) * LENGTH: number of frames the region represents */ - sframes_t position () const { return _position; } - sframes_t start () const { return _start; } + framepos_t position () const { return _position; } + framepos_t start () const { return _start; } framecnt_t length() const { return _length; } layer_t layer () const { return _layer; } @@ -112,15 +112,15 @@ class Region /* these two are valid ONLY during a StateChanged signal handler */ - sframes_t last_position() const { return _last_position; } + framepos_t last_position() const { return _last_position; } framecnt_t last_length() const { return _last_length; } - sframes_t ancestral_start () const { return _ancestral_start; } + framepos_t ancestral_start () const { return _ancestral_start; } framecnt_t ancestral_length () const { return _ancestral_length; } float stretch() const { return _stretch; } float shift() const { return _shift; } - void set_ancestral_data (nframes64_t start, nframes64_t length, float stretch, float shift); + void set_ancestral_data (framepos_t start, framepos_t length, float stretch, float shift); frameoffset_t sync_offset(int& dir) const; framepos_t sync_position() const; @@ -247,16 +247,16 @@ class Region virtual int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) = 0; - virtual void add_transient (nframes64_t) { + virtual void add_transient (framepos_t) { // no transients, but its OK } - virtual int update_transient (nframes64_t /* old_position */, nframes64_t /* new_position */) { + virtual int update_transient (framepos_t /* old_position */, framepos_t /* new_position */) { // no transients, but its OK return 0; } - virtual void remove_transient (nframes64_t /* where */) { + virtual void remove_transient (framepos_t /* where */) { // no transients, but its OK } @@ -271,7 +271,7 @@ class Region return 0; } - virtual int adjust_transients (nframes64_t /*delta*/) { + virtual int adjust_transients (framepos_t /*delta*/) { // no transients, but its OK return 0; } diff --git a/libs/ardour/ardour/return.h b/libs/ardour/ardour/return.h index 2dcb6eb270..cf709ed2f2 100644 --- a/libs/ardour/ardour/return.h +++ b/libs/ardour/ardour/return.h @@ -74,7 +74,7 @@ private: uint32_t _bitslot; void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset=ChanCount::ZERO); - void just_meter_input (sframes_t start_frame, sframes_t end_frame, nframes_t nframes); + void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index b49cb77788..9a874b459d 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -101,13 +101,13 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, /* these are the core of the API of a Route. see the protected sections as well */ - virtual int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, + virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler); - virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, + virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input); - virtual int silent_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, + virtual int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool can_record, bool rec_monitors_input, bool& need_butler); virtual void toggle_monitor_input (); @@ -120,7 +120,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, /* end of vfunc-based API */ - void shift (nframes64_t, nframes64_t); + void shift (framepos_t, framepos_t); void set_gain (gain_t val, void *src); void inc_gain (gain_t delta, void *src); @@ -382,20 +382,20 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, void mod_solo_by_others_downstream (int32_t); bool has_external_redirects() const; void curve_reallocate (); - void just_meter_input (sframes_t start_frame, sframes_t end_frame, nframes_t nframes); + void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); virtual void set_block_size (nframes_t nframes); protected: nframes_t check_initial_delay (nframes_t, nframes_t&); - void passthru (sframes_t start_frame, sframes_t end_frame, + void passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick); - virtual void write_out_of_band_data (BufferSet& /* bufs */, sframes_t /* start_frame */, sframes_t /* end_frame */, + virtual void write_out_of_band_data (BufferSet& /* bufs */, framepos_t /* start_frame */, framepos_t /* end_frame */, nframes_t /* nframes */) {} virtual void process_output_buffers (BufferSet& bufs, - sframes_t start_frame, sframes_t end_frame, + framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool with_processors, int declick); boost::shared_ptr<IO> _input; @@ -444,7 +444,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, int configure_processors (ProcessorStreams*); - void passthru_silence (sframes_t start_frame, sframes_t end_frame, + void passthru_silence (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick); void silence (nframes_t); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 315ad887ae..93d15b8439 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -212,7 +212,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr<RouteList> get_routes_with_internal_returns() const; - boost::shared_ptr<RouteList> get_routes_with_regions_at (nframes64_t const) const; + boost::shared_ptr<RouteList> get_routes_with_regions_at (framepos_t const) const; uint32_t nroutes() const { return routes.reader()->size(); } uint32_t ntracks () const; @@ -270,8 +270,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* Transport mechanism signals */ PBD::Signal0<void> TransportStateChange; /* generic */ - PBD::Signal1<void,nframes64_t> PositionChanged; /* sent after any non-sequential motion */ - PBD::Signal1<void,nframes64_t> Xrun; + PBD::Signal1<void,framepos_t> PositionChanged; /* sent after any non-sequential motion */ + PBD::Signal1<void,framepos_t> Xrun; PBD::Signal0<void> TransportLooped; /** emitted when a locate has occurred */ @@ -428,9 +428,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* Time */ - nframes64_t transport_frame () const {return _transport_frame; } - nframes64_t audible_frame () const; - nframes64_t requested_return_frame() const { return _requested_return_frame; } + framepos_t transport_frame () const {return _transport_frame; } + framepos_t audible_frame () const; + framepos_t requested_return_frame() const { return _requested_return_frame; } enum PullupFormat { pullup_Plus4Plus1, @@ -774,8 +774,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr<SessionPlaylists> playlists; - void send_mmc_locate (nframes64_t); - int send_full_time_code (nframes64_t); + void send_mmc_locate (framepos_t); + int send_full_time_code (framepos_t); PBD::Signal0<void> RouteOrderKeyChanged; @@ -822,7 +822,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi nframes_t _nominal_frame_rate; //ignores audioengine setting, "native" SR int transport_sub_state; mutable gint _record_status; - volatile nframes64_t _transport_frame; + volatile framepos_t _transport_frame; Location* _session_range_location; ///< session range, or 0 if there is nothing in the session yet Slave* _slave; bool _silent; @@ -834,9 +834,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi CubicInterpolation interpolation; bool auto_play_legal; - nframes64_t _last_slave_transport_frame; + framepos_t _last_slave_transport_frame; nframes_t maximum_output_latency; - volatile nframes64_t _requested_return_frame; + volatile framepos_t _requested_return_frame; nframes_t current_block_size; nframes_t _worst_output_latency; nframes_t _worst_input_latency; @@ -1147,9 +1147,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void overwrite_some_buffers (Track *); void flush_all_inserts (); int micro_locate (nframes_t distance); - void locate (nframes64_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true); - void start_locate (nframes64_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false); - void force_locate (nframes64_t frame, bool with_roll = false); + void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true); + void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false); + void force_locate (framepos_t frame, bool with_roll = false); void set_track_speed (Track *, double speed); void set_transport_speed (double speed, bool abort = false, bool clear_state = false); void stop_transport (bool abort = false, bool clear_state = false); diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index 396f4e778b..5c31217045 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -53,14 +53,14 @@ struct SessionEvent { Type type; Action action; - nframes64_t action_frame; - nframes64_t target_frame; + framepos_t action_frame; + framepos_t target_frame; double speed; union { void* ptr; bool yes_or_no; - nframes64_t target2_frame; + framepos_t target2_frame; Slave* slave; Route* route; }; @@ -148,13 +148,13 @@ protected: void dump_events () const; void merge_event (SessionEvent*); - void replace_event (SessionEvent::Type, nframes64_t action_frame, nframes64_t target = 0); + void replace_event (SessionEvent::Type, framepos_t action_frame, framepos_t target = 0); bool _replace_event (SessionEvent*); bool _remove_event (SessionEvent *); void _clear_event_type (SessionEvent::Type); - void add_event (nframes64_t action_frame, SessionEvent::Type type, nframes64_t target_frame = 0); - void remove_event (nframes64_t frame, SessionEvent::Type type); + void add_event (framepos_t action_frame, SessionEvent::Type type, framepos_t target_frame = 0); + void remove_event (framepos_t frame, SessionEvent::Type type); virtual void process_event(SessionEvent*) = 0; virtual void set_next_event () = 0; diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 111564cc23..74cf4371b0 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -113,7 +113,7 @@ class Slave { * @param position - The transport position requested * @return - The return value is currently ignored (see Session::follow_slave) */ - virtual bool speed_and_position (double& speed, nframes64_t& position) = 0; + virtual bool speed_and_position (double& speed, framepos_t& position) = 0; /** * reports to ARDOUR whether the Slave is currently synced to its external @@ -156,7 +156,7 @@ class Slave { * only if requires_seekahead() returns true. */ - virtual nframes64_t seekahead_distance() const { return 0; } + virtual framepos_t seekahead_distance() const { return 0; } /** * @return - when returning true, ARDOUR will use transport speed 1.0 no matter what @@ -176,12 +176,12 @@ class ISlaveSessionProxy { virtual ~ISlaveSessionProxy() {} virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); } virtual nframes_t frame_rate() const { return 0; } - virtual nframes64_t audible_frame () const { return 0; } - virtual nframes64_t transport_frame () const { return 0; } + virtual framepos_t audible_frame () const { return 0; } + virtual framepos_t transport_frame () const { return 0; } virtual nframes_t frames_since_cycle_start () const { return 0; } - virtual nframes64_t frame_time () const { return 0; } + virtual framepos_t frame_time () const { return 0; } - virtual void request_locate (nframes64_t /*frame*/, bool with_roll = false) { + virtual void request_locate (framepos_t /*frame*/, bool with_roll = false) { (void) with_roll; } virtual void request_transport_speed (double /*speed*/) {} @@ -197,19 +197,19 @@ class SlaveSessionProxy : public ISlaveSessionProxy { TempoMap& tempo_map() const; nframes_t frame_rate() const; - nframes64_t audible_frame () const; - nframes64_t transport_frame () const; + framepos_t audible_frame () const; + framepos_t transport_frame () const; nframes_t frames_since_cycle_start () const; - nframes64_t frame_time () const; + framepos_t frame_time () const; - void request_locate (nframes64_t frame, bool with_roll = false); + void request_locate (framepos_t frame, bool with_roll = false); void request_transport_speed (double speed); }; struct SafeTime { volatile int guard1; - nframes64_t position; - nframes64_t timestamp; + framepos_t position; + framepos_t timestamp; double speed; volatile int guard2; @@ -228,7 +228,7 @@ class MTC_Slave : public Slave { ~MTC_Slave (); void rebind (MIDI::Port&); - bool speed_and_position (double&, nframes64_t&); + bool speed_and_position (double&, framepos_t&); bool locked() const; bool ok() const; @@ -236,7 +236,7 @@ class MTC_Slave : public Slave { nframes_t resolution() const; bool requires_seekahead () const { return true; } - nframes64_t seekahead_distance() const; + framepos_t seekahead_distance() const; bool give_slave_full_control_over_transport_speed() const; private: @@ -275,8 +275,8 @@ class MTC_Slave : public Slave { void update_mtc_time (const MIDI::byte *, bool, nframes_t); void update_mtc_status (MIDI::MTC_Status); void read_current (SafeTime *) const; - void reset_window (nframes64_t); - bool outside_window (nframes64_t) const; + void reset_window (framepos_t); + bool outside_window (framepos_t) const; void process_apparent_speed (double); }; @@ -289,7 +289,7 @@ class MIDIClock_Slave : public Slave { ~MIDIClock_Slave (); void rebind (MIDI::Port&); - bool speed_and_position (double&, nframes64_t&); + bool speed_and_position (double&, framepos_t&); bool locked() const; bool ok() const; @@ -344,17 +344,17 @@ class MIDIClock_Slave : public Slave { double b, c, omega; void reset (); - void start (MIDI::Parser& parser, nframes64_t timestamp); - void contineu (MIDI::Parser& parser, nframes64_t timestamp); - void stop (MIDI::Parser& parser, nframes64_t timestamp); + void start (MIDI::Parser& parser, framepos_t timestamp); + void contineu (MIDI::Parser& parser, framepos_t timestamp); + void stop (MIDI::Parser& parser, framepos_t timestamp); void position (MIDI::Parser& parser, MIDI::byte* message, size_t size); // we can't use continue because it is a C++ keyword - void calculate_one_ppqn_in_frames_at(nframes64_t time); - nframes64_t calculate_song_position(uint16_t song_position_in_sixteenth_notes); + void calculate_one_ppqn_in_frames_at(framepos_t time); + framepos_t calculate_song_position(uint16_t song_position_in_sixteenth_notes); void calculate_filter_coefficients(); - void update_midi_clock (MIDI::Parser& parser, nframes64_t timestamp); + void update_midi_clock (MIDI::Parser& parser, framepos_t timestamp); void read_current (SafeTime *) const; - bool stop_if_no_more_clock_events(nframes64_t& pos, nframes64_t now); + bool stop_if_no_more_clock_events(framepos_t& pos, framepos_t now); /// whether transport should be rolling bool _started; @@ -370,7 +370,7 @@ class JACK_Slave : public Slave JACK_Slave (jack_client_t*); ~JACK_Slave (); - bool speed_and_position (double& speed, nframes64_t& pos); + bool speed_and_position (double& speed, framepos_t& pos); bool starting() const { return _starting; } bool locked() const; diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h index 165e03e483..bd1428a129 100644 --- a/libs/ardour/ardour/smf_source.h +++ b/libs/ardour/ardour/smf_source.h @@ -52,9 +52,9 @@ public: bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); } void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev); - void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sframes_t source_start); + void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t source_start); - void mark_streaming_midi_write_started (NoteMode mode, sframes_t start_time); + void mark_streaming_midi_write_started (NoteMode mode, framepos_t start_time); void mark_streaming_write_completed (); XMLNode& get_state (); @@ -74,21 +74,21 @@ public: private: nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst, - sframes_t position, - sframes_t start, + framepos_t position, + framepos_t start, nframes_t cnt, MidiStateTracker* tracker) const; nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src, - sframes_t position, + framepos_t position, nframes_t cnt); double _last_ev_time_beats; - sframes_t _last_ev_time_frames; + framepos_t _last_ev_time_frames; /** end time (start + duration) of last call to read_unlocked */ - mutable sframes_t _smf_last_read_end; + mutable framepos_t _smf_last_read_end; /** time (in SMF ticks, 1 tick per _ppqn) of the last event read by read_unlocked */ - mutable sframes_t _smf_last_read_time; + mutable framepos_t _smf_last_read_time; }; }; /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 06e329a74b..ae2cba449a 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -47,10 +47,10 @@ class SndFileSource : public AudioFileSource { int update_header (framepos_t when, struct tm&, time_t); int flush_header (); - nframes64_t natural_position () const; + framepos_t natural_position () const; - sframes_t last_capture_start_frame() const; - void mark_capture_start (sframes_t); + framepos_t last_capture_start_frame() const; + void mark_capture_start (framepos_t); void mark_capture_end (); void clear_capture_marks(); diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index ebe8cdf0f5..b8b3c9c229 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -97,8 +97,8 @@ class Source : public SessionObject std::string get_transients_path() const; int load_transients (const std::string&); - sframes_t timeline_position() const { return _timeline_position; } - virtual void set_timeline_position (sframes_t pos); + framepos_t timeline_position() const { return _timeline_position; } + virtual void set_timeline_position (framepos_t pos); void set_allow_remove_if_empty (bool yn); @@ -114,7 +114,7 @@ class Source : public SessionObject DataType _type; Flag _flags; time_t _timestamp; - sframes_t _timeline_position; + framepos_t _timeline_position; bool _analysed; mutable Glib::Mutex _lock; mutable Glib::Mutex _analysis_lock; diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 21a1185725..e692334234 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -80,18 +80,18 @@ class MetricSection { public: MetricSection (const BBT_Time& start) : _start (start), _frame (0), _movable (true) {} - MetricSection (nframes64_t start) + MetricSection (framepos_t start) : _frame (start), _movable (true) {} virtual ~MetricSection() {} const BBT_Time& start() const { return _start; } - nframes64_t frame() const { return _frame; } + framepos_t frame() const { return _frame; } void set_movable (bool yn) { _movable = yn; } bool movable() const { return _movable; } - virtual void set_frame (nframes64_t f) { + virtual void set_frame (framepos_t f) { _frame = f; } @@ -109,7 +109,7 @@ class MetricSection { private: BBT_Time _start; - nframes64_t _frame; + framepos_t _frame; bool _movable; }; @@ -117,7 +117,7 @@ class MeterSection : public MetricSection, public Meter { public: MeterSection (const BBT_Time& start, double bpb, double note_type) : MetricSection (start), Meter (bpb, note_type) {} - MeterSection (nframes64_t start, double bpb, double note_type) + MeterSection (framepos_t start, double bpb, double note_type) : MetricSection (start), Meter (bpb, note_type) {} MeterSection (const XMLNode&); @@ -130,7 +130,7 @@ class TempoSection : public MetricSection, public Tempo { public: TempoSection (const BBT_Time& start, double qpm, double note_type) : MetricSection (start), Tempo (qpm, note_type) {} - TempoSection (nframes64_t start, double qpm, double note_type) + TempoSection (framepos_t start, double qpm, double note_type) : MetricSection (start), Tempo (qpm, note_type) {} TempoSection (const XMLNode&); @@ -150,25 +150,25 @@ class TempoMetric { void set_tempo (const Tempo& t) { _tempo = &t; } void set_meter (const Meter& m) { _meter = &m; } - void set_frame (nframes64_t f) { _frame = f; } + void set_frame (framepos_t f) { _frame = f; } void set_start (const BBT_Time& t) { _start = t; } const Meter& meter() const { return *_meter; } const Tempo& tempo() const { return *_tempo; } - nframes64_t frame() const { return _frame; } + framepos_t frame() const { return _frame; } const BBT_Time& start() const { return _start; } private: const Meter* _meter; const Tempo* _tempo; - nframes64_t _frame; + framepos_t _frame; BBT_Time _start; }; class TempoMap : public PBD::StatefulDestructible { public: - TempoMap (nframes64_t frame_rate); + TempoMap (nframes_t frame_rate); ~TempoMap(); /* measure-based stuff */ @@ -180,13 +180,13 @@ class TempoMap : public PBD::StatefulDestructible struct BBTPoint { BBTPointType type; - nframes64_t frame; + framepos_t frame; const Meter* meter; const Tempo* tempo; uint32_t bar; uint32_t beat; - BBTPoint (const Meter& m, const Tempo& t, nframes64_t f, + BBTPoint (const Meter& m, const Tempo& t, framepos_t f, BBTPointType ty, uint32_t b, uint32_t e) : type (ty), frame (f), meter (&m), tempo (&t), bar (b), beat (e) {} }; @@ -198,27 +198,27 @@ class TempoMap : public PBD::StatefulDestructible (obj.*method)(*metrics); } - BBTPointList *get_points (nframes64_t start, nframes64_t end) const; + BBTPointList *get_points (framepos_t start, framepos_t end) const; - void bbt_time (nframes64_t when, BBT_Time&) const; - nframes64_t frame_time (const BBT_Time&) const; - nframes64_t bbt_duration_at (nframes64_t, const BBT_Time&, int dir) const; + void bbt_time (framepos_t when, BBT_Time&) const; + framecnt_t frame_time (const BBT_Time&) const; + framecnt_t bbt_duration_at (framepos_t, const BBT_Time&, int dir) const; - void bbt_time_add (nframes64_t origin, BBT_Time& start, const BBT_Time& shift); + void bbt_time_add (framepos_t origin, BBT_Time& start, const BBT_Time& shift); static const Tempo& default_tempo() { return _default_tempo; } static const Meter& default_meter() { return _default_meter; } - const Tempo& tempo_at (nframes64_t) const; - const Meter& meter_at (nframes64_t) const; + const Tempo& tempo_at (framepos_t) const; + const Meter& meter_at (framepos_t) const; - const TempoSection& tempo_section_at (nframes64_t); + const TempoSection& tempo_section_at (framepos_t); void add_tempo(const Tempo&, BBT_Time where); void add_meter(const Meter&, BBT_Time where); - void add_tempo(const Tempo&, nframes64_t where); - void add_meter(const Meter&, nframes64_t where); + void add_tempo(const Tempo&, framepos_t where); + void add_meter(const Meter&, framepos_t where); void move_tempo (TempoSection&, const BBT_Time& to); void move_meter (MeterSection&, const BBT_Time& to); @@ -229,12 +229,12 @@ class TempoMap : public PBD::StatefulDestructible void replace_tempo (TempoSection& existing, const Tempo& replacement); void replace_meter (MeterSection& existing, const Meter& replacement); - nframes64_t round_to_bar (nframes64_t frame, int dir); - nframes64_t round_to_beat (nframes64_t frame, int dir); - nframes64_t round_to_beat_subdivision (nframes64_t fr, int sub_num, int dir); - nframes64_t round_to_tick (nframes64_t frame, int dir); + framepos_t round_to_bar (framepos_t frame, int dir); + framepos_t round_to_beat (framepos_t frame, int dir); + framepos_t round_to_beat_subdivision (framepos_t fr, int sub_num, int dir); + framepos_t round_to_tick (framepos_t frame, int dir); - void set_length (nframes64_t frames); + void set_length (framepos_t frames); XMLNode& get_state (void); int set_state (const XMLNode&, int version); @@ -243,17 +243,17 @@ class TempoMap : public PBD::StatefulDestructible void clear (); TempoMetric metric_at (BBT_Time bbt) const; - TempoMetric metric_at (nframes64_t) const; - void bbt_time_with_metric (nframes64_t, BBT_Time&, const TempoMetric&) const; + TempoMetric metric_at (framepos_t) const; + void bbt_time_with_metric (framepos_t, BBT_Time&, const TempoMetric&) const; BBT_Time bbt_add (const BBT_Time&, const BBT_Time&, const TempoMetric&) const; BBT_Time bbt_add (const BBT_Time& a, const BBT_Time& b) const; BBT_Time bbt_subtract (const BBT_Time&, const BBT_Time&) const; - void change_existing_tempo_at (nframes64_t, double bpm, double note_type); + void change_existing_tempo_at (framepos_t, double bpm, double note_type); void change_initial_tempo (double bpm, double note_type); - void insert_time (nframes64_t, nframes64_t); + void insert_time (framepos_t, framecnt_t); int n_tempos () const; int n_meters () const; @@ -266,27 +266,27 @@ class TempoMap : public PBD::StatefulDestructible Metrics* metrics; nframes_t _frame_rate; - nframes64_t last_bbt_when; + framepos_t last_bbt_when; bool last_bbt_valid; BBT_Time last_bbt; mutable Glib::RWLock lock; void timestamp_metrics (bool use_bbt); - nframes64_t round_to_type (nframes64_t fr, int dir, BBTPointType); + framepos_t round_to_type (framepos_t fr, int dir, BBTPointType); - nframes64_t frame_time_unlocked (const BBT_Time&) const; + framepos_t frame_time_unlocked (const BBT_Time&) const; - void bbt_time_unlocked (nframes64_t, BBT_Time&) const; + void bbt_time_unlocked (framepos_t, BBT_Time&) const; - nframes64_t bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, int dir) const; + framecnt_t bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, int dir) const; const MeterSection& first_meter() const; const TempoSection& first_tempo() const; - nframes64_t count_frames_between (const BBT_Time&, const BBT_Time&) const; - nframes64_t count_frames_between_metrics (const Meter&, const Tempo&, - const BBT_Time&, const BBT_Time&) const; + framecnt_t count_frames_between (const BBT_Time&, const BBT_Time&) const; + framecnt_t count_frames_between_metrics (const Meter&, const Tempo&, + const BBT_Time&, const BBT_Time&) const; int move_metric_section (MetricSection&, const BBT_Time& to); void do_insert (MetricSection* section, bool with_bbt); diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index f91b67bb5a..cc36941ba8 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -53,13 +53,20 @@ namespace ARDOUR { typedef uint32_t layer_t; typedef uint64_t microseconds_t; typedef uint32_t nframes_t; - typedef int64_t nframes64_t; - typedef int64_t sframes_t; + /* Any position measured in audio frames. + Assumed to be non-negative but not enforced. + */ typedef int64_t framepos_t; - /* any offset from a framepos_t, measured in audio frames */ + + /* Any distance from a given framepos_t. + Maybe positive or negative. + */ typedef int64_t frameoffset_t; - /* any count of audio frames */ + + /* Any count of audio frames. + Assumed to be positive but not enforced. + */ typedef int64_t framecnt_t; static const framepos_t max_framepos = INT64_MAX; @@ -422,7 +429,7 @@ namespace ARDOUR { int opts; // really RubberBandStretcher::Options }; - typedef std::list<nframes64_t> AnalysisFeatureList; + typedef std::list<framepos_t> AnalysisFeatureList; typedef std::list<boost::shared_ptr<Route> > RouteList; @@ -533,22 +540,22 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::PositionLockStyle& sf); -static inline ARDOUR::nframes64_t -session_frame_to_track_frame (ARDOUR::nframes64_t session_frame, double speed) +static inline ARDOUR::framepos_t +session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed) { - return (ARDOUR::nframes64_t)( (double)session_frame * speed ); + return (ARDOUR::framepos_t)( (double)session_frame * speed ); } -static inline ARDOUR::nframes64_t -track_frame_to_session_frame (ARDOUR::nframes64_t track_frame, double speed) +static inline ARDOUR::framepos_t +track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed) { - return (ARDOUR::nframes64_t)( (double)track_frame / speed ); + return (ARDOUR::framepos_t)( (double)track_frame / speed ); } /* for now, break the rules and use "using" to make these "global" */ using ARDOUR::nframes_t; -using ARDOUR::nframes64_t; +using ARDOUR::framepos_t; #endif /* __ardour_types_h__ */ diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index fcc6da2ad0..90813715b0 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -348,7 +348,7 @@ AudioTrack::set_state_part_two () } int -AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick, +AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler) { Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); @@ -522,7 +522,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, } int -AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes, bool enable_processing) +AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nframes, bool enable_processing) { boost::scoped_array<gain_t> gain_buffer (new gain_t[nframes]); boost::scoped_array<Sample> mix_buffer (new Sample[nframes]); @@ -533,7 +533,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(diskstream->playlist()); assert(apl); - assert(buffers.get_audio(0).capacity() >= nframes); + assert ((framecnt_t) buffers.get_audio(0).capacity() >= nframes); if (apl->read (buffers.get_audio(0).data(), mix_buffer.get(), gain_buffer.get(), start, nframes) != nframes) { return -1; diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc index 3acfc9bce4..7b649aae89 100644 --- a/libs/ardour/audioanalyser.cc +++ b/libs/ardour/audioanalyser.cc @@ -88,8 +88,8 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel) int ret = -1; bool done = false; Sample* data = 0; - nframes64_t len = src->readable_length(); - nframes64_t pos = 0; + framecnt_t len = src->readable_length(); + framepos_t pos = 0; float* bufs[1] = { 0 }; string tmp_path; @@ -111,11 +111,11 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel) while (!done) { - nframes64_t to_read; + nframes_t to_read; /* read from source */ - to_read = min ((len - pos), bufsize); + to_read = min ((len - pos), (framecnt_t) bufsize); if (src->read (data, pos, to_read, channel) != to_read) { goto out; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index b35417b539..4947f2ec3b 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -154,7 +154,7 @@ AudioRegion::AudioRegion (const SourceList& srcs) assert (_sources.size() == _master_sources.size()); } -AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, nframes64_t offset, bool offset_relative) +AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, framecnt_t offset, bool offset_relative) : Region (other, offset, offset_relative) , AUDIOREGION_COPY_STATE (other) , _automatable (other->session()) @@ -1287,7 +1287,7 @@ AudioRegion::audio_source (uint32_t n) const } int -AudioRegion::adjust_transients (nframes64_t delta) +AudioRegion::adjust_transients (frameoffset_t delta) { for (AnalysisFeatureList::iterator x = _transients.begin(); x != _transients.end(); ++x) { (*x) = (*x) + delta; @@ -1299,7 +1299,7 @@ AudioRegion::adjust_transients (nframes64_t delta) } int -AudioRegion::update_transient (nframes64_t old_position, nframes64_t new_position) +AudioRegion::update_transient (framepos_t old_position, framepos_t new_position) { for (AnalysisFeatureList::iterator x = _transients.begin(); x != _transients.end(); ++x) { if ((*x) == old_position) { @@ -1314,7 +1314,7 @@ AudioRegion::update_transient (nframes64_t old_position, nframes64_t new_positio } void -AudioRegion::add_transient (nframes64_t where) +AudioRegion::add_transient (framepos_t where) { _transients.push_back(where); _valid_transients = true; @@ -1323,7 +1323,7 @@ AudioRegion::add_transient (nframes64_t where) } void -AudioRegion::remove_transient (nframes64_t where) +AudioRegion::remove_transient (framepos_t where) { _transients.remove(where); _valid_transients = true; diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc index 9d3b8ae4c6..180b3e563a 100644 --- a/libs/ardour/beats_frames_converter.cc +++ b/libs/ardour/beats_frames_converter.cc @@ -24,7 +24,7 @@ namespace ARDOUR { -sframes_t +framecnt_t BeatsFramesConverter::to(double beats) const { // FIXME: assumes tempo never changes after origin @@ -33,11 +33,11 @@ BeatsFramesConverter::to(double beats) const _tempo_map.frame_rate(), _tempo_map.meter_at (_origin_b)); - return lrint(beats * frames_per_beat); + return llrint (beats * frames_per_beat); } double -BeatsFramesConverter::from(sframes_t frames) const +BeatsFramesConverter::from (framecnt_t frames) const { // FIXME: assumes tempo never changes after origin const Tempo& tempo = _tempo_map.tempo_at (_origin_b); diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc index 6627409bd0..5212a3006d 100644 --- a/libs/ardour/coreaudiosource.cc +++ b/libs/ardour/coreaudiosource.cc @@ -139,7 +139,7 @@ CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu nframes_t -CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const +CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) const { nframes_t file_cnt; AudioBufferList abl; diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 6b0c0a9560..d2271030a5 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -355,7 +355,7 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer, start = _position; buf += offset; - to_write = min (_length.val(), (nframes64_t) cnt); + to_write = min (_length.val(), cnt); } else { diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index e93e550308..4277ee4ed8 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -437,7 +437,7 @@ Delivery::end_pan_touch (uint32_t which, bool mark, double when) void -Delivery::flush_buffers (nframes_t nframes, nframes64_t time) +Delivery::flush_buffers (nframes_t nframes, framepos_t time) { /* io_lock, not taken: function must be called from Session::process() calltree */ diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 05fa1d881d..9ffb7c1778 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -195,8 +195,8 @@ ExportHandler::process_timespan (nframes_t frames) /* update position */ nframes_t frames_to_read = 0; - sframes_t const start = current_timespan->get_start(); - sframes_t const end = current_timespan->get_end(); + framepos_t const start = current_timespan->get_start(); + framepos_t const end = current_timespan->get_end(); bool const last_cycle = (process_position + frames >= end); @@ -308,7 +308,7 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma /* Start actual marker stuff */ - sframes_t last_end_time = timespan->get_start(), last_start_time = timespan->get_start(); + framepos_t last_end_time = timespan->get_start(), last_start_time = timespan->get_start(); status.track_position = last_start_time - timespan->get_start(); for (i = temp.begin(); i != temp.end(); ++i) { @@ -535,9 +535,9 @@ ExportHandler::write_index_info_toc (CDMarkerStatus & status) } void -ExportHandler::frames_to_cd_frames_string (char* buf, sframes_t when) +ExportHandler::frames_to_cd_frames_string (char* buf, framepos_t when) { - sframes_t remainder; + framecnt_t remainder; nframes_t fr = session.nominal_frame_rate(); int mins, secs, frames; diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 13fb859efe..929f3c5bf4 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -410,7 +410,7 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status, status.progress += 0.01; } - const nframes64_t pos = 0; + const framepos_t pos = 0; const double length_beats = ceil(t / (double)source->ppqn()); BeatsFramesConverter converter(smfs->session().tempo_map(), pos); smfs->update_length(pos, converter.to(length_beats)); diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index ed2b23f7ee..0faab06d5c 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1505,7 +1505,7 @@ IO::connected_to (boost::shared_ptr<const IO> other) const } void -IO::process_input (boost::shared_ptr<Processor> proc, sframes_t start_frame, sframes_t end_frame, nframes_t nframes) +IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, nframes_t nframes) { BufferSet bufs; diff --git a/libs/ardour/jack_slave.cc b/libs/ardour/jack_slave.cc index 9ef6eb8579..116ccdd145 100644 --- a/libs/ardour/jack_slave.cc +++ b/libs/ardour/jack_slave.cc @@ -35,7 +35,7 @@ JACK_Slave::JACK_Slave (jack_client_t* j) : jack (j) { double x; - nframes64_t p; + framepos_t p; /* call this to initialize things */ speed_and_position (x, p); } @@ -63,7 +63,7 @@ JACK_Slave::ok() const } bool -JACK_Slave::speed_and_position (double& sp, nframes64_t& position) +JACK_Slave::speed_and_position (double& sp, framepos_t& position) { jack_position_t pos; jack_transport_state_t state; diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index ad6fd1859d..5f6f14ce14 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -53,7 +53,7 @@ Location::Location (Session& s) } -Location::Location (Session& s, nframes64_t sample_start, nframes64_t sample_end, const std::string &name, Flags bits) +Location::Location (Session& s, framepos_t sample_start, framepos_t sample_end, const std::string &name, Flags bits) : SessionHandleRef (s) , _name (name) , _start (sample_start) @@ -124,7 +124,7 @@ Location::operator= (const Location& other) * @param allow_bbt_recompute True to recompute BBT start time from the new given start time. */ int -Location::set_start (nframes64_t s, bool force, bool allow_bbt_recompute) +Location::set_start (framepos_t s, bool force, bool allow_bbt_recompute) { if (_locked) { return -1; @@ -170,7 +170,7 @@ Location::set_start (nframes64_t s, bool force, bool allow_bbt_recompute) * @param allow_bbt_recompute True to recompute BBT end time from the new given end time. */ int -Location::set_end (nframes64_t e, bool force, bool allow_bbt_recompute) +Location::set_end (framepos_t e, bool force, bool allow_bbt_recompute) { if (_locked) { return -1; @@ -211,7 +211,7 @@ Location::set_end (nframes64_t e, bool force, bool allow_bbt_recompute) } int -Location::set (nframes64_t start, nframes64_t end, bool allow_bbt_recompute) +Location::set (framepos_t start, framepos_t end, bool allow_bbt_recompute) { /* check validity */ if (((is_auto_punch() || is_auto_loop()) && start >= end) || (!is_mark() && start > end)) { @@ -226,7 +226,7 @@ Location::set (nframes64_t start, nframes64_t end, bool allow_bbt_recompute) } int -Location::move_to (nframes64_t pos) +Location::move_to (framepos_t pos) { if (_locked) { return -1; @@ -844,7 +844,7 @@ struct LocationStartLaterComparison }; Location * -Locations::first_location_before (nframes64_t frame, bool include_special_ranges) +Locations::first_location_before (framepos_t frame, bool include_special_ranges) { LocationList locs; @@ -871,7 +871,7 @@ Locations::first_location_before (nframes64_t frame, bool include_special_ranges } Location * -Locations::first_location_after (nframes64_t frame, bool include_special_ranges) +Locations::first_location_after (framepos_t frame, bool include_special_ranges) { LocationList locs; @@ -905,7 +905,7 @@ Locations::first_location_after (nframes64_t frame, bool include_special_ranges) * @param after Filled in with the position of the next `mark' after `frame' (or max_framepos if none exists) */ void -Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nframes64_t& after) const +Locations::marks_either_side (framepos_t const frame, framepos_t& before, framepos_t& after) const { before = after = max_framepos; @@ -918,7 +918,7 @@ Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nfra /* Get a list of positions; don't store any that are exactly on our requested position */ - std::list<nframes64_t> positions; + std::list<framepos_t> positions; for (LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) { if (((*i)->is_auto_loop() || (*i)->is_auto_punch())) { @@ -947,7 +947,7 @@ Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nfra positions.sort (); - std::list<nframes64_t>::iterator i = positions.begin (); + std::list<framepos_t>::iterator i = positions.begin (); while (i != positions.end () && *i < frame) { ++i; } @@ -1027,7 +1027,7 @@ Locations::get_location_by_id(PBD::ID id) } void -Locations::find_all_between (nframes64_t start, nframes64_t end, LocationList& ll, Location::Flags flags) +Locations::find_all_between (framepos_t start, framepos_t end, LocationList& ll, Location::Flags flags) { Glib::Mutex::Lock lm (lock); diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc index 61c68609f9..f6fe0d0930 100644 --- a/libs/ardour/midi_clock_slave.cc +++ b/libs/ardour/midi_clock_slave.cc @@ -85,7 +85,7 @@ MIDIClock_Slave::rebind (MIDI::Port& p) } void -MIDIClock_Slave::calculate_one_ppqn_in_frames_at(nframes64_t time) +MIDIClock_Slave::calculate_one_ppqn_in_frames_at(framepos_t time) { const Tempo& current_tempo = session->tempo_map().tempo_at(time); const Meter& current_meter = session->tempo_map().meter_at(time); @@ -100,14 +100,14 @@ MIDIClock_Slave::calculate_one_ppqn_in_frames_at(nframes64_t time) // DEBUG_TRACE (DEBUG::MidiClock, string_compose ("at %1, one ppqn = %2\n", time, one_ppqn_in_frames)); } -ARDOUR::nframes64_t +ARDOUR::framepos_t MIDIClock_Slave::calculate_song_position(uint16_t song_position_in_sixteenth_notes) { - nframes64_t song_position_frames = 0; + framepos_t song_position_frames = 0; for (uint16_t i = 1; i <= song_position_in_sixteenth_notes; ++i) { // one quarter note contains ppqn pulses, so a sixteenth note is ppqn / 4 pulses calculate_one_ppqn_in_frames_at(song_position_frames); - song_position_frames += one_ppqn_in_frames * (nframes64_t)(ppqn / 4); + song_position_frames += one_ppqn_in_frames * (framepos_t)(ppqn / 4); } return song_position_frames; @@ -123,7 +123,7 @@ MIDIClock_Slave::calculate_filter_coefficients() } void -MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes64_t timestamp) +MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, framepos_t timestamp) { // some pieces of hardware send MIDI Clock all the time if ( (!_starting) && (!_started) ) { @@ -132,7 +132,7 @@ MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes64_t timestamp) calculate_one_ppqn_in_frames_at(should_be_position); - nframes64_t elapsed_since_start = timestamp - first_timestamp; + framepos_t elapsed_since_start = timestamp - first_timestamp; double error = 0; if (_starting || last_timestamp == 0) { @@ -189,7 +189,7 @@ MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes64_t timestamp) } void -MIDIClock_Slave::start (Parser& /*parser*/, nframes64_t timestamp) +MIDIClock_Slave::start (Parser& /*parser*/, framepos_t timestamp) { DEBUG_TRACE (DEBUG::MidiClock, string_compose ("MIDIClock_Slave got start message at time %1 engine time %2\n", timestamp, session->frame_time())); @@ -216,7 +216,7 @@ MIDIClock_Slave::reset () } void -MIDIClock_Slave::contineu (Parser& /*parser*/, nframes64_t /*timestamp*/) +MIDIClock_Slave::contineu (Parser& /*parser*/, framepos_t /*timestamp*/) { DEBUG_TRACE (DEBUG::MidiClock, "MIDIClock_Slave got continue message\n"); @@ -228,7 +228,7 @@ MIDIClock_Slave::contineu (Parser& /*parser*/, nframes64_t /*timestamp*/) void -MIDIClock_Slave::stop (Parser& /*parser*/, nframes64_t /*timestamp*/) +MIDIClock_Slave::stop (Parser& /*parser*/, framepos_t /*timestamp*/) { DEBUG_TRACE (DEBUG::MidiClock, "MIDIClock_Slave got stop message\n"); @@ -245,7 +245,7 @@ MIDIClock_Slave::stop (Parser& /*parser*/, nframes64_t /*timestamp*/) // that is the position of the last MIDI Clock // message and that is probably what the master // expects where we are right now - nframes64_t stop_position = should_be_position; + framepos_t stop_position = should_be_position; // find out the last MIDI beat: go back #midi_clocks mod 6 // and lets hope the tempo didnt change in those last 6 beats :) @@ -272,7 +272,7 @@ MIDIClock_Slave::position (Parser& /*parser*/, byte* message, size_t size) assert((lsb <= 0x7f) && (msb <= 0x7f)); uint16_t position_in_sixteenth_notes = (uint16_t(msb) << 7) | uint16_t(lsb); - nframes64_t position_in_frames = calculate_song_position(position_in_sixteenth_notes); + framepos_t position_in_frames = calculate_song_position(position_in_sixteenth_notes); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position: %1 frames: %2\n", position_in_sixteenth_notes, position_in_frames)); @@ -301,7 +301,7 @@ MIDIClock_Slave::starting() const } bool -MIDIClock_Slave::stop_if_no_more_clock_events(nframes64_t& pos, nframes64_t now) +MIDIClock_Slave::stop_if_no_more_clock_events(framepos_t& pos, framepos_t now) { /* no timecode for 1/4 second ? conclude that its stopped */ if (last_timestamp && @@ -318,7 +318,7 @@ MIDIClock_Slave::stop_if_no_more_clock_events(nframes64_t& pos, nframes64_t now) } bool -MIDIClock_Slave::speed_and_position (double& speed, nframes64_t& pos) +MIDIClock_Slave::speed_and_position (double& speed, framepos_t& pos) { if (!_started || _starting) { speed = 0.0; @@ -326,7 +326,7 @@ MIDIClock_Slave::speed_and_position (double& speed, nframes64_t& pos) return true; } - nframes64_t engine_now = session->frame_time(); + framepos_t engine_now = session->frame_time(); if (stop_if_no_more_clock_events(pos, engine_now)) { return false; @@ -343,8 +343,8 @@ MIDIClock_Slave::speed_and_position (double& speed, nframes64_t& pos) if (engine_now > last_timestamp) { // we are in between MIDI clock messages // so we interpolate position according to speed - nframes64_t elapsed = engine_now - last_timestamp; - pos = (nframes64_t) (should_be_position + double(elapsed) * speed); + framecnt_t elapsed = engine_now - last_timestamp; + pos = (framepos_t) (should_be_position + double(elapsed) * speed); } else { // A new MIDI clock message has arrived this cycle pos = should_be_position; diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc index 0fd32ebddd..abc0d682ba 100644 --- a/libs/ardour/midi_playlist.cc +++ b/libs/ardour/midi_playlist.cc @@ -103,7 +103,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d // relevent regions overlapping start <--> end vector< boost::shared_ptr<Region> > regs; - typedef pair<MidiStateTracker*,nframes64_t> TrackerInfo; + typedef pair<MidiStateTracker*,framepos_t> TrackerInfo; vector<TrackerInfo> tracker_info; uint32_t note_cnt = 0; @@ -123,7 +123,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d of this read range. */ - nframes64_t resolve_at = (*i)->last_frame(); + framepos_t resolve_at = (*i)->last_frame(); if (resolve_at >= end) { resolve_at = start; } diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index 5d04457832..adf24c2eaf 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -114,7 +114,7 @@ MidiPort::cycle_split () } void -MidiPort::flush_buffers (nframes_t nframes, nframes64_t time, nframes_t offset) +MidiPort::flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset) { if (sends_output ()) { diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index b54e044201..b105aa00c5 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -183,7 +183,7 @@ MidiSource::length (framepos_t pos) const } void -MidiSource::update_length (sframes_t /*pos*/, sframes_t /*cnt*/) +MidiSource::update_length (framepos_t /*pos*/, framecnt_t /*cnt*/) { // You're not the boss of me! } @@ -197,8 +197,8 @@ MidiSource::invalidate () /** @param filtered A set of parameters whose MIDI messages will not be returned */ nframes_t -MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, sframes_t source_start, - sframes_t start, nframes_t cnt, +MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, framepos_t source_start, + framepos_t start, nframes_t cnt, MidiStateTracker* tracker, std::set<Evoral::Parameter> const & filtered) const { @@ -226,7 +226,7 @@ MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, sframes_t source_start // Read events up to end for (; i != _model->end(); ++i) { - const sframes_t time_frames = converter.to(i->time()); + const framecnt_t time_frames = converter.to(i->time()); if (time_frames < start + cnt) { /* convert event times to session frames by adding on the source start position in session frames */ dst.write (time_frames + source_start, i->event_type(), i->size(), i->buffer()); @@ -252,7 +252,7 @@ MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, sframes_t source_start } nframes_t -MidiSource::midi_write (MidiRingBuffer<nframes_t>& source, sframes_t source_start, nframes_t duration) +MidiSource::midi_write (MidiRingBuffer<nframes_t>& source, framepos_t source_start, nframes_t duration) { Glib::Mutex::Lock lm (_lock); const nframes_t ret = write_unlocked (source, source_start, duration); @@ -261,7 +261,7 @@ MidiSource::midi_write (MidiRingBuffer<nframes_t>& source, sframes_t source_star } void -MidiSource::mark_streaming_midi_write_started (NoteMode mode, sframes_t start_frame) +MidiSource::mark_streaming_midi_write_started (NoteMode mode, framepos_t start_frame) { set_timeline_position(start_frame); diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc index 4e43e72693..24c9d2884c 100644 --- a/libs/ardour/midi_state_tracker.cc +++ b/libs/ardour/midi_state_tracker.cc @@ -90,7 +90,7 @@ MidiStateTracker::track (const MidiBuffer::iterator &from, const MidiBuffer::ite } void -MidiStateTracker::resolve_notes (MidiBuffer &dst, nframes64_t time) +MidiStateTracker::resolve_notes (MidiBuffer &dst, framepos_t time) { if (!_on) { return; @@ -111,7 +111,7 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, nframes64_t time) } void -MidiStateTracker::resolve_notes (Evoral::EventSink<nframes_t> &dst, nframes64_t time) +MidiStateTracker::resolve_notes (Evoral::EventSink<nframes_t> &dst, framepos_t time) { uint8_t buf[3]; diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 2bac842655..595fccf360 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -381,7 +381,7 @@ MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame } int -MidiTrack::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, +MidiTrack::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input) { int ret = Track::no_roll (nframes, start_frame, end_frame, state_changing, can_record, rec_monitors_input); @@ -427,7 +427,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes) } void -MidiTrack::write_out_of_band_data (BufferSet& bufs, sframes_t /*start*/, sframes_t /*end*/, nframes_t nframes) +MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, nframes_t nframes) { // Append immediate events MidiBuffer& buf (bufs.get_midi (0)); @@ -444,7 +444,7 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, sframes_t /*start*/, sframes } int -MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, sframes_t /*end_frame*/) +MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, framepos_t /*end_frame*/) { return -1; } diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc index 5c36d46c3b..fecbf9b8e3 100644 --- a/libs/ardour/midi_ui.cc +++ b/libs/ardour/midi_ui.cc @@ -107,7 +107,7 @@ MidiControlUI::midi_input_handler (IOCondition ioc, MIDI::Port* port) CrossThreadChannel::drain (port->selectable()); DEBUG_TRACE (DEBUG::MidiIO, string_compose ("data available on %1\n", port->name())); - nframes64_t now = _session.engine().frame_time(); + framepos_t now = _session.engine().frame_time(); port->parse (now); } diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 354341de24..953b79083b 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -230,8 +230,8 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now) * its not the average, but we will assign it to current.speed below */ - static nframes64_t last_seen_timestamp = 0; - static nframes64_t last_seen_position = 0; + static framepos_t last_seen_timestamp = 0; + static framepos_t last_seen_position = 0; if ((now - last_seen_timestamp) < 300) { mtc_frame = (mtc_frame + last_seen_position)/2; @@ -247,7 +247,7 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now) /* Non-PiC */ - nframes64_t time_delta = (now - last_mtc_timestamp); + framepos_t time_delta = (now - last_mtc_timestamp); if (time_delta != 0) { double apparent_speed = (mtc_frame - last_mtc_frame) / (double) (time_delta); @@ -391,9 +391,9 @@ MTC_Slave::ok() const } bool -MTC_Slave::speed_and_position (double& speed, nframes64_t& pos) +MTC_Slave::speed_and_position (double& speed, framepos_t& pos) { - nframes64_t now = session.engine().frame_time(); + framepos_t now = session.engine().frame_time(); SafeTime last; nframes_t elapsed; bool in_control = false; @@ -423,12 +423,12 @@ MTC_Slave::speed_and_position (double& speed, nframes64_t& pos) if (give_slave_full_control_over_transport_speed()) { in_control = (session.slave_state() == Session::Running); - nframes64_t pic_want_locate = 0; - //nframes64_t slave_pos = session.audible_frame(); - nframes64_t slave_pos = session.transport_frame(); + framepos_t pic_want_locate = 0; + //framepos_t slave_pos = session.audible_frame(); + framepos_t slave_pos = session.transport_frame(); static double average_speed = 0; - nframes64_t ref_now = session.engine().frame_time_at_cycle_start(); + framepos_t ref_now = session.engine().frame_time_at_cycle_start(); average_speed = pic->get_ratio (last.timestamp, last.position, ref_now, slave_pos, in_control, session.engine().frames_per_cycle()); pic_want_locate = pic->want_locate(); @@ -535,7 +535,7 @@ MTC_Slave::reset (bool with_position) } void -MTC_Slave::reset_window (nframes64_t root) +MTC_Slave::reset_window (framepos_t root) { /* if we're waiting for the master to catch us after seeking ahead, keep the window @@ -581,7 +581,7 @@ MTC_Slave::reset_window (nframes64_t root) DEBUG_TRACE (DEBUG::MTC, string_compose ("legal MTC window now %1 .. %2\n", window_begin, window_end)); } -nframes64_t +framecnt_t MTC_Slave::seekahead_distance () const { /* 1 second */ @@ -589,7 +589,7 @@ MTC_Slave::seekahead_distance () const } bool -MTC_Slave::outside_window (nframes64_t pos) const +MTC_Slave::outside_window (framepos_t pos) const { return ((pos < window_begin) || (pos > window_end)); } diff --git a/libs/ardour/onset_detector.cc b/libs/ardour/onset_detector.cc index 59fd8d10df..abe7df7022 100644 --- a/libs/ardour/onset_detector.cc +++ b/libs/ardour/onset_detector.cc @@ -100,7 +100,7 @@ OnsetDetector::cleanup_onsets (AnalysisFeatureList& t, float sr, float gap_msecs AnalysisFeatureList::iterator i = t.begin(); AnalysisFeatureList::iterator f, b; - const nframes64_t gap_frames = (nframes64_t) floor (gap_msecs * (sr / 1000.0)); + const framecnt_t gap_frames = (framecnt_t) floor (gap_msecs * (sr / 1000.0)); while (i != t.end()) { diff --git a/libs/ardour/pi_controller.cc b/libs/ardour/pi_controller.cc index 0d9e5b8c37..2ecfe730d8 100644 --- a/libs/ardour/pi_controller.cc +++ b/libs/ardour/pi_controller.cc @@ -152,15 +152,15 @@ PIChaser::~PIChaser() { } double -PIChaser::get_ratio(nframes64_t chasetime_measured, nframes64_t chasetime, nframes64_t slavetime_measured, nframes64_t slavetime, bool in_control, int period_size ) { +PIChaser::get_ratio(framepos_t chasetime_measured, framepos_t chasetime, framepos_t slavetime_measured, framepos_t slavetime, bool in_control, int period_size ) { feed_estimator( chasetime_measured, chasetime ); std::cerr << (double)chasetime_measured/48000.0 << " " << chasetime << " " << slavetime << " "; double crude = get_estimate(); double fine; - nframes64_t massaged_chasetime = chasetime + (nframes64_t)( (double)(slavetime_measured - chasetime_measured) * crude ); + framepos_t massaged_chasetime = chasetime + (framepos_t)( (double)(slavetime_measured - chasetime_measured) * crude ); - fine = pic->get_ratio( slavetime - massaged_chasetime, period_size ); + fine = pic->get_ratio (slavetime - massaged_chasetime, period_size); if (in_control) { if (fabs(fine-crude) > crude*speed_threshold) { std::cout << "reset to " << crude << " fine = " << fine << "\n"; @@ -188,7 +188,7 @@ PIChaser::get_ratio(nframes64_t chasetime_measured, nframes64_t chasetime, nfram } void -PIChaser::feed_estimator( nframes64_t realtime, nframes64_t chasetime ) { +PIChaser::feed_estimator (framepos_t realtime, framepos_t chasetime ) { array_index += 1; realtime_stamps [ array_index%ESTIMATOR_SIZE ] = realtime; chasetime_stamps[ array_index%ESTIMATOR_SIZE ] = chasetime; @@ -199,8 +199,8 @@ PIChaser::get_estimate() { double est = 0; int num=0; int i; - nframes64_t n1_realtime; - nframes64_t n1_chasetime; + framepos_t n1_realtime; + framepos_t n1_chasetime; for( i=(array_index + 1); i<=(array_index + ESTIMATOR_SIZE); i++ ) { if( realtime_stamps[(i)%ESTIMATOR_SIZE] ) { n1_realtime = realtime_stamps[(i)%ESTIMATOR_SIZE]; @@ -213,8 +213,8 @@ PIChaser::get_estimate() { for( ; i<=(array_index + ESTIMATOR_SIZE); i++ ) { if( realtime_stamps[(i)%ESTIMATOR_SIZE] ) { if( (realtime_stamps[(i)%ESTIMATOR_SIZE] - n1_realtime) > 200 ) { - nframes64_t n_realtime = realtime_stamps[(i)%ESTIMATOR_SIZE]; - nframes64_t n_chasetime = chasetime_stamps[(i)%ESTIMATOR_SIZE]; + framepos_t n_realtime = realtime_stamps[(i)%ESTIMATOR_SIZE]; + framepos_t n_chasetime = chasetime_stamps[(i)%ESTIMATOR_SIZE]; est += ((double)( n_chasetime - n1_chasetime )) / ((double)( n_realtime - n1_realtime )); n1_realtime = n_realtime; diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 13576ff11a..07d27faee9 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -804,7 +804,7 @@ Region::modify_front (nframes_t new_position, bool reset_fade, void *src) if (new_position < end) { /* can't trim it zero or negative length */ nframes_t newlen = 0; - nframes64_t delta = 0; + framepos_t delta = 0; /* can't trim it back passed where source position zero is located */ @@ -1444,11 +1444,11 @@ Region::uses_source (boost::shared_ptr<const Source> source) const return false; } -sframes_t +framecnt_t Region::source_length(uint32_t n) const { assert (n < _sources.size()); - return _sources[n]->length(_position - _start); + return _sources[n]->length (_position - _start); } bool diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index cda4fa8e1e..81d822e749 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -379,7 +379,7 @@ Route::set_gain (gain_t val, void *src) */ void Route::process_output_buffers (BufferSet& bufs, - sframes_t start_frame, sframes_t end_frame, nframes_t nframes, + framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool /*with_processors*/, int declick) { bool monitor; @@ -500,7 +500,7 @@ Route::n_process_buffers () } void -Route::passthru (sframes_t start_frame, sframes_t end_frame, nframes_t nframes, int declick) +Route::passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick) { BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers()); @@ -540,7 +540,7 @@ Route::passthru (sframes_t start_frame, sframes_t end_frame, nframes_t nframes, } void -Route::passthru_silence (sframes_t start_frame, sframes_t end_frame, nframes_t nframes, int declick) +Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick) { BufferSet& bufs (_session.get_silent_buffers (n_process_buffers())); bufs.set_count (_input->n_ports()); @@ -2701,7 +2701,7 @@ Route::pans_required () const } int -Route::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, +Route::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing, bool /*can_record*/, bool /*rec_monitors_input*/) { Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); @@ -2766,7 +2766,7 @@ Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame) } int -Route::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick, +Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */) { Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK); @@ -2799,7 +2799,7 @@ Route::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int } int -Route::silent_roll (nframes_t nframes, sframes_t /*start_frame*/, sframes_t /*end_frame*/, +Route::silent_roll (nframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/, bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */) { silence (nframes); @@ -3148,7 +3148,7 @@ Route::set_pending_declick (int declick) */ void -Route::shift (nframes64_t /*pos*/, nframes64_t /*frames*/) +Route::shift (framepos_t /*pos*/, framecnt_t /*frames*/) { #ifdef THIS_NEEDS_FIXING_FOR_V3 diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 682bb541f5..4f18a300af 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1113,11 +1113,11 @@ Session::maybe_enable_record () set_dirty(); } -nframes64_t +framepos_t Session::audible_frame () const { - nframes64_t ret; - nframes64_t tf; + framepos_t ret; + framepos_t tf; nframes_t offset; /* the first of these two possible settings for "offset" @@ -3929,7 +3929,7 @@ Session::get_available_sync_options () const } boost::shared_ptr<RouteList> -Session::get_routes_with_regions_at (nframes64_t const p) const +Session::get_routes_with_regions_at (framepos_t const p) const { shared_ptr<RouteList> r = routes.reader (); shared_ptr<RouteList> rl (new RouteList); diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc index 4df5111b03..2e30c4a8f1 100644 --- a/libs/ardour/session_events.cc +++ b/libs/ardour/session_events.cc @@ -78,21 +78,21 @@ SessionEvent::operator delete (void *ptr, size_t /*size*/) } void -SessionEventManager::add_event (nframes64_t frame, SessionEvent::Type type, nframes64_t target_frame) +SessionEventManager::add_event (framepos_t frame, SessionEvent::Type type, framepos_t target_frame) { SessionEvent* ev = new SessionEvent (type, SessionEvent::Add, frame, target_frame, 0); queue_event (ev); } void -SessionEventManager::remove_event (nframes64_t frame, SessionEvent::Type type) +SessionEventManager::remove_event (framepos_t frame, SessionEvent::Type type) { SessionEvent* ev = new SessionEvent (type, SessionEvent::Remove, frame, 0, 0); queue_event (ev); } void -SessionEventManager::replace_event (SessionEvent::Type type, nframes64_t frame, nframes64_t target) +SessionEventManager::replace_event (SessionEvent::Type type, framepos_t frame, framepos_t target) { SessionEvent* ev = new SessionEvent (type, SessionEvent::Replace, frame, target, 0); queue_event (ev); diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index c5efb1f3f8..6914b9db94 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -349,7 +349,7 @@ Session::mmc_record_enable (MIDI::MachineControl &mmc, size_t trk, bool enabled) * @param t time to send. */ int -Session::send_full_time_code (nframes64_t const t) +Session::send_full_time_code (framepos_t const t) { /* This function could easily send at a given frame offset, but would * that be useful? Does ardour do sub-block accurate locating? [DR] */ diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index 342ae5c8a8..b18e00f9fd 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -435,7 +435,7 @@ bool Session::follow_slave (nframes_t nframes) { double slave_speed; - nframes64_t slave_transport_frame; + framepos_t slave_transport_frame; nframes_t this_delta; int dir; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 946d3ea890..c96c5ce510 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -131,7 +131,7 @@ Session::request_locate (nframes_t target_frame, bool with_roll) } void -Session::force_locate (nframes64_t target_frame, bool with_roll) +Session::force_locate (framepos_t target_frame, bool with_roll) { SessionEvent *ev = new SessionEvent (with_roll ? SessionEvent::LocateRoll : SessionEvent::Locate, SessionEvent::Add, SessionEvent::Immediate, target_frame, 0, true); DEBUG_TRACE (DEBUG::Transport, string_compose ("Request forced locate to %1\n", target_frame)); @@ -594,7 +594,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) } // can't cast away volatile so copy and emit that - nframes64_t tframe = _transport_frame; + framepos_t tframe = _transport_frame; PositionChanged (tframe); /* EMIT SIGNAL */ TransportStateChange (); /* EMIT SIGNAL */ @@ -724,12 +724,12 @@ Session::flush_all_inserts () } void -Session::start_locate (nframes64_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force) +Session::start_locate (framepos_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force) { if (synced_to_jack()) { double sp; - nframes64_t pos; + framepos_t pos; _slave->speed_and_position (sp, pos); @@ -776,7 +776,7 @@ Session::micro_locate (nframes_t distance) /** @param with_mmc true to send a MMC locate command when the locate is done */ void -Session::locate (nframes64_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force, bool with_mmc) +Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force, bool with_mmc) { if (actively_recording() && !with_loop) { return; @@ -1444,7 +1444,7 @@ void Session::xrun_recovery () { // can't cast away volatile so copy and emit that - nframes64_t tframe = _transport_frame; + framepos_t tframe = _transport_frame; Xrun (tframe); //EMIT SIGNAL if (Config->get_stop_recording_on_xrun() && actively_recording()) { @@ -1565,7 +1565,7 @@ Session::maybe_stop (nframes_t limit) } void -Session::send_mmc_locate (nframes64_t t) +Session::send_mmc_locate (framepos_t t) { Timecode::Time time; timecode_time_subframes (t, time); diff --git a/libs/ardour/slave.cc b/libs/ardour/slave.cc index be88fe223c..ce03f0b17e 100644 --- a/libs/ardour/slave.cc +++ b/libs/ardour/slave.cc @@ -35,13 +35,13 @@ SlaveSessionProxy::frame_rate() const return session.frame_rate(); } -nframes64_t +framepos_t SlaveSessionProxy::audible_frame() const { return session.audible_frame(); } -nframes64_t +framepos_t SlaveSessionProxy::transport_frame() const { return session.transport_frame(); @@ -53,14 +53,14 @@ SlaveSessionProxy::frames_since_cycle_start() const return session.engine().frames_since_cycle_start(); } -nframes64_t +framepos_t SlaveSessionProxy::frame_time() const { return session.engine().frame_time(); } void -SlaveSessionProxy::request_locate(nframes64_t frame, bool with_roll) +SlaveSessionProxy::request_locate(framepos_t frame, bool with_roll) { session.request_locate(frame, with_roll); } diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 11100b9f52..4ddbba8457 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -105,8 +105,8 @@ SMFSource::~SMFSource () /** All stamps in audio frames */ nframes_t -SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t const source_start, - sframes_t start, nframes_t duration, +SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, framepos_t const source_start, + framepos_t start, nframes_t duration, MidiStateTracker* tracker) const { int ret = 0; @@ -174,7 +174,7 @@ SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t c /* Note that we add on the source start time (in session frames) here so that ev_frame_time is in session frames. */ - const sframes_t ev_frame_time = converter.to(time / (double)ppqn()) + source_start; + const framepos_t ev_frame_time = converter.to(time / (double)ppqn()) + source_start; if (ev_frame_time < start + duration) { destination.write (ev_frame_time, ev_type, ev_size, ev_buffer); @@ -203,7 +203,7 @@ SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t c /** All stamps in audio frames */ nframes_t -SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position, nframes_t duration) +SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, framepos_t position, nframes_t duration) { _write_data_count = 0; @@ -313,7 +313,7 @@ SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev) /** Append an event with a timestamp in frames (nframes_t) */ void -SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sframes_t position) +SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t position) { assert(_writing); if (ev.size() == 0) { @@ -349,7 +349,7 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sfr _length_beats = max(_length_beats, ev_time_beats); - const sframes_t delta_time_frames = ev.time() - _last_ev_time_frames; + const framepos_t delta_time_frames = ev.time() - _last_ev_time_frames; const double delta_time_beats = converter.from(delta_time_frames); const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn())); @@ -385,7 +385,7 @@ SMFSource::set_state (const XMLNode& node, int version) } void -SMFSource::mark_streaming_midi_write_started (NoteMode mode, sframes_t start_frame) +SMFSource::mark_streaming_midi_write_started (NoteMode mode, framepos_t start_frame) { Glib::Mutex::Lock lm (_lock); MidiSource::mark_streaming_midi_write_started (mode, start_frame); diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index a183d26b84..b2b486813c 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -521,7 +521,7 @@ SndFileSource::flush_header () } int -SndFileSource::setup_broadcast_info (sframes_t /*when*/, struct tm& now, time_t /*tnow*/) +SndFileSource::setup_broadcast_info (framepos_t /*when*/, struct tm& now, time_t /*tnow*/) { if (!writable()) { warning << string_compose (_("attempt to store broadcast info in a non-writable audio file source (%1)"), _path) << endmsg; @@ -632,7 +632,7 @@ SndFileSource::clear_capture_marks () } void -SndFileSource::mark_capture_start (sframes_t pos) +SndFileSource::mark_capture_start (framepos_t pos) { if (destructive()) { if (pos < _timeline_position) { @@ -775,7 +775,7 @@ SndFileSource::crossfade (Sample* data, framecnt_t cnt, int fade_in) return cnt; } -sframes_t +framepos_t SndFileSource::last_capture_start_frame () const { if (destructive()) { diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 165da0befd..e5aa759670 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -195,7 +195,7 @@ Source::load_transients (const string& path) file >> val; if (!file.fail()) { - nframes64_t frame = (nframes64_t) floor (val * _session.frame_rate()); + framepos_t frame = (framepos_t) floor (val * _session.frame_rate()); transients.push_back (frame); } } diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc index 369ed95279..748c854daf 100644 --- a/libs/ardour/st_stretch.cc +++ b/libs/ardour/st_stretch.cc @@ -177,8 +177,8 @@ STStretch::run (boost::shared_ptr<Region> a_region) /* now reset ancestral data for each new region */ for (vector<boost::shared_ptr<Region> >::iterator x = results.begin(); x != results.end(); ++x) { - nframes64_t astart = (*x)->ancestral_start(); - nframes64_t alength = (*x)->ancestral_length(); + framepos_t astart = (*x)->ancestral_start(); + framepos_t alength = (*x)->ancestral_length(); nframes_t start; nframes_t length; diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index a60b0d32d3..67c3419b1b 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -218,7 +218,7 @@ struct MetricSectionSorter { } }; -TempoMap::TempoMap (nframes64_t fr) +TempoMap::TempoMap (nframes_t fr) { metrics = new Metrics; _frame_rate = fr; @@ -259,11 +259,11 @@ TempoMap::move_metric_section (MetricSection& section, const BBT_Time& when) /* position by audio frame, then recompute BBT timestamps from the audio ones */ - nframes64_t frame = frame_time (when); + framepos_t frame = frame_time (when); // cerr << "nominal frame time = " << frame << endl; - nframes64_t prev_frame = round_to_type (frame, -1, Beat); - nframes64_t next_frame = round_to_type (frame, 1, Beat); + framepos_t prev_frame = round_to_type (frame, -1, Beat); + framepos_t next_frame = round_to_type (frame, 1, Beat); // cerr << "previous beat at " << prev_frame << " next at " << next_frame << endl; @@ -439,7 +439,7 @@ TempoMap::add_tempo (const Tempo& tempo, BBT_Time where) } void -TempoMap::add_tempo (const Tempo& tempo, nframes64_t where) +TempoMap::add_tempo (const Tempo& tempo, framepos_t where) { { Glib::RWLock::WriterLock lm (lock); @@ -506,7 +506,7 @@ TempoMap::add_meter (const Meter& meter, BBT_Time where) } void -TempoMap::add_meter (const Meter& meter, nframes64_t where) +TempoMap::add_meter (const Meter& meter, framepos_t where) { { Glib::RWLock::WriterLock lm (lock); @@ -559,7 +559,7 @@ TempoMap::change_initial_tempo (double beats_per_minute, double note_type) } void -TempoMap::change_existing_tempo_at (nframes64_t where, double beats_per_minute, double note_type) +TempoMap::change_existing_tempo_at (framepos_t where, double beats_per_minute, double note_type) { Tempo newtempo (beats_per_minute, note_type); @@ -649,8 +649,8 @@ TempoMap::timestamp_metrics (bool use_bbt) // cerr << "\n\n\n ######################\nTIMESTAMP via BBT ##############\n" << endl; - nframes64_t current = 0; - nframes64_t section_frames; + framepos_t current = 0; + framepos_t section_frames; BBT_Time start; BBT_Time end; @@ -744,7 +744,7 @@ TempoMap::timestamp_metrics (bool use_bbt) } TempoMetric -TempoMap::metric_at (nframes64_t frame) const +TempoMap::metric_at (framepos_t frame) const { TempoMetric m (first_meter(), first_tempo()); const Meter* meter; @@ -812,7 +812,7 @@ TempoMap::metric_at (BBT_Time bbt) const } void -TempoMap::bbt_time (nframes64_t frame, BBT_Time& bbt) const +TempoMap::bbt_time (framepos_t frame, BBT_Time& bbt) const { { Glib::RWLock::ReaderLock lm (lock); @@ -821,15 +821,15 @@ TempoMap::bbt_time (nframes64_t frame, BBT_Time& bbt) const } void -TempoMap::bbt_time_unlocked (nframes64_t frame, BBT_Time& bbt) const +TempoMap::bbt_time_unlocked (framepos_t frame, BBT_Time& bbt) const { bbt_time_with_metric (frame, bbt, metric_at (frame)); } void -TempoMap::bbt_time_with_metric (nframes64_t frame, BBT_Time& bbt, const TempoMetric& metric) const +TempoMap::bbt_time_with_metric (framepos_t frame, BBT_Time& bbt, const TempoMetric& metric) const { - nframes64_t frame_diff; + framecnt_t frame_diff; // cerr << "---- BBT time for " << frame << " using metric @ " << metric.frame() << " BBT " << metric.start() << endl; @@ -872,16 +872,16 @@ TempoMap::bbt_time_with_metric (nframes64_t frame, BBT_Time& bbt, const TempoMet // cerr << "-----\t RETURN " << bbt << endl; } -nframes64_t -TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) const +framecnt_t +TempoMap::count_frames_between (const BBT_Time& start, const BBT_Time& end) const { /* for this to work with fractional measure types, start and end have to be "legal" BBT types, that means that the beats and ticks should be inside a bar */ - nframes64_t frames = 0; - nframes64_t start_frame = 0; - nframes64_t end_frame = 0; + framecnt_t frames = 0; + framepos_t start_frame = 0; + framepos_t end_frame = 0; TempoMetric m = metric_at (start); @@ -891,7 +891,7 @@ TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) con + start.ticks/Meter::ticks_per_beat; - start_frame = m.frame() + (nframes64_t) rint( beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter())); + start_frame = m.frame() + (framepos_t) rint( beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter())); m = metric_at(end); @@ -900,7 +900,7 @@ TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) con beat_offset = bar_offset * m.meter().beats_per_bar() - (m.start().beats -1) + (end.beats - 1) + end.ticks/Meter::ticks_per_beat; - end_frame = m.frame() + (nframes64_t) rint(beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter())); + end_frame = m.frame() + (framepos_t) rint(beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter())); frames = end_frame - start_frame; @@ -908,12 +908,12 @@ TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) con } -nframes64_t +framecnt_t TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo, const BBT_Time& start, const BBT_Time& end) const { /* this is used in timestamping the metrics by actually counting the beats */ - nframes64_t frames = 0; + framecnt_t frames = 0; uint32_t bar = start.bars; double beat = (double) start.beats; double beats_counted = 0; @@ -952,13 +952,13 @@ TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo, // << " fpb was " << beat_frames // << endl; - frames = (nframes64_t) floor (beats_counted * beat_frames); + frames = (framecnt_t) llrint (floor (beats_counted * beat_frames)); return frames; } -nframes64_t +framepos_t TempoMap::frame_time (const BBT_Time& bbt) const { BBT_Time start ; /* 1|1|0 */ @@ -966,10 +966,10 @@ TempoMap::frame_time (const BBT_Time& bbt) const return count_frames_between ( start, bbt); } -nframes64_t -TempoMap::bbt_duration_at (nframes64_t pos, const BBT_Time& bbt, int dir) const +framecnt_t +TempoMap::bbt_duration_at (framepos_t pos, const BBT_Time& bbt, int dir) const { - nframes64_t frames = 0; + framecnt_t frames = 0; BBT_Time when; bbt_time(pos, when); @@ -982,11 +982,10 @@ TempoMap::bbt_duration_at (nframes64_t pos, const BBT_Time& bbt, int dir) const return frames; } -nframes64_t +framecnt_t TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, int dir) const { - - nframes64_t frames = 0; + framecnt_t frames = 0; double beats_per_bar; BBT_Time result; @@ -1109,8 +1108,8 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i -nframes64_t -TempoMap::round_to_bar (nframes64_t fr, int dir) +framepos_t +TempoMap::round_to_bar (framepos_t fr, int dir) { { Glib::RWLock::ReaderLock lm (lock); @@ -1119,8 +1118,8 @@ TempoMap::round_to_bar (nframes64_t fr, int dir) } -nframes64_t -TempoMap::round_to_beat (nframes64_t fr, int dir) +framepos_t +TempoMap::round_to_beat (framepos_t fr, int dir) { { Glib::RWLock::ReaderLock lm (lock); @@ -1128,8 +1127,8 @@ TempoMap::round_to_beat (nframes64_t fr, int dir) } } -nframes64_t -TempoMap::round_to_beat_subdivision (nframes64_t fr, int sub_num, int dir) +framepos_t +TempoMap::round_to_beat_subdivision (framepos_t fr, int sub_num, int dir) { BBT_Time the_beat; uint32_t ticks_one_half_subdivisions_worth; @@ -1199,8 +1198,8 @@ TempoMap::round_to_beat_subdivision (nframes64_t fr, int sub_num, int dir) return frame_time (the_beat); } -nframes64_t -TempoMap::round_to_type (nframes64_t frame, int dir, BBTPointType type) +framepos_t +TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type) { TempoMetric metric = metric_at (frame); BBT_Time bbt; @@ -1320,7 +1319,7 @@ TempoMap::round_to_type (nframes64_t frame, int dir, BBTPointType type) } TempoMap::BBTPointList * -TempoMap::get_points (nframes64_t lower, nframes64_t upper) const +TempoMap::get_points (framepos_t lower, framepos_t upper) const { Metrics::const_iterator i; @@ -1339,7 +1338,7 @@ TempoMap::get_points (nframes64_t lower, nframes64_t upper) const double delta_bars; double delta_beats; double dummy; - nframes64_t limit; + framepos_t limit; meter = &first_meter (); tempo = &first_tempo (); @@ -1416,7 +1415,7 @@ TempoMap::get_points (nframes64_t lower, nframes64_t upper) const if (beat == 1) { if (current >= lower) { // cerr << "Add Bar at " << bar << "|1" << " @ " << current << endl; - points->push_back (BBTPoint (*meter, *tempo,(nframes64_t)rint(current), Bar, bar, 1)); + points->push_back (BBTPoint (*meter, *tempo,(framepos_t)rint(current), Bar, bar, 1)); } } @@ -1428,7 +1427,7 @@ TempoMap::get_points (nframes64_t lower, nframes64_t upper) const while (beat <= ceil( beats_per_bar) && beat_frame < limit) { if (beat_frame >= lower) { // cerr << "Add Beat at " << bar << '|' << beat << " @ " << beat_frame << endl; - points->push_back (BBTPoint (*meter, *tempo, (nframes64_t) rint(beat_frame), Beat, bar, beat)); + points->push_back (BBTPoint (*meter, *tempo, (framepos_t) rint(beat_frame), Beat, bar, beat)); } beat_frame += beat_frames; current+= beat_frames; @@ -1509,7 +1508,7 @@ TempoMap::get_points (nframes64_t lower, nframes64_t upper) const } const TempoSection& -TempoMap::tempo_section_at (nframes64_t frame) +TempoMap::tempo_section_at (framepos_t frame) { Glib::RWLock::ReaderLock lm (lock); Metrics::iterator i; @@ -1536,7 +1535,7 @@ TempoMap::tempo_section_at (nframes64_t frame) } const Tempo& -TempoMap::tempo_at (nframes64_t frame) const +TempoMap::tempo_at (framepos_t frame) const { TempoMetric m (metric_at (frame)); return m.tempo(); @@ -1544,7 +1543,7 @@ TempoMap::tempo_at (nframes64_t frame) const const Meter& -TempoMap::meter_at (nframes64_t frame) const +TempoMap::meter_at (framepos_t frame) const { TempoMetric m (metric_at (frame)); return m.meter(); @@ -1671,7 +1670,7 @@ TempoMap::n_meters() const } void -TempoMap::insert_time (nframes64_t where, nframes64_t amount) +TempoMap::insert_time (framepos_t where, framecnt_t amount) { for (Metrics::iterator i = metrics->begin(); i != metrics->end(); ++i) { if ((*i)->frame() >= where) { diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc index 1eca79e67d..6573262393 100644 --- a/libs/ardour/transient_detector.cc +++ b/libs/ardour/transient_detector.cc @@ -91,7 +91,7 @@ TransientDetector::cleanup_transients (AnalysisFeatureList& t, float sr, float g AnalysisFeatureList::iterator i = t.begin(); AnalysisFeatureList::iterator f, b; - const nframes64_t gap_frames = (nframes64_t) floor (gap_msecs * (sr / 1000.0)); + const framecnt_t gap_frames = (framecnt_t) floor (gap_msecs * (sr / 1000.0)); while (i != t.end()) { |