summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-03 22:26:29 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-03 22:26:29 +0000
commit73192bc1a7ea55fa1864dc3826845b15c00dd2ec (patch)
treec0039f3f5a848aed6e880abf11519dad855fa899 /libs/ardour
parent74b4a3c77b08dc1e58274875604eb73e8492fa93 (diff)
Remove all use of nframes_t.
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/amp.cc31
-rw-r--r--libs/ardour/ardour/amp.h18
-rw-r--r--libs/ardour/ardour/audio_buffer.h18
-rw-r--r--libs/ardour/ardour/audio_diskstream.h26
-rw-r--r--libs/ardour/ardour/audio_port.h18
-rw-r--r--libs/ardour/ardour/audio_track.h4
-rw-r--r--libs/ardour/ardour/audio_unit.h16
-rw-r--r--libs/ardour/ardour/audioanalyser.h4
-rw-r--r--libs/ardour/ardour/audioengine.h77
-rw-r--r--libs/ardour/ardour/audiofilesource.h4
-rw-r--r--libs/ardour/ardour/audioplaylist.h4
-rw-r--r--libs/ardour/ardour/audioregion.h4
-rw-r--r--libs/ardour/ardour/audiosource.h2
-rw-r--r--libs/ardour/ardour/auditioner.h6
-rw-r--r--libs/ardour/ardour/automatable.h12
-rw-r--r--libs/ardour/ardour/buffer.h6
-rw-r--r--libs/ardour/ardour/buffer_set.h10
-rw-r--r--libs/ardour/ardour/butler.h8
-rw-r--r--libs/ardour/ardour/click.h32
-rw-r--r--libs/ardour/ardour/delivery.h12
-rw-r--r--libs/ardour/ardour/diskstream.h34
-rw-r--r--libs/ardour/ardour/element_importer.h4
-rw-r--r--libs/ardour/ardour/export_channel.h18
-rw-r--r--libs/ardour/ardour/export_format_specification.h10
-rw-r--r--libs/ardour/ardour/export_graph_builder.h20
-rw-r--r--libs/ardour/ardour/export_handler.h4
-rw-r--r--libs/ardour/ardour/export_profile_manager.h4
-rw-r--r--libs/ardour/ardour/export_timespan.h18
-rw-r--r--libs/ardour/ardour/gain.h8
-rw-r--r--libs/ardour/ardour/graph.h14
-rw-r--r--libs/ardour/ardour/importable_source.h6
-rw-r--r--libs/ardour/ardour/internal_return.h10
-rw-r--r--libs/ardour/ardour/internal_send.h4
-rw-r--r--libs/ardour/ardour/interpolation.h8
-rw-r--r--libs/ardour/ardour/io.h14
-rw-r--r--libs/ardour/ardour/io_processor.h2
-rw-r--r--libs/ardour/ardour/ladspa_plugin.h14
-rw-r--r--libs/ardour/ardour/latent.h14
-rw-r--r--libs/ardour/ardour/lv2_plugin.h14
-rw-r--r--libs/ardour/ardour/meter.h2
-rw-r--r--libs/ardour/ardour/midi_buffer.h10
-rw-r--r--libs/ardour/ardour/midi_diskstream.h18
-rw-r--r--libs/ardour/ardour/midi_playlist.h6
-rw-r--r--libs/ardour/ardour/midi_port.h12
-rw-r--r--libs/ardour/ardour/midi_region.h6
-rw-r--r--libs/ardour/ardour/midi_ring_buffer.h2
-rw-r--r--libs/ardour/ardour/midi_source.h32
-rw-r--r--libs/ardour/ardour/midi_state_tracker.h2
-rw-r--r--libs/ardour/ardour/midi_track.h23
-rw-r--r--libs/ardour/ardour/mix.h38
-rw-r--r--libs/ardour/ardour/monitor_processor.h2
-rw-r--r--libs/ardour/ardour/panner.h16
-rw-r--r--libs/ardour/ardour/peak.h4
-rw-r--r--libs/ardour/ardour/playlist_factory.h2
-rw-r--r--libs/ardour/ardour/plugin.h4
-rw-r--r--libs/ardour/ardour/plugin_insert.h18
-rw-r--r--libs/ardour/ardour/port.h22
-rw-r--r--libs/ardour/ardour/port_insert.h19
-rw-r--r--libs/ardour/ardour/processor.h8
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h4
-rw-r--r--libs/ardour/ardour/region.h8
-rw-r--r--libs/ardour/ardour/resampled_source.h8
-rw-r--r--libs/ardour/ardour/return.h8
-rw-r--r--libs/ardour/ardour/route.h38
-rw-r--r--libs/ardour/ardour/runtime_functions.h10
-rw-r--r--libs/ardour/ardour/send.h2
-rw-r--r--libs/ardour/ardour/session.h164
-rw-r--r--libs/ardour/ardour/session_event.h4
-rw-r--r--libs/ardour/ardour/silentfilesource.h2
-rw-r--r--libs/ardour/ardour/slave.h28
-rw-r--r--libs/ardour/ardour/smf_source.h22
-rw-r--r--libs/ardour/ardour/sndfileimportable.h6
-rw-r--r--libs/ardour/ardour/sndfilesource.h4
-rw-r--r--libs/ardour/ardour/source_factory.h2
-rw-r--r--libs/ardour/ardour/strip_silence.h6
-rw-r--r--libs/ardour/ardour/tempo.h12
-rw-r--r--libs/ardour/ardour/thread_buffers.h2
-rw-r--r--libs/ardour/ardour/ticker.h18
-rw-r--r--libs/ardour/ardour/track.h14
-rw-r--r--libs/ardour/ardour/types.h17
-rw-r--r--libs/ardour/ardour/utils.h2
-rw-r--r--libs/ardour/ardour/vbap.h4
-rw-r--r--libs/ardour/audio_diskstream.cc60
-rw-r--r--libs/ardour/audio_playlist.cc10
-rw-r--r--libs/ardour/audio_port.cc10
-rw-r--r--libs/ardour/audio_region_importer.cc2
-rw-r--r--libs/ardour/audio_track.cc8
-rw-r--r--libs/ardour/audio_track_importer.cc2
-rw-r--r--libs/ardour/audio_unit.cc6
-rw-r--r--libs/ardour/audioanalyser.cc2
-rw-r--r--libs/ardour/audioengine.cc46
-rw-r--r--libs/ardour/audiofilesource.cc20
-rw-r--r--libs/ardour/audioregion.cc45
-rw-r--r--libs/ardour/audiosource.cc4
-rw-r--r--libs/ardour/auditioner.cc6
-rw-r--r--libs/ardour/automatable.cc4
-rw-r--r--libs/ardour/automation_list.cc2
-rw-r--r--libs/ardour/buffer_set.cc12
-rw-r--r--libs/ardour/butler.cc2
-rw-r--r--libs/ardour/caimportable.cc14
-rw-r--r--libs/ardour/coreaudiosource.cc2
-rw-r--r--libs/ardour/default_click.cc4
-rw-r--r--libs/ardour/delivery.cc14
-rw-r--r--libs/ardour/diskstream.cc14
-rw-r--r--libs/ardour/element_importer.cc6
-rw-r--r--libs/ardour/export_channel.cc6
-rw-r--r--libs/ardour/export_format_specification.cc6
-rw-r--r--libs/ardour/export_graph_builder.cc16
-rw-r--r--libs/ardour/export_handler.cc8
-rw-r--r--libs/ardour/export_profile_manager.cc4
-rw-r--r--libs/ardour/export_timespan.cc15
-rw-r--r--libs/ardour/gain.cc8
-rw-r--r--libs/ardour/graph.cc6
-rw-r--r--libs/ardour/import.cc10
-rw-r--r--libs/ardour/internal_return.cc10
-rw-r--r--libs/ardour/internal_send.cc4
-rw-r--r--libs/ardour/interpolation.cc18
-rw-r--r--libs/ardour/io.cc16
-rw-r--r--libs/ardour/io_processor.cc2
-rw-r--r--libs/ardour/ladspa_plugin.cc14
-rw-r--r--libs/ardour/location_importer.cc2
-rw-r--r--libs/ardour/lv2_plugin.cc14
-rw-r--r--libs/ardour/meter.cc4
-rw-r--r--libs/ardour/midi_buffer.cc6
-rw-r--r--libs/ardour/midi_clock_slave.cc4
-rw-r--r--libs/ardour/midi_diskstream.cc28
-rw-r--r--libs/ardour/midi_playlist.cc22
-rw-r--r--libs/ardour/midi_port.cc18
-rw-r--r--libs/ardour/midi_region.cc6
-rw-r--r--libs/ardour/midi_ring_buffer.cc6
-rw-r--r--libs/ardour/midi_source.cc12
-rw-r--r--libs/ardour/midi_state_tracker.cc2
-rw-r--r--libs/ardour/midi_stretch.cc2
-rw-r--r--libs/ardour/midi_track.cc19
-rw-r--r--libs/ardour/mix.cc38
-rw-r--r--libs/ardour/monitor_processor.cc6
-rw-r--r--libs/ardour/mtc_slave.cc20
-rw-r--r--libs/ardour/onset_detector.cc2
-rw-r--r--libs/ardour/panner.cc30
-rw-r--r--libs/ardour/playlist_factory.cc2
-rw-r--r--libs/ardour/plugin_insert.cc26
-rw-r--r--libs/ardour/port.cc6
-rw-r--r--libs/ardour/port_insert.cc10
-rw-r--r--libs/ardour/rb_effect.cc34
-rw-r--r--libs/ardour/region.cc16
-rw-r--r--libs/ardour/resampled_source.cc12
-rw-r--r--libs/ardour/return.cc2
-rw-r--r--libs/ardour/reverse.cc2
-rw-r--r--libs/ardour/route.cc46
-rw-r--r--libs/ardour/send.cc2
-rw-r--r--libs/ardour/session.cc22
-rw-r--r--libs/ardour/session_click.cc8
-rw-r--r--libs/ardour/session_export.cc6
-rw-r--r--libs/ardour/session_midi.cc16
-rw-r--r--libs/ardour/session_process.cc58
-rw-r--r--libs/ardour/session_state.cc4
-rw-r--r--libs/ardour/session_time.cc30
-rw-r--r--libs/ardour/session_transport.cc12
-rw-r--r--libs/ardour/slave.cc4
-rw-r--r--libs/ardour/smf_source.cc18
-rw-r--r--libs/ardour/sndfileimportable.cc12
-rw-r--r--libs/ardour/sndfilesource.cc10
-rw-r--r--libs/ardour/source_factory.cc2
-rw-r--r--libs/ardour/sse_functions_xmm.cc2
-rw-r--r--libs/ardour/st_stretch.cc20
-rw-r--r--libs/ardour/strip_silence.cc2
-rw-r--r--libs/ardour/tempo.cc6
-rw-r--r--libs/ardour/test/interpolation_test.cpp32
-rw-r--r--libs/ardour/test/midi_clock_slave_test.h6
-rw-r--r--libs/ardour/thread_buffers.cc2
-rw-r--r--libs/ardour/ticker.cc22
-rw-r--r--libs/ardour/track.cc14
-rw-r--r--libs/ardour/transient_detector.cc4
-rw-r--r--libs/ardour/utils.cc6
-rw-r--r--libs/ardour/vbap.cc6
-rw-r--r--libs/ardour/vst_plugin.cc8
176 files changed, 1160 insertions, 1172 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc
index 7f0b397703..230b9f0d6b 100644
--- a/libs/ardour/amp.cc
+++ b/libs/ardour/amp.cc
@@ -71,7 +71,7 @@ Amp::configure_io (ChanCount in, ChanCount out)
}
void
-Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
{
if (!_active && !_pending_active) {
return;
@@ -85,7 +85,7 @@ Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
Sample* const sp = i->data();
- for (nframes_t nx = 0; nx < nframes; ++nx) {
+ for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] *= gab[nx];
}
}
@@ -129,7 +129,7 @@ Amp::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
}
void
-Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target)
+Amp::apply_gain (BufferSet& bufs, framecnt_t nframes, gain_t initial, gain_t target)
{
/** Apply a (potentially) declicked gain to the buffers of @a bufs
*/
@@ -144,7 +144,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
return;
}
- const nframes_t declick = std::min ((nframes_t)128, nframes);
+ const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta;
double fractional_shift = -1.0/declick;
double fractional_pos;
@@ -180,7 +180,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
fractional_pos = 1.0;
- for (nframes_t nx = 0; nx < declick; ++nx) {
+ for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift;
}
@@ -199,7 +199,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
}
void
-Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
+Amp::declick (BufferSet& bufs, framecnt_t nframes, int dir)
{
/* Almost exactly like ::apply_gain() but skips MIDI buffers and has fixed initial+target
values.
@@ -209,7 +209,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
return;
}
- const nframes_t declick = std::min ((nframes_t)128, nframes);
+ const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta, initial, target;
double fractional_shift = -1.0/declick;
double fractional_pos;
@@ -233,7 +233,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
fractional_pos = 1.0;
- for (nframes_t nx = 0; nx < declick; ++nx) {
+ for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift;
}
@@ -252,7 +252,7 @@ Amp::declick (BufferSet& bufs, nframes_t nframes, int dir)
}
void
-Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target)
+Amp::apply_gain (AudioBuffer& buf, framecnt_t nframes, gain_t initial, gain_t target)
{
/** Apply a (potentially) declicked gain to the contents of @a buf
*/
@@ -267,7 +267,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
return;
}
- const nframes_t declick = std::min ((nframes_t)128, nframes);
+ const framecnt_t declick = std::min ((framecnt_t) 128, nframes);
gain_t delta;
double fractional_shift = -1.0/declick;
double fractional_pos;
@@ -285,7 +285,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
fractional_pos = 1.0;
- for (nframes_t nx = 0; nx < declick; ++nx) {
+ for (pframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift;
}
@@ -303,7 +303,7 @@ Amp::apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t tar
}
void
-Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
+Amp::apply_simple_gain (BufferSet& bufs, framecnt_t nframes, gain_t target)
{
if (target == 0.0) {
@@ -342,7 +342,7 @@ Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
}
void
-Amp::apply_simple_gain (AudioBuffer& buf, nframes_t nframes, gain_t target)
+Amp::apply_simple_gain (AudioBuffer& buf, framecnt_t nframes, gain_t target)
{
if (target == 0.0) {
memset (buf.data(), 0, sizeof (Sample) * nframes);
@@ -412,8 +412,9 @@ void
Amp::GainControl::set_value (double val)
{
// max gain at about +6dB (10.0 ^ ( 6 dB * 0.05))
- if (val > 1.99526231f)
+ if (val > 1.99526231f) {
val = 1.99526231f;
+ }
_amp->set_gain (val, this);
@@ -427,7 +428,7 @@ Amp::GainControl::get_value (void) const
}
void
-Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes)
+Amp::setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_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 0ec493e8ce..711cc5489f 100644
--- a/libs/ardour/ardour/amp.h
+++ b/libs/ardour/ardour/amp.h
@@ -43,12 +43,12 @@ public:
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
- bool apply_gain() const { return _apply_gain; }
- void apply_gain(bool yn) { _apply_gain = yn; }
+ bool apply_gain () const { return _apply_gain; }
+ void apply_gain (bool yn) { _apply_gain = yn; }
- void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
+ void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes);
bool apply_gain_automation() const { return _apply_gain_automation; }
void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
@@ -56,13 +56,13 @@ public:
XMLNode& state (bool full);
int set_state (const XMLNode&, int version);
- static void apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target);
- static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target);
+ static void apply_gain (BufferSet& bufs, framecnt_t nframes, gain_t initial, gain_t target);
+ static void apply_simple_gain(BufferSet& bufs, framecnt_t nframes, gain_t target);
- static void apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target);
- static void apply_simple_gain(AudioBuffer& buf, nframes_t nframes, gain_t target);
+ static void apply_gain (AudioBuffer& buf, framecnt_t nframes, gain_t initial, gain_t target);
+ static void apply_simple_gain(AudioBuffer& buf, framecnt_t nframes, gain_t target);
- static void declick (BufferSet& bufs, nframes_t nframes, int dir);
+ static void declick (BufferSet& bufs, framecnt_t nframes, int dir);
gain_t gain () const { return _gain_control->user_double(); }
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h
index 65eb38d6db..6c5a0a0832 100644
--- a/libs/ardour/ardour/audio_buffer.h
+++ b/libs/ardour/ardour/audio_buffer.h
@@ -30,7 +30,7 @@ public:
AudioBuffer(size_t capacity);
~AudioBuffer();
- void silence (nframes_t len, nframes_t offset = 0) {
+ void silence (framecnt_t len, framecnt_t offset = 0) {
if (!_silent) {
assert(_capacity > 0);
assert(offset + len <= _capacity);
@@ -43,7 +43,7 @@ public:
}
/** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
- void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
+ void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(&src != this);
assert(_capacity > 0);
assert(src.type() == DataType::AUDIO);
@@ -58,14 +58,14 @@ public:
}
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
- void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
+ void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
const AudioBuffer* ab = dynamic_cast<const AudioBuffer*>(&src);
assert (ab);
accumulate_from (*ab, len, dst_offset, src_offset);
}
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
- void accumulate_from (const AudioBuffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
+ void accumulate_from (const AudioBuffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(_capacity > 0);
assert(len <= _capacity);
@@ -80,7 +80,7 @@ public:
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset
* scaling by @a gain_coeff */
- void accumulate_with_gain_from (const AudioBuffer& src, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
+ void accumulate_with_gain_from (const AudioBuffer& src, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
assert(_capacity > 0);
assert(len <= _capacity);
@@ -100,7 +100,7 @@ public:
/** Accumulate (add) @a len frames FROM THE START OF @a src into self
* scaling by @a gain_coeff */
- void accumulate_with_gain_from (const Sample* src_raw, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0) {
+ void accumulate_with_gain_from (const Sample* src_raw, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0) {
assert(_capacity > 0);
assert(len <= _capacity);
@@ -113,7 +113,7 @@ public:
_written = true;
}
- void apply_gain (gain_t gain, nframes_t len) {
+ void apply_gain (gain_t gain, framecnt_t len) {
apply_gain_to_buffer (_data, len, gain);
}
@@ -137,12 +137,12 @@ public:
void resize (size_t nframes);
- const Sample* data (nframes_t offset = 0) const {
+ const Sample* data (framecnt_t offset = 0) const {
assert(offset <= _capacity);
return _data + offset;
}
- Sample* data (nframes_t offset = 0) {
+ Sample* data (framecnt_t offset = 0) {
assert(offset <= _capacity);
return _data + offset;
}
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h
index 4106602b63..2bd44d62a6 100644
--- a/libs/ardour/ardour/audio_diskstream.h
+++ b/libs/ardour/ardour/audio_diskstream.h
@@ -139,7 +139,7 @@ class AudioDiskstream : public Diskstream
}
}
- static void swap_by_ptr (Sample *first, Sample *last, nframes_t n) {
+ static void swap_by_ptr (Sample *first, Sample *last, framecnt_t n) {
while (n--) {
Sample tmp = *first;
*first++ = *last;
@@ -161,7 +161,7 @@ class AudioDiskstream : public Diskstream
void set_pending_overwrite(bool);
int overwrite_existing_buffers ();
- void set_block_size (nframes_t);
+ void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources ();
@@ -177,17 +177,17 @@ class AudioDiskstream : public Diskstream
protected:
friend class AudioTrack;
- int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
- bool commit (nframes_t nframes);
+ int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
+ bool commit (framecnt_t nframes);
private:
struct ChannelInfo : public boost::noncopyable {
- ChannelInfo (nframes_t playback_buffer_size,
- nframes_t capture_buffer_size,
- nframes_t speed_buffer_size,
- nframes_t wrap_buffer_size);
+ ChannelInfo (framecnt_t playback_buffer_size,
+ framecnt_t capture_buffer_size,
+ framecnt_t speed_buffer_size,
+ framecnt_t wrap_buffer_size);
~ChannelInfo ();
Sample *playback_wrap_buffer;
@@ -216,15 +216,15 @@ class AudioDiskstream : public Diskstream
RingBufferNPT<CaptureTransition> * capture_transition_buf;
// the following are used in the butler thread only
- nframes_t curr_capture_cnt;
+ framecnt_t curr_capture_cnt;
- void resize_playback (nframes_t);
- void resize_capture (nframes_t);
+ void resize_playback (framecnt_t);
+ void resize_capture (framecnt_t);
};
typedef std::vector<ChannelInfo*> ChannelList;
- void process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c);
+ void process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c);
/* The two central butler operations */
int do_flush (RunContext context, bool force = false);
@@ -233,7 +233,7 @@ class AudioDiskstream : public Diskstream
int do_refill_with_alloc ();
int read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
- framepos_t& start, nframes_t cnt,
+ framepos_t& start, framecnt_t cnt,
ChannelInfo* channel_info, int channel, bool reversed);
void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>);
diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h
index 895cae99a6..748ef8263b 100644
--- a/libs/ardour/ardour/audio_port.h
+++ b/libs/ardour/ardour/audio_port.h
@@ -35,25 +35,25 @@ class AudioPort : public Port
return DataType::AUDIO;
}
- void cycle_start (nframes_t);
- void cycle_end (nframes_t);
+ void cycle_start (pframes_t);
+ void cycle_end (pframes_t);
void cycle_split ();
- size_t raw_buffer_size(jack_nframes_t nframes) const;
+ size_t raw_buffer_size (pframes_t nframes) const;
- Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) {
+ Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) {
return get_audio_buffer (nframes, offset);
}
- AudioBuffer& get_audio_buffer (nframes_t nframes, nframes_t offset = 0);
+ AudioBuffer& get_audio_buffer (framecnt_t nframes, framecnt_t offset = 0);
- static nframes_t port_offset() { return _port_offset; }
+ static framecnt_t port_offset() { return _port_offset; }
- static void set_port_offset (nframes_t off) {
+ static void set_port_offset (framecnt_t off) {
_port_offset = off;
}
- static void increment_port_offset (nframes_t n) {
+ static void increment_port_offset (framecnt_t n) {
_port_offset += n;
}
@@ -65,7 +65,7 @@ class AudioPort : public Port
private:
AudioBuffer* _buffer;
- static nframes_t _port_offset;
+ static framecnt_t _port_offset;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h
index 8e31db34fd..b9c60d5107 100644
--- a/libs/ardour/ardour/audio_track.h
+++ b/libs/ardour/ardour/audio_track.h
@@ -39,7 +39,7 @@ class AudioTrack : public Track
int set_mode (TrackMode m);
bool can_use_mode (TrackMode m, bool& bounce_required);
- int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler);
void use_new_diskstream ();
@@ -55,7 +55,7 @@ class AudioTrack : public Track
void unfreeze ();
boost::shared_ptr<Region> bounce (InterThreadInfo&);
- boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing);
+ boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing);
int set_state(const XMLNode&, int version);
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h
index 048e6b978b..b00c23b1dc 100644
--- a/libs/ardour/ardour/audio_unit.h
+++ b/libs/ardour/ardour/audio_unit.h
@@ -71,7 +71,7 @@ class AUPlugin : public ARDOUR::Plugin
const char * maker () const { return _info->creator.c_str(); }
uint32_t parameter_count () const;
float default_value (uint32_t port);
- nframes_t signal_latency() const;
+ framecnt_t signal_latency() const;
void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const;
@@ -80,11 +80,11 @@ class AUPlugin : public ARDOUR::Plugin
void activate ();
void deactivate ();
void flush ();
- int set_block_size (nframes_t nframes);
+ int set_block_size (pframes_t nframes);
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
- nframes_t nframes, nframes_t offset);
+ pframes_t nframes, framecnt_t offset);
std::set<Evoral::Parameter> automatable() const;
std::string describe_parameter (Evoral::Parameter);
std::string state_node_name () const { return "audiounit"; }
@@ -150,8 +150,8 @@ class AUPlugin : public ARDOUR::Plugin
int32_t input_channels;
int32_t output_channels;
std::vector<std::pair<int,int> > io_configs;
- nframes_t _current_block_size;
- nframes_t _last_nframes;
+ pframes_t _current_block_size;
+ framecnt_t _last_nframes;
bool _requires_fixed_size_buffers;
AudioBufferList* buffers;
bool _has_midi_input;
@@ -181,10 +181,10 @@ class AUPlugin : public ARDOUR::Plugin
std::vector<std::pair<uint32_t, uint32_t> > parameter_map;
uint32_t current_maxbuf;
- nframes_t current_offset;
- nframes_t cb_offset;
+ framecnt_t current_offset;
+ framecnt_t cb_offset;
BufferSet* current_buffers;
- nframes_t frames_processed;
+ framecnt_t frames_processed;
std::vector<AUParameterDescriptor> descriptors;
void init ();
diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h
index f16a2b1e49..27a03ce805 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;
- nframes_t bufsize;
- nframes_t stepsize;
+ framecnt_t bufsize;
+ framecnt_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/audioengine.h b/libs/ardour/ardour/audioengine.h
index 523a05b4c1..f55a7e334e 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -91,46 +91,57 @@ class AudioEngine : public SessionHandlePtr
Glib::Mutex& process_lock() { return _process_lock; }
- nframes_t frame_rate() const;
- nframes_t frames_per_cycle() const;
+ framecnt_t frame_rate () const;
+ framecnt_t frames_per_cycle () const;
size_t raw_buffer_size(DataType t);
int usecs_per_cycle () const { return _usecs_per_cycle; }
- bool get_sync_offset (nframes_t& offset) const;
+ bool get_sync_offset (pframes_t & offset) const;
- nframes_t frames_since_cycle_start () {
+ pframes_t frames_since_cycle_start () {
jack_client_t* _priv_jack = _jack;
- if (!_running || !_priv_jack) return 0;
+ if (!_running || !_priv_jack) {
+ return 0;
+ }
return jack_frames_since_cycle_start (_priv_jack);
}
- nframes_t frame_time () {
+
+ pframes_t frame_time () {
jack_client_t* _priv_jack = _jack;
- if (!_running || !_priv_jack) return 0;
+ if (!_running || !_priv_jack) {
+ return 0;
+ }
return jack_frame_time (_priv_jack);
}
- nframes_t frame_time_at_cycle_start () {
+ pframes_t frame_time_at_cycle_start () {
jack_client_t* _priv_jack = _jack;
- if (!_running || !_priv_jack) return 0;
+ if (!_running || !_priv_jack) {
+ return 0;
+ }
return jack_last_frame_time (_priv_jack);
}
- nframes_t transport_frame () const {
+ pframes_t transport_frame () const {
const jack_client_t* _priv_jack = _jack;
- if (!_running || !_priv_jack) return 0;
+ if (!_running || !_priv_jack) {
+ return 0;
+ }
return jack_get_current_transport_frame (_priv_jack);
}
- int request_buffer_size (nframes_t);
+ int request_buffer_size (pframes_t);
- nframes_t set_monitor_check_interval (nframes_t);
- nframes_t processed_frames() const { return _processed_frames; }
+ framecnt_t set_monitor_check_interval (framecnt_t);
+ framecnt_t processed_frames() const { return _processed_frames; }
float get_cpu_load() {
jack_client_t* _priv_jack = _jack;
- if (!_running || !_priv_jack) return 0;
+ if (!_running || !_priv_jack) {
+ return 0;
+ }
return jack_cpu_load (_priv_jack);
}
@@ -159,7 +170,7 @@ class AudioEngine : public SessionHandlePtr
Port *register_output_port (DataType, const std::string& portname);
int unregister_port (Port &);
- void split_cycle (nframes_t offset);
+ void split_cycle (pframes_t offset);
int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination);
@@ -189,7 +200,7 @@ class AudioEngine : public SessionHandlePtr
void transport_start ();
void transport_stop ();
- void transport_locate (nframes_t);
+ void transport_locate (framepos_t);
TransportState transport_state ();
int reset_timebase ();
@@ -203,7 +214,7 @@ class AudioEngine : public SessionHandlePtr
_ the regular process() call to session->process() is not made.
*/
- PBD::Signal1<int,nframes_t> Freewheel;
+ PBD::Signal1<int, pframes_t> Freewheel;
PBD::Signal0<void> Xrun;
@@ -218,7 +229,7 @@ _ the regular process() call to session->process() is not made.
/* this signal is emitted if the sample rate changes */
- PBD::Signal1<void,nframes_t> SampleRateChanged;
+ PBD::Signal1<void, framecnt_t> SampleRateChanged;
/* this signal is sent if JACK ever disconnects us */
@@ -255,18 +266,18 @@ _ the regular process() call to session->process() is not made.
bool session_remove_pending;
bool _running;
bool _has_run;
- mutable nframes_t _buffer_size;
+ mutable framecnt_t _buffer_size;
std::map<DataType,size_t> _raw_buffer_sizes;
- mutable nframes_t _frame_rate;
+ mutable framecnt_t _frame_rate;
/// number of frames between each check for changes in monitor input
- nframes_t monitor_check_interval;
+ framecnt_t monitor_check_interval;
/// time of the last monitor check in frames
- nframes_t last_monitor_check;
+ framecnt_t last_monitor_check;
/// the number of frames processed since start() was called
- nframes_t _processed_frames;
+ framecnt_t _processed_frames;
bool _freewheeling;
bool _freewheel_pending;
- boost::function<int(nframes_t)> freewheel_action;
+ boost::function<int(framecnt_t)> freewheel_action;
bool reconnect_on_halt;
int _usecs_per_cycle;
@@ -274,7 +285,7 @@ _ the regular process() call to session->process() is not made.
Port *register_port (DataType type, const std::string& portname, bool input);
- int process_callback (nframes_t nframes);
+ int process_callback (pframes_t nframes);
void* process_thread ();
void finish_process_cycle (int status);
void remove_all_ports ();
@@ -289,20 +300,20 @@ _ the regular process() call to session->process() is not made.
static void _session_callback (jack_session_event_t *event, void *arg);
#endif
static int _graph_order_callback (void *arg);
- static int _process_callback (nframes_t nframes, void *arg);
+ static int _process_callback (pframes_t nframes, void *arg);
static void* _process_thread (void *arg);
- static int _sample_rate_callback (nframes_t nframes, void *arg);
- static int _bufsize_callback (nframes_t nframes, void *arg);
- static void _jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int, void*);
+ static int _sample_rate_callback (pframes_t nframes, void *arg);
+ static int _bufsize_callback (pframes_t nframes, void *arg);
+ static void _jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int, void*);
static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg);
static void _freewheel_callback (int , void *arg);
static void _registration_callback (jack_port_id_t, int, void *);
static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *);
- void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int);
+ void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
- int jack_bufsize_callback (nframes_t);
- int jack_sample_rate_callback (nframes_t);
+ int jack_bufsize_callback (pframes_t);
+ int jack_sample_rate_callback (pframes_t);
int connect_to_jack (std::string client_name, std::string session_uuid);
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h
index 4f01bf4182..3bd4bbd34c 100644
--- a/libs/ardour/ardour/audiofilesource.h
+++ b/libs/ardour/ardour/audiofilesource.h
@@ -82,7 +82,7 @@ public:
static bool is_empty (Session&, std::string path);
static void set_bwf_serial_number (int);
- static void set_header_position_offset (nframes_t offset );
+ static void set_header_position_offset (framecnt_t offset);
static PBD::Signal0<void> HeaderPositionOffsetChanged;
@@ -104,7 +104,7 @@ protected:
int move_dependents_to_trash();
- static Sample* get_interleave_buffer (nframes_t size);
+ static Sample* get_interleave_buffer (framecnt_t size);
static std::string peak_dir;
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 253329b38e..6c3169070f 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -72,7 +72,7 @@ public:
AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
AudioPlaylist (Session&, std::string name, bool hidden = false);
AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false);
- AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false);
+ AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
~AudioPlaylist ();
@@ -85,7 +85,7 @@ public:
PBD::Signal1<void,boost::shared_ptr<Crossfade> > NewCrossfade;
void foreach_crossfade (boost::function<void (boost::shared_ptr<Crossfade>)>);
- void crossfades_at (nframes_t frame, Crossfades&);
+ void crossfades_at (framepos_t frame, Crossfades&);
bool destroy_region (boost::shared_ptr<Region>);
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index 902e7eb934..a5791c8b30 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -93,8 +93,8 @@ class AudioRegion : public Region
boost::shared_ptr<AutomationList> fade_out() { return _fade_out; }
boost::shared_ptr<AutomationList> envelope() { return _envelope; }
- virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks,
- nframes_t offset, nframes_t cnt,
+ virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks,
+ framecnt_t offset, framecnt_t cnt,
uint32_t chan_n=0, double samples_per_unit= 1.0) const;
/* Readable interface */
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index 08c879d926..22d5d1a724 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -69,7 +69,7 @@ class AudioSource : virtual public Source,
uint32_t read_data_count() const { return _read_data_count; }
uint32_t write_data_count() const { return _write_data_count; }
- void dec_read_data_count(nframes_t);
+ void dec_read_data_count (framecnt_t);
int read_peaks (PeakData *peaks, framecnt_t npeaks,
framepos_t start, framecnt_t cnt, double samples_per_visual_peak) const;
diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h
index e7d3347cb6..25a7b91158 100644
--- a/libs/ardour/ardour/auditioner.h
+++ b/libs/ardour/ardour/auditioner.h
@@ -46,7 +46,7 @@ class Auditioner : public AudioTrack
ARDOUR::AudioPlaylist& prepare_playlist ();
void audition_current_playlist ();
- int play_audition (nframes_t nframes);
+ int play_audition (framecnt_t nframes);
void cancel_audition () {
g_atomic_int_set (&_auditioning, 0);
@@ -57,10 +57,10 @@ class Auditioner : public AudioTrack
private:
boost::shared_ptr<AudioRegion> the_region;
- nframes_t current_frame;
+ framepos_t current_frame;
mutable gint _auditioning;
Glib::Mutex lock;
- nframes_t length;
+ framecnt_t length;
bool via_monitor;
void drop_ports ();
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h
index f90f1dec48..541e9d562d 100644
--- a/libs/ardour/ardour/automatable.h
+++ b/libs/ardour/ardour/automatable.h
@@ -60,7 +60,7 @@ public:
virtual void add_control(boost::shared_ptr<Evoral::Control>);
void clear_controls ();
- virtual void automation_snapshot(nframes_t now, bool force);
+ virtual void automation_snapshot (framepos_t now, bool force);
virtual void transport_stopped (framepos_t now);
virtual std::string describe_parameter(Evoral::Parameter param);
@@ -78,16 +78,16 @@ public:
void mark_automation_visible(Evoral::Parameter, bool);
- inline bool should_snapshot (nframes_t now) {
+ inline bool should_snapshot (framepos_t now) {
return (_last_automation_snapshot > now
|| (now - _last_automation_snapshot) > _automation_interval);
}
- static void set_automation_interval (jack_nframes_t frames) {
+ static void set_automation_interval (framecnt_t frames) {
_automation_interval = frames;
}
- static jack_nframes_t automation_interval() {
+ static framecnt_t automation_interval() {
return _automation_interval;
}
@@ -109,8 +109,8 @@ public:
std::set<Evoral::Parameter> _visible_controls;
std::set<Evoral::Parameter> _can_automate_list;
- nframes_t _last_automation_snapshot;
- static nframes_t _automation_interval;
+ framepos_t _last_automation_snapshot;
+ static framecnt_t _automation_interval;
private:
PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h
index 48fd7f099b..5b76aafca6 100644
--- a/libs/ardour/ardour/buffer.h
+++ b/libs/ardour/ardour/buffer.h
@@ -71,13 +71,13 @@ public:
virtual void resize (size_t) = 0;
/** Clear (eg zero, or empty) buffer */
- virtual void silence (nframes_t len, nframes_t offset = 0) = 0;
+ virtual void silence (framecnt_t len, framecnt_t offset = 0) = 0;
/** Clear the entire buffer */
virtual void clear() { silence(_capacity, 0); }
- virtual void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0;
- virtual void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0;
+ virtual void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
+ virtual void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
protected:
Buffer(DataType type, size_t capacity)
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h
index 711e2350fd..c3358f4436 100644
--- a/libs/ardour/ardour/buffer_set.h
+++ b/libs/ardour/ardour/buffer_set.h
@@ -66,7 +66,7 @@ public:
void clear();
- void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset = 0);
+ void attach_buffers(PortSet& ports, framecnt_t nframes, framecnt_t offset = 0);
/* the capacity here is a size_t and has a different interpretation depending
on the DataType of the buffers. for audio, its a frame count. for MIDI
@@ -83,7 +83,7 @@ public:
ChanCount& count() { return _count; }
void is_silent(bool yn);
- void silence (nframes_t nframes, nframes_t offset);
+ void silence (framecnt_t nframes, framecnt_t offset);
bool is_mirror() const { return _is_mirror; }
void set_count(const ChanCount& count) { assert(count <= _available); _count = count; }
@@ -115,8 +115,8 @@ public:
VstEvents* get_vst_midi (size_t);
#endif
- void read_from(const BufferSet& in, nframes_t nframes);
- void merge_from(const BufferSet& in, nframes_t nframes);
+ void read_from(const BufferSet& in, framecnt_t nframes);
+ void merge_from(const BufferSet& in, framecnt_t nframes);
template <typename BS, typename B>
class iterator_base {
@@ -176,7 +176,7 @@ private:
~VSTBuffer ();
void clear ();
- void push_back (Evoral::MIDIEvent<nframes_t> const &);
+ void push_back (Evoral::MIDIEvent<framepos_t> const &);
VstEvents* events () const {
return _events;
}
diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h
index 6ad96dc704..6751f3dcca 100644
--- a/libs/ardour/ardour/butler.h
+++ b/libs/ardour/ardour/butler.h
@@ -54,8 +54,8 @@ class Butler : public SessionHandleRef
float read_data_rate() const; ///< in usec
float write_data_rate() const;
- nframes_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; }
- nframes_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; }
+ framecnt_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; }
+ framecnt_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; }
uint32_t midi_diskstream_buffer_size() const { return midi_dstream_buffer_size; }
static void* _thread_work(void *arg);
@@ -76,8 +76,8 @@ class Butler : public SessionHandleRef
bool should_run;
mutable gint should_do_transport_work;
int request_pipe[2];
- nframes_t audio_dstream_capture_buffer_size;
- nframes_t audio_dstream_playback_buffer_size;
+ framecnt_t audio_dstream_capture_buffer_size;
+ framecnt_t audio_dstream_playback_buffer_size;
uint32_t midi_dstream_buffer_size;
RingBuffer<CrossThreadPool*> pool_trash;
diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h
index 5ee1d50194..783588c8ab 100644
--- a/libs/ardour/ardour/click.h
+++ b/libs/ardour/ardour/click.h
@@ -29,34 +29,34 @@
namespace ARDOUR {
struct Click {
- nframes_t start;
- nframes_t duration;
- nframes_t offset;
- const Sample *data;
-
- Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
+ framepos_t start;
+ framecnt_t duration;
+ framecnt_t offset;
+ const Sample *data;
+
+ Click (framepos_t s, framecnt_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {}
- void *operator new (size_t) {
- return pool.alloc ();
+ void *operator new (size_t) {
+ return pool.alloc ();
};
-
- void operator delete(void *ptr, size_t /*size*/) {
- pool.release (ptr);
- }
-
+
+ void operator delete(void *ptr, size_t /*size*/) {
+ pool.release (ptr);
+ }
+
private:
- static Pool pool;
+ static Pool pool;
};
typedef std::list<Click*> Clicks;
class ClickIO : public IO
{
- public:
+public:
ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {}
~ClickIO() {}
- protected:
+protected:
uint32_t pans_required () const { return 1; }
};
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index c920fadc2c..e1aa389df7 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -66,21 +66,21 @@ public:
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
/* supplemental method used with MIDI */
- void flush_buffers (nframes_t nframes, framepos_t time);
+ void flush_buffers (framecnt_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 cycle_start (pframes_t);
+ void increment_output_offset (framecnt_t);
void transport_stopped (framepos_t frame);
BufferSet& output_buffers() { return *_output_buffers; }
PBD::Signal0<void> MuteChange;
- static PBD::Signal1<void,nframes_t> CycleStart;
+ static PBD::Signal1<void, pframes_t> CycleStart;
XMLNode& state (bool full);
int set_state (const XMLNode&, int version);
@@ -104,7 +104,7 @@ public:
Role _role;
BufferSet* _output_buffers;
gain_t _current_gain;
- nframes_t _output_offset;
+ framecnt_t _output_offset;
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
bool no_panner_reset;
diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h
index 4eabe29d85..cd5932b3e5 100644
--- a/libs/ardour/ardour/diskstream.h
+++ b/libs/ardour/ardour/diskstream.h
@@ -79,8 +79,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
void set_align_style (AlignStyle);
void set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; }
- nframes_t roll_delay() const { return _roll_delay; }
- void set_roll_delay (nframes_t);
+ framecnt_t roll_delay() const { return _roll_delay; }
+ void set_roll_delay (framecnt_t);
bool record_enabled() const { return g_atomic_int_get (&_record_enabled); }
virtual void set_record_enabled (bool yn) = 0;
@@ -118,8 +118,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
ChanCount n_channels() { return _n_channels; }
- static nframes_t disk_io_frames() { return disk_io_chunk_frames; }
- static void set_disk_io_chunk_frames (uint32_t n) { disk_io_chunk_frames = n; }
+ static framecnt_t disk_io_frames() { return disk_io_chunk_frames; }
+ static void set_disk_io_chunk_frames (framecnt_t n) { disk_io_chunk_frames = n; }
/* Stateful */
virtual XMLNode& get_state(void) = 0;
@@ -127,7 +127,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
virtual void monitor_input (bool) {}
- nframes_t capture_offset() const { return _capture_offset; }
+ framecnt_t capture_offset() const { return _capture_offset; }
virtual void set_capture_offset ();
bool slaved() const { return _slaved; }
@@ -144,7 +144,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
/** For non-butler contexts (allocates temporary working buffers) */
virtual int do_refill_with_alloc() = 0;
- virtual void set_block_size (nframes_t) = 0;
+ virtual void set_block_size (pframes_t) = 0;
bool pending_overwrite () const {
return _pending_overwrite;
@@ -186,8 +186,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
protected:
friend class Track;
- virtual int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
- virtual bool commit (nframes_t nframes) = 0;
+ virtual int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
+ virtual bool commit (framecnt_t nframes) = 0;
//private:
@@ -239,9 +239,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
virtual void prepare_to_stop (framepos_t pos);
void calculate_record_range(OverlapType ot, framepos_t transport_frame, framecnt_t nframes,
- nframes_t& rec_nframes, nframes_t& rec_offset);
+ framecnt_t& rec_nframes, framecnt_t& rec_offset);
- static nframes_t disk_io_chunk_frames;
+ static framecnt_t disk_io_chunk_frames;
std::vector<CaptureInfo*> capture_info;
mutable Glib::Mutex capture_info_lock;
@@ -265,9 +265,9 @@ class Diskstream : public SessionObject, public PublicDiskstream
framepos_t capture_start_frame;
framecnt_t capture_captured;
bool was_recording;
- nframes_t adjust_capture_position;
- nframes_t _capture_offset;
- nframes_t _roll_delay;
+ framecnt_t adjust_capture_position;
+ framecnt_t _capture_offset;
+ framecnt_t _roll_delay;
framepos_t first_recordable_frame;
framepos_t last_recordable_frame;
int last_possibly_recording;
@@ -280,8 +280,8 @@ class Diskstream : public SessionObject, public PublicDiskstream
bool _pending_overwrite;
bool overwrite_queued;
IOChange input_change_pending;
- nframes_t wrap_buffer_size;
- nframes_t speed_buffer_size;
+ framecnt_t wrap_buffer_size;
+ framecnt_t speed_buffer_size;
double _speed;
double _target_speed;
@@ -299,10 +299,6 @@ class Diskstream : public SessionObject, public PublicDiskstream
Glib::Mutex state_lock;
- framepos_t scrub_start;
- nframes_t scrub_buffer_size;
- nframes_t scrub_offset;
-
PBD::ScopedConnectionList playlist_connections;
PBD::ScopedConnection ic_connection;
diff --git a/libs/ardour/ardour/element_importer.h b/libs/ardour/ardour/element_importer.h
index 8ffa3b90ba..8c25fd380d 100644
--- a/libs/ardour/ardour/element_importer.h
+++ b/libs/ardour/ardour/element_importer.h
@@ -109,13 +109,13 @@ class ElementImporter
std::string name;
/// The sample rate of the session from which we are importing
- nframes_t sample_rate;
+ framecnt_t sample_rate;
/// Converts timecode time to a string
std::string timecode_to_string (Timecode::Time & time) const;
/// Converts samples so that times match the sessions sample rate
- nframes_t rate_convert_samples (nframes_t samples) const;
+ framecnt_t rate_convert_samples (framecnt_t samples) const;
/// Converts samples so that times match the sessions sample rate (for straight use in XML)
std::string rate_convert_samples (std::string const & samples) const;
diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h
index 51ecabee25..96b9c1eda2 100644
--- a/libs/ardour/ardour/export_channel.h
+++ b/libs/ardour/ardour/export_channel.h
@@ -43,7 +43,7 @@ class ExportChannel : public boost::less_than_comparable<ExportChannel>
virtual ~ExportChannel () {}
- virtual void read (Sample * data, nframes_t frames) const = 0;
+ virtual void read (Sample * data, framecnt_t frames) const = 0;
virtual bool empty () const = 0;
/// Adds state to node passed
@@ -75,7 +75,7 @@ class PortExportChannel : public ExportChannel
PortExportChannel () {}
- void read (Sample * data, nframes_t frames) const;
+ void read (Sample * data, framecnt_t frames) const;
bool empty () const { return ports.empty(); }
void get_state (XMLNode * node) const;
@@ -104,23 +104,23 @@ class RegionExportChannelFactory
~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel);
- void read (uint32_t channel, Sample * data, nframes_t frames_to_read);
+ void read (uint32_t channel, Sample * data, framecnt_t frames_to_read);
private:
- int new_cycle_started (nframes_t) { buffers_up_to_date = false; return 0; }
- void update_buffers (nframes_t frames);
+ int new_cycle_started (framecnt_t) { buffers_up_to_date = false; return 0; }
+ void update_buffers (framecnt_t frames);
AudioRegion const & region;
AudioTrack & track;
Type type;
- nframes_t frames_per_cycle;
+ framecnt_t frames_per_cycle;
size_t n_channels;
BufferSet buffers;
bool buffers_up_to_date;
- nframes_t region_start;
- nframes_t position;
+ framecnt_t region_start;
+ framecnt_t position;
Sample * mixdown_buffer;
Sample * gain_buffer;
@@ -134,7 +134,7 @@ class RegionExportChannel : public ExportChannel
friend class RegionExportChannelFactory;
public:
- void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
+ void read (Sample * data, framecnt_t frames_to_read) const { factory.read (channel, data, frames_to_read); }
void get_state (XMLNode * /*node*/) const {};
void set_state (XMLNode * /*node*/, Session & /*session*/) {};
bool empty () const { return false; }
diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h
index 9594485a91..52ed9769a7 100644
--- a/libs/ardour/ardour/export_format_specification.h
+++ b/libs/ardour/ardour/export_format_specification.h
@@ -47,7 +47,7 @@ class ExportFormatSpecification : public ExportFormatBase {
Time (Session & session) : AnyTime (), session (session) {}
Time & operator= (AnyTime const & other);
- nframes_t get_frames (nframes_t target_rate) const;
+ framecnt_t get_frames (framecnt_t target_rate) const;
/* Serialization */
@@ -123,11 +123,11 @@ class ExportFormatSpecification : public ExportFormatBase {
bool tag () const { return _tag && supports_tagging; }
- nframes_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); }
- nframes_t silence_end () const { return _silence_end.get_frames (sample_rate()); }
+ framecnt_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); }
+ framecnt_t silence_end () const { return _silence_end.get_frames (sample_rate()); }
- nframes_t silence_beginning (nframes_t samplerate) const { return _silence_beginning.get_frames (samplerate); }
- nframes_t silence_end (nframes_t samplerate) const { return _silence_end.get_frames (samplerate); }
+ framecnt_t silence_beginning (framecnt_t samplerate) const { return _silence_beginning.get_frames (samplerate); }
+ framecnt_t silence_end (framecnt_t samplerate) const { return _silence_end.get_frames (samplerate); }
AnyTime silence_beginning_time () const { return _silence_beginning; }
AnyTime silence_end_time () const { return _silence_end; }
diff --git a/libs/ardour/ardour/export_graph_builder.h b/libs/ardour/ardour/export_graph_builder.h
index 55fa7133fc..1c49eccd9d 100644
--- a/libs/ardour/ardour/export_graph_builder.h
+++ b/libs/ardour/ardour/export_graph_builder.h
@@ -62,7 +62,7 @@ class ExportGraphBuilder
ExportGraphBuilder (Session const & session);
~ExportGraphBuilder ();
- int process (nframes_t frames, bool last_cycle);
+ int process (framecnt_t frames, bool last_cycle);
bool process_normalize (); // returns true when finished
void reset ();
@@ -102,7 +102,7 @@ class ExportGraphBuilder
class SFC {
public:
// This constructor so that this can be constructed like a Normalizer
- SFC (ExportGraphBuilder &, FileSpec const & new_config, nframes_t max_frames);
+ SFC (ExportGraphBuilder &, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink ();
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@ -124,7 +124,7 @@ class ExportGraphBuilder
class Normalizer {
public:
- Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames);
+ Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink ();
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@ -144,7 +144,7 @@ class ExportGraphBuilder
ExportGraphBuilder & parent;
FileSpec config;
- nframes_t max_frames_out;
+ framecnt_t max_frames_out;
BufferPtr buffer;
PeakReaderPtr peak_reader;
@@ -159,7 +159,7 @@ class ExportGraphBuilder
// sample rate converter
class SRC {
public:
- SRC (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames);
+ SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink ();
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@ -175,13 +175,13 @@ class ExportGraphBuilder
boost::ptr_list<SFC> children;
boost::ptr_list<Normalizer> normalized_children;
SRConverterPtr converter;
- nframes_t max_frames_out;
+ framecnt_t max_frames_out;
};
// Silence trimmer + adder
class SilenceHandler {
public:
- SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames);
+ SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames);
FloatSinkPtr sink ();
void add_child (FileSpec const & new_config);
bool operator== (FileSpec const & other_config) const;
@@ -193,7 +193,7 @@ class ExportGraphBuilder
FileSpec config;
boost::ptr_list<SRC> children;
SilenceTrimmerPtr silence_trimmer;
- nframes_t max_frames_in;
+ framecnt_t max_frames_in;
};
// channel configuration
@@ -210,7 +210,7 @@ class ExportGraphBuilder
FileSpec config;
boost::ptr_list<SilenceHandler> children;
InterleaverPtr interleaver;
- nframes_t max_frames;
+ framecnt_t max_frames;
};
Session const & session;
@@ -223,7 +223,7 @@ class ExportGraphBuilder
ChannelMap channels;
Sample * process_buffer;
- nframes_t process_buffer_frames;
+ framecnt_t process_buffer_frames;
std::list<Normalizer *> normalizers;
diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h
index f826e09bf5..dbc8213eed 100644
--- a/libs/ardour/ardour/export_handler.h
+++ b/libs/ardour/ardour/export_handler.h
@@ -119,7 +119,7 @@ class ExportHandler : public ExportElementFactory
private:
- int process (nframes_t frames);
+ int process (framecnt_t frames);
Session & session;
GraphBuilderPtr graph_builder;
@@ -132,7 +132,7 @@ class ExportHandler : public ExportElementFactory
/* Timespan management */
void start_timespan ();
- int process_timespan (nframes_t frames);
+ int process_timespan (framecnt_t frames);
int process_normalize ();
void finish_timespan ();
diff --git a/libs/ardour/ardour/export_profile_manager.h b/libs/ardour/ardour/export_profile_manager.h
index b8e86d11df..67ebe2b316 100644
--- a/libs/ardour/ardour/export_profile_manager.h
+++ b/libs/ardour/ardour/export_profile_manager.h
@@ -136,8 +136,8 @@ class ExportProfileManager
typedef boost::shared_ptr<TimespanState> TimespanStatePtr;
typedef std::list<TimespanStatePtr> TimespanStateList;
- void set_selection_range (nframes_t start = 0, nframes_t end = 0);
- std::string set_single_range (nframes_t start, nframes_t end, std::string name);
+ void set_selection_range (framepos_t start = 0, framepos_t end = 0);
+ std::string set_single_range (framepos_t start, framepos_t end, std::string name);
TimespanStateList const & get_timespans () { return check_list (timespans); }
private:
diff --git a/libs/ardour/ardour/export_timespan.h b/libs/ardour/ardour/export_timespan.h
index 592f36b1a9..ba31fd6f6a 100644
--- a/libs/ardour/ardour/export_timespan.h
+++ b/libs/ardour/ardour/export_timespan.h
@@ -42,7 +42,7 @@ class ExportTimespan
private:
friend class ExportElementFactory;
- ExportTimespan (ExportStatusPtr status, nframes_t frame_rate);
+ ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate);
public:
~ExportTimespan ();
@@ -53,19 +53,19 @@ class ExportTimespan
std::string range_id () const { return _range_id; }
void set_range_id (std::string range_id) { _range_id = range_id; }
- void set_range (nframes_t start, nframes_t end);
- nframes_t get_length () const { return end_frame - start_frame; }
- nframes_t get_start () const { return start_frame; }
- nframes_t get_end () const { return end_frame; }
+ void set_range (framepos_t start, framepos_t end);
+ framecnt_t get_length () const { return end_frame - start_frame; }
+ framepos_t get_start () const { return start_frame; }
+ framepos_t get_end () const { return end_frame; }
private:
ExportStatusPtr status;
- nframes_t start_frame;
- nframes_t end_frame;
- nframes_t position;
- nframes_t frame_rate;
+ framepos_t start_frame;
+ framepos_t end_frame;
+ framepos_t position;
+ framecnt_t frame_rate;
std::string _name;
std::string _range_id;
diff --git a/libs/ardour/ardour/gain.h b/libs/ardour/ardour/gain.h
index 785475444a..71706a2837 100644
--- a/libs/ardour/ardour/gain.h
+++ b/libs/ardour/ardour/gain.h
@@ -31,10 +31,10 @@ struct Gain : public AutomationList {
Gain (const Gain&);
Gain& operator= (const Gain&);
- static void fill_linear_fade_in (Gain& curve, nframes_t frames);
- static void fill_linear_volume_fade_in (Gain& curve, nframes_t frames);
- static void fill_linear_fade_out (Gain& curve, nframes_t frames);
- static void fill_linear_volume_fade_out (Gain& curve, nframes_t frames);
+ static void fill_linear_fade_in (Gain& curve, framecnt_t frames);
+ static void fill_linear_volume_fade_in (Gain& curve, framecnt_t frames);
+ static void fill_linear_fade_out (Gain& curve, framecnt_t frames);
+ static void fill_linear_volume_fade_out (Gain& curve, framecnt_t frames);
};
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index bb51c99237..6893c08d9d 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -71,14 +71,14 @@ class Graph : public SessionHandleRef
void helper_thread();
void main_thread();
- int silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
- bool can_record, bool rec_monitors_input, bool& need_butler);
+ int silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ bool can_record, bool rec_monitors_input, bool& need_butler);
- int process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
- bool can_record, bool rec_monitors_input, bool& need_butler);
+ int process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+ bool can_record, bool rec_monitors_input, bool& need_butler);
- int routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
- bool non_rt_pending, bool can_record, int declick);
+ int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ bool non_rt_pending, bool can_record, int declick);
void process_one_route (Route * route);
@@ -118,7 +118,7 @@ class Graph : public SessionHandleRef
volatile int _setup_chain;
// parameter caches.
- nframes_t _process_nframes;
+ pframes_t _process_nframes;
framepos_t _process_start_frame;
framepos_t _process_end_frame;
bool _process_can_record;
diff --git a/libs/ardour/ardour/importable_source.h b/libs/ardour/ardour/importable_source.h
index c610d546f2..804b062969 100644
--- a/libs/ardour/ardour/importable_source.h
+++ b/libs/ardour/ardour/importable_source.h
@@ -30,12 +30,12 @@ public:
ImportableSource () {}
virtual ~ImportableSource() {}
- virtual nframes_t read (Sample* buffer, nframes_t nframes) = 0;
+ virtual framecnt_t read (Sample* buffer, framecnt_t nframes) = 0;
virtual float ratio() const { return 1.0f; }
virtual uint32_t channels() const = 0;
virtual framecnt_t length() const = 0;
- virtual nframes_t samplerate() const = 0;
- virtual void seek (nframes_t pos) = 0;
+ virtual framecnt_t samplerate() const = 0;
+ virtual void seek (framecnt_t pos) = 0;
virtual framepos_t natural_position() const = 0;
virtual bool clamped_at_unity () const = 0;
diff --git a/libs/ardour/ardour/internal_return.h b/libs/ardour/ardour/internal_return.h
index d05e764592..41d09b2805 100644
--- a/libs/ardour/ardour/internal_return.h
+++ b/libs/ardour/ardour/internal_return.h
@@ -36,21 +36,21 @@ XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode&, int version);
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool configure_io (ChanCount in, ChanCount out);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
- int set_block_size (nframes_t);
+ int set_block_size (pframes_t);
BufferSet* get_buffers();
void release_buffers();
- static PBD::Signal1<void,nframes_t> CycleStart;
+ static PBD::Signal1<void, pframes_t> CycleStart;
private:
BufferSet buffers;
gint user_count; /* atomic */
- void allocate_buffers (nframes_t);
- void cycle_start (nframes_t);
+ void allocate_buffers (pframes_t);
+ void cycle_start (pframes_t);
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h
index d2a769982c..903e4673df 100644
--- a/libs/ardour/ardour/internal_send.h
+++ b/libs/ardour/ardour/internal_send.h
@@ -39,11 +39,11 @@ class InternalSend : public Send
XMLNode& get_state(void);
int set_state(const XMLNode& node, int version);
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool feeds (boost::shared_ptr<Route> other) const;
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
- int set_block_size (nframes_t);
+ int set_block_size (pframes_t);
boost::shared_ptr<Route> target_route() const { return _send_to; }
const PBD::ID& target_id() const { return _send_to_id; }
diff --git a/libs/ardour/ardour/interpolation.h b/libs/ardour/ardour/interpolation.h
index 21a47cfcdc..0d79b01d14 100644
--- a/libs/ardour/ardour/interpolation.h
+++ b/libs/ardour/ardour/interpolation.h
@@ -39,13 +39,13 @@ class Interpolation {
};
class LinearInterpolation : public Interpolation {
- public:
- nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
+public:
+ framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
};
class CubicInterpolation : public Interpolation {
- public:
- nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
+public:
+ framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output);
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index 9d423f55a5..fd7cb563fd 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -89,7 +89,7 @@ class IO : public SessionObject, public Latent
bool set_name (const std::string& str);
- virtual void silence (nframes_t);
+ virtual void silence (framecnt_t);
int ensure_io (ChanCount cnt, bool clear, void *src);
@@ -109,9 +109,9 @@ class IO : public SessionObject, public Latent
bool connected () const;
bool physically_connected () const;
- nframes_t signal_latency() const { return _own_latency; }
- nframes_t latency() const;
- void set_port_latency (nframes_t);
+ framecnt_t signal_latency () const { return _own_latency; }
+ framecnt_t latency () const;
+ void set_port_latency (framecnt_t);
void update_port_total_latencies ();
@@ -188,9 +188,9 @@ 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>, 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);
+ void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset);
+ void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
+ void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset);
/* AudioTrack::deprecated_use_diskstream_connections() needs these */
diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h
index 7d1854ced0..cb80b74351 100644
--- a/libs/ardour/ardour/io_processor.h
+++ b/libs/ardour/ardour/io_processor.h
@@ -62,7 +62,7 @@ class IOProcessor : public Processor
void set_input (boost::shared_ptr<IO>);
void set_output (boost::shared_ptr<IO>);
- void silence (nframes_t nframes);
+ void silence (framecnt_t nframes);
void disconnect ();
virtual bool feeds (boost::shared_ptr<Route> other) const;
diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h
index f4da2bf0a0..968342a909 100644
--- a/libs/ardour/ardour/ladspa_plugin.h
+++ b/libs/ardour/ardour/ladspa_plugin.h
@@ -39,7 +39,7 @@ class Session;
class LadspaPlugin : public ARDOUR::Plugin
{
public:
- LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, nframes_t sample_rate);
+ LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, framecnt_t sample_rate);
LadspaPlugin (const LadspaPlugin &);
~LadspaPlugin ();
@@ -51,7 +51,7 @@ class LadspaPlugin : public ARDOUR::Plugin
const char* maker() const { return _descriptor->Maker; }
uint32_t parameter_count() const { return _descriptor->PortCount; }
float default_value (uint32_t port);
- nframes_t signal_latency() const;
+ framecnt_t signal_latency() const;
void set_parameter (uint32_t port, float val);
float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@@ -81,11 +81,11 @@ class LadspaPlugin : public ARDOUR::Plugin
_descriptor->cleanup (_handle);
}
- int set_block_size (nframes_t /*nframes*/) { return 0; }
+ int set_block_size (pframes_t /*nframes*/) { return 0; }
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
- nframes_t nframes, nframes_t offset);
+ pframes_t nframes, framecnt_t offset);
std::string describe_parameter (Evoral::Parameter);
std::string state_node_name() const { return "ladspa"; }
@@ -122,15 +122,15 @@ class LadspaPlugin : public ARDOUR::Plugin
void* _module;
const LADSPA_Descriptor* _descriptor;
LADSPA_Handle _handle;
- nframes_t _sample_rate;
+ framecnt_t _sample_rate;
LADSPA_Data* _control_data;
LADSPA_Data* _shadow_data;
LADSPA_Data* _latency_control_port;
uint32_t _index;
bool _was_activated;
- void init (void *mod, uint32_t index, nframes_t rate);
- void run_in_place (nframes_t nsamples);
+ void init (void *mod, uint32_t index, framecnt_t rate);
+ void run_in_place (pframes_t nsamples);
void latency_compute_run ();
int set_state_2X (const XMLNode&, int version);
};
diff --git a/libs/ardour/ardour/latent.h b/libs/ardour/ardour/latent.h
index d1e62aaf45..ba2f91d2a2 100644
--- a/libs/ardour/ardour/latent.h
+++ b/libs/ardour/ardour/latent.h
@@ -10,10 +10,10 @@ class Latent {
Latent() : _own_latency (0), _user_latency (0) {}
virtual ~Latent() {}
- virtual nframes_t signal_latency() const = 0;
- nframes_t user_latency () const { return _user_latency; }
+ virtual framecnt_t signal_latency() const = 0;
+ framecnt_t user_latency () const { return _user_latency; }
- nframes_t effective_latency() const {
+ framecnt_t effective_latency() const {
if (_user_latency) {
return _user_latency;
} else {
@@ -21,12 +21,12 @@ class Latent {
}
}
- virtual void set_latency_delay (nframes_t val) { _own_latency = val; }
- virtual void set_user_latency (nframes_t val) { _user_latency = val; }
+ virtual void set_latency_delay (framecnt_t val) { _own_latency = val; }
+ virtual void set_user_latency (framecnt_t val) { _user_latency = val; }
protected:
- nframes_t _own_latency;
- nframes_t _user_latency;
+ framecnt_t _own_latency;
+ framecnt_t _user_latency;
};
}
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index 0c8b3e511c..821922903b 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -41,7 +41,7 @@ struct LV2World;
class LV2Plugin : public ARDOUR::Plugin
{
public:
- LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, nframes_t sample_rate);
+ LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, framecnt_t sample_rate);
LV2Plugin (const LV2Plugin &);
~LV2Plugin ();
@@ -53,7 +53,7 @@ class LV2Plugin : public ARDOUR::Plugin
const char* maker() const { return _author ? slv2_value_as_string(_author) : "Unknown"; }
uint32_t parameter_count() const { return slv2_plugin_get_num_ports(_plugin); }
float default_value (uint32_t port);
- nframes_t signal_latency() const;
+ framecnt_t signal_latency () const;
void set_parameter (uint32_t port, float val);
float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
@@ -93,11 +93,11 @@ class LV2Plugin : public ARDOUR::Plugin
_instance = NULL;
}
- int set_block_size (nframes_t /*nframes*/) { return 0; }
+ int set_block_size (pframes_t /*nframes*/) { return 0; }
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
- nframes_t nframes, nframes_t offset);
+ pframes_t nframes, framecnt_t offset);
std::string describe_parameter (Evoral::Parameter);
std::string state_node_name() const { return "lv2"; }
@@ -129,7 +129,7 @@ class LV2Plugin : public ARDOUR::Plugin
SLV2Value _name;
SLV2Value _author;
SLV2Instance _instance;
- nframes_t _sample_rate;
+ framecnt_t _sample_rate;
float* _control_data;
float* _shadow_data;
float* _defaults;
@@ -149,8 +149,8 @@ class LV2Plugin : public ARDOUR::Plugin
static URIMap _uri_map;
static uint32_t _midi_event_type;
- void init (LV2World& world, SLV2Plugin plugin, nframes_t rate);
- void run (nframes_t nsamples);
+ void init (LV2World& world, SLV2Plugin plugin, framecnt_t rate);
+ void run (pframes_t nsamples);
void latency_compute_run ();
};
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index dad86d5185..7ff910a91b 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -68,7 +68,7 @@ public:
void reflect_inputs (const ChanCount& in);
/** Compute peaks */
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
ChanCount input_streams () const { return current_meters; }
ChanCount output_streams () const { return current_meters; }
diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h
index b3ed093df7..18a95e9347 100644
--- a/libs/ardour/ardour/midi_buffer.h
+++ b/libs/ardour/ardour/midi_buffer.h
@@ -32,14 +32,14 @@ namespace ARDOUR {
class MidiBuffer : public Buffer
{
public:
- typedef nframes_t TimeType;
+ typedef framepos_t TimeType;
MidiBuffer(size_t capacity);
~MidiBuffer();
- void silence (nframes_t nframes, nframes_t offset = 0);
- void read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
- void merge_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
+ void silence (framecnt_t nframes, framecnt_t offset = 0);
+ void read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0);
+ void merge_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0);
void copy(const MidiBuffer& copy);
@@ -55,7 +55,7 @@ public:
template<typename BufferType, typename EventType>
struct iterator_base {
- iterator_base<BufferType, EventType>(BufferType& b, nframes_t o) : buffer(b), offset(o) {}
+ iterator_base<BufferType, EventType>(BufferType& b, framecnt_t o) : buffer(b), offset(o) {}
inline EventType operator*() const {
uint8_t* ev_start = buffer._data + offset + sizeof(TimeType);
int event_size = Evoral::midi_event_size(ev_start);
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index 126857a858..aea60dc3bf 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -124,7 +124,7 @@ class MidiDiskstream : public Diskstream
void set_pending_overwrite(bool);
int overwrite_existing_buffers ();
- void set_block_size (nframes_t);
+ void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources ();
@@ -133,7 +133,7 @@ class MidiDiskstream : public Diskstream
void non_realtime_input_change ();
void non_realtime_locate (framepos_t location);
- static void set_readahead_frames(nframes_t frames_ahead) { midi_readahead = frames_ahead; }
+ static void set_readahead_frames (framecnt_t frames_ahead) { midi_readahead = frames_ahead; }
protected:
int seek (framepos_t which_sample, bool complete_refill = false);
@@ -141,9 +141,9 @@ class MidiDiskstream : public Diskstream
protected:
friend class MidiTrack;
- int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
- bool commit (nframes_t nframes);
- static nframes_t midi_readahead;
+ int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler);
+ bool commit (framecnt_t nframes);
+ static framecnt_t midi_readahead;
private:
@@ -153,7 +153,7 @@ class MidiDiskstream : public Diskstream
int do_refill_with_alloc();
- int read (framepos_t& start, nframes_t cnt, bool reversed);
+ int read (framepos_t& start, framecnt_t cnt, bool reversed);
void finish_capture (bool rec_monitors_input);
void transport_stopped_wallclock (struct tm&, time_t, bool abort);
@@ -181,11 +181,11 @@ class MidiDiskstream : public Diskstream
void engage_record_enable ();
void disengage_record_enable ();
- MidiRingBuffer<nframes_t>* _playback_buf;
- MidiRingBuffer<nframes_t>* _capture_buf;
+ MidiRingBuffer<framepos_t>* _playback_buf;
+ MidiRingBuffer<framepos_t>* _capture_buf;
MidiPort* _source_port;
boost::shared_ptr<SMFSource> _write_source;
- nframes_t _last_flush_frame;
+ framepos_t _last_flush_frame;
NoteMode _note_mode;
volatile gint _frames_written_to_ringbuffer;
volatile gint _frames_read_from_ringbuffer;
diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h
index ccadb39e92..6170e9271f 100644
--- a/libs/ardour/ardour/midi_playlist.h
+++ b/libs/ardour/ardour/midi_playlist.h
@@ -43,13 +43,13 @@ public:
MidiPlaylist (Session&, const XMLNode&, bool hidden = false);
MidiPlaylist (Session&, std::string name, bool hidden = false);
MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, std::string name, bool hidden = false);
- MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t cnt,
+ MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, framepos_t start, framecnt_t cnt,
std::string name, bool hidden = false);
~MidiPlaylist ();
- nframes_t read (MidiRingBuffer<nframes_t>& buf,
- nframes_t start, nframes_t cnt, uint32_t chan_n=0);
+ framecnt_t read (MidiRingBuffer<framepos_t>& buf,
+ framepos_t start, framecnt_t cnt, uint32_t chan_n = 0);
int set_state (const XMLNode&, int version);
diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h
index 8b6095c470..7a019e5a20 100644
--- a/libs/ardour/ardour/midi_port.h
+++ b/libs/ardour/ardour/midi_port.h
@@ -37,20 +37,20 @@ class MidiPort : public Port {
return DataType::MIDI;
}
- void cycle_start (nframes_t nframes);
- void cycle_end (nframes_t nframes);
+ void cycle_start (pframes_t nframes);
+ void cycle_end (pframes_t nframes);
void cycle_split ();
- void flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset = 0);
+ void flush_buffers (pframes_t nframes, framepos_t time, framecnt_t offset = 0);
void transport_stopped ();
- size_t raw_buffer_size(jack_nframes_t nframes) const;
+ size_t raw_buffer_size (pframes_t nframes) const;
- Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) {
+ Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) {
return get_midi_buffer (nframes, offset);
}
- MidiBuffer& get_midi_buffer (nframes_t nframes, nframes_t offset = 0);
+ MidiBuffer& get_midi_buffer (framecnt_t nframes, framecnt_t offset = 0);
protected:
friend class AudioEngine;
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h
index dbbf6d80d1..853272d349 100644
--- a/libs/ardour/ardour/midi_region.h
+++ b/libs/ardour/ardour/midi_region.h
@@ -70,14 +70,14 @@ class MidiRegion : public Region
virtual framecnt_t read (Sample*, framepos_t /*pos*/, framecnt_t /*cnt*/, int /*channel*/) const { return 0; }
virtual framecnt_t readable_length() const { return length(); }
- framecnt_t read_at (Evoral::EventSink<nframes_t>& dst,
+ framecnt_t read_at (Evoral::EventSink<framepos_t>& dst,
framepos_t position,
framecnt_t dur,
uint32_t chan_n = 0,
NoteMode mode = Sustained,
MidiStateTracker* tracker = 0) const;
- framepos_t master_read_at (MidiRingBuffer<nframes_t>& dst,
+ framepos_t master_read_at (MidiRingBuffer<framepos_t>& dst,
framepos_t position,
framecnt_t dur,
uint32_t chan_n = 0,
@@ -114,7 +114,7 @@ class MidiRegion : public Region
MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset = 0, bool offset_relative = true);
private:
- framecnt_t _read_at (const SourceList&, Evoral::EventSink<nframes_t>& dst,
+ framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst,
framepos_t position,
framecnt_t dur,
uint32_t chan_n = 0,
diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h
index 2de611f4d6..a809226a30 100644
--- a/libs/ardour/ardour/midi_ring_buffer.h
+++ b/libs/ardour/ardour/midi_ring_buffer.h
@@ -50,7 +50,7 @@ public:
inline bool read_prefix(T* time, Evoral::EventType* type, uint32_t* size);
inline bool read_contents(uint32_t size, uint8_t* buf);
- size_t read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset=0);
+ size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0);
void dump(std::ostream& dst);
/** Set the channel filtering mode.
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 0c2759b96d..e40ccff291 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -58,19 +58,19 @@ class MidiSource : virtual public Source
* \param cnt Length of range to be read (in audio frames)
* \param tracker an optional pointer to MidiStateTracker object, for note on/off tracking
*/
- virtual nframes_t midi_read (Evoral::EventSink<nframes_t>& dst,
- framepos_t source_start,
- framepos_t start, nframes_t cnt,
- MidiStateTracker*,
- std::set<Evoral::Parameter> const &) const;
+ virtual framecnt_t midi_read (Evoral::EventSink<framepos_t>& dst,
+ framepos_t source_start,
+ framepos_t start, framecnt_t cnt,
+ MidiStateTracker*,
+ std::set<Evoral::Parameter> const &) const;
- virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src,
- framepos_t source_start,
- nframes_t cnt);
+ virtual framecnt_t midi_write (MidiRingBuffer<framepos_t>& src,
+ framepos_t source_start,
+ framecnt_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,
+ virtual void append_event_unlocked_frames(const Evoral::Event<framepos_t>& ev,
framepos_t source_start) = 0;
virtual bool empty () const;
@@ -130,14 +130,14 @@ class MidiSource : virtual public Source
protected:
virtual void flush_midi() = 0;
- virtual nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst,
- framepos_t position,
- framepos_t start, nframes_t cnt,
- MidiStateTracker* tracker) const = 0;
+ virtual framepos_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+ framepos_t position,
+ framepos_t start, framecnt_t cnt,
+ MidiStateTracker* tracker) const = 0;
- virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst,
- framepos_t position,
- nframes_t cnt) = 0;
+ virtual framepos_t write_unlocked (MidiRingBuffer<framepos_t>& dst,
+ framepos_t position,
+ framecnt_t cnt) = 0;
std::string _captured_for;
mutable uint32_t _read_data_count; ///< modified in read()
diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h
index 9720649a10..f6acb88f23 100644
--- a/libs/ardour/ardour/midi_state_tracker.h
+++ b/libs/ardour/ardour/midi_state_tracker.h
@@ -42,7 +42,7 @@ public:
void add (uint8_t note, uint8_t chn);
void remove (uint8_t note, uint8_t chn);
void resolve_notes (MidiBuffer& buffer, framepos_t time);
- void resolve_notes (Evoral::EventSink<nframes_t>& buffer, framepos_t time);
+ void resolve_notes (Evoral::EventSink<framepos_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 91ccc4b1fe..554f5b3385 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -39,7 +39,7 @@ public:
MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
~MidiTrack ();
- int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler);
void handle_transport_stopped (bool abort, bool did_locate, bool flush_processors);
@@ -52,16 +52,17 @@ public:
return DataType::MIDI;
}
- void set_latency_delay (nframes_t);
+ void set_latency_delay (framecnt_t);
- int export_stuff (BufferSet& bufs, nframes_t nframes, framepos_t end_frame);
+ int export_stuff (BufferSet& bufs, framecnt_t nframes, framepos_t end_frame);
void freeze_me (InterThreadInfo&);
void unfreeze ();
boost::shared_ptr<Region> bounce (InterThreadInfo&);
- boost::shared_ptr<Region> bounce_range (
- nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing);
+ boost::shared_ptr<Region> bounce_range (
+ framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing
+ );
int set_state(const XMLNode&, int version);
@@ -86,7 +87,7 @@ public:
bool step_editing() const { return _step_editing; }
void set_step_editing (bool yn);
- MidiRingBuffer<nframes_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; }
+ MidiRingBuffer<framepos_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; }
PBD::Signal1<void,bool> StepEditStatusChange;
@@ -112,21 +113,21 @@ protected:
private:
boost::shared_ptr<MidiDiskstream> midi_diskstream () const;
- void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
+ void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, framecnt_t nframes);
void set_state_part_two ();
void set_state_part_three ();
- MidiRingBuffer<nframes_t> _immediate_events;
- MidiRingBuffer<nframes_t> _step_edit_ring_buffer;
+ MidiRingBuffer<framepos_t> _immediate_events;
+ MidiRingBuffer<framepos_t> _step_edit_ring_buffer;
NoteMode _note_mode;
bool _step_editing;
uint8_t _default_channel;
bool _midi_thru;
- int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ int no_roll (pframes_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);
+ void push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes);
void diskstream_data_recorded (boost::shared_ptr<MidiBuffer>, boost::weak_ptr<MidiSource>);
PBD::ScopedConnection _diskstream_data_recorded_connection;
diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h
index 72b414d09c..2118b819b5 100644
--- a/libs/ardour/ardour/mix.h
+++ b/libs/ardour/ardour/mix.h
@@ -26,39 +26,39 @@
extern "C" {
/* SSE functions */
- float x86_sse_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
- void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
- void x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
- void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+ float x86_sse_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+ void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+ void x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+ void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
}
-void x86_sse_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
+void x86_sse_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
/* debug wrappers for SSE functions */
-float debug_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float debug_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
#endif
#if defined (__APPLE__)
-float veclib_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void veclib_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
-void veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float veclib_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void veclib_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
+void veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
#endif
/* non-optimized functions */
-float default_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current);
-void default_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max);
-void default_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain);
-void default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain);
-void default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes);
+float default_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current);
+void default_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max);
+void default_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain);
+void default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain);
+void default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes);
#endif /* __ardour_mix_h__ */
diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h
index 0f23d7029f..f8675bde2e 100644
--- a/libs/ardour/ardour/monitor_processor.h
+++ b/libs/ardour/ardour/monitor_processor.h
@@ -110,7 +110,7 @@ class MonitorProcessor : public Processor
bool display_to_user() const;
- void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/);
+ void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/);
XMLNode& state (bool full);
int set_state (const XMLNode&, int /* version */);
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index 3bfe2cf713..4550aab5a5 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -56,8 +56,8 @@ class StreamPanner : public PBD::Stateful
void set_position (const PBD::AngularVector&, bool link_call = false);
void set_diffusion (double);
- void distribute (AudioBuffer &, BufferSet &, gain_t, nframes_t);
- void distribute_automated (AudioBuffer &, BufferSet &, nframes_t, nframes_t, nframes_t, pan_t **);
+ void distribute (AudioBuffer &, BufferSet &, gain_t, pframes_t);
+ void distribute_automated (AudioBuffer &, BufferSet &, framepos_t, framepos_t, pframes_t, pan_t **);
/* the basic StreamPanner API */
@@ -69,9 +69,9 @@ class StreamPanner : public PBD::Stateful
* @param gain_coeff Gain coefficient to apply to output samples.
* @param nframes Number of frames in the input.
*/
- virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes) = 0;
+ virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes) = 0;
virtual void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes,
+ framepos_t start, framepos_t end, pframes_t nframes,
pan_t** buffers) = 0;
boost::shared_ptr<AutomationControl> pan_control() { return _control; }
@@ -135,7 +135,7 @@ class BaseStereoPanner : public StreamPanner
and a type name. See EqualPowerStereoPanner as an example.
*/
- void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
+ void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
static double azimuth_to_lr_fract (double azi) {
/* 180.0 degrees=> left => 0.0 */
@@ -169,7 +169,7 @@ class EqualPowerStereoPanner : public BaseStereoPanner
~EqualPowerStereoPanner ();
void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes,
+ framepos_t start, framepos_t end, pframes_t nframes,
pan_t** buffers);
void get_current_coefficients (pan_t*) const;
@@ -219,7 +219,7 @@ public:
bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; };
/// The fundamental Panner function
- void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, nframes_t nframes);
+ void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes);
bool bypassed() const { return _bypassed; }
void set_bypassed (bool yn);
@@ -300,7 +300,7 @@ public:
/* disallow copy construction */
Panner (Panner const &);
- void distribute_no_automation(BufferSet& src, BufferSet& dest, nframes_t nframes, gain_t gain_coeff);
+ void distribute_no_automation(BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
std::vector<StreamPanner*> _streampanners; ///< one StreamPanner per input
std::vector<Output> outputs;
uint32_t current_outs;
diff --git a/libs/ardour/ardour/peak.h b/libs/ardour/ardour/peak.h
index 2283f50118..ab99889dd3 100644
--- a/libs/ardour/ardour/peak.h
+++ b/libs/ardour/ardour/peak.h
@@ -25,9 +25,9 @@
#include "ardour/utils.h"
static inline float
-default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::pframes_t nsamples, float current)
{
- for (ARDOUR::nframes_t i = 0; i < nsamples; ++i) {
+ for (ARDOUR::pframes_t i = 0; i < nsamples; ++i) {
current = f_max (current, fabsf (buf[i]));
}
return current;
diff --git a/libs/ardour/ardour/playlist_factory.h b/libs/ardour/ardour/playlist_factory.h
index 17645ad8a3..8b5d9d6a23 100644
--- a/libs/ardour/ardour/playlist_factory.h
+++ b/libs/ardour/ardour/playlist_factory.h
@@ -36,7 +36,7 @@ class PlaylistFactory {
static boost::shared_ptr<Playlist> create (Session&, const XMLNode&, bool hidden = false, bool unused = false);
static boost::shared_ptr<Playlist> create (DataType type, Session&, std::string name, bool hidden = false);
static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, std::string name, bool hidden = false);
- static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false);
+ static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
};
}
diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h
index 3d7c8d9c33..bab2b71f31 100644
--- a/libs/ardour/ardour/plugin.h
+++ b/libs/ardour/ardour/plugin.h
@@ -112,11 +112,11 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual void deactivate () = 0;
virtual void flush () { deactivate(); activate(); }
- virtual int set_block_size (nframes_t nframes) = 0;
+ virtual int set_block_size (pframes_t nframes) = 0;
virtual int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
- nframes_t nframes, nframes_t offset) = 0;
+ pframes_t nframes, framecnt_t offset) = 0;
virtual std::set<Evoral::Parameter> automatable() const = 0;
virtual std::string describe_parameter (Evoral::Parameter) = 0;
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index 9b65ba41f5..e4a42d8165 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -52,14 +52,14 @@ class PluginInsert : public Processor
XMLNode& get_state(void);
int set_state(const XMLNode&, int version);
- void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
- void silence (nframes_t nframes);
+ void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
+ void silence (framecnt_t nframes);
void activate ();
void deactivate ();
void flush ();
- int set_block_size (nframes_t nframes);
+ int set_block_size (pframes_t nframes);
ChanCount output_streams() const;
ChanCount input_streams() const;
@@ -101,11 +101,11 @@ class PluginInsert : public Processor
std::string describe_parameter (Evoral::Parameter param);
- nframes_t signal_latency() const;
+ framecnt_t signal_latency () const;
boost::shared_ptr<Plugin> get_impulse_analysis_plugin();
- void collect_signal_for_analysis(nframes_t nframes);
+ void collect_signal_for_analysis (framecnt_t nframes);
PBD::Signal2<void,BufferSet*, BufferSet*> AnalysisDataGathered;
@@ -125,14 +125,14 @@ class PluginInsert : public Processor
boost::weak_ptr<Plugin> _impulseAnalysisPlugin;
- nframes_t _signal_analysis_collected_nframes;
- nframes_t _signal_analysis_collect_nframes_max;
+ framecnt_t _signal_analysis_collected_nframes;
+ framecnt_t _signal_analysis_collect_nframes_max;
BufferSet _signal_analysis_inputs;
BufferSet _signal_analysis_outputs;
- void automation_run (BufferSet& bufs, nframes_t nframes);
- void connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now = 0);
+ void automation_run (BufferSet& bufs, pframes_t nframes);
+ void connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now = 0);
void set_automatable ();
void control_list_automation_state_changed (Evoral::Parameter, AutoState);
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 23b42a55ea..ffdc1d4721 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -45,7 +45,7 @@ public:
virtual ~Port ();
- static void set_buffer_size (nframes_t sz) {
+ static void set_buffer_size (pframes_t sz) {
_buffer_size = sz;
}
static void set_connecting_blocked( bool yn ) {
@@ -93,24 +93,24 @@ public:
void ensure_monitor_input (bool);
bool monitoring_input () const;
- nframes_t total_latency () const;
+ framecnt_t total_latency () const;
int reestablish ();
int reconnect ();
void request_monitor_input (bool);
- void set_latency (nframes_t);
+ void set_latency (framecnt_t);
virtual void reset ();
/** @return the size of the raw buffer (bytes) for duration @a nframes (audio frames) */
- virtual size_t raw_buffer_size(jack_nframes_t nframes) const = 0;
+ virtual size_t raw_buffer_size (pframes_t nframes) const = 0;
virtual DataType type () const = 0;
- virtual void cycle_start (nframes_t) = 0;
- virtual void cycle_end (nframes_t) = 0;
+ virtual void cycle_start (pframes_t) = 0;
+ virtual void cycle_end (pframes_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, framepos_t /*time*/, nframes_t offset = 0) {
- assert(offset < nframes);
+ virtual Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) = 0;
+ virtual void flush_buffers (pframes_t nframes, framepos_t /*time*/, framecnt_t offset = 0) {
+ assert (offset < nframes);
}
virtual void transport_stopped () {}
@@ -126,8 +126,8 @@ protected:
jack_port_t* _jack_port; ///< JACK port
- static nframes_t _buffer_size;
- static bool _connecting_blocked;
+ static pframes_t _buffer_size;
+ static bool _connecting_blocked;
static AudioEngine* _engine; ///< the AudioEngine
diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h
index f4e20a8045..d460aa5546 100644
--- a/libs/ardour/ardour/port_insert.h
+++ b/libs/ardour/ardour/port_insert.h
@@ -50,9 +50,9 @@ class PortInsert : public IOProcessor
XMLNode& get_state(void);
int set_state (const XMLNode&, int version);
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
- nframes_t signal_latency() const;
+ framecnt_t signal_latency () const;
bool set_name (const std::string& name);
@@ -68,8 +68,8 @@ class PortInsert : public IOProcessor
void stop_latency_detection ();
MTDM* mtdm () const { return _mtdm; }
- void set_measured_latency (nframes_t);
- nframes_t latency() const;
+ void set_measured_latency (framecnt_t);
+ framecnt_t latency () const;
private:
/* disallow copy construction */
@@ -77,11 +77,12 @@ class PortInsert : public IOProcessor
boost::shared_ptr<Delivery> _out;
- uint32_t bitslot;
- MTDM* _mtdm;
- bool _latency_detect;
- nframes_t _latency_flush_frames;
- nframes_t _measured_latency;};
+ uint32_t bitslot;
+ MTDM* _mtdm;
+ bool _latency_detect;
+ framecnt_t _latency_flush_frames;
+ framecnt_t _measured_latency;
+};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 09505e3f72..182208e560 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -61,16 +61,16 @@ class Processor : public SessionObject, public Automatable, public Latent
bool get_next_ab_is_active () const { return _next_ab_is_active; }
void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
- virtual nframes_t signal_latency() const { return 0; }
+ virtual framecnt_t signal_latency() const { return 0; }
- virtual int set_block_size (nframes_t /*nframes*/) { return 0; }
+ virtual int set_block_size (pframes_t /*nframes*/) { return 0; }
virtual bool requires_fixed_sized_buffers() const { return false; }
/** @param result_required true if, on return from this method, bufs is required to contain valid data;
* if false, the method need not bother writing to bufs if it doesn't want to.
*/
- virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/) {}
- virtual void silence (nframes_t /*nframes*/) {}
+ virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/) {}
+ virtual void silence (framecnt_t /*nframes*/) {}
virtual void activate () { _pending_active = true; ActiveChanged(); }
virtual void deactivate () { _pending_active = false; ActiveChanged(); }
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index 9348544c27..d06edac230 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -102,8 +102,8 @@ CONFIG_VARIABLE (bool, stop_recording_on_xrun, "stop-recording-on-xrun", false)
CONFIG_VARIABLE (bool, create_xrun_marker, "create-xrun-marker", true)
CONFIG_VARIABLE (bool, stop_at_session_end, "stop-at-session-end", true)
CONFIG_VARIABLE (bool, seamless_loop, "seamless-loop", false)
-CONFIG_VARIABLE (nframes_t, preroll, "preroll", 0)
-CONFIG_VARIABLE (nframes_t, postroll, "postroll", 0)
+CONFIG_VARIABLE (framecnt_t, preroll, "preroll", 0)
+CONFIG_VARIABLE (framecnt_t, postroll, "postroll", 0)
CONFIG_VARIABLE (float, rf_speed, "rf-speed", 2.0f)
CONFIG_VARIABLE (float, shuttle_speed_factor, "shuttle-speed-factor", 1.0f)
CONFIG_VARIABLE (float, shuttle_speed_threshold, "shuttle-speed-threshold", 5.0f)
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index ef86dce4b2..3ad61919b1 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -193,8 +193,8 @@ class Region
void trim_end (framepos_t new_position, void *src);
void trim_to (framepos_t position, framecnt_t length, void *src);
- void cut_front (nframes_t new_position, void *src);
- void cut_end (nframes_t new_position, void *src);
+ void cut_front (framepos_t new_position, void *src);
+ void cut_end (framepos_t new_position, void *src);
void set_layer (layer_t l); /* ONLY Playlist can call this */
void raise ();
@@ -321,8 +321,8 @@ class Region
void trim_to_internal (framepos_t position, framecnt_t length, void *src);
virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
- void modify_front (nframes_t new_position, bool reset_fade, void* src);
- void modify_end (nframes_t new_position, bool reset_fade, void* src);
+ void modify_front (framepos_t new_position, bool reset_fade, void* src);
+ void modify_end (framepos_t new_position, bool reset_fade, void* src);
void maybe_uncopy ();
void first_edit ();
diff --git a/libs/ardour/ardour/resampled_source.h b/libs/ardour/ardour/resampled_source.h
index 6d630bc44b..b315430b46 100644
--- a/libs/ardour/ardour/resampled_source.h
+++ b/libs/ardour/ardour/resampled_source.h
@@ -30,16 +30,16 @@ namespace ARDOUR {
class ResampledImportableSource : public ImportableSource
{
public:
- ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
+ ResampledImportableSource (boost::shared_ptr<ImportableSource>, framecnt_t rate, SrcQuality);
~ResampledImportableSource ();
- nframes_t read (Sample* buffer, nframes_t nframes);
+ framecnt_t read (Sample* buffer, framecnt_t nframes);
float ratio() const { return src_data.src_ratio; }
uint32_t channels() const { return source->channels(); }
framecnt_t length() const { return source->length(); }
- nframes_t samplerate() const { return source->samplerate(); }
- void seek (nframes_t);
+ framecnt_t samplerate() const { return source->samplerate(); }
+ void seek (framecnt_t);
framepos_t natural_position() const;
bool clamped_at_unity () const {
diff --git a/libs/ardour/ardour/return.h b/libs/ardour/ardour/return.h
index cf709ed2f2..8ec4c9b8b5 100644
--- a/libs/ardour/ardour/return.h
+++ b/libs/ardour/ardour/return.h
@@ -42,7 +42,7 @@ public:
uint32_t bit_slot() const { return _bitslot; }
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
boost::shared_ptr<Amp> amp() const { return _amp; }
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
@@ -71,10 +71,10 @@ private:
/* disallow copy construction */
Return (const Return&);
- uint32_t _bitslot;
+ uint32_t _bitslot;
- void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset=ChanCount::ZERO);
- void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
+ void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset = ChanCount::ZERO);
+ void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 7702901523..afa6c0e527 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -102,13 +102,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, framepos_t start_frame, framepos_t end_frame,
+ virtual int roll (pframes_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, framepos_t start_frame, framepos_t end_frame,
+ virtual int no_roll (pframes_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, framepos_t start_frame, framepos_t end_frame,
+ virtual int silent_roll (pframes_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 ();
@@ -243,10 +243,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
void all_processors_flip();
void all_processors_active (Placement, bool state);
- virtual nframes_t update_total_latency();
- void set_latency_delay (nframes_t);
- void set_user_latency (nframes_t);
- nframes_t initial_delay() const { return _initial_delay; }
+ virtual framecnt_t update_total_latency();
+ void set_latency_delay (framecnt_t);
+ void set_user_latency (framecnt_t);
+ framecnt_t initial_delay() const { return _initial_delay; }
PBD::Signal0<void> active_changed;
PBD::Signal0<void> phase_invert_changed;
@@ -365,7 +365,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
boost::shared_ptr<Panner> panner() const;
boost::shared_ptr<AutomationControl> gain_control() const;
- void automation_snapshot (nframes_t now, bool force=false);
+ void automation_snapshot (framepos_t now, bool force=false);
void protect_automation ();
void set_remote_control_id (uint32_t id, bool notify_class_listeners = true);
@@ -390,28 +390,28 @@ 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 (framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
- virtual void set_block_size (nframes_t nframes);
+ void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
+ virtual void set_block_size (pframes_t nframes);
protected:
- nframes_t check_initial_delay (nframes_t, nframes_t&);
+ framecnt_t check_initial_delay (framecnt_t, framecnt_t&);
void passthru (framepos_t start_frame, framepos_t end_frame,
- nframes_t nframes, int declick);
+ pframes_t nframes, int declick);
virtual void write_out_of_band_data (BufferSet& /* bufs */, framepos_t /* start_frame */, framepos_t /* end_frame */,
- nframes_t /* nframes */) {}
+ framecnt_t /* nframes */) {}
virtual void process_output_buffers (BufferSet& bufs,
framepos_t start_frame, framepos_t end_frame,
- nframes_t nframes, bool with_processors, int declick);
+ pframes_t nframes, bool with_processors, int declick);
boost::shared_ptr<IO> _input;
boost::shared_ptr<IO> _output;
bool _active;
- nframes_t _initial_delay;
- nframes_t _roll_delay;
+ framecnt_t _initial_delay;
+ framecnt_t _roll_delay;
ProcessorList _processors;
mutable Glib::RWLock _processor_lock;
@@ -453,10 +453,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
int configure_processors (ProcessorStreams*);
void passthru_silence (framepos_t start_frame, framepos_t end_frame,
- nframes_t nframes, int declick);
+ pframes_t nframes, int declick);
- void silence (nframes_t);
- void silence_unlocked (nframes_t);
+ void silence (framecnt_t);
+ void silence_unlocked (framecnt_t);
ChanCount processor_max_streams;
uint32_t _remote_control_id;
diff --git a/libs/ardour/ardour/runtime_functions.h b/libs/ardour/ardour/runtime_functions.h
index 147d697fca..8882d721d7 100644
--- a/libs/ardour/ardour/runtime_functions.h
+++ b/libs/ardour/ardour/runtime_functions.h
@@ -24,11 +24,11 @@
namespace ARDOUR {
- typedef float (*compute_peak_t) (const ARDOUR::Sample *, nframes_t, float);
- typedef void (*find_peaks_t) (const ARDOUR::Sample *, nframes_t, float *, float*);
- typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, nframes_t, float);
- typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t, float);
- typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t);
+ typedef float (*compute_peak_t) (const ARDOUR::Sample *, pframes_t, float);
+ typedef void (*find_peaks_t) (const ARDOUR::Sample *, pframes_t, float *, float*);
+ typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, pframes_t, float);
+ typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float);
+ typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t);
extern compute_peak_t compute_peak;
extern find_peaks_t find_peaks;
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index e66c72367a..bf5c5d7370 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -55,7 +55,7 @@ class Send : public Delivery
uint32_t pans_required() const { return _configured_input.n_audio(); }
- void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool);
+ void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index f1a79ba4f3..4966c19b69 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -190,7 +190,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
std::string new_source_path_from_name (DataType type, const std::string&, bool as_stub = false);
RouteList new_route_from_template (uint32_t how_many, const std::string& template_path);
- void process (nframes_t nframes);
+ void process (pframes_t nframes);
BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
@@ -297,7 +297,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void request_play_loop (bool yn, bool leave_rolling = false);
bool get_play_loop () const { return play_loop; }
- nframes_t last_transport_start() const { return _last_roll_location; }
+ framepos_t last_transport_start () const { return _last_roll_location; }
void goto_end ();
void goto_start ();
void use_rf_shuttle_speed ();
@@ -317,14 +317,14 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
std::pair<framepos_t, framepos_t> get_extent () const;
framepos_t current_end_frame () const;
framepos_t current_start_frame () const;
- /// "actual" sample rate of session, set by current audioengine rate, pullup/down etc.
- nframes_t frame_rate() const { return _current_frame_rate; }
- /// "native" sample rate of session, regardless of current audioengine rate, pullup/down etc
- nframes_t nominal_frame_rate() const { return _nominal_frame_rate; }
- nframes_t frames_per_hour() const { return _frames_per_hour; }
+ /** "actual" sample rate of session, set by current audioengine rate, pullup/down etc. */
+ framecnt_t frame_rate () const { return _current_frame_rate; }
+ /** "native" sample rate of session, regardless of current audioengine rate, pullup/down etc */
+ framecnt_t nominal_frame_rate () const { return _nominal_frame_rate; }
+ framecnt_t frames_per_hour () const { return _frames_per_hour; }
double frames_per_timecode_frame() const { return _frames_per_timecode_frame; }
- nframes_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
+ framecnt_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
MIDI::byte get_mtc_timecode_bits() const {
return mtc_timecode_bits; /* encoding of SMTPE type for MTC */
@@ -347,10 +347,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void reset_input_monitor_state ();
- nframes_t get_block_size() const { return current_block_size; }
- nframes_t worst_output_latency () const { return _worst_output_latency; }
- nframes_t worst_input_latency () const { return _worst_input_latency; }
- nframes_t worst_track_latency () const { return _worst_track_latency; }
+ pframes_t get_block_size() const { return current_block_size; }
+ framecnt_t worst_output_latency () const { return _worst_output_latency; }
+ framecnt_t worst_input_latency () const { return _worst_input_latency; }
+ framecnt_t worst_track_latency () const { return _worst_track_latency; }
#ifdef HAVE_JACK_SESSION
void jack_session_event (jack_session_event_t* event);
@@ -449,17 +449,17 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void sync_time_vars();
- void bbt_time (nframes_t when, BBT_Time&);
+ void bbt_time (framepos_t when, BBT_Time&);
void timecode_to_sample(Timecode::Time& timecode, framepos_t& sample, bool use_offset, bool use_subframes) const;
void sample_to_timecode(framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
void timecode_time (Timecode::Time &);
- void timecode_time (nframes_t when, Timecode::Time&);
- void timecode_time_subframes (nframes_t when, Timecode::Time&);
+ void timecode_time (framepos_t when, Timecode::Time&);
+ void timecode_time_subframes (framepos_t when, Timecode::Time&);
void timecode_duration (framecnt_t, Timecode::Time&) const;
void timecode_duration_string (char *, framecnt_t) const;
- nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
+ framecnt_t convert_to_frames_at (framepos_t position, AnyTime const &);
static PBD::Signal1<void, framepos_t> StartTimeChanged;
static PBD::Signal1<void, framepos_t> EndTimeChanged;
@@ -475,12 +475,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void set_silent (bool yn);
bool silent () { return _silent; }
- int jack_slave_sync (nframes_t);
-
TempoMap& tempo_map() { return *_tempo_map; }
/// signals the current transport position in frames, bbt and timecode time (in that order)
- PBD::Signal3<void,const nframes_t&, const BBT_Time&, const Timecode::Time&> tick;
+ PBD::Signal3<void, const framepos_t &, const BBT_Time&, const Timecode::Time&> tick;
/* region info */
@@ -501,9 +499,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<ExportHandler> get_export_handler ();
boost::shared_ptr<ExportStatus> get_export_status ();
- int start_audio_export (nframes_t position, bool realtime);
+ int start_audio_export (framepos_t position, bool realtime);
- PBD::Signal1<int,nframes_t> ProcessExport;
+ PBD::Signal1<int, framecnt_t> ProcessExport;
static PBD::Signal2<void,std::string, std::string> Exported;
void add_source (boost::shared_ptr<Source>);
@@ -525,7 +523,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/** handlers should return 0 for "ignore the rate mismatch",
!0 for "do not use this session"
*/
- static PBD::Signal2<int,nframes_t, nframes_t> AskAboutSampleRateMismatch;
+ static PBD::Signal2<int, framecnt_t, framecnt_t> AskAboutSampleRateMismatch;
/** handlers should return !0 for use pending state, 0 for ignore it.
*/
@@ -641,14 +639,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void midi_panic ();
- /* Scrubbing */
-
- void start_scrub (nframes_t where);
- void stop_scrub ();
- void set_scrub_speed (float);
- nframes_t scrub_buffer_size() const;
- PBD::Signal0<void> ScrubReady;
-
/* History (for editors, mixers, UIs etc.) */
/** Undo some transactions.
@@ -809,8 +799,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
protected:
friend class AudioEngine;
- void set_block_size (nframes_t nframes);
- void set_frame_rate (nframes_t nframes);
+ void set_block_size (pframes_t nframes);
+ void set_frame_rate (framecnt_t nframes);
protected:
friend class Route;
@@ -832,16 +822,16 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
maximise cache hits
*/
- typedef void (Session::*process_function_type)(nframes_t);
+ typedef void (Session::*process_function_type)(pframes_t);
AudioEngine& _engine;
mutable gint processing_prohibited;
process_function_type process_function;
process_function_type last_process_function;
bool waiting_for_sync_offset;
- nframes_t _base_frame_rate;
- nframes_t _current_frame_rate; //this includes video pullup offset
- nframes_t _nominal_frame_rate; //ignores audioengine setting, "native" SR
+ framecnt_t _base_frame_rate;
+ framecnt_t _current_frame_rate; //this includes video pullup offset
+ framecnt_t _nominal_frame_rate; //ignores audioengine setting, "native" SR
int transport_sub_state;
mutable gint _record_status;
framepos_t _transport_frame;
@@ -857,12 +847,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
bool auto_play_legal;
framepos_t _last_slave_transport_frame;
- nframes_t maximum_output_latency;
+ framecnt_t maximum_output_latency;
framepos_t _requested_return_frame;
- nframes_t current_block_size;
- nframes_t _worst_output_latency;
- nframes_t _worst_input_latency;
- nframes_t _worst_track_latency;
+ pframes_t current_block_size;
+ framecnt_t _worst_output_latency;
+ framecnt_t _worst_input_latency;
+ framecnt_t _worst_track_latency;
bool _have_captured;
float _meter_hold;
float _meter_falloff;
@@ -881,12 +871,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void ensure_buffers (ChanCount howmany = ChanCount::ZERO);
- void process_scrub (nframes_t);
- void process_without_events (nframes_t);
- void process_with_events (nframes_t);
- void process_audition (nframes_t);
- void process_export (nframes_t);
- int process_export_fw (nframes_t);
+ void process_scrub (pframes_t);
+ void process_without_events (pframes_t);
+ void process_with_events (pframes_t);
+ void process_audition (pframes_t);
+ void process_export (pframes_t);
+ int process_export_fw (pframes_t);
void block_processing() { g_atomic_int_set (&processing_prohibited, 1); }
void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); }
@@ -905,20 +895,20 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
bool have_first_delta_accumulator;
SlaveState _slave_state;
- nframes_t slave_wait_end;
+ framepos_t slave_wait_end;
void reset_slave_state ();
- bool follow_slave (nframes_t);
- void calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta);
- void track_slave_state(float slave_speed, nframes_t slave_transport_frame, nframes_t this_delta);
- void follow_slave_silently(nframes_t nframes, float slave_speed);
+ bool follow_slave (pframes_t);
+ void calculate_moving_average_of_slave_delta (int dir, framecnt_t this_delta);
+ void track_slave_state (float slave_speed, framepos_t slave_transport_frame, framecnt_t this_delta);
+ void follow_slave_silently (pframes_t nframes, float slave_speed);
void switch_to_sync_source (SyncSource); /* !RT context */
void drop_sync_source (); /* !RT context */
void use_sync_source (Slave*); /* RT context */
bool post_export_sync;
- nframes_t post_export_position;
+ framepos_t post_export_position;
bool _exporting;
bool _export_rolling;
@@ -933,8 +923,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
PBD::ScopedConnection export_freewheel_connection;
void get_track_statistics ();
- int process_routes (nframes_t, bool& need_butler);
- int silent_process_routes (nframes_t, bool& need_butler);
+ int process_routes (pframes_t, bool& need_butler);
+ int silent_process_routes (pframes_t, bool& need_butler);
bool get_rec_monitors_input () {
if (actively_recording()) {
@@ -959,8 +949,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
}
}
- bool maybe_stop (nframes_t limit);
- bool maybe_sync_start (nframes_t&);
+ bool maybe_stop (framepos_t limit);
+ bool maybe_sync_start (pframes_t &);
void check_declick_out ();
@@ -971,7 +961,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
bool session_midi_feedback;
bool play_loop;
bool loop_changing;
- nframes_t last_loopend;
+ framepos_t last_loopend;
boost::scoped_ptr<SessionDirectory> _session_dir;
@@ -989,12 +979,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
int load_options (const XMLNode&);
int load_state (std::string snapshot_name);
- nframes_t _last_roll_location;
- nframes_t _last_roll_or_reversal_location;
- nframes_t _last_record_location;
+ framepos_t _last_roll_location;
+ framepos_t _last_roll_or_reversal_location;
+ framepos_t _last_record_location;
bool pending_locate_roll;
- nframes_t pending_locate_frame;
+ framepos_t pending_locate_frame;
bool pending_locate_flush;
bool pending_abort;
bool pending_auto_loop;
@@ -1045,7 +1035,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
uint32_t rf_scale;
void set_rf_speed (float speed);
- void reset_rf_scale (nframes_t frames_moved);
+ void reset_rf_scale (framecnt_t frames_moved);
Locations* _locations;
void locations_changed ();
@@ -1099,9 +1089,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* MIDI Machine Control */
- void spp_start (MIDI::Parser&, nframes_t timestamp);
- void spp_continue (MIDI::Parser&, nframes_t timestamp);
- void spp_stop (MIDI::Parser&, nframes_t timestamp);
+ void spp_start (MIDI::Parser&, framepos_t timestamp);
+ void spp_continue (MIDI::Parser&, framepos_t timestamp);
+ void spp_stop (MIDI::Parser&, framepos_t timestamp);
void mmc_deferred_play (MIDI::MachineControl &);
void mmc_stop (MIDI::MachineControl &);
@@ -1129,30 +1119,28 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
MIDI::byte mtc_msg[16];
MIDI::byte mtc_timecode_bits; /* encoding of SMTPE type for MTC */
MIDI::byte midi_msg[16];
- nframes_t outbound_mtc_timecode_frame;
+ framepos_t outbound_mtc_timecode_frame;
Timecode::Time transmitting_timecode_time;
int next_quarter_frame_to_send;
double _frames_per_timecode_frame; /* has to be floating point because of drop frame */
- nframes_t _frames_per_hour;
- nframes_t _timecode_frames_per_hour;
+ framecnt_t _frames_per_hour;
+ framecnt_t _timecode_frames_per_hour;
/* cache the most-recently requested time conversions. This helps when we
* have multiple clocks showing the same time (e.g. the transport frame) */
- bool last_timecode_valid;
- nframes_t last_timecode_when;
- Timecode::Time last_timecode;
+ bool last_timecode_valid;
+ framepos_t last_timecode_when;
+ Timecode::Time last_timecode;
bool _send_timecode_update; ///< Flag to send a full frame (Timecode) MTC message this cycle
- int send_midi_time_code_for_cycle(nframes_t nframes);
-
- nframes_t adjust_apparent_position (nframes_t frames);
+ int send_midi_time_code_for_cycle (pframes_t nframes);
void reset_record_status ();
- int no_roll (nframes_t nframes);
- int fail_roll (nframes_t nframes);
+ int no_roll (pframes_t nframes);
+ int fail_roll (pframes_t nframes);
bool non_realtime_work_pending() const { return static_cast<bool>(post_transport_work()); }
bool process_can_proceed() const { return !(post_transport_work() & ProcessCannotProceedMask); }
@@ -1166,7 +1154,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void unset_play_loop ();
void overwrite_some_buffers (Track *);
void flush_all_inserts ();
- int micro_locate (nframes_t distance);
+ int micro_locate (framecnt_t distance);
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);
@@ -1294,7 +1282,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* FLATTEN */
- int flatten_one_track (AudioTrack&, nframes_t start, nframes_t cnt);
+ int flatten_one_track (AudioTrack&, framepos_t start, framecnt_t cnt);
/* INSERT AND SEND MANAGEMENT */
@@ -1344,7 +1332,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
UndoHistory _history;
std::stack<UndoTransaction*> _current_trans;
- void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int);
+ void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
void reset_jack_connection (jack_client_t* jack);
void process_rtop (SessionEvent*);
@@ -1358,19 +1346,19 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<IO> _click_io;
Sample* click_data;
Sample* click_emphasis_data;
- nframes_t click_length;
- nframes_t click_emphasis_length;
+ framecnt_t click_length;
+ framecnt_t click_emphasis_length;
mutable Glib::RWLock click_lock;
- static const Sample default_click[];
- static const nframes_t default_click_length;
- static const Sample default_click_emphasis[];
- static const nframes_t default_click_emphasis_length;
+ static const Sample default_click[];
+ static const framecnt_t default_click_length;
+ static const Sample default_click_emphasis[];
+ static const framecnt_t default_click_emphasis_length;
Click *get_click();
void setup_click_sounds (int which);
void clear_clicks ();
- void click (nframes_t start, nframes_t nframes);
+ void click (framepos_t start, framecnt_t nframes);
std::vector<Route*> master_outs;
@@ -1448,7 +1436,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/** temporary list of Diskstreams used only during load of 2.X sessions */
std::list<boost::shared_ptr<Diskstream> > _diskstreams_2X;
- void add_session_range_location (nframes_t, nframes_t);
+ void add_session_range_location (framepos_t, framepos_t);
void setup_midi_machine_control ();
void cleanup_stubfiles ();
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h
index 5c31217045..738de46a86 100644
--- a/libs/ardour/ardour/session_event.h
+++ b/libs/ardour/ardour/session_event.h
@@ -83,7 +83,7 @@ struct SessionEvent {
boost::shared_ptr<Region> region;
- SessionEvent (Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false, bool yn2 = false)
+ SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false)
: type (t)
, action (a)
, action_frame (when)
@@ -112,7 +112,7 @@ struct SessionEvent {
void* operator new (size_t);
void operator delete (void *ptr, size_t /*size*/);
- static const nframes_t Immediate = 0;
+ static const framepos_t Immediate = 0;
static void create_per_thread_pool (const std::string& n, uint32_t nitems);
static void init_event_pool ();
diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h
index d24aa9d136..46ddda3985 100644
--- a/libs/ardour/ardour/silentfilesource.h
+++ b/libs/ardour/ardour/silentfilesource.h
@@ -31,7 +31,7 @@ public:
int flush_header () { return 0; }
float sample_rate () const { return _sample_rate; }
- void set_length (nframes_t len) { _length = len; }
+ void set_length (framecnt_t len) { _length = len; }
bool destructive() const { return false; }
bool can_be_analysed() const { return false; }
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index 74cf4371b0..45ab00a44f 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -143,7 +143,7 @@ class Slave {
* @return - the timing resolution of the Slave - If the distance of ARDOURs transport
* to the slave becomes greater than the resolution, sound will stop
*/
- virtual nframes_t resolution() const = 0;
+ virtual framecnt_t resolution() const = 0;
/**
* @return - when returning true, ARDOUR will wait for seekahead_distance() before transport
@@ -174,11 +174,11 @@ class Slave {
class ISlaveSessionProxy {
public:
virtual ~ISlaveSessionProxy() {}
- virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); }
- virtual nframes_t frame_rate() const { return 0; }
+ virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); }
+ virtual framecnt_t frame_rate() 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 pframes_t frames_since_cycle_start () const { return 0; }
virtual framepos_t frame_time () const { return 0; }
virtual void request_locate (framepos_t /*frame*/, bool with_roll = false) {
@@ -195,11 +195,11 @@ class SlaveSessionProxy : public ISlaveSessionProxy {
public:
SlaveSessionProxy(Session &s) : session(s) {}
- TempoMap& tempo_map() const;
- nframes_t frame_rate() const;
+ TempoMap& tempo_map() const;
+ framecnt_t frame_rate() const;
framepos_t audible_frame () const;
framepos_t transport_frame () const;
- nframes_t frames_since_cycle_start () const;
+ pframes_t frames_since_cycle_start () const;
framepos_t frame_time () const;
void request_locate (framepos_t frame, bool with_roll = false);
@@ -234,7 +234,7 @@ class MTC_Slave : public Slave {
bool ok() const;
void handle_locate (const MIDI::byte*);
- nframes_t resolution() const;
+ framecnt_t resolution () const;
bool requires_seekahead () const { return true; }
framepos_t seekahead_distance() const;
bool give_slave_full_control_over_transport_speed() const;
@@ -271,8 +271,8 @@ class MTC_Slave : public Slave {
void queue_reset (bool with_pos);
void maybe_reset ();
- void update_mtc_qtr (MIDI::Parser&, int, nframes_t);
- void update_mtc_time (const MIDI::byte *, bool, nframes_t);
+ void update_mtc_qtr (MIDI::Parser&, int, framepos_t);
+ void update_mtc_time (const MIDI::byte *, bool, framepos_t);
void update_mtc_status (MIDI::MTC_Status);
void read_current (SafeTime *) const;
void reset_window (framepos_t);
@@ -295,7 +295,7 @@ class MIDIClock_Slave : public Slave {
bool ok() const;
bool starting() const;
- nframes_t resolution() const;
+ framecnt_t resolution () const;
bool requires_seekahead () const { return false; }
bool give_slave_full_control_over_transport_speed() const { return true; }
@@ -313,10 +313,10 @@ class MIDIClock_Slave : public Slave {
double one_ppqn_in_frames;
/// the timestamp of the first MIDI clock message
- nframes_t first_timestamp;
+ framepos_t first_timestamp;
/// the time stamp and should-be transport position of the last inbound MIDI clock message
- nframes_t last_timestamp;
+ framepos_t last_timestamp;
double should_be_position;
/// the number of midi clock messages received (zero-based)
@@ -375,7 +375,7 @@ class JACK_Slave : public Slave
bool starting() const { return _starting; }
bool locked() const;
bool ok() const;
- nframes_t resolution() const { return 1; }
+ framecnt_t resolution () const { return 1; }
bool requires_seekahead () const { return false; }
void reset_client (jack_client_t* jack);
bool is_always_synced() const { return true; }
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index bd1428a129..32163551a0 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -52,7 +52,7 @@ 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, framepos_t source_start);
+ void append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t source_start);
void mark_streaming_midi_write_started (NoteMode mode, framepos_t start_time);
void mark_streaming_write_completed ();
@@ -65,7 +65,7 @@ public:
void flush_midi ();
- static void set_header_position_offset (nframes_t offset, bool negative);
+ static void set_header_position_offset (framecnt_t offset, bool negative);
static bool safe_midi_file_extension (const std::string& path);
@@ -73,15 +73,15 @@ public:
void set_path (const std::string& newpath);
private:
- nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst,
- framepos_t position,
- framepos_t start,
- nframes_t cnt,
- MidiStateTracker* tracker) const;
-
- nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src,
- framepos_t position,
- nframes_t cnt);
+ framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
+ framepos_t position,
+ framepos_t start,
+ framecnt_t cnt,
+ MidiStateTracker* tracker) const;
+
+ framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& src,
+ framepos_t position,
+ framecnt_t cnt);
double _last_ev_time_beats;
framepos_t _last_ev_time_frames;
diff --git a/libs/ardour/ardour/sndfileimportable.h b/libs/ardour/ardour/sndfileimportable.h
index aab8b6ac59..2b5535e29f 100644
--- a/libs/ardour/ardour/sndfileimportable.h
+++ b/libs/ardour/ardour/sndfileimportable.h
@@ -33,11 +33,11 @@ class SndFileImportableSource : public ImportableSource {
SndFileImportableSource (const std::string& path);
virtual ~SndFileImportableSource();
- nframes_t read (Sample* buffer, nframes_t nframes);
+ framecnt_t read (Sample* buffer, framecnt_t nframes);
uint32_t channels() const;
framecnt_t length() const;
- nframes_t samplerate() const;
- void seek (nframes_t pos);
+ framecnt_t samplerate() const;
+ void seek (framecnt_t pos);
framepos_t natural_position() const;
bool clamped_at_unity () const;
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index ff15608d70..f08b0be4c0 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -35,7 +35,7 @@ class SndFileSource : public AudioFileSource {
/* Constructor to be called for new in-session files */
SndFileSource (Session&, const std::string& path, const std::string& origin,
- SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
+ SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate,
Flag flags = SndFileSource::default_writable_flags);
/** Constructor to be called for existing in-session files */
@@ -60,7 +60,7 @@ class SndFileSource : public AudioFileSource {
bool clamped_at_unity () const;
- static void setup_standard_crossfades (Session const &, nframes_t sample_rate);
+ static void setup_standard_crossfades (Session const &, framecnt_t sample_rate);
static const Source::Flag default_writable_flags;
static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg);
diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h
index c59dab9223..c5994027ce 100644
--- a/libs/ardour/ardour/source_factory.h
+++ b/libs/ardour/ardour/source_factory.h
@@ -49,7 +49,7 @@ class SourceFactory {
static boost::shared_ptr<Source> createWritable (DataType type, Session&,
const std::string& path, const std::string& origin,
- bool destructive, nframes_t rate, bool announce = true, bool async = false);
+ bool destructive, framecnt_t rate, bool announce = true, bool async = false);
static Glib::Cond* PeaksToBuild;
static Glib::StaticMutex peak_building_lock;
diff --git a/libs/ardour/ardour/strip_silence.h b/libs/ardour/ardour/strip_silence.h
index e77aa7111c..91374be88a 100644
--- a/libs/ardour/ardour/strip_silence.h
+++ b/libs/ardour/ardour/strip_silence.h
@@ -25,14 +25,14 @@ namespace ARDOUR {
class StripSilence : public Filter {
public:
- StripSilence (Session &, double, nframes_t, nframes_t);
+ StripSilence (Session &, double, framecnt_t, framecnt_t);
int run (boost::shared_ptr<ARDOUR::Region>, Progress* progress = 0);
private:
double _threshold; ///< silence threshold, in dBFS
- nframes_t _minimum_length; ///< minimum length to be considered silence, in samples
- nframes_t _fade_length; ///< fade in/out to use on trimmed regions, in samples
+ framecnt_t _minimum_length; ///< minimum length to be considered silence, in samples
+ framecnt_t _fade_length; ///< fade in/out to use on trimmed regions, in samples
};
}
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index e692334234..a1ad8d1f31 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -44,7 +44,7 @@ class Tempo {
double beats_per_minute () const { return _beats_per_minute;}
double note_type () const { return _note_type;}
- double frames_per_beat (nframes_t sr, const Meter& meter) const;
+ double frames_per_beat (framecnt_t sr, const Meter& meter) const;
protected:
double _beats_per_minute;
@@ -61,7 +61,7 @@ class Meter {
double beats_per_bar () const { return _beats_per_bar; }
double note_divisor() const { return _note_type; }
- double frames_per_bar (const Tempo&, nframes_t sr) const;
+ double frames_per_bar (const Tempo&, framecnt_t sr) const;
protected:
/** The number of beats in a bar. This is a real value because
@@ -168,7 +168,7 @@ class TempoMetric {
class TempoMap : public PBD::StatefulDestructible
{
public:
- TempoMap (nframes_t frame_rate);
+ TempoMap (framecnt_t frame_rate);
~TempoMap();
/* measure-based stuff */
@@ -258,15 +258,15 @@ class TempoMap : public PBD::StatefulDestructible
int n_tempos () const;
int n_meters () const;
- nframes_t frame_rate () const { return _frame_rate; }
+ framecnt_t frame_rate () const { return _frame_rate; }
private:
static Tempo _default_tempo;
static Meter _default_meter;
Metrics* metrics;
- nframes_t _frame_rate;
- framepos_t last_bbt_when;
+ framecnt_t _frame_rate;
+ framepos_t last_bbt_when;
bool last_bbt_valid;
BBT_Time last_bbt;
mutable Glib::RWLock lock;
diff --git a/libs/ardour/ardour/thread_buffers.h b/libs/ardour/ardour/thread_buffers.h
index 3c312176a8..8e927471a0 100644
--- a/libs/ardour/ardour/thread_buffers.h
+++ b/libs/ardour/ardour/thread_buffers.h
@@ -25,7 +25,7 @@ class ThreadBuffers {
uint32_t npan_buffers;
private:
- void allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force);
+ void allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force);
};
} // namespace
diff --git a/libs/ardour/ardour/ticker.h b/libs/ardour/ardour/ticker.h
index f5cda677ed..0a24070608 100644
--- a/libs/ardour/ardour/ticker.h
+++ b/libs/ardour/ardour/ticker.h
@@ -43,8 +43,8 @@ public:
Ticker() {};
virtual ~Ticker() {}
- virtual void tick(
- const nframes_t& transport_frames,
+ virtual void tick (
+ const framepos_t& transport_frames,
const BBT_Time& transport_bbt,
const Timecode::Time& transport_timecode) = 0;
@@ -68,7 +68,7 @@ public:
}
void tick(
- const nframes_t& transport_frames,
+ const framepos_t& transport_frames,
const BBT_Time& transport_bbt,
const Timecode::Time& transport_timecode);
@@ -82,7 +82,7 @@ public:
void transport_state_changed();
/// slot for the signal session::PositionChanged
- void position_changed(nframes_t position);
+ void position_changed (framepos_t position);
/// slot for the signal session::TransportLooped
void transport_looped();
@@ -95,12 +95,12 @@ private:
int _ppqn;
double _last_tick;
- double one_ppqn_in_frames(nframes_t transport_position);
+ double one_ppqn_in_frames (framepos_t transport_position);
- void send_midi_clock_event(nframes_t offset);
- void send_start_event(nframes_t offset);
- void send_continue_event(nframes_t offset);
- void send_stop_event(nframes_t offset);
+ void send_midi_clock_event (framecnt_t offset);
+ void send_start_event (framecnt_t offset);
+ void send_continue_event (framecnt_t offset);
+ void send_stop_event (framecnt_t offset);
};
}
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index ff1b57950a..5087ddda3a 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -48,13 +48,13 @@ class Track : public Route, public PublicDiskstream
virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
PBD::Signal0<void> TrackModeChanged;
- virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool state_changing, bool can_record, bool rec_monitors_input);
- int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool can_record, bool rec_monitors_input, bool& need_butler);
- virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+ virtual int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
int declick, bool can_record, bool rec_monitors_input, bool& need_butler) = 0;
bool needs_butler() const { return _needs_butler; }
@@ -67,8 +67,8 @@ class Track : public Route, public PublicDiskstream
virtual void use_new_diskstream () = 0;
virtual void set_diskstream (boost::shared_ptr<Diskstream>);
- nframes_t update_total_latency();
- void set_latency_delay (nframes_t);
+ framecnt_t update_total_latency();
+ void set_latency_delay (framecnt_t);
enum FreezeState {
NoFreeze,
@@ -82,7 +82,7 @@ class Track : public Route, public PublicDiskstream
virtual void unfreeze () = 0;
virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0;
- virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0;
+ virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0;
XMLNode& get_state();
XMLNode& get_template();
@@ -97,7 +97,7 @@ class Track : public Route, public PublicDiskstream
/* XXX: unfortunate that this is exposed */
PBD::ID const & diskstream_id () const;
- void set_block_size (nframes_t);
+ void set_block_size (pframes_t);
/* PublicDiskstream interface */
boost::shared_ptr<Playlist> playlist ();
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index d452cd6b54..1f16ce6313 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -52,7 +52,7 @@ namespace ARDOUR {
typedef float gain_t;
typedef uint32_t layer_t;
typedef uint64_t microseconds_t;
- typedef uint32_t nframes_t;
+ typedef jack_nframes_t pframes_t;
/* Any position measured in audio frames.
Assumed to be non-negative but not enforced.
@@ -213,7 +213,7 @@ namespace ARDOUR {
BBT_Time bbt;
union {
- nframes_t frames;
+ framecnt_t frames;
double seconds;
};
@@ -221,13 +221,13 @@ namespace ARDOUR {
};
struct AudioRange {
- nframes_t start;
- nframes_t end;
+ framepos_t start;
+ framepos_t end;
uint32_t id;
- AudioRange (nframes_t s, nframes_t e, uint32_t i) : start (s), end (e) , id (i) {}
+ AudioRange (framepos_t s, framepos_t e, uint32_t i) : start (s), end (e) , id (i) {}
- nframes_t length() { return end - start + 1; }
+ framecnt_t length() { return end - start + 1; }
bool operator== (const AudioRange& other) const {
return start == other.start && end == other.end && id == other.id;
@@ -237,7 +237,7 @@ namespace ARDOUR {
return start == other.start && end == other.end;
}
- OverlapType coverage (nframes_t s, nframes_t e) const {
+ OverlapType coverage (framepos_t s, framepos_t e) const {
return ARDOUR::coverage (start, end, s, e);
}
};
@@ -560,9 +560,8 @@ track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed)
return (ARDOUR::framepos_t)( (double)track_frame / speed );
}
-/* for now, break the rules and use "using" to make these "global" */
+/* for now, break the rules and use "using" to make this "global" */
-using ARDOUR::nframes_t;
using ARDOUR::framepos_t;
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index 8c3145a28b..06dc6d6bd9 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -62,7 +62,7 @@ std::string path_expand (std::string);
std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0);
bool path_is_paired (std::string path, std::string& pair_base);
-void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out);
+void compute_equal_power_fades (ARDOUR::framecnt_t nframes, float* in, float* out);
const char* sync_source_to_string (ARDOUR::SyncSource src);
ARDOUR::SyncSource string_to_sync_source (std::string str);
diff --git a/libs/ardour/ardour/vbap.h b/libs/ardour/ardour/vbap.h
index 4b6b42e732..063bcb82d6 100644
--- a/libs/ardour/ardour/vbap.h
+++ b/libs/ardour/ardour/vbap.h
@@ -37,9 +37,9 @@ public:
static StreamPanner* factory (Panner& parent, Evoral::Parameter param, Speakers& s);
static std::string name;
- void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
+ void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes);
void do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
+ framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers);
void set_azimuth_elevation (double azimuth, double elevation);
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index c6caf4ddc5..7b271b2e73 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -421,14 +421,14 @@ AudioDiskstream::prepare_record_status(framepos_t capture_start_frame)
}
int
-AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
+AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
{
uint32_t n;
boost::shared_ptr<ChannelList> c = channels.reader();
ChannelList::iterator chan;
int ret = -1;
- nframes_t rec_offset = 0;
- nframes_t rec_nframes = 0;
+ framecnt_t rec_offset = 0;
+ framecnt_t rec_nframes = 0;
bool collect_playback = false;
playback_distance = 0;
@@ -519,7 +519,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
} else {
- nframes_t total = chaninfo->capture_vector.len[0] + chaninfo->capture_vector.len[1];
+ framecnt_t total = chaninfo->capture_vector.len[0] + chaninfo->capture_vector.len[1];
if (rec_nframes > total) {
DiskOverrun ();
@@ -530,7 +530,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
assert(ap);
Sample* buf = ap->get_audio_buffer(nframes).data();
- nframes_t first = chaninfo->capture_vector.len[0];
+ framecnt_t first = chaninfo->capture_vector.len[0];
memcpy (chaninfo->capture_wrap_buffer, buf, sizeof (Sample) * first);
memcpy (chaninfo->capture_vector.buf[0], buf, sizeof (Sample) * first);
@@ -593,12 +593,12 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
/* we're doing playback */
- nframes_t necessary_samples;
+ framecnt_t necessary_samples;
/* no varispeed playback if we're recording, because the output .... TBD */
if (rec_nframes == 0 && _actual_speed != 1.0f) {
- necessary_samples = (nframes_t) floor ((nframes * fabs (_actual_speed))) + 1;
+ necessary_samples = (framecnt_t) floor ((nframes * fabs (_actual_speed))) + 1;
} else {
necessary_samples = nframes;
}
@@ -618,7 +618,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
chaninfo->current_playback_buffer = chaninfo->playback_vector.buf[0];
} else {
- nframes_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
+ framecnt_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
if (necessary_samples > total) {
cerr << _name << " Need " << necessary_samples << " total = " << total << endl;
@@ -662,7 +662,7 @@ AudioDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool ca
}
void
-AudioDiskstream::process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c)
+AudioDiskstream::process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c)
{
ChannelList::iterator chan;
@@ -680,7 +680,7 @@ AudioDiskstream::process_varispeed_playback(nframes_t nframes, boost::shared_ptr
}
bool
-AudioDiskstream::commit (nframes_t /* nframes */)
+AudioDiskstream::commit (framecnt_t /* nframes */)
{
bool need_butler = false;
@@ -750,7 +750,7 @@ AudioDiskstream::overwrite_existing_buffers ()
overwrite_queued = false;
/* assume all are the same size */
- nframes_t size = c->front()->playback_buf->bufsize();
+ framecnt_t size = c->front()->playback_buf->bufsize();
mixdown_buffer = new Sample[size];
gain_buffer = new float[size];
@@ -764,7 +764,7 @@ AudioDiskstream::overwrite_existing_buffers ()
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++n) {
start = overwrite_frame;
- nframes_t cnt = size;
+ framecnt_t cnt = size;
/* to fill the buffer without resetting the playback sample, we need to
do it one or two chunks (normally two).
@@ -777,7 +777,7 @@ AudioDiskstream::overwrite_existing_buffers ()
*/
- nframes_t to_read = size - overwrite_offset;
+ framecnt_t to_read = size - overwrite_offset;
if (read ((*chan)->playback_buf->buffer() + overwrite_offset, mixdown_buffer, gain_buffer, start, to_read, *chan, n, reversed)) {
error << string_compose(_("AudioDiskstream %1: when refilling, cannot read %2 from playlist at frame %3"),
@@ -874,14 +874,14 @@ AudioDiskstream::internal_playback_seek (framecnt_t distance)
int
AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
- framepos_t& start, nframes_t cnt,
+ framepos_t& start, framecnt_t cnt,
ChannelInfo* /*channel_info*/, int channel, bool reversed)
{
- nframes_t this_read = 0;
+ framecnt_t this_read = 0;
bool reloop = false;
framepos_t loop_end = 0;
framepos_t loop_start = 0;
- nframes_t offset = 0;
+ framecnt_t offset = 0;
Location *loc = 0;
/* XXX we don't currently play loops in reverse. not sure why */
@@ -988,15 +988,15 @@ int
AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
{
int32_t ret = 0;
- nframes_t to_read;
+ framecnt_t to_read;
RingBufferNPT<Sample>::rw_vector vector;
bool reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
- nframes_t total_space;
- nframes_t zero_fill;
+ framecnt_t total_space;
+ framecnt_t zero_fill;
uint32_t chan_n;
ChannelList::iterator i;
boost::shared_ptr<ChannelList> c = channels.reader();
- nframes_t ts;
+ framecnt_t ts;
if (c->empty()) {
return 0;
@@ -1121,7 +1121,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
ChannelInfo* chan (*i);
Sample* buf1;
Sample* buf2;
- nframes_t len1, len2;
+ framecnt_t len1, len2;
chan->playback_buf->get_write_vector (&vector);
@@ -1216,7 +1216,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
int32_t ret = 0;
RingBufferNPT<Sample>::rw_vector vector;
RingBufferNPT<CaptureTransition>::rw_vector transvec;
- nframes_t total;
+ framecnt_t total;
_write_data_count = 0;
@@ -1251,7 +1251,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
ret = 1;
}
- to_write = min (disk_io_chunk_frames, (nframes_t) vector.len[0]);
+ to_write = min (disk_io_chunk_frames, (framecnt_t) vector.len[0]);
// check the transition buffer when recording destructive
// important that we get this after the capture buf
@@ -1321,7 +1321,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
of vector.len[1] to be flushed to disk as well.
*/
- to_write = min ((nframes_t)(disk_io_chunk_frames - to_write), (nframes_t) vector.len[1]);
+ to_write = min ((framecnt_t)(disk_io_chunk_frames - to_write), (framecnt_t) vector.len[1]);
if ((*chan)->write_source->write (vector.buf[1], to_write) != to_write) {
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), _id) << endmsg;
@@ -1346,7 +1346,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
bool more_work = true;
int err = 0;
boost::shared_ptr<AudioRegion> region;
- nframes_t total_capture;
+ framecnt_t total_capture;
SourceList srcs;
SourceList::iterator src;
ChannelList::iterator chan;
@@ -2002,7 +2002,7 @@ AudioDiskstream::rename_write_sources ()
}
void
-AudioDiskstream::set_block_size (nframes_t /*nframes*/)
+AudioDiskstream::set_block_size (pframes_t /*nframes*/)
{
if (_session.get_block_size() > speed_buffer_size) {
speed_buffer_size = _session.get_block_size();
@@ -2026,7 +2026,7 @@ AudioDiskstream::allocate_temporary_buffers ()
*/
double const sp = max (fabsf (_actual_speed), 1.2f);
- nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() * sp) + 1;
+ framecnt_t required_wrap_size = (framecnt_t) floor (_session.get_block_size() * sp) + 1;
if (required_wrap_size > wrap_buffer_size) {
@@ -2350,7 +2350,7 @@ AudioDiskstream::adjust_capture_buffering ()
}
}
-AudioDiskstream::ChannelInfo::ChannelInfo (nframes_t playback_bufsize, nframes_t capture_bufsize, nframes_t speed_size, nframes_t wrap_size)
+AudioDiskstream::ChannelInfo::ChannelInfo (framecnt_t playback_bufsize, framecnt_t capture_bufsize, framecnt_t speed_size, framecnt_t wrap_size)
{
peak_power = 0.0f;
source = 0;
@@ -2378,7 +2378,7 @@ AudioDiskstream::ChannelInfo::ChannelInfo (nframes_t playback_bufsize, nframes_t
}
void
-AudioDiskstream::ChannelInfo::resize_playback (nframes_t playback_bufsize)
+AudioDiskstream::ChannelInfo::resize_playback (framecnt_t playback_bufsize)
{
delete playback_buf;
playback_buf = new RingBufferNPT<Sample> (playback_bufsize);
@@ -2386,7 +2386,7 @@ AudioDiskstream::ChannelInfo::resize_playback (nframes_t playback_bufsize)
}
void
-AudioDiskstream::ChannelInfo::resize_capture (nframes_t capture_bufsize)
+AudioDiskstream::ChannelInfo::resize_capture (framecnt_t capture_bufsize)
{
delete capture_buf;
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index 1fa9c5adc4..4976672152 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -164,7 +164,7 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, stri
}
}
-AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, nframes_t start, nframes_t cnt, string name, bool hidden)
+AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, framepos_t start, framecnt_t cnt, string name, bool hidden)
: Playlist (other, start, cnt, name, hidden)
, _crossfades (*this)
{
@@ -838,15 +838,13 @@ AudioPlaylist::region_changed (const PropertyChange& what_changed, boost::shared
}
void
-AudioPlaylist::crossfades_at (nframes_t frame, Crossfades& clist)
+AudioPlaylist::crossfades_at (framepos_t frame, Crossfades& clist)
{
RegionLock rlock (this);
for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
- nframes_t start, end;
-
- start = (*i)->position();
- end = start + (*i)->overlap_length(); // not length(), important difference
+ framepos_t const start = (*i)->position ();
+ framepos_t const end = start + (*i)->overlap_length(); // not length(), important difference
if (frame >= start && frame <= end) {
clist.push_back (*i);
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc
index c7e920dfb6..aad56748c3 100644
--- a/libs/ardour/audio_port.cc
+++ b/libs/ardour/audio_port.cc
@@ -25,7 +25,7 @@
using namespace ARDOUR;
using namespace std;
-nframes_t AudioPort::_port_offset = 0;
+framecnt_t AudioPort::_port_offset = 0;
AudioPort::AudioPort (const std::string& name, Flags flags)
: Port (name, DataType::AUDIO, flags)
@@ -40,7 +40,7 @@ AudioPort::~AudioPort ()
}
void
-AudioPort::cycle_start (nframes_t nframes)
+AudioPort::cycle_start (pframes_t nframes)
{
/* caller must hold process lock */
@@ -65,7 +65,7 @@ AudioPort::cycle_start (nframes_t nframes)
}
void
-AudioPort::cycle_end (nframes_t nframes)
+AudioPort::cycle_end (pframes_t nframes)
{
if (sends_output() && !_buffer->written()) {
_buffer->silence (nframes);
@@ -78,7 +78,7 @@ AudioPort::cycle_split ()
}
AudioBuffer&
-AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
+AudioPort::get_audio_buffer (framecnt_t nframes, framecnt_t offset)
{
/* caller must hold process lock */
@@ -100,7 +100,7 @@ AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
}
size_t
-AudioPort::raw_buffer_size (nframes_t nframes) const
+AudioPort::raw_buffer_size (pframes_t nframes) const
{
return nframes * sizeof (Sample);
}
diff --git a/libs/ardour/audio_region_importer.cc b/libs/ardour/audio_region_importer.cc
index 2cade745f2..775bd0119f 100644
--- a/libs/ardour/audio_region_importer.cc
+++ b/libs/ardour/audio_region_importer.cc
@@ -126,7 +126,7 @@ AudioRegionImporter::~AudioRegionImporter ()
string
AudioRegionImporter::get_info () const
{
- nframes_t length, position;
+ framecnt_t length, position;
Timecode::Time length_time, position_time;
std::ostringstream oss;
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index ca2291902d..182fdccd26 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -354,7 +354,7 @@ AudioTrack::set_state_part_two ()
}
int
-AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+AudioTrack::roll (pframes_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);
@@ -365,7 +365,7 @@ AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_fram
int dret;
Sample* b;
Sample* tmpb;
- nframes_t transport_frame;
+ framepos_t transport_frame;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
automation_snapshot (start_frame, false);
@@ -453,7 +453,7 @@ AudioTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_fram
Sample* bb = bufs.get_audio (i).data();
- for (nframes_t xx = 0; xx < nframes; ++xx) {
+ for (pframes_t xx = 0; xx < nframes; ++xx) {
bb[xx] = b[xx] * scaling;
}
@@ -595,7 +595,7 @@ AudioTrack::bounce (InterThreadInfo& itt)
}
boost::shared_ptr<Region>
-AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing)
+AudioTrack::bounce_range (framepos_t start, framepos_t end, InterThreadInfo& itt, bool enable_processing)
{
vector<boost::shared_ptr<Source> > srcs;
return _session.write_one_track (*this, start, end, false, srcs, itt, enable_processing);
diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc
index b29384b201..a831e480db 100644
--- a/libs/ardour/audio_track_importer.cc
+++ b/libs/ardour/audio_track_importer.cc
@@ -357,7 +357,7 @@ AudioTrackImporter::rate_convert_events (XMLNode & node)
std::stringstream str (content_node->content());
std::ostringstream new_content;
- nframes_t x;
+ framecnt_t x;
double y;
bool ok = true;
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index 517c5f150c..daace03de1 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -758,7 +758,7 @@ AUPlugin::default_value (uint32_t port)
return 0;
}
-nframes_t
+framecnt_t
AUPlugin::signal_latency () const
{
return unit->Latency() * _session.frame_rate();
@@ -858,7 +858,7 @@ AUPlugin::requires_fixed_size_buffers() const
int
-AUPlugin::set_block_size (nframes_t nframes)
+AUPlugin::set_block_size (pframes_t nframes)
{
bool was_initialized = initialized;
UInt32 numFrames = nframes;
@@ -1252,7 +1252,7 @@ AUPlugin::render_callback(AudioUnitRenderActionFlags*,
}
int
-AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping, ChanMapping, nframes_t nframes, nframes_t offset)
+AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping, ChanMapping, pframes_t nframes, framecnt_t offset)
{
AudioUnitRenderActionFlags flags = 0;
AudioTimeStamp ts;
diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc
index 7b649aae89..cb46c45def 100644
--- a/libs/ardour/audioanalyser.cc
+++ b/libs/ardour/audioanalyser.cc
@@ -111,7 +111,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
while (!done) {
- nframes_t to_read;
+ framecnt_t to_read;
/* read from source */
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 32ebe1643e..cb5374eabb 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -176,7 +176,7 @@ AudioEngine::start ()
if (!_running) {
- nframes_t blocksize = jack_get_buffer_size (_priv_jack);
+ pframes_t blocksize = jack_get_buffer_size (_priv_jack);
if (_session) {
BootMessage (_("Connect session to engine"));
@@ -274,7 +274,7 @@ AudioEngine::stop (bool forever)
bool
-AudioEngine::get_sync_offset (nframes_t& offset) const
+AudioEngine::get_sync_offset (pframes_t& offset) const
{
#ifdef HAVE_JACK_VIDEO_SUPPORT
@@ -300,14 +300,14 @@ AudioEngine::get_sync_offset (nframes_t& offset) const
}
void
-AudioEngine::_jack_timebase_callback (jack_transport_state_t state, nframes_t nframes,
+AudioEngine::_jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
jack_position_t* pos, int new_position, void *arg)
{
static_cast<AudioEngine*> (arg)->jack_timebase_callback (state, nframes, pos, new_position);
}
void
-AudioEngine::jack_timebase_callback (jack_transport_state_t state, nframes_t nframes,
+AudioEngine::jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
jack_position_t* pos, int new_position)
{
if (_jack && _session && _session->synced_to_jack()) {
@@ -368,7 +368,7 @@ AudioEngine::_graph_order_callback (void *arg)
* @param arg User argument passed by JACK, which will be the AudioEngine*.
*/
int
-AudioEngine::_process_callback (nframes_t nframes, void *arg)
+AudioEngine::_process_callback (pframes_t nframes, void *arg)
{
return static_cast<AudioEngine *> (arg)->process_callback (nframes);
}
@@ -400,7 +400,7 @@ AudioEngine::_connect_callback (jack_port_id_t /*id_a*/, jack_port_id_t /*id_b*/
}
void
-AudioEngine::split_cycle (nframes_t offset)
+AudioEngine::split_cycle (pframes_t offset)
{
/* caller must hold process lock */
@@ -434,7 +434,7 @@ AudioEngine::process_thread ()
while (1) {
GET_PRIVATE_JACK_POINTER_RET(_jack,0);
- jack_nframes_t nframes = jack_cycle_wait (_jack);
+ pframes_t nframes = jack_cycle_wait (_jack);
if (process_callback (nframes)) {
cerr << "--- process\n";
@@ -452,14 +452,14 @@ AudioEngine::process_thread ()
* @param nframes Number of frames to process.
*/
int
-AudioEngine::process_callback (nframes_t nframes)
+AudioEngine::process_callback (pframes_t nframes)
{
GET_PRIVATE_JACK_POINTER_RET(_jack,0);
// CycleTimer ct ("AudioEngine::process");
Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK);
/// The number of frames that will have been processed when we've finished
- nframes_t next_processed_frames;
+ pframes_t next_processed_frames;
/* handle wrap around of total frames counter */
@@ -571,13 +571,13 @@ AudioEngine::process_callback (nframes_t nframes)
}
int
-AudioEngine::_sample_rate_callback (nframes_t nframes, void *arg)
+AudioEngine::_sample_rate_callback (pframes_t nframes, void *arg)
{
return static_cast<AudioEngine *> (arg)->jack_sample_rate_callback (nframes);
}
int
-AudioEngine::jack_sample_rate_callback (nframes_t nframes)
+AudioEngine::jack_sample_rate_callback (pframes_t nframes)
{
_frame_rate = nframes;
_usecs_per_cycle = (int) floor ((((double) frames_per_cycle() / nframes)) * 1000000.0);
@@ -597,13 +597,13 @@ AudioEngine::jack_sample_rate_callback (nframes_t nframes)
}
int
-AudioEngine::_bufsize_callback (nframes_t nframes, void *arg)
+AudioEngine::_bufsize_callback (pframes_t nframes, void *arg)
{
return static_cast<AudioEngine *> (arg)->jack_bufsize_callback (nframes);
}
int
-AudioEngine::jack_bufsize_callback (nframes_t nframes)
+AudioEngine::jack_bufsize_callback (pframes_t nframes)
{
bool need_midi_size = true;
bool need_audio_size = true;
@@ -694,7 +694,7 @@ AudioEngine::set_session (Session *s)
start_metering_thread ();
- nframes_t blocksize = jack_get_buffer_size (_jack);
+ pframes_t blocksize = jack_get_buffer_size (_jack);
/* page in as much of the session process code as we
can before we really start running.
@@ -933,14 +933,14 @@ AudioEngine::disconnect (Port& port)
return port.disconnect_all ();
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
AudioEngine::frame_rate () const
{
- GET_PRIVATE_JACK_POINTER_RET (_jack,0);
+ GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
if (_frame_rate == 0) {
- return (_frame_rate = jack_get_sample_rate (_priv_jack));
+ return (_frame_rate = jack_get_sample_rate (_priv_jack));
} else {
- return _frame_rate;
+ return _frame_rate;
}
}
@@ -951,14 +951,14 @@ AudioEngine::raw_buffer_size (DataType t)
return (s != _raw_buffer_sizes.end()) ? s->second : 0;
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
AudioEngine::frames_per_cycle () const
{
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
if (_buffer_size == 0) {
- return (_buffer_size = jack_get_buffer_size (_jack));
+ return (_buffer_size = jack_get_buffer_size (_jack));
} else {
- return _buffer_size;
+ return _buffer_size;
}
}
@@ -1196,7 +1196,7 @@ AudioEngine::transport_start ()
}
void
-AudioEngine::transport_locate (nframes_t where)
+AudioEngine::transport_locate (framepos_t where)
{
GET_PRIVATE_JACK_POINTER (_jack);
// cerr << "tell JACK to locate to " << where << endl;
@@ -1401,7 +1401,7 @@ AudioEngine::reconnect_to_jack ()
}
int
-AudioEngine::request_buffer_size (nframes_t nframes)
+AudioEngine::request_buffer_size (pframes_t nframes)
{
GET_PRIVATE_JACK_POINTER_RET (_jack, -1);
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index 39701f24cc..63f7b55016 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -77,16 +77,16 @@ uint64_t AudioFileSource::header_position_offset = 0;
char AudioFileSource::bwf_serial_number[13] = "000000000000";
struct SizedSampleBuffer {
- nframes_t size;
- Sample* buf;
+ framecnt_t size;
+ Sample* buf;
- SizedSampleBuffer (nframes_t sz) : size (sz) {
- buf = new Sample[size];
- }
+ SizedSampleBuffer (framecnt_t sz) : size (sz) {
+ buf = new Sample[size];
+ }
- ~SizedSampleBuffer() {
- delete [] buf;
- }
+ ~SizedSampleBuffer() {
+ delete [] buf;
+ }
};
Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
@@ -302,7 +302,7 @@ AudioFileSource::move_dependents_to_trash()
}
void
-AudioFileSource::set_header_position_offset (nframes_t offset)
+AudioFileSource::set_header_position_offset (framecnt_t offset)
{
header_position_offset = offset;
HeaderPositionOffsetChanged ();
@@ -385,7 +385,7 @@ AudioFileSource::safe_audio_file_extension(const string& file)
}
Sample*
-AudioFileSource::get_interleave_buffer (nframes_t size)
+AudioFileSource::get_interleave_buffer (framecnt_t size)
{
SizedSampleBuffer* ssb;
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 9d94651eb0..f3ae05f1b1 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -297,8 +297,8 @@ AudioRegion::set_envelope_active (bool yn)
}
}
-ARDOUR::nframes_t
-AudioRegion::read_peaks (PeakData *buf, nframes_t npeaks, nframes_t offset, nframes_t cnt, uint32_t chan_n, double samples_per_unit) const
+ARDOUR::framecnt_t
+AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, framecnt_t cnt, uint32_t chan_n, double samples_per_unit) const
{
if (chan_n >= _sources.size()) {
return 0;
@@ -308,7 +308,7 @@ AudioRegion::read_peaks (PeakData *buf, nframes_t npeaks, nframes_t offset, nfra
return 0;
} else {
if (_scale_amplitude != 1.0f) {
- for (nframes_t n = 0; n < npeaks; ++n) {
+ for (framecnt_t n = 0; n < npeaks; ++n) {
buf[n].max *= _scale_amplitude;
buf[n].min *= _scale_amplitude;
}
@@ -438,20 +438,19 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
if (_fade_in_active && _session.config.get_use_region_fades()) {
- nframes_t fade_in_length = (nframes_t) _fade_in->back()->when;
+ framecnt_t fade_in_length = (framecnt_t) _fade_in->back()->when;
/* see if this read is within the fade in */
if (internal_offset < fade_in_length) {
- nframes_t fi_limit;
+ framecnt_t fi_limit;
fi_limit = min (to_read, fade_in_length - internal_offset);
-
_fade_in->curve().get_vector (internal_offset, internal_offset+fi_limit, gain_buffer, fi_limit);
- for (nframes_t n = 0; n < fi_limit; ++n) {
+ for (framecnt_t n = 0; n < fi_limit; ++n) {
mixdown_buffer[n] *= gain_buffer[n];
}
}
@@ -480,20 +479,20 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
*/
- nframes_t fade_out_length = (nframes_t) _fade_out->back()->when;
- nframes_t fade_interval_start = max(internal_offset, limit-fade_out_length);
- nframes_t fade_interval_end = min(internal_offset + to_read, limit);
+ framecnt_t fade_out_length = (framecnt_t) _fade_out->back()->when;
+ framecnt_t fade_interval_start = max(internal_offset, limit-fade_out_length);
+ framecnt_t fade_interval_end = min(internal_offset + to_read, limit);
if (fade_interval_end > fade_interval_start) {
/* (part of the) the fade out is in this buffer */
- nframes_t fo_limit = fade_interval_end - fade_interval_start;
- nframes_t curve_offset = fade_interval_start - (limit-fade_out_length);
- nframes_t fade_offset = fade_interval_start - internal_offset;
+ framecnt_t fo_limit = fade_interval_end - fade_interval_start;
+ framecnt_t curve_offset = fade_interval_start - (limit-fade_out_length);
+ framecnt_t fade_offset = fade_interval_start - internal_offset;
_fade_out->curve().get_vector (curve_offset, curve_offset+fo_limit, gain_buffer, fo_limit);
- for (nframes_t n = 0, m = fade_offset; n < fo_limit; ++n, ++m) {
+ for (framecnt_t n = 0, m = fade_offset; n < fo_limit; ++n, ++m) {
mixdown_buffer[m] *= gain_buffer[n];
}
}
@@ -507,11 +506,11 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
_envelope->curve().get_vector (internal_offset, internal_offset + to_read, gain_buffer, to_read);
if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
- for (nframes_t n = 0; n < to_read; ++n) {
+ for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n] * _scale_amplitude;
}
} else {
- for (nframes_t n = 0; n < to_read; ++n) {
+ for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n];
}
}
@@ -520,7 +519,7 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
// XXX this should be using what in 2.0 would have been:
// Session::apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
- for (nframes_t n = 0; n < to_read; ++n) {
+ for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= _scale_amplitude;
}
}
@@ -532,7 +531,7 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit,
buf += buf_offset;
- for (nframes_t n = 0; n < to_read; ++n) {
+ for (framecnt_t n = 0; n < to_read; ++n) {
buf[n] += mixdown_buffer[n];
}
}
@@ -713,13 +712,13 @@ AudioRegion::set_state (const XMLNode& node, int version)
void
AudioRegion::set_fade_in_shape (FadeShape shape)
{
- set_fade_in (shape, (nframes_t) _fade_in->back()->when);
+ set_fade_in (shape, (framecnt_t) _fade_in->back()->when);
}
void
AudioRegion::set_fade_out_shape (FadeShape shape)
{
- set_fade_out (shape, (nframes_t) _fade_out->back()->when);
+ set_fade_out (shape, (framecnt_t) _fade_out->back()->when);
}
void
@@ -1063,8 +1062,8 @@ int
AudioRegion::exportme (Session& /*session*/, ARDOUR::ExportSpecification& /*spec*/)
{
// TODO EXPORT
-// const nframes_t blocksize = 4096;
-// nframes_t to_read;
+// const framecnt_t blocksize = 4096;
+// framecnt_t to_read;
// int status = -1;
//
// spec.channels = _sources.size();
@@ -1099,7 +1098,7 @@ AudioRegion::exportme (Session& /*session*/, ARDOUR::ExportSpecification& /*spec
// goto out;
// }
//
-// for (nframes_t x = 0; x < to_read; ++x) {
+// for (framecnt_t x = 0; x < to_read; ++x) {
// spec.dataF[chan+(x*spec.channels)] = buf[x];
// }
// }
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index c61fb72ae2..38261f3cbb 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -238,7 +238,7 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path)
/* we found it in the peaks dir, so check it out */
- if (statbuf.st_size == 0 || ((nframes_t) statbuf.st_size < ((length(_timeline_position) / _FPP) * sizeof (PeakData)))) {
+ if (statbuf.st_size == 0 || ((framecnt_t) statbuf.st_size < ((length(_timeline_position) / _FPP) * sizeof (PeakData)))) {
// empty
_peaks_built = false;
} else {
@@ -938,7 +938,7 @@ AudioSource::available_peaks (double zoom_factor) const
}
void
-AudioSource::dec_read_data_count (nframes_t cnt)
+AudioSource::dec_read_data_count (framecnt_t cnt)
{
uint32_t val = cnt * sizeof (Sample);
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index 37df6297da..d7605f26e1 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -193,7 +193,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
length = the_region->length();
int dir;
- nframes_t offset = the_region->sync_offset (dir);
+ framecnt_t offset = the_region->sync_offset (dir);
/* can't audition from a negative sync point */
@@ -208,10 +208,10 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
}
int
-Auditioner::play_audition (nframes_t nframes)
+Auditioner::play_audition (framecnt_t nframes)
{
bool need_butler = false;
- nframes_t this_nframes;
+ framecnt_t this_nframes;
int ret;
if (g_atomic_int_get (&_auditioning) == 0) {
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index 903ae5df75..248bb96b52 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -45,7 +45,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
-nframes_t Automatable::_automation_interval = 0;
+framecnt_t Automatable::_automation_interval = 0;
Automatable::Automatable(Session& session)
: _a_session(session)
@@ -387,7 +387,7 @@ Automatable::protect_automation ()
}
void
-Automatable::automation_snapshot (nframes_t now, bool force)
+Automatable::automation_snapshot (framepos_t now, bool force)
{
if (force || _last_automation_snapshot > now || (now - _last_automation_snapshot) > _automation_interval) {
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index c8f5d18aec..f4f4f95238 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -392,7 +392,7 @@ AutomationList::set_state (const XMLNode& node, int version)
const XMLNodeList& elist = node.children();
XMLNodeConstIterator i;
XMLProperty* prop;
- nframes_t x;
+ pframes_t x;
double y;
ControlList::freeze ();
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc
index 4c802b1443..c60c0ac2b9 100644
--- a/libs/ardour/buffer_set.cc
+++ b/libs/ardour/buffer_set.cc
@@ -85,7 +85,7 @@ BufferSet::clear()
/** Make this BufferSet a direct mirror of a PortSet's buffers.
*/
void
-BufferSet::attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset)
+BufferSet::attach_buffers (PortSet& ports, framecnt_t nframes, framecnt_t offset)
{
clear();
@@ -224,7 +224,7 @@ BufferSet::get_lv2_midi(bool input, size_t i)
ebuf->reset();
if (input) {
for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
- const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+ const Evoral::MIDIEvent<framepos_t> ev(*e, false);
uint32_t type = LV2Plugin::midi_event_type();
ebuf->append(ev.time(), 0, type, ev.size(), ev.buffer());
}
@@ -299,7 +299,7 @@ BufferSet::VSTBuffer::clear ()
}
void
-BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<nframes_t> const & ev)
+BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<framepos_t> const & ev)
{
if (ev.size() > 3) {
/* XXX: this will silently drop MIDI messages longer than 3 bytes, so
@@ -333,7 +333,7 @@ BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent<nframes_t> const & ev)
#endif /* VST_SUPPORT */
void
-BufferSet::read_from (const BufferSet& in, nframes_t nframes)
+BufferSet::read_from (const BufferSet& in, framecnt_t nframes)
{
assert(available() >= in.count());
@@ -349,7 +349,7 @@ BufferSet::read_from (const BufferSet& in, nframes_t nframes)
}
void
-BufferSet::merge_from (const BufferSet& in, nframes_t nframes)
+BufferSet::merge_from (const BufferSet& in, framecnt_t nframes)
{
/* merge all input buffers into out existing buffers.
@@ -367,7 +367,7 @@ BufferSet::merge_from (const BufferSet& in, nframes_t nframes)
}
void
-BufferSet::silence (nframes_t nframes, nframes_t offset)
+BufferSet::silence (framecnt_t nframes, framecnt_t offset)
{
for (std::vector<BufferVec>::iterator i = _buffers.begin(); i != _buffers.end(); ++i) {
for (BufferVec::iterator b = i->begin(); b != i->end(); ++b) {
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc
index a77c11b983..72f2a0971d 100644
--- a/libs/ardour/butler.cc
+++ b/libs/ardour/butler.cc
@@ -87,7 +87,7 @@ Butler::start_thread()
*/
midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate);
- MidiDiskstream::set_readahead_frames ((nframes_t)(Config->get_midi_readahead() * rate));
+ MidiDiskstream::set_readahead_frames ((framecnt_t) (Config->get_midi_readahead() * rate));
Crossfade::set_buffer_size (audio_dstream_playback_buffer_size);
diff --git a/libs/ardour/caimportable.cc b/libs/ardour/caimportable.cc
index e78691a1dd..149f213222 100644
--- a/libs/ardour/caimportable.cc
+++ b/libs/ardour/caimportable.cc
@@ -36,12 +36,12 @@ CAImportableSource::~CAImportableSource ()
{
}
-nframes_t
-CAImportableSource::read (Sample* buffer, nframes_t nframes)
+framecnt_t
+CAImportableSource::read (Sample* buffer, framecnt_t nframes)
{
- nframes_t nread = 0;
+ framecnt_t nread = 0;
AudioBufferList abl;
- nframes_t per_channel;
+ framecnt_t per_channel;
bool at_end = false;
abl.mNumberBuffers = 1;
@@ -91,8 +91,8 @@ CAImportableSource::length () const
return af.GetNumberFrames();
}
-nframes_t
-CAImportableSource::samplerate() const
+framecnt_t
+CAImportableSource::samplerate () const
{
CAStreamBasicDescription client_asbd;
@@ -107,7 +107,7 @@ CAImportableSource::samplerate() const
}
void
-CAImportableSource::seek (nframes_t pos)
+CAImportableSource::seek (framepos_t pos)
{
try {
af.Seek (pos);
diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc
index d1038faf62..09e06a49bc 100644
--- a/libs/ardour/coreaudiosource.cc
+++ b/libs/ardour/coreaudiosource.cc
@@ -92,7 +92,7 @@ CoreAudioSource::~CoreAudioSource ()
}
int
-CoreAudioSource::safe_read (Sample* dst, nframes_t start, framecnt_t cnt, AudioBufferList& abl) const
+CoreAudioSource::safe_read (Sample* dst, framepos_t start, framecnt_t cnt, AudioBufferList& abl) const
{
framecnt_t nread = 0;
diff --git a/libs/ardour/default_click.cc b/libs/ardour/default_click.cc
index b1f4772852..242e5c2918 100644
--- a/libs/ardour/default_click.cc
+++ b/libs/ardour/default_click.cc
@@ -555,7 +555,7 @@ const Sample Session::default_click_emphasis[] = {
0, 0,
};
-const nframes_t Session::default_click_emphasis_length = sizeof (default_click_emphasis) / sizeof (default_click_emphasis[0]);
+const framecnt_t Session::default_click_emphasis_length = sizeof (default_click_emphasis) / sizeof (default_click_emphasis[0]);
const Sample Session::default_click[] = {
0, -0.014312744, -0.03338623, 0.019165039, 0.042541504,
@@ -1171,4 +1171,4 @@ const Sample Session::default_click[] = {
0, 0, 0, 0, 0, 0, 0, 0,
};
-const nframes_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]);
+const framecnt_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]);
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index 700efd8ac1..9bf597ef66 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -43,9 +43,9 @@ using namespace std;
using namespace PBD;
using namespace ARDOUR;
-PBD::Signal1<void,nframes_t> Delivery::CycleStart;
-PBD::Signal0<int> Delivery::PannersLegal;
-bool Delivery::panners_legal = false;
+PBD::Signal1<void, pframes_t> Delivery::CycleStart;
+PBD::Signal0<int> Delivery::PannersLegal;
+bool Delivery::panners_legal = false;
/* deliver to an existing IO object */
@@ -115,14 +115,14 @@ Delivery::display_name () const
}
void
-Delivery::cycle_start (nframes_t /*nframes*/)
+Delivery::cycle_start (pframes_t /*nframes*/)
{
_output_offset = 0;
_no_outs_cuz_we_no_monitor = false;
}
void
-Delivery::increment_output_offset (nframes_t n)
+Delivery::increment_output_offset (framecnt_t n)
{
_output_offset += n;
}
@@ -226,7 +226,7 @@ Delivery::configure_io (ChanCount in, ChanCount out)
}
void
-Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool result_required)
+Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool result_required)
{
assert (_output);
@@ -441,7 +441,7 @@ Delivery::end_pan_touch (uint32_t which, bool mark, double when)
void
-Delivery::flush_buffers (nframes_t nframes, framepos_t time)
+Delivery::flush_buffers (framecnt_t nframes, framepos_t time)
{
/* io_lock, not taken: function must be called from Session::process() calltree */
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 5b3fe34870..bf77d7d6ad 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -66,7 +66,7 @@ using namespace PBD;
* default from configuration_vars.h). 0 is not a good value for
* allocating buffer sizes..
*/
-ARDOUR::nframes_t Diskstream::disk_io_chunk_frames = 1024 * 256;
+ARDOUR::framecnt_t Diskstream::disk_io_chunk_frames = 1024 * 256;
PBD::Signal0<void> Diskstream::DiskOverrun;
PBD::Signal0<void> Diskstream::DiskUnderrun;
@@ -110,9 +110,6 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
, in_set_state (false)
, _persistent_alignment_style (ExistingMaterial)
, first_input_change (true)
- , scrub_start (0)
- , scrub_buffer_size (0)
- , scrub_offset (0)
, _flags (flag)
{
@@ -157,9 +154,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
, in_set_state (false)
, _persistent_alignment_style (ExistingMaterial)
, first_input_change (true)
- , scrub_start (0)
- , scrub_buffer_size (0)
- , scrub_offset (0)
, _flags (Recordable)
{
}
@@ -238,7 +232,7 @@ Diskstream::realtime_set_speed (double sp, bool global)
if (new_speed != _actual_speed) {
- nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() *
+ framecnt_t required_wrap_size = (framecnt_t) floor (_session.get_block_size() *
fabs (new_speed)) + 1;
if (required_wrap_size > wrap_buffer_size) {
@@ -329,7 +323,7 @@ Diskstream::get_captured_frames (uint32_t n) const
}
void
-Diskstream::set_roll_delay (ARDOUR::nframes_t nframes)
+Diskstream::set_roll_delay (ARDOUR::framecnt_t nframes)
{
_roll_delay = nframes;
}
@@ -639,7 +633,7 @@ Diskstream::route_going_away ()
void
Diskstream::calculate_record_range(OverlapType ot, framepos_t transport_frame, framecnt_t nframes,
- nframes_t& rec_nframes, nframes_t& rec_offset)
+ framecnt_t & rec_nframes, framecnt_t & rec_offset)
{
switch (ot) {
case OverlapNone:
diff --git a/libs/ardour/element_importer.cc b/libs/ardour/element_importer.cc
index 9f217c2cd9..4f635f1693 100644
--- a/libs/ardour/element_importer.cc
+++ b/libs/ardour/element_importer.cc
@@ -95,15 +95,15 @@ ElementImporter::timecode_to_string(Timecode::Time & time) const
return oss.str();
}
-nframes_t
-ElementImporter::rate_convert_samples (nframes_t samples) const
+framecnt_t
+ElementImporter::rate_convert_samples (framecnt_t samples) const
{
if (sample_rate == session.frame_rate()) {
return samples;
}
// +0.5 for proper rounding
- return static_cast<nframes_t> (samples * (static_cast<double> (session.nominal_frame_rate()) / sample_rate) + 0.5);
+ return static_cast<framecnt_t> (samples * (static_cast<double> (session.nominal_frame_rate()) / sample_rate) + 0.5);
}
string
diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc
index f94ee13257..0f2548dd00 100644
--- a/libs/ardour/export_channel.cc
+++ b/libs/ardour/export_channel.cc
@@ -39,7 +39,7 @@ PortExportChannel::operator< (ExportChannel const & other) const
}
void
-PortExportChannel::read (Sample * data, nframes_t frames) const
+PortExportChannel::read (Sample * data, framecnt_t frames) const
{
memset (data, 0, frames * sizeof (float));
@@ -128,7 +128,7 @@ RegionExportChannelFactory::create (uint32_t channel)
}
void
-RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t frames_to_read)
+RegionExportChannelFactory::read (uint32_t channel, Sample * data, framecnt_t frames_to_read)
{
assert (channel < n_channels);
assert (frames_to_read <= frames_per_cycle);
@@ -142,7 +142,7 @@ RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t fra
}
void
-RegionExportChannelFactory::update_buffers (nframes_t frames)
+RegionExportChannelFactory::update_buffers (framecnt_t frames)
{
assert (frames <= frames_per_cycle);
diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc
index 1658e8cffc..315da339d4 100644
--- a/libs/ardour/export_format_specification.cc
+++ b/libs/ardour/export_format_specification.cc
@@ -55,11 +55,11 @@ ExportFormatSpecification::Time::operator= (AnyTime const & other)
return *this;
}
-nframes_t
-ExportFormatSpecification::Time::get_frames (nframes_t target_rate) const
+framecnt_t
+ExportFormatSpecification::Time::get_frames (framecnt_t target_rate) const
{
//TODO position
- nframes_t duration = session.convert_to_frames_at (0, *this);
+ framecnt_t duration = session.convert_to_frames_at (0, *this);
return ((double) target_rate / session.frame_rate()) * duration + 0.5;
}
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc
index 1cd3118eae..ba7491c976 100644
--- a/libs/ardour/export_graph_builder.cc
+++ b/libs/ardour/export_graph_builder.cc
@@ -38,7 +38,7 @@ ExportGraphBuilder::~ExportGraphBuilder ()
}
int
-ExportGraphBuilder::process (nframes_t frames, bool last_cycle)
+ExportGraphBuilder::process (framecnt_t frames, bool last_cycle)
{
assert(frames <= process_buffer_frames);
@@ -187,7 +187,7 @@ ExportGraphBuilder::Encoder::copy_files (std::string orig_path)
/* SFC */
-ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &, FileSpec const & new_config, framecnt_t max_frames)
: data_width(0)
{
config = new_config;
@@ -252,7 +252,7 @@ ExportGraphBuilder::SFC::operator== (FileSpec const & other_config) const
/* Normalizer */
-ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t /*max_frames*/)
+ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t /*max_frames*/)
: parent (parent)
{
config = new_config;
@@ -306,7 +306,7 @@ ExportGraphBuilder::Normalizer::operator== (FileSpec const & other_config) const
bool
ExportGraphBuilder::Normalizer::process()
{
- nframes_t frames_read = tmp_file->read (*buffer);
+ framecnt_t frames_read = tmp_file->read (*buffer);
return frames_read != buffer->frames();
}
@@ -321,7 +321,7 @@ ExportGraphBuilder::Normalizer::start_post_processing()
/* SRC */
-ExportGraphBuilder::SRC::SRC (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SRC::SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
: parent (parent)
{
config = new_config;
@@ -371,12 +371,12 @@ ExportGraphBuilder::SRC::operator== (FileSpec const & other_config) const
}
/* SilenceHandler */
-ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames)
+ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
: parent (parent)
{
config = new_config;
max_frames_in = max_frames;
- nframes_t sample_rate = parent.session.nominal_frame_rate();
+ framecnt_t sample_rate = parent.session.nominal_frame_rate();
silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in));
silence_trimmer->set_trim_beginning (config.format->trim_beginning());
@@ -457,7 +457,7 @@ ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
}
}
- nframes_t max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
+ framecnt_t const max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
interleaver->add_output (children.back().sink ());
}
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index 9ffb7c1778..59a023c4d8 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -178,7 +178,7 @@ ExportHandler::start_timespan ()
}
int
-ExportHandler::process (nframes_t frames)
+ExportHandler::process (framecnt_t frames)
{
if (!export_status->running) {
return 0;
@@ -190,11 +190,11 @@ ExportHandler::process (nframes_t frames)
}
int
-ExportHandler::process_timespan (nframes_t frames)
+ExportHandler::process_timespan (framecnt_t frames)
{
/* update position */
- nframes_t frames_to_read = 0;
+ framecnt_t frames_to_read = 0;
framepos_t const start = current_timespan->get_start();
framepos_t const end = current_timespan->get_end();
@@ -538,7 +538,7 @@ void
ExportHandler::frames_to_cd_frames_string (char* buf, framepos_t when)
{
framecnt_t remainder;
- nframes_t fr = session.nominal_frame_rate();
+ framecnt_t fr = session.nominal_frame_rate();
int mins, secs, frames;
mins = when / (60 * fr);
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index d745b1f94c..1b6f4406a5 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -290,7 +290,7 @@ ExportProfileManager::find_file (std::string const & pattern)
}
void
-ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
+ExportProfileManager::set_selection_range (framepos_t start, framepos_t end)
{
if (start || end) {
@@ -307,7 +307,7 @@ ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
}
std::string
-ExportProfileManager::set_single_range (nframes_t start, nframes_t end, string name)
+ExportProfileManager::set_single_range (framepos_t start, framepos_t end, string name)
{
single_range_mode = true;
diff --git a/libs/ardour/export_timespan.cc b/libs/ardour/export_timespan.cc
index 948bf768d5..5b62c7dfcc 100644
--- a/libs/ardour/export_timespan.cc
+++ b/libs/ardour/export_timespan.cc
@@ -27,13 +27,14 @@
namespace ARDOUR
{
-ExportTimespan::ExportTimespan (ExportStatusPtr status, nframes_t frame_rate) :
- status (status),
- start_frame (0),
- end_frame (0),
- position (0),
- frame_rate (frame_rate)
+ExportTimespan::ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate) :
+ status (status),
+ start_frame (0),
+ end_frame (0),
+ position (0),
+ frame_rate (frame_rate)
{
+
}
ExportTimespan::~ExportTimespan ()
@@ -41,7 +42,7 @@ ExportTimespan::~ExportTimespan ()
}
void
-ExportTimespan::set_range (nframes_t start, nframes_t end)
+ExportTimespan::set_range (framepos_t start, framepos_t end)
{
start_frame = start;
position = start_frame;
diff --git a/libs/ardour/gain.cc b/libs/ardour/gain.cc
index 6f2161f578..a3c27f4260 100644
--- a/libs/ardour/gain.cc
+++ b/libs/ardour/gain.cc
@@ -41,21 +41,21 @@ Gain::operator= (const Gain& other)
}
void
-Gain::fill_linear_volume_fade_in (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_volume_fade_in (Gain& /*gain*/, framecnt_t /*frames*/)
{
}
void
-Gain::fill_linear_volume_fade_out (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_volume_fade_out (Gain& /*gain*/, framecnt_t /*frames*/)
{
}
void
-Gain::fill_linear_fade_in (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_fade_in (Gain& /*gain*/, framecnt_t /*frames*/)
{
}
void
-Gain::fill_linear_fade_out (Gain& /*gain*/, nframes_t /*frames*/)
+Gain::fill_linear_fade_out (Gain& /*gain*/, framecnt_t /*frames*/)
{
}
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index a24fcad8ce..9549a9dcc9 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -445,7 +445,7 @@ Graph::dump (int chain)
}
int
-Graph::silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Graph::silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool can_record, bool rec_monitors_input, bool& need_butler)
{
_process_nframes = nframes;
@@ -471,7 +471,7 @@ Graph::silent_process_routes (nframes_t nframes, framepos_t start_frame, framepo
}
int
-Graph::process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+Graph::process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& need_butler)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
@@ -500,7 +500,7 @@ Graph::process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end
}
int
-Graph::routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Graph::routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool non_rt_pending, bool can_record, int declick)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("no-roll graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index 3dd2a99ee1..deba3efb05 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -73,7 +73,7 @@ using namespace ARDOUR;
using namespace PBD;
static boost::shared_ptr<ImportableSource>
-open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQuality quality)
+open_importable_source (const string& path, framecnt_t samplerate, ARDOUR::SrcQuality quality)
{
/* try libsndfile first, because it can get BWF info from .wav, which ExtAudioFile cannot.
We don't necessarily need that information in an ImportableSource, but it keeps the
@@ -274,7 +274,7 @@ static void
write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
vector<boost::shared_ptr<Source> >& newfiles)
{
- const nframes_t nframes = ResampledImportableSource::blocksize;
+ const framecnt_t nframes = ResampledImportableSource::blocksize;
boost::shared_ptr<AudioFileSource> afs;
uint channels = source->channels();
@@ -305,7 +305,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
uint read_count = 0;
while (!status.cancel) {
- nframes_t const nread = source->read (data.get(), nframes);
+ framecnt_t const nread = source->read (data.get(), nframes);
if (nread == 0) {
break;
}
@@ -330,7 +330,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
while (!status.cancel) {
- nframes_t nread, nfread;
+ framecnt_t nread, nfread;
uint x;
uint chn;
@@ -349,7 +349,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
for (chn = 0; chn < channels; ++chn) {
- nframes_t n;
+ framecnt_t n;
for (x = chn, n = 0; n < nfread; x += channels, ++n) {
channel_data[chn][n] = (Sample) data[x];
}
diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc
index 1d135cc44f..8e058b69b1 100644
--- a/libs/ardour/internal_return.cc
+++ b/libs/ardour/internal_return.cc
@@ -27,7 +27,7 @@
using namespace std;
using namespace ARDOUR;
-PBD::Signal1<void,nframes_t> InternalReturn::CycleStart;
+PBD::Signal1<void, pframes_t> InternalReturn::CycleStart;
InternalReturn::InternalReturn (Session& s)
: Return (s, true)
@@ -38,7 +38,7 @@ InternalReturn::InternalReturn (Session& s)
}
void
-InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
{
if (!_active && !_pending_active) {
return;
@@ -64,14 +64,14 @@ InternalReturn::configure_io (ChanCount in, ChanCount out)
}
int
-InternalReturn::set_block_size (nframes_t nframes)
+InternalReturn::set_block_size (pframes_t nframes)
{
allocate_buffers (nframes);
return 0;
}
void
-InternalReturn::allocate_buffers (nframes_t nframes)
+InternalReturn::allocate_buffers (pframes_t nframes)
{
buffers.ensure_buffers (_configured_input, nframes);
buffers.set_count (_configured_input);
@@ -101,7 +101,7 @@ InternalReturn::release_buffers ()
}
void
-InternalReturn::cycle_start (nframes_t nframes)
+InternalReturn::cycle_start (pframes_t nframes)
{
/* called from process cycle - no lock necessary */
if (user_count) {
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index 8ec5430308..43276516dd 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -81,7 +81,7 @@ InternalSend::send_to_going_away ()
}
void
-InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
{
if ((!_active && !_pending_active) || !target || !_send_to) {
_meter->reset ();
@@ -147,7 +147,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame
}
int
-InternalSend::set_block_size (nframes_t nframes)
+InternalSend::set_block_size (pframes_t nframes)
{
mixbufs.ensure_buffers (_configured_input, nframes);
diff --git a/libs/ardour/interpolation.cc b/libs/ardour/interpolation.cc
index 1393d8aae8..0a9bbc3a7d 100644
--- a/libs/ardour/interpolation.cc
+++ b/libs/ardour/interpolation.cc
@@ -6,11 +6,11 @@
using namespace ARDOUR;
-nframes_t
-LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input, Sample *output)
+framecnt_t
+LinearInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input, Sample *output)
{
// index in the input buffers
- nframes_t i = 0;
+ framecnt_t i = 0;
double acceleration;
double distance = 0.0;
@@ -22,7 +22,7 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
}
distance = phase[channel];
- for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+ for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
i = floor(distance);
Sample fractional_phase_part = distance - i;
if (fractional_phase_part >= 1.0) {
@@ -45,11 +45,11 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
return i;
}
-nframes_t
-CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input, Sample *output)
+framecnt_t
+CubicInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input, Sample *output)
{
// index in the input buffers
- nframes_t i = 0;
+ framecnt_t i = 0;
double acceleration;
double distance = 0.0;
@@ -87,7 +87,7 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
inm1 = input[i-1];
}
- for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+ for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
float f = floor (distance);
float fractional_phase_part = distance - f;
@@ -124,7 +124,7 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
/* not sure that this is ever utilized - it implies that one of the input/output buffers is missing */
- for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
+ for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
distance += _speed + acceleration;
}
}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index ebed41fd64..c29ee51a58 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -96,7 +96,7 @@ IO::~IO ()
}
void
-IO::silence (nframes_t nframes)
+IO::silence (framecnt_t nframes)
{
/* io_lock, not taken: function must be called from Session::process() calltree */
@@ -1133,7 +1133,7 @@ IO::set_name (const string& requested_name)
}
void
-IO::set_port_latency (nframes_t nframes)
+IO::set_port_latency (framecnt_t nframes)
{
Glib::Mutex::Lock lm (io_lock);
@@ -1142,11 +1142,11 @@ IO::set_port_latency (nframes_t nframes)
}
}
-nframes_t
+framecnt_t
IO::latency () const
{
- nframes_t max_latency;
- nframes_t latency;
+ framecnt_t max_latency;
+ framecnt_t latency;
max_latency = 0;
@@ -1521,7 +1521,7 @@ IO::connected_to (boost::shared_ptr<const IO> other) const
}
void
-IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, nframes_t nframes)
+IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
{
BufferSet bufs;
@@ -1532,7 +1532,7 @@ IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, fr
}
void
-IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
+IO::collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset)
{
assert(bufs.available() >= _ports.count());
@@ -1560,7 +1560,7 @@ IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
}
void
-IO::copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset)
+IO::copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset)
{
// Copy any buffers 1:1 to outputs
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc
index 877e0422fa..8cad0ba6cb 100644
--- a/libs/ardour/io_processor.cc
+++ b/libs/ardour/io_processor.cc
@@ -242,7 +242,7 @@ IOProcessor::set_state_2X (const XMLNode& node, int version)
}
void
-IOProcessor::silence (nframes_t nframes)
+IOProcessor::silence (framecnt_t nframes)
{
if (_own_output && _output) {
_output->silence (nframes);
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index 027c16e78c..fb5a88e5f8 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -53,7 +53,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
-LadspaPlugin::LadspaPlugin (void *mod, AudioEngine& e, Session& session, uint32_t index, nframes_t rate)
+LadspaPlugin::LadspaPlugin (void *mod, AudioEngine& e, Session& session, uint32_t index, framecnt_t rate)
: Plugin (e, session)
{
init (mod, index, rate);
@@ -71,7 +71,7 @@ LadspaPlugin::LadspaPlugin (const LadspaPlugin &other)
}
void
-LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
+LadspaPlugin::init (void *mod, uint32_t index, framecnt_t rate)
{
LADSPA_Descriptor_Function dfunc;
uint32_t i, port_cnt;
@@ -530,7 +530,7 @@ LadspaPlugin::describe_parameter (Evoral::Parameter which)
}
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
LadspaPlugin::signal_latency () const
{
if (_user_latency) {
@@ -538,7 +538,7 @@ LadspaPlugin::signal_latency () const
}
if (_latency_control_port) {
- return (nframes_t) floor (*_latency_control_port);
+ return (framecnt_t) floor (*_latency_control_port);
} else {
return 0;
}
@@ -563,7 +563,7 @@ LadspaPlugin::automatable () const
int
LadspaPlugin::connect_and_run (BufferSet& bufs,
ChanMapping in_map, ChanMapping out_map,
- nframes_t nframes, nframes_t offset)
+ pframes_t nframes, framecnt_t offset)
{
cycles_t now;
cycles_t then = get_cycles ();
@@ -626,7 +626,7 @@ LadspaPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
}
void
-LadspaPlugin::run_in_place (nframes_t nframes)
+LadspaPlugin::run_in_place (pframes_t nframes)
{
for (uint32_t i = 0; i < parameter_count(); ++i) {
if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) && LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
@@ -655,7 +655,7 @@ LadspaPlugin::latency_compute_run ()
uint32_t port_index = 0;
uint32_t in_index = 0;
uint32_t out_index = 0;
- const nframes_t bufsize = 1024;
+ const framecnt_t bufsize = 1024;
LADSPA_Data buffer[bufsize];
memset(buffer,0,sizeof(LADSPA_Data)*bufsize);
diff --git a/libs/ardour/location_importer.cc b/libs/ardour/location_importer.cc
index 1674616096..281e045ae3 100644
--- a/libs/ardour/location_importer.cc
+++ b/libs/ardour/location_importer.cc
@@ -104,7 +104,7 @@ LocationImporter::~LocationImporter ()
string
LocationImporter::get_info () const
{
- nframes_t start, end;
+ framepos_t start, end;
Timecode::Time start_time, end_time;
// Get sample positions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index d8f83c98e9..9edd929aad 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -55,7 +55,7 @@ uint32_t LV2Plugin::_midi_event_type = _uri_map.uri_to_id(
"http://lv2plug.in/ns/ext/event",
"http://lv2plug.in/ns/ext/midi#MidiEvent");
-LV2Plugin::LV2Plugin (AudioEngine& e, Session& session, LV2World& world, SLV2Plugin plugin, nframes_t rate)
+LV2Plugin::LV2Plugin (AudioEngine& e, Session& session, LV2World& world, SLV2Plugin plugin, framecnt_t rate)
: Plugin (e, session)
, _world(world)
, _features(NULL)
@@ -77,7 +77,7 @@ LV2Plugin::LV2Plugin (const LV2Plugin &other)
}
void
-LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
+LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate)
{
_world = world;
_plugin = plugin;
@@ -501,11 +501,11 @@ LV2Plugin::describe_parameter (Evoral::Parameter which)
}
}
-nframes_t
+framecnt_t
LV2Plugin::signal_latency () const
{
if (_latency_control_port) {
- return (nframes_t) floor (*_latency_control_port);
+ return (framecnt_t) floor (*_latency_control_port);
} else {
return 0;
}
@@ -528,7 +528,7 @@ LV2Plugin::automatable () const
int
LV2Plugin::connect_and_run (BufferSet& bufs,
ChanMapping in_map, ChanMapping out_map,
- nframes_t nframes, nframes_t offset)
+ pframes_t nframes, framecnt_t offset)
{
cycles_t then = get_cycles ();
@@ -632,7 +632,7 @@ LV2Plugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
}
void
-LV2Plugin::run (nframes_t nframes)
+LV2Plugin::run (pframes_t nframes)
{
for (uint32_t i = 0; i < parameter_count(); ++i) {
if (parameter_is_control(i) && parameter_is_input(i)) {
@@ -660,7 +660,7 @@ LV2Plugin::latency_compute_run ()
uint32_t in_index = 0;
uint32_t out_index = 0;
- const nframes_t bufsize = 1024;
+ const framecnt_t bufsize = 1024;
float buffer[bufsize];
memset(buffer, 0, sizeof(float) * bufsize);
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index 443146cf13..226cf417f3 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -39,7 +39,7 @@ PBD::Signal0<void> Metering::Meter;
* be set to 0.
*/
void
-PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
{
if (!_active && !_pending_active) {
return;
@@ -54,7 +54,7 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
for (uint32_t i = 0; i < n_midi; ++i, ++n) {
float val = 0.0f;
for (MidiBuffer::iterator e = bufs.get_midi(i).begin(); e != bufs.get_midi(i).end(); ++e) {
- const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+ const Evoral::MIDIEvent<framepos_t> ev(*e, false);
if (ev.is_note_on()) {
const float this_vel = log(ev.buffer()[2] / 127.0 * (M_E*M_E-M_E) + M_E) - 1.0;
if (this_vel > val) {
diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc
index 2eb9df8c5c..c65ba58288 100644
--- a/libs/ardour/midi_buffer.cc
+++ b/libs/ardour/midi_buffer.cc
@@ -79,7 +79,7 @@ MidiBuffer::copy(const MidiBuffer& copy)
* Note that offset and nframes refer to sample time, NOT buffer offsets or event counts.
*/
void
-MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset, nframes_t src_offset)
+MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset, framecnt_t src_offset)
{
assert (src.type() == DataType::MIDI);
assert (&src != this);
@@ -109,7 +109,7 @@ MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offse
}
void
-MidiBuffer::merge_from (const Buffer& src, nframes_t /*nframes*/, nframes_t /*dst_offset*/, nframes_t /*src_offset*/)
+MidiBuffer::merge_from (const Buffer& src, framecnt_t /*nframes*/, framecnt_t /*dst_offset*/, framecnt_t /*src_offset*/)
{
const MidiBuffer* mbuf = dynamic_cast<const MidiBuffer*>(&src);
assert (mbuf);
@@ -253,7 +253,7 @@ MidiBuffer::reserve(TimeType time, size_t size)
void
-MidiBuffer::silence (nframes_t /*nframes*/, nframes_t /*offset*/)
+MidiBuffer::silence (framecnt_t /*nframes*/, framecnt_t /*offset*/)
{
/* XXX iterate over existing events, find all in range given by offset & nframes,
and delete them.
diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc
index f6fe0d0930..5dfd63fe1a 100644
--- a/libs/ardour/midi_clock_slave.cc
+++ b/libs/ardour/midi_clock_slave.cc
@@ -355,10 +355,10 @@ MIDIClock_Slave::speed_and_position (double& speed, framepos_t& pos)
return true;
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
MIDIClock_Slave::resolution() const
{
// one beat
- return (nframes_t) one_ppqn_in_frames * ppqn;
+ return (framecnt_t) one_ppqn_in_frames * ppqn;
}
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index f5b9cb5345..29217d9e5e 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -67,7 +67,7 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
-nframes_t MidiDiskstream::midi_readahead = 4096;
+framecnt_t MidiDiskstream::midi_readahead = 4096;
MidiDiskstream::MidiDiskstream (Session &sess, const string &name, Diskstream::Flag flag)
: Diskstream(sess, name, flag)
@@ -128,8 +128,8 @@ MidiDiskstream::init ()
allocate_temporary_buffers ();
const size_t size = _session.butler()->midi_diskstream_buffer_size();
- _playback_buf = new MidiRingBuffer<nframes_t>(size);
- _capture_buf = new MidiRingBuffer<nframes_t>(size);
+ _playback_buf = new MidiRingBuffer<framepos_t>(size);
+ _capture_buf = new MidiRingBuffer<framepos_t>(size);
_n_channels = ChanCount(DataType::MIDI, 1);
@@ -488,11 +488,11 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
#endif
int
-MidiDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
+MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler)
{
int ret = -1;
- nframes_t rec_offset = 0;
- nframes_t rec_nframes = 0;
+ framecnt_t rec_offset = 0;
+ framecnt_t rec_nframes = 0;
bool nominally_recording;
bool re = record_enabled ();
@@ -588,7 +588,7 @@ MidiDiskstream::process (framepos_t transport_frame, nframes_t nframes, bool can
}
bool
-MidiDiskstream::commit (nframes_t nframes)
+MidiDiskstream::commit (framecnt_t nframes)
{
bool need_butler = false;
@@ -678,9 +678,9 @@ MidiDiskstream::internal_playback_seek (framecnt_t distance)
/** @a start is set to the new frame position (TIME) read up to */
int
-MidiDiskstream::read (framepos_t& start, nframes_t dur, bool reversed)
+MidiDiskstream::read (framepos_t& start, framecnt_t dur, bool reversed)
{
- nframes_t this_read = 0;
+ framecnt_t this_read = 0;
bool reloop = false;
framepos_t loop_end = 0;
framepos_t loop_start = 0;
@@ -812,12 +812,12 @@ MidiDiskstream::do_refill ()
return 0;
}
- nframes_t to_read = midi_readahead - (frames_written - frames_read);
+ framecnt_t to_read = midi_readahead - (frames_written - frames_read);
//cout << "MDS read for midi_readahead " << to_read << " rb_contains: "
// << frames_written - frames_read << endl;
- to_read = (nframes_t) min ((framecnt_t) to_read, (framecnt_t) (max_framepos - file_frame));
+ to_read = (framecnt_t) min ((framecnt_t) to_read, (framecnt_t) (max_framepos - file_frame));
if (read (file_frame, to_read, reversed)) {
ret = -1;
@@ -841,7 +841,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
{
uint32_t to_write;
int32_t ret = 0;
- nframes_t total;
+ framecnt_t total;
_write_data_count = 0;
@@ -941,7 +941,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen
assert(_write_source);
- nframes_t total_capture = 0;
+ framecnt_t total_capture = 0;
for (ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
total_capture += (*ci)->frames;
}
@@ -1408,7 +1408,7 @@ MidiDiskstream::rename_write_sources ()
}
void
-MidiDiskstream::set_block_size (nframes_t /*nframes*/)
+MidiDiskstream::set_block_size (pframes_t /*nframes*/)
{
}
diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc
index abc0d682ba..9986d9750c 100644
--- a/libs/ardour/midi_playlist.cc
+++ b/libs/ardour/midi_playlist.cc
@@ -68,7 +68,7 @@ MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, string
{
}
-MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t dur, string name, bool hidden)
+MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, framepos_t start, framecnt_t dur, string name, bool hidden)
: Playlist (other, start, dur, name, hidden)
, _note_mode(other->_note_mode)
{
@@ -87,8 +87,8 @@ struct EventsSortByTime {
};
/** Returns the number of frames in time duration read (eg could be large when 0 events are read) */
-nframes_t
-MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t dur, unsigned chan_n)
+framecnt_t
+MidiPlaylist::read (MidiRingBuffer<framepos_t>& dst, framepos_t start, framecnt_t dur, unsigned chan_n)
{
/* this function is never called from a realtime thread, so
its OK to block (for short intervals).
@@ -97,7 +97,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
Glib::RecMutex::Lock rm (region_lock);
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("++++++ %1 .. %2 +++++++++++++++++++++++++++++++++++++++++++++++\n", start, start + dur));
- nframes_t end = start + dur - 1;
+ framepos_t end = start + dur - 1;
_read_data_count = 0;
@@ -190,7 +190,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("%1 regions to read, plus %2 trackers\n", regs.size(), tracker_info.size()));
- Evoral::EventList<nframes_t> evlist;
+ Evoral::EventList<framepos_t> evlist;
for (vector<TrackerInfo>::iterator t = tracker_info.begin(); t != tracker_info.end(); ++t) {
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("Resolve %1 notes\n", (*t).first->on()));
@@ -200,7 +200,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("After resolution we now have %1 events\n", evlist.size()));
- for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+ for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
}
#endif
@@ -235,7 +235,7 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("After %1 (%2 .. %3) we now have %4\n", mr->name(), mr->position(), mr->last_frame(), evlist.size()));
- for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+ for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
}
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\tAFTER: tracker says there are %1 on notes\n", tracker->on()));
@@ -253,18 +253,18 @@ MidiPlaylist::read (MidiRingBuffer<nframes_t>& dst, nframes_t start, nframes_t d
if (!evlist.empty()) {
/* sort the event list */
- EventsSortByTime<nframes_t> time_cmp;
+ EventsSortByTime<framepos_t> time_cmp;
evlist.sort (time_cmp);
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("Final we now have %1 events\n", evlist.size()));
- for (Evoral::EventList<nframes_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
+ for (Evoral::EventList<framepos_t>::iterator x = evlist.begin(); x != evlist.end(); ++x) {
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("\t%1\n", **x));
}
#endif
/* write into dst */
- for (Evoral::EventList<nframes_t>::iterator e = evlist.begin(); e != evlist.end(); ++e) {
- Evoral::Event<nframes_t>* ev (*e);
+ for (Evoral::EventList<framepos_t>::iterator e = evlist.begin(); e != evlist.end(); ++e) {
+ Evoral::Event<framepos_t>* ev (*e);
dst.write (ev->time(), ev->event_type(), ev->size(), ev->buffer());
delete ev;
}
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index adf24c2eaf..5f18810122 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -39,7 +39,7 @@ MidiPort::~MidiPort()
}
void
-MidiPort::cycle_start (nframes_t nframes)
+MidiPort::cycle_start (pframes_t nframes)
{
_buffer->clear ();
assert (_buffer->size () == 0);
@@ -50,7 +50,7 @@ MidiPort::cycle_start (nframes_t nframes)
}
MidiBuffer &
-MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
+MidiPort::get_midi_buffer (framecnt_t nframes, framecnt_t offset)
{
if (_has_been_mixed_down) {
return *_buffer;
@@ -59,7 +59,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
if (receives_input ()) {
void* jack_buffer = jack_port_get_buffer (_jack_port, nframes);
- const nframes_t event_count = jack_midi_get_event_count(jack_buffer);
+ const pframes_t event_count = jack_midi_get_event_count(jack_buffer);
assert (event_count < _buffer->capacity());
@@ -67,7 +67,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
into our MidiBuffer
*/
- for (nframes_t i = 0; i < event_count; ++i) {
+ for (pframes_t i = 0; i < event_count; ++i) {
jack_midi_event_t ev;
@@ -102,7 +102,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
void
-MidiPort::cycle_end (nframes_t /*nframes*/)
+MidiPort::cycle_end (pframes_t /*nframes*/)
{
_has_been_mixed_down = false;
}
@@ -114,7 +114,7 @@ MidiPort::cycle_split ()
}
void
-MidiPort::flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset)
+MidiPort::flush_buffers (pframes_t nframes, framepos_t time, framecnt_t offset)
{
if (sends_output ()) {
@@ -133,7 +133,7 @@ MidiPort::flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset)
_resolve_in_process = false;
for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
- const Evoral::Event<nframes_t>& ev = *i;
+ const Evoral::Event<framepos_t>& ev = *i;
// event times are in frames, relative to cycle start
@@ -157,8 +157,8 @@ MidiPort::transport_stopped ()
}
size_t
-MidiPort::raw_buffer_size (nframes_t nframes) const
+MidiPort::raw_buffer_size (pframes_t nframes) const
{
- return jack_midi_max_event_size(jack_port_get_buffer(_jack_port, nframes));
+ return jack_midi_max_event_size (jack_port_get_buffer (_jack_port, nframes));
}
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index e8d6229e91..f9fb791bad 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -129,19 +129,19 @@ MidiRegion::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
}
framecnt_t
-MidiRegion::read_at (Evoral::EventSink<nframes_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode, MidiStateTracker* tracker) const
+MidiRegion::read_at (Evoral::EventSink<framepos_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode, MidiStateTracker* tracker) const
{
return _read_at (_sources, out, position, dur, chan_n, mode, tracker);
}
framecnt_t
-MidiRegion::master_read_at (MidiRingBuffer<nframes_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode) const
+MidiRegion::master_read_at (MidiRingBuffer<framepos_t>& out, framepos_t position, framecnt_t dur, uint32_t chan_n, NoteMode mode) const
{
return _read_at (_master_sources, out, position, dur, chan_n, mode); /* no tracker */
}
framecnt_t
-MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink<nframes_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n,
+MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink<framepos_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n,
NoteMode mode, MidiStateTracker* tracker) const
{
frameoffset_t internal_offset = 0;
diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc
index eb83d41645..b25154fefb 100644
--- a/libs/ardour/midi_ring_buffer.cc
+++ b/libs/ardour/midi_ring_buffer.cc
@@ -34,7 +34,7 @@ using namespace PBD;
*/
template<typename T>
size_t
-MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset)
+MidiRingBuffer<T>::read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset)
{
if (this->read_space() == 0) {
return 0;
@@ -97,7 +97,7 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
// This event marks a loop end (i.e. the next event's timestamp will be non-monotonic)
if (ev_type == LoopEventType) {
assert (ev_size == sizeof (framepos_t));
- nframes_t loop_start;
+ framepos_t loop_start;
read_contents (ev_size, (uint8_t *) &loop_start);
loop_offset = ev_time - loop_start;
@@ -240,5 +240,5 @@ MidiRingBuffer<T>::dump(ostream& str)
}
-template class MidiRingBuffer<nframes_t>;
+template class MidiRingBuffer<framepos_t>;
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index 5a703f6772..120ee29e8e 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -196,9 +196,9 @@ 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, framepos_t source_start,
- framepos_t start, nframes_t cnt,
+framecnt_t
+MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_start,
+ framepos_t start, framecnt_t cnt,
MidiStateTracker* tracker,
std::set<Evoral::Parameter> const & filtered) const
{
@@ -255,11 +255,11 @@ MidiSource::midi_read (Evoral::EventSink<nframes_t>& dst, framepos_t source_star
* @param source Source to read from.
* @param source_start This source's start position in session frames.
*/
-nframes_t
-MidiSource::midi_write (MidiRingBuffer<nframes_t>& source, framepos_t source_start, nframes_t duration)
+framecnt_t
+MidiSource::midi_write (MidiRingBuffer<framepos_t>& source, framepos_t source_start, framecnt_t duration)
{
Glib::Mutex::Lock lm (_lock);
- const nframes_t ret = write_unlocked (source, source_start, duration);
+ const framecnt_t ret = write_unlocked (source, source_start, duration);
_last_write_end += duration;
return ret;
}
diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc
index 24c9d2884c..cbbf73b682 100644
--- a/libs/ardour/midi_state_tracker.cc
+++ b/libs/ardour/midi_state_tracker.cc
@@ -111,7 +111,7 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, framepos_t time)
}
void
-MidiStateTracker::resolve_notes (Evoral::EventSink<nframes_t> &dst, framepos_t time)
+MidiStateTracker::resolve_notes (Evoral::EventSink<framepos_t> &dst, framepos_t time)
{
uint8_t buf[3];
diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc
index ee1ccc31ae..e5b773465f 100644
--- a/libs/ardour/midi_stretch.cc
+++ b/libs/ardour/midi_stretch.cc
@@ -110,7 +110,7 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress* progress)
const int ret = finish (region, nsrcs, new_name);
- results[0]->set_length((nframes_t) floor (r->length() * _request.time_fraction), NULL);
+ results[0]->set_length((framecnt_t) floor (r->length() * _request.time_fraction), NULL);
return ret;
}
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index 6e4f07cf15..c994350ebc 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -298,7 +298,7 @@ MidiTrack::set_state_part_two ()
}
int
-MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& needs_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -320,8 +320,7 @@ MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame
return 0;
}
- nframes_t transport_frame = _session.transport_frame();
-
+ framepos_t transport_frame = _session.transport_frame();
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
@@ -391,7 +390,7 @@ MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame
}
int
-MidiTrack::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+MidiTrack::no_roll (pframes_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);
@@ -410,7 +409,7 @@ MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_pro
}
void
-MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
+MidiTrack::push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes)
{
PortSet& ports (_input->ports());
@@ -422,7 +421,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
for (MidiBuffer::const_iterator e = mb->begin(); e != mb->end(); ++e) {
- const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+ const Evoral::MIDIEvent<framepos_t> ev(*e, false);
/* note on, since for step edit, note length is determined
elsewhere
@@ -437,7 +436,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
}
void
-MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, nframes_t nframes)
+MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, framecnt_t nframes)
{
// Append immediate events
MidiBuffer& buf (bufs.get_midi (0));
@@ -454,13 +453,13 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framep
}
int
-MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, framepos_t /*end_frame*/)
+MidiTrack::export_stuff (BufferSet& /*bufs*/, framecnt_t /*nframes*/, framepos_t /*end_frame*/)
{
return -1;
}
void
-MidiTrack::set_latency_delay (nframes_t longest_session_latency)
+MidiTrack::set_latency_delay (framecnt_t longest_session_latency)
{
Route::set_latency_delay (longest_session_latency);
_diskstream->set_roll_delay (_roll_delay);
@@ -477,7 +476,7 @@ MidiTrack::bounce (InterThreadInfo& /*itt*/)
boost::shared_ptr<Region>
-MidiTrack::bounce_range (nframes_t /*start*/, nframes_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
+MidiTrack::bounce_range (framepos_t /*start*/, framepos_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
{
throw;
//vector<MidiSource*> srcs;
diff --git a/libs/ardour/mix.cc b/libs/ardour/mix.cc
index c058dec06b..3a873a8e50 100644
--- a/libs/ardour/mix.cc
+++ b/libs/ardour/mix.cc
@@ -30,7 +30,7 @@ using namespace ARDOUR;
// Debug wrappers
float
-debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
+debug_compute_peak (ARDOUR::Sample *buf, pframes_t nsamples, float current)
{
if ( ((intptr_t)buf % 16) != 0) {
std::cerr << "compute_peak(): buffer unaligned!" << std::endl;
@@ -40,7 +40,7 @@ debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
}
void
-debug_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
+debug_apply_gain_to_buffer (ARDOUR::Sample *buf, pframes_t nframes, float gain)
{
if ( ((intptr_t)buf % 16) != 0) {
std::cerr << "apply_gain_to_buffer(): buffer unaligned!" << std::endl;
@@ -50,7 +50,7 @@ debug_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain)
}
void
-debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain)
+debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, pframes_t nframes, float gain)
{
if ( ((intptr_t)dst & 15) != 0) {
std::cerr << "mix_buffers_with_gain(): dst unaligned!" << std::endl;
@@ -65,7 +65,7 @@ debug_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t
}
void
-debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes)
+debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, pframes_t nframes)
{
if ( ((intptr_t)dst & 15) != 0) {
std::cerr << "mix_buffers_no_gain(): dst unaligned!" << std::endl;
@@ -83,9 +83,9 @@ debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t n
float
-default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * buf, pframes_t nsamples, float current)
{
- for (nframes_t i = 0; i < nsamples; ++i) {
+ for (pframes_t i = 0; i < nsamples; ++i) {
current = f_max (current, fabsf (buf[i]));
}
@@ -93,9 +93,9 @@ default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float curr
}
void
-default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
+default_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
{
- nframes_t i;
+ pframes_t i;
float a, b;
a = *max;
@@ -112,24 +112,24 @@ default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, f
}
void
-default_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
+default_apply_gain_to_buffer (ARDOUR::Sample * buf, pframes_t nframes, float gain)
{
- for (nframes_t i=0; i<nframes; i++)
+ for (pframes_t i=0; i<nframes; i++)
buf[i] *= gain;
}
void
-default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
+default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes, float gain)
{
- for (nframes_t i = 0; i < nframes; i++) {
+ for (pframes_t i = 0; i < nframes; i++) {
dst[i] += src[i] * gain;
}
}
void
-default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
+default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes)
{
- for (nframes_t i=0; i < nframes; i++) {
+ for (pframes_t i=0; i < nframes; i++) {
dst[i] += src[i];
}
}
@@ -138,7 +138,7 @@ default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, n
#include <Accelerate/Accelerate.h>
float
-veclib_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
+veclib_compute_peak (const ARDOUR::Sample * buf, pframes_t nsamples, float current)
{
float tmpmax = 0.0f;
vDSP_maxmgv(buf, 1, &tmpmax, nsamples);
@@ -146,26 +146,26 @@ veclib_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float curre
}
void
-veclib_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
+veclib_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
{
vDSP_maxv (const_cast<ARDOUR::Sample*>(buf), 1, max, nframes);
vDSP_minv (const_cast<ARDOUR::Sample*>(buf), 1, min, nframes);
}
void
-veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
+veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, pframes_t nframes, float gain)
{
vDSP_vsmul(buf, 1, &gain, buf, 1, nframes);
}
void
-veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain)
+veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes, float gain)
{
vDSP_vsma(src, 1, &gain, dst, 1, dst, 1, nframes);
}
void
-veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes)
+veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pframes_t nframes)
{
// It seems that a vector mult only operation does not exist...
float gain = 1.0f;
diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc
index a164f025e8..4f204031ac 100644
--- a/libs/ardour/monitor_processor.cc
+++ b/libs/ardour/monitor_processor.cc
@@ -245,7 +245,7 @@ MonitorProcessor::state (bool full)
}
void
-MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool /*result_required*/)
+MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool /*result_required*/)
{
uint32_t chn = 0;
gain_t target_gain;
@@ -297,7 +297,7 @@ MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /
/* scale the first channel */
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (pframes_t n = 0; n < nframes; ++n) {
buf[n] *= scale;
}
@@ -307,7 +307,7 @@ MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /
for (; b != bufs.audio_end(); ++b) {
AudioBuffer& ob (*b);
Sample* obuf = ob.data ();
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (pframes_t n = 0; n < nframes; ++n) {
buf[n] += obuf[n] * scale;
}
}
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index 953b79083b..9564770f7f 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -101,7 +101,7 @@ MTC_Slave::rebind (MIDI::Port& p)
}
void
-MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, nframes_t now)
+MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, framepos_t now)
{
DEBUG_TRACE (DEBUG::MTC, string_compose ("qtr frame %1 at %2\n", which_qtr, now));
maybe_reset ();
@@ -109,7 +109,7 @@ MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, nframes_t now)
}
void
-MTC_Slave::update_mtc_time (const byte *msg, bool was_full, nframes_t now)
+MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now)
{
/* "now" can be zero if this is called from a context where we do not have or do not want
to use a timestamp indicating when this MTC time was received. example: when we received
@@ -395,7 +395,7 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
{
framepos_t now = session.engine().frame_time();
SafeTime last;
- nframes_t elapsed;
+ framecnt_t elapsed;
bool in_control = false;
read_current (&last);
@@ -450,7 +450,7 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
/* scale elapsed time by the current MTC speed */
if (last.timestamp && (now > last.timestamp)) {
- elapsed = (nframes_t) floor (last.speed * (now - last.timestamp));
+ elapsed = (framecnt_t) floor (last.speed * (now - last.timestamp));
DEBUG_TRACE (DEBUG::MTC, string_compose ("last timecode received @ %1, now = %2, elapsed frames = %3 w/speed= %4\n",
last.timestamp, now, elapsed, last.speed));
} else {
@@ -476,10 +476,10 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos)
return true;
}
-ARDOUR::nframes_t
-MTC_Slave::resolution() const
+ARDOUR::framecnt_t
+MTC_Slave::resolution () const
{
- return (nframes_t) session.frames_per_timecode_frame();
+ return (framecnt_t) session.frames_per_timecode_frame();
}
void
@@ -555,7 +555,7 @@ MTC_Slave::reset_window (framepos_t root)
case MTC_Backward:
if (session.slave_state() == Session::Running) {
- nframes_t d = session.frames_per_timecode_frame() * frame_tolerance;
+ framecnt_t const d = session.frames_per_timecode_frame() * frame_tolerance;
if (root > d) {
window_begin = root - d;
window_end = root;
@@ -563,7 +563,7 @@ MTC_Slave::reset_window (framepos_t root)
window_begin = 0;
}
} else {
- nframes_t d = seekahead_distance ();
+ framecnt_t const d = seekahead_distance ();
if (root > d) {
window_begin = root - d;
} else {
@@ -581,7 +581,7 @@ MTC_Slave::reset_window (framepos_t root)
DEBUG_TRACE (DEBUG::MTC, string_compose ("legal MTC window now %1 .. %2\n", window_begin, window_end));
}
-framecnt_t
+ARDOUR::framecnt_t
MTC_Slave::seekahead_distance () const
{
/* 1 second */
diff --git a/libs/ardour/onset_detector.cc b/libs/ardour/onset_detector.cc
index abe7df7022..4f2151a03d 100644
--- a/libs/ardour/onset_detector.cc
+++ b/libs/ardour/onset_detector.cc
@@ -56,7 +56,7 @@ OnsetDetector::use_features (Plugin::FeatureSet& features, ostream* out)
(*out) << (*f).timestamp.toString() << endl;
}
- current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
+ current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (framecnt_t) floor(sample_rate)));
}
}
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index 6bef67788a..c3f4d52a56 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -204,7 +204,7 @@ StreamPanner::get_state ()
}
void
-StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes)
+StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
{
if (_mono) {
/* we're in mono mode, so just pan the input to all outputs equally */
@@ -220,7 +220,7 @@ StreamPanner::distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff,
void
StreamPanner::distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers)
+ framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
{
if (_mono) {
/* we're in mono mode, so just pan the input to all outputs equally */
@@ -260,7 +260,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
_control->list()->clear ();
while (in.getline (line, sizeof (line), '\n')) {
- nframes_t when;
+ framepos_t when;
double value;
++linecnt;
@@ -269,7 +269,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
break;
}
- if (sscanf (line, "%" PRIu32 " %lf", &when, &value) != 2) {
+ if (sscanf (line, "%" PRIu64 " %lf", &when, &value) != 2) {
warning << string_compose(_("badly formatted pan automation event record at line %1 of %2 (ignored) [%3]"), linecnt, path, line) << endmsg;
continue;
}
@@ -285,7 +285,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
}
void
-BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes)
+BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes)
{
assert(obufs.count().n_audio() == 2);
@@ -308,8 +308,8 @@ BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t g
/* we've moving the pan by an appreciable amount, so we must
interpolate over 64 frames or nframes, whichever is smaller */
- nframes_t const limit = min ((nframes_t)64, nframes);
- nframes_t n;
+ pframes_t const limit = min ((pframes_t) 64, nframes);
+ pframes_t n;
delta = -(delta / (float) (limit));
@@ -365,8 +365,8 @@ BaseStereoPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t g
/* we're moving the pan by an appreciable amount, so we must
interpolate over 64 frames or nframes, whichever is smaller */
- nframes_t const limit = min ((nframes_t)64, nframes);
- nframes_t n;
+ pframes_t const limit = min ((pframes_t) 64, nframes);
+ pframes_t n;
delta = -(delta / (float) (limit));
@@ -460,7 +460,7 @@ EqualPowerStereoPanner::update ()
void
EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes,
+ framepos_t start, framepos_t end, pframes_t nframes,
pan_t** buffers)
{
assert (obufs.count().n_audio() == 2);
@@ -496,7 +496,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
const float pan_law_attenuation = -3.0f;
const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (pframes_t n = 0; n < nframes; ++n) {
float const panR = buffers[0][n];
float const panL = 1 - panR;
@@ -510,7 +510,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
dst = obufs.get_audio(0).data();
pbuf = buffers[0];
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (pframes_t n = 0; n < nframes; ++n) {
dst[n] += src[n] * pbuf[n];
}
@@ -521,7 +521,7 @@ EqualPowerStereoPanner::do_distribute_automated (AudioBuffer& srcbuf, BufferSet&
dst = obufs.get_audio(1).data();
pbuf = buffers[1];
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (pframes_t n = 0; n < nframes; ++n) {
dst[n] += src[n] * pbuf[n];
}
@@ -1120,7 +1120,7 @@ Panner::set_position (const AngularVector& a, StreamPanner& orig)
}
void
-Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes_t nframes, gain_t gain_coeff)
+Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, pframes_t nframes, gain_t gain_coeff)
{
if (outbufs.count().n_audio() == 0) {
// Don't want to lose audio...
@@ -1191,7 +1191,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
}
void
-Panner::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes)
+Panner::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
{
if (outbufs.count().n_audio() == 0) {
// Failing to deliver audio we were asked to deliver is a bug
diff --git a/libs/ardour/playlist_factory.cc b/libs/ardour/playlist_factory.cc
index 00996a059d..f7556cc961 100644
--- a/libs/ardour/playlist_factory.cc
+++ b/libs/ardour/playlist_factory.cc
@@ -94,7 +94,7 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, boo
}
boost::shared_ptr<Playlist>
-PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden)
+PlaylistFactory::create (boost::shared_ptr<const Playlist> old, framepos_t start, framecnt_t cnt, string name, bool hidden)
{
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<const AudioPlaylist> apl;
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index c852d6b2a9..ecaca5cc50 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -223,7 +223,7 @@ PluginInsert::parameter_changed (Evoral::Parameter which, float val)
}
int
-PluginInsert::set_block_size (nframes_t nframes)
+PluginInsert::set_block_size (pframes_t nframes)
{
int ret = 0;
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
@@ -263,11 +263,11 @@ PluginInsert::flush ()
}
void
-PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now)
+PluginInsert::connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now)
{
// Calculate if, and how many frames we need to collect for analysis
- nframes_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
- _signal_analysis_collected_nframes);
+ framecnt_t collect_signal_nframes = (_signal_analysis_collect_nframes_max -
+ _signal_analysis_collected_nframes);
if (nframes < collect_signal_nframes) { // we might not get all frames now
collect_signal_nframes = nframes;
}
@@ -355,7 +355,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
}
void
-PluginInsert::silence (nframes_t nframes)
+PluginInsert::silence (framecnt_t nframes)
{
ChanMapping in_map(input_streams());
ChanMapping out_map(output_streams());
@@ -368,7 +368,7 @@ PluginInsert::silence (nframes_t nframes)
}
void
-PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t nframes, bool)
+PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
{
if (_pending_active) {
/* run as normal if we are active or moving from inactive to active */
@@ -437,12 +437,12 @@ PluginInsert::get_parameter (Evoral::Parameter param)
}
void
-PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
+PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
{
Evoral::ControlEvent next_event (0, 0.0f);
- nframes_t now = _session.transport_frame ();
- nframes_t end = now + nframes;
- nframes_t offset = 0;
+ framepos_t now = _session.transport_frame ();
+ framepos_t end = now + nframes;
+ framecnt_t offset = 0;
Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
@@ -461,7 +461,7 @@ PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
while (nframes) {
- nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
+ framecnt_t cnt = min (((framecnt_t) ceil (next_event.when) - now), (framecnt_t) nframes);
connect_and_run (bufs, cnt, offset, true, now);
@@ -922,7 +922,7 @@ PluginInsert::describe_parameter (Evoral::Parameter param)
return _plugins[0]->describe_parameter (param);
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
PluginInsert::signal_latency() const
{
if (_user_latency) {
@@ -1040,7 +1040,7 @@ PluginInsert::get_impulse_analysis_plugin()
}
void
-PluginInsert::collect_signal_for_analysis(nframes_t nframes)
+PluginInsert::collect_signal_for_analysis (framecnt_t nframes)
{
// called from outside the audio thread, so this should be safe
// only do audio as analysis is (currently) only for audio plugins
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index ab38285f0c..fe234c593f 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -34,7 +34,7 @@ using namespace std;
using namespace ARDOUR;
AudioEngine* Port::_engine = 0;
-nframes_t Port::_buffer_size = 0;
+pframes_t Port::_buffer_size = 0;
bool Port::_connecting_blocked = false;
/** @param n Port short name */
@@ -220,7 +220,7 @@ Port::recompute_total_latency () const
#endif
}
-nframes_t
+framecnt_t
Port::total_latency () const
{
jack_client_t* jack = _engine->jack();
@@ -293,7 +293,7 @@ Port::request_monitor_input (bool yn)
}
void
-Port::set_latency (nframes_t n)
+Port::set_latency (framecnt_t n)
{
jack_port_set_latency (_jack_port, n);
}
diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc
index 4854c08d8b..b738c68de8 100644
--- a/libs/ardour/port_insert.cc
+++ b/libs/ardour/port_insert.cc
@@ -78,12 +78,12 @@ PortInsert::stop_latency_detection ()
}
void
-PortInsert::set_measured_latency (nframes_t n)
+PortInsert::set_measured_latency (framecnt_t n)
{
_measured_latency = n;
}
-nframes_t
+framecnt_t
PortInsert::latency() const
{
/* because we deliver and collect within the same cycle,
@@ -101,7 +101,7 @@ PortInsert::latency() const
}
void
-PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
{
if (_output->n_ports().n_total() == 0) {
return;
@@ -166,7 +166,7 @@ PortInsert::state (bool full)
node.add_property ("type", "port");
snprintf (buf, sizeof (buf), "%" PRIu32, bitslot);
node.add_property ("bitslot", buf);
- snprintf (buf, sizeof (buf), "%u", _measured_latency);
+ snprintf (buf, sizeof (buf), "%" PRId64, _measured_latency);
node.add_property("latency", buf);
snprintf (buf, sizeof (buf), "%u", _session.get_block_size());
node.add_property("block_size", buf);
@@ -227,7 +227,7 @@ PortInsert::set_state (const XMLNode& node, int version)
return 0;
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
PortInsert::signal_latency() const
{
/* because we deliver and collect within the same cycle,
diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc
index e31cebe602..805782807a 100644
--- a/libs/ardour/rb_effect.cc
+++ b/libs/ardour/rb_effect.cc
@@ -70,16 +70,16 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
}
SourceList nsrcs;
- nframes_t done;
+ framecnt_t done;
int ret = -1;
- const nframes_t bufsize = 256;
+ const framecnt_t bufsize = 256;
gain_t* gain_buffer = 0;
Sample** buffers = 0;
char suffix[32];
string new_name;
string::size_type at;
- nframes_t pos = 0;
- int avail = 0;
+ framepos_t pos = 0;
+ framecnt_t avail = 0;
boost::shared_ptr<AudioRegion> result;
cerr << "RBEffect: source region: position = " << region->position()
@@ -148,11 +148,11 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
double stretch = region->stretch() * tsr.time_fraction;
double shift = region->shift() * tsr.pitch_fraction;
- nframes_t read_start = region->ancestral_start() +
- nframes_t(region->start() / (double)region->stretch());
+ framecnt_t read_start = region->ancestral_start() +
+ framecnt_t(region->start() / (double)region->stretch());
- nframes_t read_duration =
- nframes_t(region->length() / (double)region->stretch());
+ framecnt_t read_duration =
+ framecnt_t(region->length() / (double)region->stretch());
uint32_t channels = region->n_channels();
@@ -206,16 +206,16 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
try {
while (pos < read_duration && !tsr.cancel) {
- nframes_t this_read = 0;
+ framecnt_t this_read = 0;
for (uint32_t i = 0; i < channels; ++i) {
this_read = 0;
- nframes_t this_time;
+ framepos_t this_time;
this_time = min(bufsize, read_duration - pos);
- nframes_t this_position;
+ framepos_t this_position;
this_position = read_start + pos -
region->start() + region->position();
@@ -248,15 +248,15 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
while (pos < read_duration && !tsr.cancel) {
- nframes_t this_read = 0;
+ framecnt_t this_read = 0;
for (uint32_t i = 0; i < channels; ++i) {
this_read = 0;
- nframes_t this_time;
+ framepos_t this_time;
this_time = min(bufsize, read_duration - pos);
- nframes_t this_position;
+ framepos_t this_position;
this_position = read_start + pos -
region->start() + region->position();
@@ -283,11 +283,11 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
stretcher.process(buffers, this_read, pos == read_duration);
- int avail = 0;
+ framecnt_t avail = 0;
while ((avail = stretcher.available()) > 0) {
- this_read = min(bufsize, uint32_t(avail));
+ this_read = min (bufsize, avail);
stretcher.retrieve(buffers, this_read);
@@ -308,7 +308,7 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress*)
while ((avail = stretcher.available()) >= 0) {
- uint32_t this_read = min(bufsize, uint32_t(avail));
+ framecnt_t this_read = min (bufsize, avail);
stretcher.retrieve(buffers, this_read);
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 33338e52ea..09c2552c48 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -774,26 +774,26 @@ Region::trim_front (framepos_t new_position, void *src)
}
void
-Region::cut_front (nframes_t new_position, void *src)
+Region::cut_front (framepos_t new_position, void *src)
{
modify_front (new_position, true, src);
}
void
-Region::cut_end (nframes_t new_endpoint, void *src)
+Region::cut_end (framepos_t new_endpoint, void *src)
{
modify_end (new_endpoint, true, src);
}
void
-Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
+Region::modify_front (framepos_t new_position, bool reset_fade, void *src)
{
if (locked()) {
return;
}
- nframes_t end = last_frame();
- nframes_t source_zero;
+ framepos_t end = last_frame();
+ framepos_t source_zero;
if (_position > _start) {
source_zero = _position - _start;
@@ -803,7 +803,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;
+ framecnt_t newlen = 0;
framepos_t delta = 0;
/* can't trim it back passed where source position zero is located */
@@ -835,7 +835,7 @@ Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
}
void
-Region::modify_end (nframes_t new_endpoint, bool reset_fade, void* /*src*/)
+Region::modify_end (framepos_t new_endpoint, bool reset_fade, void* /*src*/)
{
if (locked()) {
return;
@@ -1045,7 +1045,7 @@ Region::clear_sync_position ()
}
/* @return the sync point relative the first frame of the region */
-framepos_t
+frameoffset_t
Region::sync_offset (int& dir) const
{
if (sync_marked()) {
diff --git a/libs/ardour/resampled_source.cc b/libs/ardour/resampled_source.cc
index 7379aa74af..1d60281565 100644
--- a/libs/ardour/resampled_source.cc
+++ b/libs/ardour/resampled_source.cc
@@ -28,7 +28,7 @@ using namespace PBD;
const uint32_t ResampledImportableSource::blocksize = 16384U;
-ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<ImportableSource> src, nframes_t rate, SrcQuality srcq)
+ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<ImportableSource> src, framecnt_t rate, SrcQuality srcq)
: source (src)
, src_state (0)
{
@@ -65,8 +65,8 @@ ResampledImportableSource::~ResampledImportableSource ()
delete [] input;
}
-nframes_t
-ResampledImportableSource::read (Sample* output, nframes_t nframes)
+framecnt_t
+ResampledImportableSource::read (Sample* output, framecnt_t nframes)
{
int err;
@@ -78,7 +78,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
/* The last read will not be a full buffer, so set end_of_input. */
- if ((nframes_t) src_data.input_frames < blocksize) {
+ if ((framecnt_t) src_data.input_frames < blocksize) {
src_data.end_of_input = true;
}
@@ -91,7 +91,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
if (!src_data.end_of_input) {
src_data.output_frames = nframes / source->channels();
} else {
- src_data.output_frames = std::min ((nframes_t) src_data.input_frames, nframes / source->channels());
+ src_data.output_frames = std::min ((framecnt_t) src_data.input_frames, nframes / source->channels());
}
if ((err = src_process (src_state, &src_data))) {
@@ -112,7 +112,7 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
}
void
-ResampledImportableSource::seek (nframes_t pos)
+ResampledImportableSource::seek (framepos_t pos)
{
source->seek (pos);
diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc
index d8c8dd22f8..e64db79c86 100644
--- a/libs/ardour/return.cc
+++ b/libs/ardour/return.cc
@@ -103,7 +103,7 @@ Return::set_state (const XMLNode& node, int version)
}
void
-Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
{
if ((!_active && !_pending_active) || _input->n_ports() == ChanCount::ZERO) {
return;
diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc
index 9fcfb8c1b1..45d7c83051 100644
--- a/libs/ardour/reverse.cc
+++ b/libs/ardour/reverse.cc
@@ -90,7 +90,7 @@ Reverse::run (boost::shared_ptr<Region> r, Progress*)
/* swap memory order */
- for (nframes_t i = 0; i < to_read/2; ++i) {
+ for (framecnt_t i = 0; i < to_read/2; ++i) {
swap (buf[i],buf[to_read-1-i]);
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 1e0edc2077..3577d3a659 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -382,7 +382,7 @@ Route::set_gain (gain_t val, void *src)
*/
void
Route::process_output_buffers (BufferSet& bufs,
- framepos_t start_frame, framepos_t end_frame, nframes_t nframes,
+ framepos_t start_frame, framepos_t end_frame, pframes_t nframes,
bool /*with_processors*/, int declick)
{
bool monitor;
@@ -436,12 +436,12 @@ Route::process_output_buffers (BufferSet& bufs,
Sample* const sp = i->data();
if (_phase_invert[chn]) {
- for (nframes_t nx = 0; nx < nframes; ++nx) {
+ for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] = -sp[nx];
sp[nx] += 1.0e-27f;
}
} else {
- for (nframes_t nx = 0; nx < nframes; ++nx) {
+ for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] += 1.0e-27f;
}
}
@@ -453,7 +453,7 @@ Route::process_output_buffers (BufferSet& bufs,
Sample* const sp = i->data();
if (_phase_invert[chn]) {
- for (nframes_t nx = 0; nx < nframes; ++nx) {
+ for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] = -sp[nx];
}
}
@@ -466,7 +466,7 @@ Route::process_output_buffers (BufferSet& bufs,
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
Sample* const sp = i->data();
- for (nframes_t nx = 0; nx < nframes; ++nx) {
+ for (pframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] += 1.0e-27f;
}
}
@@ -507,7 +507,7 @@ Route::n_process_buffers ()
}
void
-Route::passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick)
+Route::passthru (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
{
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
@@ -547,7 +547,7 @@ Route::passthru (framepos_t start_frame, framepos_t end_frame, nframes_t nframes
}
void
-Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, nframes_t nframes, int declick)
+Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
{
BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
bufs.set_count (_input->n_ports());
@@ -2417,7 +2417,7 @@ Route::curve_reallocate ()
}
void
-Route::silence (nframes_t nframes)
+Route::silence (framecnt_t nframes)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (!lm.locked()) {
@@ -2428,7 +2428,7 @@ Route::silence (nframes_t nframes)
}
void
-Route::silence_unlocked (nframes_t nframes)
+Route::silence_unlocked (framecnt_t nframes)
{
/* Must be called with the processor lock held */
@@ -2774,7 +2774,7 @@ Route::pans_required () const
}
int
-Route::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Route::no_roll (pframes_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);
@@ -2811,8 +2811,8 @@ Route::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
return 0;
}
-nframes_t
-Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame)
+framecnt_t
+Route::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame)
{
if (_roll_delay > nframes) {
@@ -2839,7 +2839,7 @@ Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame)
}
int
-Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+Route::roll (pframes_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);
@@ -2858,7 +2858,7 @@ Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
return 0;
}
- nframes_t unused = 0;
+ framecnt_t unused = 0;
if ((nframes = check_initial_delay (nframes, unused)) == 0) {
return 0;
@@ -2872,7 +2872,7 @@ Route::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
}
int
-Route::silent_roll (nframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
+Route::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
{
silence (nframes);
@@ -3041,11 +3041,11 @@ Route::put_monitor_send_at (Placement p)
_session.set_dirty ();
}
-nframes_t
+framecnt_t
Route::update_total_latency ()
{
- nframes_t old = _output->effective_latency();
- nframes_t own_latency = _output->user_latency();
+ framecnt_t old = _output->effective_latency();
+ framecnt_t own_latency = _output->user_latency();
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->active ()) {
@@ -3080,16 +3080,16 @@ Route::update_total_latency ()
}
void
-Route::set_user_latency (nframes_t nframes)
+Route::set_user_latency (framecnt_t nframes)
{
_output->set_user_latency (nframes);
_session.update_latency_compensation (false, false);
}
void
-Route::set_latency_delay (nframes_t longest_session_latency)
+Route::set_latency_delay (framecnt_t longest_session_latency)
{
- nframes_t old = _initial_delay;
+ framecnt_t old = _initial_delay;
if (_output->effective_latency() < longest_session_latency) {
_initial_delay = longest_session_latency - _output->effective_latency();
@@ -3107,7 +3107,7 @@ Route::set_latency_delay (nframes_t longest_session_latency)
}
void
-Route::automation_snapshot (nframes_t now, bool force)
+Route::automation_snapshot (framepos_t now, bool force)
{
panner()->automation_snapshot (now, force);
@@ -3186,7 +3186,7 @@ Route::MuteControllable::get_value (void) const
}
void
-Route::set_block_size (nframes_t nframes)
+Route::set_block_size (pframes_t nframes)
{
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->set_block_size (nframes);
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index 74212155ec..9e34080fe0 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -71,7 +71,7 @@ Send::deactivate ()
}
void
-Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool)
+Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
{
if (_output->n_ports() == ChanCount::ZERO) {
_meter->reset ();
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 5abaaf3508..690fbc5e9a 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -115,7 +115,7 @@ bool Session::_disable_all_loaded_plugins = false;
PBD::Signal1<void,std::string> Session::Dialog;
PBD::Signal0<int> Session::AskAboutPendingState;
-PBD::Signal2<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
+PBD::Signal2<int, framecnt_t, framecnt_t> Session::AskAboutSampleRateMismatch;
PBD::Signal0<void> Session::SendFeedback;
PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
@@ -826,7 +826,7 @@ Session::auto_punch_start_changed (Location* location)
void
Session::auto_punch_end_changed (Location* location)
{
- nframes_t when_to_stop = location->end();
+ framepos_t when_to_stop = location->end();
// when_to_stop += _worst_output_latency + _worst_input_latency;
replace_event (SessionEvent::PunchOut, when_to_stop);
}
@@ -834,7 +834,7 @@ Session::auto_punch_end_changed (Location* location)
void
Session::auto_punch_changed (Location* location)
{
- nframes_t when_to_stop = location->end();
+ framepos_t when_to_stop = location->end();
replace_event (SessionEvent::PunchIn, location->start());
//when_to_stop += _worst_output_latency + _worst_input_latency;
@@ -1122,7 +1122,7 @@ Session::audible_frame () const
{
framepos_t ret;
framepos_t tf;
- nframes_t offset;
+ framecnt_t offset;
/* the first of these two possible settings for "offset"
mean that the audible frame is stationary until
@@ -1197,9 +1197,9 @@ Session::audible_frame () const
}
void
-Session::set_frame_rate (nframes_t frames_per_second)
+Session::set_frame_rate (framecnt_t frames_per_second)
{
- /** \fn void Session::set_frame_size(nframes_t)
+ /** \fn void Session::set_frame_size(framecnt_t)
the AudioEngine object that calls this guarantees
that it will not be called while we are also in
::process(). Its fine to do things that block
@@ -1210,7 +1210,7 @@ Session::set_frame_rate (nframes_t frames_per_second)
sync_time_vars();
- Automatable::set_automation_interval ((jack_nframes_t) ceil ((double) frames_per_second * (0.001 * Config->get_automation_interval())));
+ Automatable::set_automation_interval (ceil ((double) frames_per_second * (0.001 * Config->get_automation_interval())));
clear_clicks ();
@@ -1223,7 +1223,7 @@ Session::set_frame_rate (nframes_t frames_per_second)
}
void
-Session::set_block_size (nframes_t nframes)
+Session::set_block_size (pframes_t nframes)
{
/* the AudioEngine guarantees
that it will not be called while we are also in
@@ -1258,7 +1258,7 @@ void
Session::set_default_fade (float /*steepness*/, float /*fade_msecs*/)
{
#if 0
- nframes_t fade_frames;
+ framecnt_t fade_frames;
/* Don't allow fade of less 1 frame */
@@ -1269,7 +1269,7 @@ Session::set_default_fade (float /*steepness*/, float /*fade_msecs*/)
} else {
- fade_frames = (nframes_t) floor (fade_msecs * _current_frame_rate * 0.001);
+ fade_frames = (framecnt_t) floor (fade_msecs * _current_frame_rate * 0.001);
}
@@ -4029,7 +4029,7 @@ Session::current_end_frame () const
}
void
-Session::add_session_range_location (nframes_t start, nframes_t end)
+Session::add_session_range_location (framepos_t start, framepos_t end)
{
_session_range_location = new Location (*this, start, end, _("session"), Location::IsSessionRange);
_locations->add (_session_range_location);
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index 363c5911b8..0a83a0f6d9 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -38,7 +38,7 @@ using namespace PBD;
Pool Click::pool ("click", sizeof (Click), 128);
void
-Session::click (nframes_t start, nframes_t nframes)
+Session::click (framepos_t start, framecnt_t nframes)
{
TempoMap::BBTPointList *points;
Sample *buf;
@@ -54,7 +54,7 @@ Session::click (nframes_t start, nframes_t nframes)
return;
}
- const nframes_t end = start + nframes;
+ const framepos_t end = start + nframes;
BufferSet& bufs = get_scratch_buffers(ChanCount(DataType::AUDIO, 1));
buf = bufs.get_audio(0).data();
@@ -90,8 +90,8 @@ Session::click (nframes_t start, nframes_t nframes)
for (list<Click*>::iterator i = clicks.begin(); i != clicks.end(); ) {
- nframes_t copy;
- nframes_t internal_offset;
+ framecnt_t copy;
+ framecnt_t internal_offset;
Click *clk;
list<Click*>::iterator next;
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index 75c8fd0dd7..2c4d8a1a22 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -96,7 +96,7 @@ Session::pre_export ()
}
int
-Session::start_audio_export (nframes_t position, bool /* realtime */)
+Session::start_audio_export (framepos_t position, bool /* realtime */)
{
if (!_exporting) {
pre_export ();
@@ -149,7 +149,7 @@ Session::start_audio_export (nframes_t position, bool /* realtime */)
}
void
-Session::process_export (nframes_t nframes)
+Session::process_export (pframes_t nframes)
{
if (_export_rolling && export_status->stop) {
stop_audio_export ();
@@ -178,7 +178,7 @@ Session::process_export (nframes_t nframes)
}
int
-Session::process_export_fw (nframes_t nframes)
+Session::process_export_fw (pframes_t nframes)
{
_engine.main_thread()->get_buffers ();
process_export (nframes);
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 6914b9db94..ee43a7263a 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -90,7 +90,7 @@ Session::setup_midi_control ()
}
void
-Session::spp_start (Parser &, nframes_t /*timestamp*/)
+Session::spp_start (Parser &, framepos_t /*timestamp*/)
{
if (Config->get_mmc_control() && (!config.get_external_sync() || config.get_sync_source() != JACK)) {
request_transport_speed (1.0);
@@ -98,13 +98,13 @@ Session::spp_start (Parser &, nframes_t /*timestamp*/)
}
void
-Session::spp_continue (Parser& ignored, nframes_t timestamp)
+Session::spp_continue (Parser& ignored, framepos_t timestamp)
{
spp_start (ignored, timestamp);
}
void
-Session::spp_stop (Parser&, nframes_t /*timestamp*/)
+Session::spp_stop (Parser&, framepos_t /*timestamp*/)
{
if (Config->get_mmc_control()) {
request_stop ();
@@ -373,7 +373,7 @@ Session::send_full_time_code (framepos_t const t)
if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {
// start MTC quarter frame transmission on an even frame
Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
- outbound_mtc_timecode_frame += (nframes_t) _frames_per_timecode_frame;
+ outbound_mtc_timecode_frame += _frames_per_timecode_frame;
}
// Compensate for audio latency
@@ -410,7 +410,7 @@ Session::send_full_time_code (framepos_t const t)
* earlier already this cycle by send_full_time_code)
*/
int
-Session::send_midi_time_code_for_cycle(nframes_t nframes)
+Session::send_midi_time_code_for_cycle (pframes_t nframes)
{
if (_slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
// cerr << "(MTC) Not sending MTC\n";
@@ -421,7 +421,7 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
assert (next_quarter_frame_to_send <= 7);
/* Duration of one quarter frame */
- nframes_t quarter_frame_duration = ((nframes_t) _frames_per_timecode_frame) >> 2;
+ framecnt_t quarter_frame_duration = ((framecnt_t) _frames_per_timecode_frame) >> 2;
DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 NQ %3 FD %4\n", _transport_frame, outbound_mtc_timecode_frame,
next_quarter_frame_to_send, quarter_frame_duration));
@@ -463,14 +463,14 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
break;
}
- const nframes_t msg_time = (outbound_mtc_timecode_frame
+ const framepos_t msg_time = (outbound_mtc_timecode_frame
+ (quarter_frame_duration * next_quarter_frame_to_send));
// This message must fall within this block or something is broken
assert(msg_time >= _transport_frame);
assert(msg_time < _transport_frame + nframes);
- nframes_t out_stamp = msg_time - _transport_frame;
+ framepos_t out_stamp = msg_time - _transport_frame;
assert(out_stamp < nframes);
if (MIDI::Manager::instance()->mtc_output_port()->midimsg (mtc_msg, 2, out_stamp)) {
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 7f88642b12..fe85109869 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -52,7 +52,7 @@ using namespace std;
* @param nframes Number of frames to process.
*/
void
-Session::process (nframes_t nframes)
+Session::process (pframes_t nframes)
{
MIDI::Manager::instance()->cycle_start(nframes);
@@ -76,8 +76,8 @@ Session::process (nframes_t nframes)
_engine.main_thread()->drop_buffers ();
// the ticker is for sending time information like MidiClock
- nframes_t transport_frames = transport_frame();
- BBT_Time transport_bbt;
+ framepos_t transport_frames = transport_frame();
+ BBT_Time transport_bbt;
bbt_time(transport_frames, transport_bbt);
Timecode::Time transport_timecode;
timecode_time(transport_frames, transport_timecode);
@@ -89,15 +89,15 @@ Session::process (nframes_t nframes)
}
int
-Session::fail_roll (nframes_t nframes)
+Session::fail_roll (pframes_t nframes)
{
return no_roll (nframes);
}
int
-Session::no_roll (nframes_t nframes)
+Session::no_roll (pframes_t nframes)
{
- nframes_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
+ framepos_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
int ret = 0;
bool declick = get_transport_declick_required();
boost::shared_ptr<RouteList> r = routes.reader ();
@@ -130,7 +130,7 @@ Session::no_roll (nframes_t nframes)
}
int
-Session::process_routes (nframes_t nframes, bool& need_butler)
+Session::process_routes (pframes_t nframes, bool& need_butler)
{
bool record_active;
int declick = get_transport_declick_required();
@@ -144,8 +144,8 @@ Session::process_routes (nframes_t nframes, bool& need_butler)
record_active = actively_recording(); // || (get_record_enabled() && get_punch_in());
- const nframes_t start_frame = _transport_frame;
- const nframes_t end_frame = _transport_frame + (nframes_t)floor(nframes * _transport_speed);
+ const framepos_t start_frame = _transport_frame;
+ const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
DEBUG_TRACE(DEBUG::Graph,"calling graph/process-routes\n");
route_graph->process_routes( nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler);
@@ -170,7 +170,7 @@ Session::process_routes (nframes_t nframes, bool& need_butler)
}
int
-Session::silent_process_routes (nframes_t nframes, bool& need_butler)
+Session::silent_process_routes (pframes_t nframes, bool& need_butler)
{
bool record_active = actively_recording();
int declick = get_transport_declick_required();
@@ -182,8 +182,8 @@ Session::silent_process_routes (nframes_t nframes, bool& need_butler)
declick = -1;
}
- const nframes_t start_frame = _transport_frame;
- const nframes_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
+ const framepos_t start_frame = _transport_frame;
+ const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
route_graph->silent_process_routes( nframes, start_frame, end_frame, record_active, rec_monitors, need_butler);
/*
@@ -233,10 +233,10 @@ Session::get_track_statistics ()
/** Process callback used when the auditioner is not active */
void
-Session::process_with_events (nframes_t nframes)
+Session::process_with_events (pframes_t nframes)
{
SessionEvent* ev;
- nframes_t this_nframes;
+ pframes_t this_nframes;
framepos_t end_frame;
bool session_needs_butler = false;
framepos_t stop_limit;
@@ -291,7 +291,7 @@ Session::process_with_events (nframes_t nframes)
frames_moved = (framecnt_t) interpolation.interpolate (0, nframes, 0, 0);
}
- end_frame = _transport_frame + (nframes_t)frames_moved;
+ end_frame = _transport_frame + frames_moved;
{
SessionEvent* this_event;
@@ -350,7 +350,7 @@ Session::process_with_events (nframes_t nframes)
if (this_event && this_event->action_frame <= end_frame && this_event->action_frame >= _transport_frame) {
/* this isn't quite right for reverse play */
frames_moved = (framecnt_t) (this_event->action_frame - _transport_frame);
- this_nframes = (nframes_t) abs( floor(frames_moved / _transport_speed) );
+ this_nframes = abs (floor(frames_moved / _transport_speed));
}
if (this_nframes) {
@@ -399,7 +399,7 @@ Session::process_with_events (nframes_t nframes)
}
/* this is necessary to handle the case of seamless looping */
- end_frame = _transport_frame + (nframes_t) floor (nframes * _transport_speed);
+ end_frame = _transport_frame + floor (nframes * _transport_speed);
}
@@ -434,11 +434,11 @@ Session::transport_locked () const
}
bool
-Session::follow_slave (nframes_t nframes)
+Session::follow_slave (pframes_t nframes)
{
double slave_speed;
framepos_t slave_transport_frame;
- nframes_t this_delta;
+ framecnt_t this_delta;
int dir;
if (!_slave->ok()) {
@@ -538,7 +538,7 @@ Session::follow_slave (nframes_t nframes)
}
#if 1
- if ((nframes_t) abs(average_slave_delta) > _slave->resolution()) {
+ if ((framecnt_t) abs(average_slave_delta) > _slave->resolution()) {
cerr << "average slave delta greater than slave resolution (" << _slave->resolution() << "), going to silent motion\n";
goto silent_motion;
}
@@ -564,7 +564,7 @@ Session::follow_slave (nframes_t nframes)
}
void
-Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
+Session::calculate_moving_average_of_slave_delta (int dir, framecnt_t this_delta)
{
if (delta_accumulator_cnt >= delta_accumulator_size) {
have_first_delta_accumulator = true;
@@ -572,7 +572,7 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
}
if (delta_accumulator_cnt != 0 || this_delta < _current_frame_rate) {
- delta_accumulator[delta_accumulator_cnt++] = (nframes_t) dir * (nframes_t) this_delta;
+ delta_accumulator[delta_accumulator_cnt++] = (framecnt_t) dir * (framecnt_t) this_delta;
}
if (have_first_delta_accumulator) {
@@ -591,7 +591,7 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
}
void
-Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame, nframes_t this_delta)
+Session::track_slave_state (float slave_speed, framepos_t slave_transport_frame, framecnt_t this_delta)
{
if (slave_speed != 0.0f) {
@@ -644,7 +644,7 @@ Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame,
bool ok = true;
- nframes_t frame_delta = slave_transport_frame - _transport_frame;
+ framecnt_t frame_delta = slave_transport_frame - _transport_frame;
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
@@ -699,7 +699,7 @@ Session::track_slave_state (float slave_speed, nframes_t slave_transport_frame,
}
void
-Session::follow_slave_silently (nframes_t nframes, float slave_speed)
+Session::follow_slave_silently (pframes_t nframes, float slave_speed)
{
if (slave_speed && _transport_speed) {
@@ -742,7 +742,7 @@ Session::follow_slave_silently (nframes_t nframes, float slave_speed)
}
void
-Session::process_without_events (nframes_t nframes)
+Session::process_without_events (pframes_t nframes)
{
bool session_needs_butler = false;
framepos_t stop_limit;
@@ -822,7 +822,7 @@ Session::process_without_events (nframes_t nframes)
* @param nframes number of frames to process.
*/
void
-Session::process_audition (nframes_t nframes)
+Session::process_audition (pframes_t nframes)
{
SessionEvent* ev;
boost::shared_ptr<RouteList> r = routes.reader ();
@@ -869,9 +869,9 @@ Session::process_audition (nframes_t nframes)
}
bool
-Session::maybe_sync_start (nframes_t& nframes)
+Session::maybe_sync_start (pframes_t & nframes)
{
- nframes_t sync_offset;
+ pframes_t sync_offset;
if (!waiting_for_sync_offset) {
return false;
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index dea341bf15..b67de14d07 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -225,7 +225,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
/* default short fade = 15ms */
- Crossfade::set_short_xfade_length ((nframes_t) floor (config.get_short_xfade_seconds() * frame_rate()));
+ Crossfade::set_short_xfade_length ((framecnt_t) floor (config.get_short_xfade_seconds() * frame_rate()));
SndFileSource::setup_standard_crossfades (*this, frame_rate());
last_mmc_step.tv_sec = 0;
@@ -1017,7 +1017,7 @@ Session::state(bool full_state)
if (full_state) {
node->add_property ("name", _name);
- snprintf (buf, sizeof (buf), "%" PRId32, _nominal_frame_rate);
+ snprintf (buf, sizeof (buf), "%" PRId64, _nominal_frame_rate);
node->add_property ("sample-rate", buf);
if (session_dirs.size() > 1) {
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index e33fe3a9fb..b5137e0d6a 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -47,7 +47,7 @@ using namespace PBD;
/* BBT TIME*/
void
-Session::bbt_time (nframes_t when, BBT_Time& bbt)
+Session::bbt_time (framepos_t when, BBT_Time& bbt)
{
_tempo_map->bbt_time (when, bbt);
}
@@ -155,14 +155,14 @@ Session::timecode_drop_frames() const
void
Session::sync_time_vars ()
{
- _current_frame_rate = (nframes_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
+ _current_frame_rate = (framecnt_t) round (_base_frame_rate * (1.0 + (config.get_video_pullup()/100.0)));
_frames_per_timecode_frame = (double) _current_frame_rate / (double) timecode_frames_per_second();
if (timecode_drop_frames()) {
_frames_per_hour = (int32_t)(107892 * _frames_per_timecode_frame);
} else {
_frames_per_hour = (int32_t)(3600 * rint(timecode_frames_per_second()) * _frames_per_timecode_frame);
}
- _timecode_frames_per_hour = (nframes_t)rint(timecode_frames_per_second() * 3600.0);
+ _timecode_frames_per_hour = rint(timecode_frames_per_second() * 3600.0);
last_timecode_valid = false;
// timecode type bits are the middle two in the upper nibble
@@ -231,13 +231,13 @@ Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool
// Per Sigmond <per@sigmond.no>
// Samples inside time dividable by 10 minutes (real time accurate)
- nframes_t base_samples = (nframes_t) (((timecode.hours * 107892) + ((timecode.minutes / 10) * 17982)) * _frames_per_timecode_frame);
+ framecnt_t base_samples = (framecnt_t) (((timecode.hours * 107892) + ((timecode.minutes / 10) * 17982)) * _frames_per_timecode_frame);
// Samples inside time exceeding the nearest 10 minutes (always offset, see above)
int32_t exceeding_df_minutes = timecode.minutes % 10;
int32_t exceeding_df_seconds = (exceeding_df_minutes * 60) + timecode.seconds;
int32_t exceeding_df_frames = (30 * exceeding_df_seconds) + timecode.frames - (2 * exceeding_df_minutes);
- nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_timecode_frame);
+ framecnt_t exceeding_samples = (framecnt_t) rint(exceeding_df_frames * _frames_per_timecode_frame);
sample = base_samples + exceeding_samples;
} else {
/*
@@ -247,7 +247,7 @@ Session::timecode_to_sample( Timecode::Time& timecode, framepos_t& sample, bool
frame_rate() in the non-integer Timecode rate case.
*/
- sample = (nframes_t)rint((((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds) * (rint(timecode.rate) * _frames_per_timecode_frame)) + (timecode.frames * _frames_per_timecode_frame));
+ sample = (framecnt_t)rint((((timecode.hours * 60 * 60) + (timecode.minutes * 60) + timecode.seconds) * (rint(timecode.rate) * _frames_per_timecode_frame)) + (timecode.frames * _frames_per_timecode_frame));
}
if (use_subframes) {
@@ -376,7 +376,7 @@ Session::sample_to_timecode (framepos_t sample, Timecode::Time& timecode, bool u
}
void
-Session::timecode_time (nframes_t when, Timecode::Time& timecode)
+Session::timecode_time (framepos_t when, Timecode::Time& timecode)
{
if (last_timecode_valid && when == last_timecode_when) {
timecode = last_timecode;
@@ -391,7 +391,7 @@ Session::timecode_time (nframes_t when, Timecode::Time& timecode)
}
void
-Session::timecode_time_subframes (nframes_t when, Timecode::Time& timecode)
+Session::timecode_time_subframes (framepos_t when, Timecode::Time& timecode)
{
if (last_timecode_valid && when == last_timecode_when) {
timecode = last_timecode;
@@ -469,7 +469,7 @@ Session::jack_sync_callback (jack_transport_state_t state,
void
Session::jack_timebase_callback (jack_transport_state_t /*state*/,
- nframes_t /*nframes*/,
+ pframes_t /*nframes*/,
jack_position_t* pos,
int /*new_position*/)
{
@@ -546,14 +546,14 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/,
#endif
}
-ARDOUR::nframes_t
-Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
+ARDOUR::framecnt_t
+Session::convert_to_frames_at (framepos_t /*position*/, AnyTime const & any)
{
double secs;
switch (any.type) {
case AnyTime::BBT:
- return _tempo_map->frame_time ( any.bbt);
+ return _tempo_map->frame_time (any.bbt);
break;
case AnyTime::Timecode:
@@ -563,14 +563,14 @@ Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
secs += any.timecode.seconds;
secs += any.timecode.frames / timecode_frames_per_second();
if (config.get_timecode_offset_negative()) {
- return (nframes_t) floor (secs * frame_rate()) - config.get_timecode_offset();
+ return (framecnt_t) floor (secs * frame_rate()) - config.get_timecode_offset();
} else {
- return (nframes_t) floor (secs * frame_rate()) + config.get_timecode_offset();
+ return (framecnt_t) floor (secs * frame_rate()) + config.get_timecode_offset();
}
break;
case AnyTime::Seconds:
- return (nframes_t) floor (any.seconds * frame_rate());
+ return (framecnt_t) floor (any.seconds * frame_rate());
break;
case AnyTime::Frames:
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 3c50065684..bb20fe97ac 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -751,7 +751,7 @@ Session::start_locate (framepos_t target_frame, bool with_roll, bool with_flush,
}
int
-Session::micro_locate (nframes_t distance)
+Session::micro_locate (framecnt_t distance)
{
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
@@ -1182,7 +1182,7 @@ Session::post_transport ()
}
void
-Session::reset_rf_scale (nframes_t motion)
+Session::reset_rf_scale (framecnt_t motion)
{
cumulative_rf_motion += motion;
@@ -1359,7 +1359,7 @@ Session::set_play_range (list<AudioRange>& range, bool leave_rolling)
/* locating/stopping is subject to delays for declicking.
*/
- nframes_t requested_frame = (*i).end;
+ framepos_t requested_frame = i->end;
if (requested_frame > current_block_size) {
requested_frame -= current_block_size;
@@ -1490,8 +1490,8 @@ Session::update_latency_compensation (bool with_stop, bool abort)
(*i)->handle_transport_stopped (abort, (ptw & PostTransportLocate), (!(ptw & PostTransportLocate) || pending_locate_flush));
}
- nframes_t old_latency = (*i)->output()->signal_latency ();
- nframes_t track_latency = (*i)->update_total_latency ();
+ framecnt_t old_latency = (*i)->output()->signal_latency ();
+ framecnt_t track_latency = (*i)->update_total_latency ();
if (old_latency != track_latency) {
(*i)->input()->update_port_total_latencies ();
@@ -1547,7 +1547,7 @@ Session::reset_jack_connection (jack_client_t* jack)
}
bool
-Session::maybe_stop (nframes_t limit)
+Session::maybe_stop (framepos_t limit)
{
if ((_transport_speed > 0.0f && _transport_frame >= limit) || (_transport_speed < 0.0f && _transport_frame == 0)) {
if (synced_to_jack () && config.get_jack_time_master ()) {
diff --git a/libs/ardour/slave.cc b/libs/ardour/slave.cc
index ce03f0b17e..1cbcba8ee6 100644
--- a/libs/ardour/slave.cc
+++ b/libs/ardour/slave.cc
@@ -29,7 +29,7 @@ SlaveSessionProxy::tempo_map() const
return session.tempo_map();
}
-nframes_t
+framecnt_t
SlaveSessionProxy::frame_rate() const
{
return session.frame_rate();
@@ -47,7 +47,7 @@ SlaveSessionProxy::transport_frame() const
return session.transport_frame();
}
-nframes_t
+pframes_t
SlaveSessionProxy::frames_since_cycle_start() const
{
return session.engine().frames_since_cycle_start();
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 7a664b30d6..4e939a3762 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -106,9 +106,9 @@ SMFSource::~SMFSource ()
}
/** All stamps in audio frames */
-nframes_t
-SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, framepos_t const source_start,
- framepos_t start, nframes_t duration,
+framecnt_t
+SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, framepos_t const source_start,
+ framepos_t start, framecnt_t duration,
MidiStateTracker* tracker) const
{
int ret = 0;
@@ -207,12 +207,12 @@ SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, framepos_t
* @param source Buffer to read from.
* @param position This source's start position in session frames.
*/
-nframes_t
-SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, framepos_t position, nframes_t duration)
+framecnt_t
+SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t position, framecnt_t duration)
{
_write_data_count = 0;
- nframes_t time;
+ framepos_t time;
Evoral::EventType type;
uint32_t size;
@@ -223,7 +223,7 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, framepos_t positio
_model->start_write();
}
- Evoral::MIDIEvent<nframes_t> ev;
+ Evoral::MIDIEvent<framepos_t> ev;
while (true) {
bool ret = source.peek_time(&time);
@@ -315,9 +315,9 @@ SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
}
-/** Append an event with a timestamp in frames (nframes_t) */
+/** Append an event with a timestamp in frames (framepos_t) */
void
-SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t position)
+SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t position)
{
assert(_writing);
if (ev.size() == 0) {
diff --git a/libs/ardour/sndfileimportable.cc b/libs/ardour/sndfileimportable.cc
index b51ad3634a..75bfb9da57 100644
--- a/libs/ardour/sndfileimportable.cc
+++ b/libs/ardour/sndfileimportable.cc
@@ -43,10 +43,10 @@ SndFileImportableSource::~SndFileImportableSource ()
{
}
-nframes_t
-SndFileImportableSource::read (Sample* buffer, nframes_t nframes)
+framecnt_t
+SndFileImportableSource::read (Sample* buffer, framecnt_t nframes)
{
- nframes_t per_channel = nframes / sf_info.channels;
+ framecnt_t per_channel = nframes / sf_info.channels;
per_channel = sf_readf_float (in.get(), buffer, per_channel);
return per_channel * sf_info.channels;
}
@@ -63,14 +63,14 @@ SndFileImportableSource::length () const
return (framecnt_t) sf_info.frames;
}
-nframes_t
-SndFileImportableSource::samplerate() const
+framecnt_t
+SndFileImportableSource::samplerate () const
{
return sf_info.samplerate;
}
void
-SndFileImportableSource::seek (nframes_t /*pos*/)
+SndFileImportableSource::seek (framepos_t /*pos*/)
{
sf_seek (in.get(), 0, SEEK_SET);
}
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 0afe50a311..fa2e761d8e 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -83,7 +83,7 @@ SndFileSource::SndFileSource (Session& s, const string& path, int chn, Flag flag
/** This constructor is used to construct new files, not open existing ones. */
SndFileSource::SndFileSource (Session& s, const string& path, const string& origin,
- SampleFormat sfmt, HeaderFormat hf, nframes_t rate, Flag flags)
+ SampleFormat sfmt, HeaderFormat hf, framecnt_t rate, Flag flags)
: Source(s, DataType::AUDIO, path, flags)
, AudioFileSource (s, path, origin, flags, sfmt, hf)
{
@@ -321,7 +321,7 @@ SndFileSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) con
}
if (_info.channels == 1) {
- nframes_t ret = sf_read_float (sf, dst, file_cnt);
+ framecnt_t ret = sf_read_float (sf, dst, file_cnt);
_read_data_count = ret * sizeof(float);
if (ret != file_cnt) {
char errbuf[256];
@@ -420,8 +420,8 @@ SndFileSource::destructive_write_unlocked (Sample* data, framecnt_t cnt)
file_pos = capture_start_frame - _timeline_position;
// split cnt in half
- nframes_t subcnt = cnt / 2;
- nframes_t ofilepos = file_pos;
+ framecnt_t subcnt = cnt / 2;
+ framecnt_t ofilepos = file_pos;
// fade in
if (crossfade (data, subcnt, 1) != subcnt) {
@@ -804,7 +804,7 @@ SndFileSource::handle_header_position_change ()
}
void
-SndFileSource::setup_standard_crossfades (Session const & s, nframes_t rate)
+SndFileSource::setup_standard_crossfades (Session const & s, framecnt_t rate)
{
/* This static method is assumed to have been called by the Session
before any DFS's are created.
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index c9f7386c00..f886f952bd 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -257,7 +257,7 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path,
boost::shared_ptr<Source>
SourceFactory::createWritable (DataType type, Session& s, const std::string& path, const std::string& origin,
- bool destructive, nframes_t rate, bool announce, bool defer_peaks)
+ bool destructive, framecnt_t rate, bool announce, bool defer_peaks)
{
/* this might throw failed_constructor(), which is OK */
diff --git a/libs/ardour/sse_functions_xmm.cc b/libs/ardour/sse_functions_xmm.cc
index b3e3342cb8..48212ea8e1 100644
--- a/libs/ardour/sse_functions_xmm.cc
+++ b/libs/ardour/sse_functions_xmm.cc
@@ -22,7 +22,7 @@
#include "ardour/types.h"
void
-x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::nframes_t nframes, float *min, float *max)
+x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::pframes_t nframes, float *min, float *max)
{
__m128 current_max, current_min, work;
diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc
index 748c854daf..3660ff34d3 100644
--- a/libs/ardour/st_stretch.cc
+++ b/libs/ardour/st_stretch.cc
@@ -67,10 +67,10 @@ int
STStretch::run (boost::shared_ptr<Region> a_region)
{
SourceList nsrcs;
- nframes_t total_frames;
- nframes_t done;
+ framecnt_t total_frames;
+ framecnt_t done;
int ret = -1;
- const nframes_t bufsize = 16384;
+ const framecnt_t bufsize = 16384;
gain_t *gain_buffer = 0;
Sample *buffer = 0;
char suffix[32];
@@ -108,13 +108,13 @@ STStretch::run (boost::shared_ptr<Region> a_region)
boost::shared_ptr<AudioSource> asrc
= boost::dynamic_pointer_cast<AudioSource>(nsrcs[i]);
- nframes_t pos = 0;
- nframes_t this_read = 0;
+ framepos_t pos = 0;
+ framecnt_t this_read = 0;
st.clear();
while (!tsr.cancel && pos < region->length()) {
- nframes_t this_time;
+ framecnt_t this_time;
this_time = min (bufsize, region->length() - pos);
@@ -179,16 +179,16 @@ STStretch::run (boost::shared_ptr<Region> a_region)
for (vector<boost::shared_ptr<Region> >::iterator x = results.begin(); x != results.end(); ++x) {
framepos_t astart = (*x)->ancestral_start();
framepos_t alength = (*x)->ancestral_length();
- nframes_t start;
- nframes_t length;
+ framepos_t start;
+ framecnt_t length;
// note: tsr.fraction is a percentage of original length. 100 = no change,
// 50 is half as long, 200 is twice as long, etc.
float stretch = (*x)->stretch() * (tsr.time_fraction/100.0);
- start = (nframes_t) floor (astart + ((astart - (*x)->start()) / stretch));
- length = (nframes_t) floor (alength / stretch);
+ start = (framepos_t) floor (astart + ((astart - (*x)->start()) / stretch));
+ length = (framecnt_t) floor (alength / stretch);
(*x)->set_ancestral_data (start, length, stretch, (*x)->shift());
}
diff --git a/libs/ardour/strip_silence.cc b/libs/ardour/strip_silence.cc
index a7308b06ab..cf03c2df8b 100644
--- a/libs/ardour/strip_silence.cc
+++ b/libs/ardour/strip_silence.cc
@@ -35,7 +35,7 @@ using namespace ARDOUR;
* @param fade_length Length of fade in/out to apply to trimmed regions, in samples.
*/
-StripSilence::StripSilence (Session & s, double threshold, nframes_t minimum_length, nframes_t fade_length)
+StripSilence::StripSilence (Session & s, double threshold, framecnt_t minimum_length, framecnt_t fade_length)
: Filter (s), _threshold (threshold), _minimum_length (minimum_length), _fade_length (fade_length)
{
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 67c3419b1b..8afdfb140b 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -45,7 +45,7 @@ Tempo TempoMap::_default_tempo (120.0);
const double Meter::ticks_per_beat = 1920.0;
-double Tempo::frames_per_beat (nframes_t sr, const Meter& meter) const
+double Tempo::frames_per_beat (framecnt_t sr, const Meter& meter) const
{
return ((60.0 * sr) / (_beats_per_minute * meter.note_divisor()/_note_type));
}
@@ -53,7 +53,7 @@ double Tempo::frames_per_beat (nframes_t sr, const Meter& meter) const
/***********************************************************************/
double
-Meter::frames_per_bar (const Tempo& tempo, nframes_t sr) const
+Meter::frames_per_bar (const Tempo& tempo, framecnt_t sr) const
{
return ((60.0 * sr * _beats_per_bar) / (tempo.beats_per_minute() * _note_type/tempo.note_type()));
}
@@ -218,7 +218,7 @@ struct MetricSectionSorter {
}
};
-TempoMap::TempoMap (nframes_t fr)
+TempoMap::TempoMap (framecnt_t fr)
{
metrics = new Metrics;
_frame_rate = fr;
diff --git a/libs/ardour/test/interpolation_test.cpp b/libs/ardour/test/interpolation_test.cpp
index ef47417c6e..0bbb697b85 100644
--- a/libs/ardour/test/interpolation_test.cpp
+++ b/libs/ardour/test/interpolation_test.cpp
@@ -9,7 +9,7 @@ using namespace ARDOUR;
void
InterpolationTest::linearInterpolationTest ()
{
- nframes_t result = 0;
+ framecnt_t result = 0;
// cout << "\nLinear Interpolation Test\n";
// cout << "\nSpeed: 1/3";
@@ -25,7 +25,7 @@ InterpolationTest::linearInterpolationTest ()
linear.set_speed (1.0);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -35,7 +35,7 @@ InterpolationTest::linearInterpolationTest ()
linear.set_speed (0.5);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / linear.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -45,14 +45,14 @@ InterpolationTest::linearInterpolationTest ()
linear.set_speed (0.2);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
// cout << "\nSpeed: 0.02";
linear.reset();
linear.set_speed (0.02);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
/* This one fails due too error accumulation
cout << "\nSpeed: 0.002";
@@ -61,7 +61,7 @@ InterpolationTest::linearInterpolationTest ()
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES, input, output);
linear.speed();
- CPPUNIT_ASSERT_EQUAL ((nframes_t)(NUM_SAMPLES * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result);
*/
// cout << "\nSpeed: 2.0";
@@ -69,7 +69,7 @@ InterpolationTest::linearInterpolationTest ()
linear.set_speed (2.0);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES / 2, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 2 * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * linear.speed()), result);
for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / linear.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -78,7 +78,7 @@ InterpolationTest::linearInterpolationTest ()
linear.set_speed (10.0);
linear.set_target_speed (linear.speed());
result = linear.interpolate (0, NUM_SAMPLES / 10, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 10 * linear.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * linear.speed()), result);
for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / linear.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -92,7 +92,7 @@ InterpolationTest::linearInterpolationTest ()
void
InterpolationTest::cubicInterpolationTest ()
{
- nframes_t result = 0;
+ framecnt_t result = 0;
// cout << "\nCubic Interpolation Test\n";
// cout << "\nSpeed: 1/3";
@@ -108,7 +108,7 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_speed (1.0);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -118,7 +118,7 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_speed (0.5);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / cubic.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -128,14 +128,14 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_speed (0.2);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
// cout << "\nSpeed: 0.02";
cubic.reset();
cubic.set_speed (0.02);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
/* This one fails due too error accumulation
cout << "\nSpeed: 0.002";
@@ -144,7 +144,7 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES, input, output);
cubic.speed();
- CPPUNIT_ASSERT_EQUAL ((nframes_t)(NUM_SAMPLES * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result);
*/
// cout << "\nSpeed: 2.0";
@@ -152,7 +152,7 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_speed (2.0);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES / 2, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 2 * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * cubic.speed()), result);
for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / cubic.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
@@ -161,7 +161,7 @@ InterpolationTest::cubicInterpolationTest ()
cubic.set_speed (10.0);
cubic.set_target_speed (cubic.speed());
result = cubic.interpolate (0, NUM_SAMPLES / 10, input, output);
- CPPUNIT_ASSERT_EQUAL ((uint32_t)(NUM_SAMPLES / 10 * cubic.speed()), result);
+ CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * cubic.speed()), result);
for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / cubic.speed() +0.5)) {
CPPUNIT_ASSERT_EQUAL (1.0f, output[i]);
}
diff --git a/libs/ardour/test/midi_clock_slave_test.h b/libs/ardour/test/midi_clock_slave_test.h
index 3b9278b872..7bc73fdab4 100644
--- a/libs/ardour/test/midi_clock_slave_test.h
+++ b/libs/ardour/test/midi_clock_slave_test.h
@@ -61,11 +61,11 @@ class TestSlaveSessionProxy : public ISlaveSessionProxy {
}
// Implementation
- TempoMap& tempo_map () const { return *_tempo_map; }
- nframes_t frame_rate () const { return FRAME_RATE; }
+ TempoMap& tempo_map () const { return *_tempo_map; }
+ framecnt_t frame_rate () const { return FRAME_RATE; }
framepos_t audible_frame () const { return _transport_frame; }
framepos_t transport_frame () const { return _transport_frame; }
- nframes_t frames_since_cycle_start () const { return 0; }
+ pframes_t frames_since_cycle_start () const { return 0; }
framecnt_t frame_time () const { return _frame_time; }
void request_locate (framepos_t frame, bool with_roll = false) {
diff --git a/libs/ardour/thread_buffers.cc b/libs/ardour/thread_buffers.cc
index e319acc329..2436b6d365 100644
--- a/libs/ardour/thread_buffers.cc
+++ b/libs/ardour/thread_buffers.cc
@@ -66,7 +66,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
}
void
-ThreadBuffers::allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force)
+ThreadBuffers::allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force)
{
if (!force && howmany <= npan_buffers) {
return;
diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc
index 98f0632c45..d3499c13be 100644
--- a/libs/ardour/ticker.cc
+++ b/libs/ardour/ticker.cc
@@ -72,8 +72,8 @@ void MidiClockTicker::transport_state_changed()
return;
}
- float speed = _session->transport_speed();
- nframes_t position = _session->transport_frame();
+ float speed = _session->transport_speed();
+ framepos_t position = _session->transport_frame();
#ifdef DEBUG_MIDI_CLOCK
cerr << "Transport state change, speed:" << speed << "position:" << position<< " play loop " << _session->get_play_loop() << endl;
#endif
@@ -108,7 +108,7 @@ void MidiClockTicker::transport_state_changed()
tick(position, *((ARDOUR::BBT_Time *) 0), *((Timecode::Time *)0));
}
-void MidiClockTicker::position_changed(nframes_t position)
+void MidiClockTicker::position_changed (framepos_t position)
{
#ifdef DEBUG_MIDI_CLOCK
cerr << "Position changed:" << position << endl;
@@ -131,18 +131,18 @@ void MidiClockTicker::transport_looped()
// adjust _last_tick, so that the next MIDI clock message is sent
// in due time (and the tick interval is still constant)
- nframes_t elapsed_since_last_tick = loop_location->end() - _last_tick;
+ framecnt_t elapsed_since_last_tick = loop_location->end() - _last_tick;
_last_tick = loop_location->start() - elapsed_since_last_tick;
}
-void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
+void MidiClockTicker::tick (const framepos_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
{
if (!Config->get_send_midi_clock() || _session == 0 || _session->transport_speed() != 1.0f || _midi_port == 0)
return;
while (true) {
double next_tick = _last_tick + one_ppqn_in_frames(transport_frames);
- nframes_t next_tick_offset = nframes_t(next_tick) - transport_frames;
+ framecnt_t next_tick_offset = framecnt_t(next_tick) - transport_frames;
#ifdef DEBUG_MIDI_CLOCK
cerr << "Transport:" << transport_frames
@@ -162,7 +162,7 @@ void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*
}
}
-double MidiClockTicker::one_ppqn_in_frames(nframes_t transport_position)
+double MidiClockTicker::one_ppqn_in_frames (framepos_t transport_position)
{
const Tempo& current_tempo = _session->tempo_map().tempo_at(transport_position);
const Meter& current_meter = _session->tempo_map().meter_at(transport_position);
@@ -176,7 +176,7 @@ double MidiClockTicker::one_ppqn_in_frames(nframes_t transport_position)
return frames_per_quarter_note / double (_ppqn);
}
-void MidiClockTicker::send_midi_clock_event(nframes_t offset)
+void MidiClockTicker::send_midi_clock_event (framecnt_t offset)
{
if (!_midi_port) {
return;
@@ -190,7 +190,7 @@ void MidiClockTicker::send_midi_clock_event(nframes_t offset)
_midi_port->write(_midi_clock_tick, 1, offset);
}
-void MidiClockTicker::send_start_event(nframes_t offset)
+void MidiClockTicker::send_start_event (framecnt_t offset)
{
if (!_midi_port) {
return;
@@ -200,7 +200,7 @@ void MidiClockTicker::send_start_event(nframes_t offset)
_midi_port->write(_midi_clock_tick, 1, offset);
}
-void MidiClockTicker::send_continue_event(nframes_t offset)
+void MidiClockTicker::send_continue_event (framecnt_t offset)
{
if (!_midi_port) {
return;
@@ -210,7 +210,7 @@ void MidiClockTicker::send_continue_event(nframes_t offset)
_midi_port->write(_midi_clock_tick, 1, offset);
}
-void MidiClockTicker::send_stop_event(nframes_t offset)
+void MidiClockTicker::send_stop_event (framecnt_t offset)
{
if (!_midi_port) {
return;
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index f480638d13..6a39553cf7 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -85,11 +85,11 @@ Track::toggle_monitor_input ()
}
}
-ARDOUR::nframes_t
+ARDOUR::framecnt_t
Track::update_total_latency ()
{
- nframes_t old = _output->effective_latency();
- nframes_t own_latency = _output->user_latency();
+ framecnt_t old = _output->effective_latency();
+ framecnt_t own_latency = _output->user_latency();
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->active ()) {
@@ -221,7 +221,7 @@ Track::set_name (const string& str)
}
void
-Track::set_latency_delay (nframes_t longest_session_latency)
+Track::set_latency_delay (framecnt_t longest_session_latency)
{
Route::set_latency_delay (longest_session_latency);
_diskstream->set_roll_delay (_roll_delay);
@@ -236,7 +236,7 @@ Track::zero_diskstream_id_in_xml (XMLNode& node)
}
int
-Track::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+Track::no_roll (pframes_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);
@@ -336,7 +336,7 @@ Track::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
}
int
-Track::silent_roll (nframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
+Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
bool can_record, bool rec_monitors_input, bool& need_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
@@ -662,7 +662,7 @@ Track::diskstream_id () const
}
void
-Track::set_block_size (nframes_t n)
+Track::set_block_size (pframes_t n)
{
Route::set_block_size (n);
_diskstream->set_block_size (n);
diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc
index 6573262393..27abf9a0b3 100644
--- a/libs/ardour/transient_detector.cc
+++ b/libs/ardour/transient_detector.cc
@@ -49,13 +49,13 @@ TransientDetector::use_features (Plugin::FeatureSet& features, ostream* out)
for (Plugin::FeatureList::const_iterator f = fl.begin(); f != fl.end(); ++f) {
- if ((*f).hasTimestamp) {
+ if (f->hasTimestamp) {
if (out) {
(*out) << (*f).timestamp.toString() << endl;
}
- current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
+ current_results->push_back (RealTime::realTime2Frame (f->timestamp, (framecnt_t) floor(sample_rate)));
}
}
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 9698486e90..64e06b6f12 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -341,7 +341,7 @@ CFStringRefToStdString(CFStringRef stringRef)
#endif // __APPLE__
void
-compute_equal_power_fades (nframes_t nframes, float* in, float* out)
+compute_equal_power_fades (framecnt_t nframes, float* in, float* out)
{
double step;
@@ -349,7 +349,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
in[0] = 0.0f;
- for (nframes_t i = 1; i < nframes - 1; ++i) {
+ for (framecnt_t i = 1; i < nframes - 1; ++i) {
in[i] = in[i-1] + step;
}
@@ -358,7 +358,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
const float pan_law_attenuation = -3.0f;
const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
- for (nframes_t n = 0; n < nframes; ++n) {
+ for (framecnt_t n = 0; n < nframes; ++n) {
float inVal = in[n];
float outVal = 1 - inVal;
out[n] = outVal * (scale * outVal + 1.0f - scale);
diff --git a/libs/ardour/vbap.cc b/libs/ardour/vbap.cc
index 4e54327acf..d727293b05 100644
--- a/libs/ardour/vbap.cc
+++ b/libs/ardour/vbap.cc
@@ -141,7 +141,7 @@ VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
}
void
-VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coefficient, nframes_t nframes)
+VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coefficient, pframes_t nframes)
{
if (_muted) {
return;
@@ -179,7 +179,7 @@ VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coe
for (int o = 0; o < 3; ++o) {
if (desired_outputs[o] != -1) {
- nframes_t n = 0;
+ pframes_t n = 0;
/* XXX TODO: interpolate across changes in gain and/or outputs
*/
@@ -209,7 +209,7 @@ VBAPanner::do_distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coe
void
VBAPanner::do_distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers)
+ framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers)
{
}
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index d805a2feec..ee7c165fb3 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -107,7 +107,7 @@ VSTPlugin::~VSTPlugin ()
}
int
-VSTPlugin::set_block_size (nframes_t nframes)
+VSTPlugin::set_block_size (pframes_t nframes)
{
deactivate ();
_plugin->dispatcher (_plugin, effSetBlockSize, 0, nframes, NULL, 0.0f);
@@ -357,7 +357,7 @@ VSTPlugin::describe_parameter (Evoral::Parameter param)
return name;
}
-nframes_t
+framecnt_t
VSTPlugin::signal_latency () const
{
if (_user_latency) {
@@ -365,7 +365,7 @@ VSTPlugin::signal_latency () const
}
#ifdef VESTIGE_HEADER
- return *((nframes_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */
+ return *((framecnt_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */
#else
return _plugin->initial_delay;
#endif
@@ -386,7 +386,7 @@ VSTPlugin::automatable () const
int
VSTPlugin::connect_and_run (BufferSet& bufs,
ChanMapping in_map, ChanMapping out_map,
- nframes_t nframes, nframes_t offset)
+ pframes_t nframes, framecnt_t offset)
{
float *ins[_plugin->numInputs];
float *outs[_plugin->numOutputs];