Remove all use of nframes_t.

git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-12-03 22:26:29 +00:00
parent 74b4a3c77b
commit 73192bc1a7
280 changed files with 1615 additions and 1628 deletions

View file

@ -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);

View file

@ -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(); }

View file

@ -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;
}

View file

@ -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>);

View file

@ -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

View file

@ -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);

View file

@ -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 ();

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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>);

View file

@ -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 */

View file

@ -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;

View file

@ -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 ();

View file

@ -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

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -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; }
};

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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; }

View file

@ -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; }

View file

@ -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;

View file

@ -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 ();

View file

@ -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:

View file

@ -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;

View file

@ -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);
};

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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; }

View file

@ -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

View file

@ -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 */

View file

@ -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;

View file

@ -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);
};

View file

@ -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;
};
}

View file

@ -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 ();
};

View file

@ -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; }

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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,

View file

@ -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.

View file

@ -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()

View file

@ -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 ();

View file

@ -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;

View file

@ -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__ */

View file

@ -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 */);

View file

@ -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;

View file

@ -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;

View file

@ -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);
};
}

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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(); }

View file

@ -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)

View file

@ -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 ();

View file

@ -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 {

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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 ();

View file

@ -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 ();

View file

@ -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; }

View file

@ -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; }

View file

@ -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;
framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
framepos_t position,
framepos_t start,
framecnt_t cnt,
MidiStateTracker* tracker) const;
nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src,
framepos_t position,
nframes_t cnt);
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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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
};
}

View file

@ -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;

View file

@ -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

View file

@ -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);
};
}

View file

@ -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 ();

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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);
}

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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 */

View file

@ -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);

View file

@ -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;

View file

@ -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];
// }
// }

View file

@ -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);

View file

@ -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) {

View file

@ -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) {

View file

@ -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 ();

View file

@ -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) {

View file

@ -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);

View file

@ -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);

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