From cc7d4db5fe9132c38b919ab073b91d442abad9b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 14 Apr 2012 22:04:51 +0000 Subject: [PATCH] Fix a few framecnt / framepos type confusions. git-svn-id: svn://localhost/ardour2/branches/3.0@11975 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_drag.h | 2 +- gtk2_ardour/midi_region_view.cc | 2 +- gtk2_ardour/rhythm_ferret.cc | 4 ++-- gtk2_ardour/time_axis_view_item.cc | 2 +- gtk2_ardour/time_axis_view_item.h | 2 +- libs/ardour/ardour/audioregion.h | 2 +- libs/ardour/ardour/importable_source.h | 2 +- libs/ardour/ardour/midi_playlist_source.h | 4 ++-- libs/ardour/ardour/midi_region.h | 2 +- libs/ardour/ardour/midi_track.h | 2 +- libs/ardour/ardour/region.h | 4 ++-- libs/ardour/ardour/resampled_source.h | 2 +- libs/ardour/ardour/route.h | 4 ++-- libs/ardour/ardour/slave.h | 4 ++-- libs/ardour/ardour/sndfileimportable.h | 2 +- libs/ardour/ardour/tempo.h | 2 +- libs/ardour/ardour/track.h | 2 +- libs/ardour/beats_frames_converter.cc | 4 ++-- libs/ardour/crossfade.cc | 2 +- libs/ardour/midi_playlist_source.cc | 4 ++-- libs/ardour/midi_track.cc | 2 +- libs/ardour/route.cc | 2 +- libs/ardour/source.cc | 2 +- libs/ardour/test/midi_clock_slave_test.h | 2 +- libs/ardour/track.cc | 6 +++--- 25 files changed, 34 insertions(+), 34 deletions(-) diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 2c806126bd..0d457a39d9 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -310,7 +310,7 @@ public: protected: - double compute_x_delta (GdkEvent const *, ARDOUR::framecnt_t *); + double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *); bool y_movement_allowed (int, double) const; bool _brushing; diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index c535d4b02b..e87a8418b3 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2953,7 +2953,7 @@ MidiRegionView::nudge_notes (bool forward) framepos_t ref_point = source_beats_to_absolute_frames ((*(_selection.begin()))->note()->time()); framepos_t unused; - framepos_t distance; + framecnt_t distance; if (trackview.editor().snap_mode() == Editing::SnapOff) { diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index 7d7250d055..bd9dd42f87 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -216,7 +216,7 @@ RhythmFerret::run_analysis () } int -RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr readable, framepos_t /*offset*/, AnalysisFeatureList& results) +RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr readable, frameoffset_t /*offset*/, AnalysisFeatureList& results) { TransientDetector t (_session->frame_rate()); @@ -263,7 +263,7 @@ RhythmFerret::get_note_onset_function () } int -RhythmFerret::run_note_onset_analysis (boost::shared_ptr readable, framepos_t /*offset*/, AnalysisFeatureList& results) +RhythmFerret::run_note_onset_analysis (boost::shared_ptr readable, frameoffset_t /*offset*/, AnalysisFeatureList& results) { try { OnsetDetector t (_session->frame_rate()); diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 9df586bf7f..9e0c83aa1e 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -321,7 +321,7 @@ TimeAxisViewItem::get_position() const */ bool -TimeAxisViewItem::set_duration (framepos_t dur, void* src) +TimeAxisViewItem::set_duration (framecnt_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) diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index 5bcaa48545..6b4bc09ec1 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -144,7 +144,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList protected: TimeAxisViewItem(const std::string &, ArdourCanvas::Group&, TimeAxisView&, double, Gdk::Color const &, - framepos_t, framepos_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); + framepos_t, framecnt_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); TimeAxisViewItem (const TimeAxisViewItem&); diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index c1476f69a4..077f90c95a 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -166,7 +166,7 @@ class AudioRegion : public Region int set_transients (AnalysisFeatureList&); int get_transients (AnalysisFeatureList&, bool force_new = false); int update_transient (framepos_t old_position, framepos_t new_position); - int adjust_transients (framepos_t delta); + int adjust_transients (frameoffset_t delta); AudioIntervalResult find_silence (Sample, framecnt_t, InterThreadInfo&) const; diff --git a/libs/ardour/ardour/importable_source.h b/libs/ardour/ardour/importable_source.h index 804b062969..fc695d88c1 100644 --- a/libs/ardour/ardour/importable_source.h +++ b/libs/ardour/ardour/importable_source.h @@ -35,7 +35,7 @@ public: virtual uint32_t channels() const = 0; virtual framecnt_t length() const = 0; virtual framecnt_t samplerate() const = 0; - virtual void seek (framecnt_t pos) = 0; + virtual void seek (framepos_t pos) = 0; virtual framepos_t natural_position() const = 0; virtual bool clamped_at_unity () const = 0; diff --git a/libs/ardour/ardour/midi_playlist_source.h b/libs/ardour/ardour/midi_playlist_source.h index c64b6e53f9..b75e8c0bd2 100644 --- a/libs/ardour/ardour/midi_playlist_source.h +++ b/libs/ardour/ardour/midi_playlist_source.h @@ -60,12 +60,12 @@ protected: void flush_midi(); - framepos_t read_unlocked (Evoral::EventSink& dst, + framecnt_t read_unlocked (Evoral::EventSink& dst, framepos_t position, framepos_t start, framecnt_t cnt, MidiStateTracker* tracker) const; - framepos_t write_unlocked (MidiRingBuffer& dst, + framecnt_t write_unlocked (MidiRingBuffer& dst, framepos_t position, framecnt_t cnt); diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 9868d1408f..ba7c2972f3 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -77,7 +77,7 @@ class MidiRegion : public Region NoteMode mode = Sustained, MidiStateTracker* tracker = 0) const; - framepos_t master_read_at (MidiRingBuffer& dst, + framecnt_t master_read_at (MidiRingBuffer& dst, framepos_t position, framecnt_t dur, uint32_t chan_n = 0, diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index 45055a0c3d..bb810ff74a 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -62,7 +62,7 @@ public: boost::shared_ptr bounce (InterThreadInfo&); boost::shared_ptr bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, boost::shared_ptr endpoint, bool include_endpoint); - int export_stuff (BufferSet& bufs, framecnt_t nframes, framepos_t end_frame, + int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t end_frame, boost::shared_ptr endpoint, bool include_endpoint, bool for_export); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 0acbf04af4..c698d2fdc2 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -128,7 +128,7 @@ class Region float stretch () const { return _stretch; } float shift () const { return _shift; } - void set_ancestral_data (framepos_t start, framepos_t length, float stretch, float shift); + void set_ancestral_data (framepos_t start, framecnt_t length, float stretch, float shift); frameoffset_t sync_offset (int& dir) const; framepos_t sync_position () const; @@ -282,7 +282,7 @@ class Region return 0; } - virtual int adjust_transients (framepos_t /*delta*/) { + virtual int adjust_transients (frameoffset_t /*delta*/) { // no transients, but its OK return 0; } diff --git a/libs/ardour/ardour/resampled_source.h b/libs/ardour/ardour/resampled_source.h index 74f1a76e5b..a36ad4331f 100644 --- a/libs/ardour/ardour/resampled_source.h +++ b/libs/ardour/ardour/resampled_source.h @@ -39,7 +39,7 @@ class ResampledImportableSource : public ImportableSource uint32_t channels() const { return source->channels(); } framecnt_t length() const { return source->length(); } framecnt_t samplerate() const { return source->samplerate(); } - void seek (framecnt_t); + void seek (framepos_t); framepos_t natural_position() const; bool clamped_at_unity () const { diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 42b74b50bc..89a0cac214 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -132,7 +132,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, /* end of vfunc-based API */ - void shift (framepos_t, framepos_t); + void shift (framepos_t, framecnt_t); void set_gain (gain_t val, void *src); void inc_gain (gain_t delta, void *src); @@ -435,7 +435,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, virtual void set_block_size (pframes_t nframes); protected: - virtual framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&) { return nframes; } + virtual framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&) { return nframes; } void passthru (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick); diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 9bd3124e23..a487824e51 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -155,7 +155,7 @@ class Slave { * only if requires_seekahead() returns true. */ - virtual framepos_t seekahead_distance() const { return 0; } + virtual framecnt_t seekahead_distance() const { return 0; } /** * @return - when returning true, ARDOUR will use transport speed 1.0 no matter what @@ -235,7 +235,7 @@ class MTC_Slave : public Slave { framecnt_t resolution () const; bool requires_seekahead () const { return true; } - framepos_t seekahead_distance() const; + framecnt_t seekahead_distance() const; bool give_slave_full_control_over_transport_speed() const; private: diff --git a/libs/ardour/ardour/sndfileimportable.h b/libs/ardour/ardour/sndfileimportable.h index f085334a21..b146d3231c 100644 --- a/libs/ardour/ardour/sndfileimportable.h +++ b/libs/ardour/ardour/sndfileimportable.h @@ -37,7 +37,7 @@ class SndFileImportableSource : public ImportableSource { uint32_t channels() const; framecnt_t length() const; framecnt_t samplerate() const; - void seek (framecnt_t pos); + void seek (framepos_t pos); framepos_t natural_position() const; bool clamped_at_unity () const; diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index fd89ace9d9..15032b8741 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -241,7 +241,7 @@ class TempoMap : public PBD::StatefulDestructible to provide an answer. */ void bbt_time_rt (framepos_t when, Timecode::BBT_Time&); - framecnt_t frame_time (const Timecode::BBT_Time&); + framepos_t frame_time (const Timecode::BBT_Time&); framecnt_t bbt_duration_at (framepos_t, const Timecode::BBT_Time&, int dir); /* TEMPO-SENSITIVE FUNCTIONS diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index 71ec61bb24..99d9e3783a 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -220,7 +220,7 @@ class Track : public Route, public PublicDiskstream boost::shared_ptr _rec_enable_control; - framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&); + framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&); private: diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc index 62a0ebde69..94042b1b03 100644 --- a/libs/ardour/beats_frames_converter.cc +++ b/libs/ardour/beats_frames_converter.cc @@ -30,7 +30,7 @@ namespace ARDOUR { * supplied to the constructor. Returns the equivalent number of frames, * taking tempo changes into account. */ -framecnt_t +framepos_t BeatsFramesConverter::to (double beats) const { if (beats < 0) { @@ -47,7 +47,7 @@ BeatsFramesConverter::to (double beats) const * taking tempo changes into account. */ double -BeatsFramesConverter::from (framecnt_t frames) const +BeatsFramesConverter::from (framepos_t frames) const { double b = _tempo_map.framewalk_to_beats (_origin_b, frames); return b; diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index c687c60cd1..d1db33bdcd 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -324,7 +324,7 @@ Crossfade::initialize () } framecnt_t -Crossfade::read_raw_internal (Sample* buf, framecnt_t start, framecnt_t cnt, int channel) const +Crossfade::read_raw_internal (Sample* buf, framepos_t start, framecnt_t cnt, int channel) const { Sample* mixdown = new Sample[cnt]; float* gain = new float[cnt]; diff --git a/libs/ardour/midi_playlist_source.cc b/libs/ardour/midi_playlist_source.cc index 6270ad4339..208b2b0460 100644 --- a/libs/ardour/midi_playlist_source.cc +++ b/libs/ardour/midi_playlist_source.cc @@ -126,7 +126,7 @@ MidiPlaylistSource::length (framepos_t) const return extent.second - extent.first; } -framepos_t +framecnt_t MidiPlaylistSource::read_unlocked (Evoral::EventSink& dst, framepos_t /*position*/, framepos_t start, framecnt_t cnt, @@ -141,7 +141,7 @@ MidiPlaylistSource::read_unlocked (Evoral::EventSink& dst, return mp->read (dst, start, cnt); } -framepos_t +framecnt_t MidiPlaylistSource::write_unlocked (MidiRingBuffer& dst, framepos_t, framecnt_t) diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 15db5ddb97..e99df0ffb9 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -478,7 +478,7 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framep } int -MidiTrack::export_stuff (BufferSet& /*bufs*/, framecnt_t /*nframes*/, framepos_t /*end_frame*/, +MidiTrack::export_stuff (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framecnt_t /*nframes*/, boost::shared_ptr /*endpoint*/, bool /*include_endpoint*/, bool /*forexport*/) { return -1; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 3cb71fad84..10898cac0e 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2964,7 +2964,7 @@ Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, in return 0; } - framecnt_t unused = 0; + framepos_t unused = 0; if ((nframes = check_initial_delay (nframes, unused)) == 0) { return 0; diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 4c582f3ad7..e9e3b00142 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -263,7 +263,7 @@ Source::mark_for_remove () } void -Source::set_timeline_position (int64_t pos) +Source::set_timeline_position (framepos_t pos) { _timeline_position = pos; } diff --git a/libs/ardour/test/midi_clock_slave_test.h b/libs/ardour/test/midi_clock_slave_test.h index 4b3572a613..56bda2ba58 100644 --- a/libs/ardour/test/midi_clock_slave_test.h +++ b/libs/ardour/test/midi_clock_slave_test.h @@ -66,7 +66,7 @@ class TestSlaveSessionProxy : public ISlaveSessionProxy { framepos_t audible_frame () const { return _transport_frame; } framepos_t transport_frame () const { return _transport_frame; } pframes_t frames_since_cycle_start () const { return 0; } - framecnt_t frame_time () const { return _frame_time; } + framepos_t frame_time () const { return _frame_time; } void request_locate (framepos_t frame, bool with_roll = false) { _transport_frame = frame; diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index f7f0e6fdbe..63b56bd878 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -577,13 +577,13 @@ Track::hidden () const } int -Track::can_internal_playback_seek (framepos_t p) +Track::can_internal_playback_seek (framecnt_t p) { return _diskstream->can_internal_playback_seek (p); } int -Track::internal_playback_seek (framepos_t p) +Track::internal_playback_seek (framecnt_t p) { return _diskstream->internal_playback_seek (p); } @@ -859,7 +859,7 @@ Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick) } framecnt_t -Track::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame) +Track::check_initial_delay (framecnt_t nframes, framepos_t& transport_frame) { if (_roll_delay > nframes) {