diff options
Diffstat (limited to 'libs/ardour/ardour')
81 files changed, 564 insertions, 568 deletions
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index 0ec493e8ce..711cc5489f 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -43,12 +43,12 @@ public: bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); - bool apply_gain() const { return _apply_gain; } - void apply_gain(bool yn) { _apply_gain = yn; } + bool apply_gain () const { return _apply_gain; } + void apply_gain (bool yn) { _apply_gain = yn; } - void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); + void setup_gain_automation (framepos_t start_frame, framepos_t end_frame, framecnt_t nframes); bool apply_gain_automation() const { return _apply_gain_automation; } void apply_gain_automation(bool yn) { _apply_gain_automation = yn; } @@ -56,13 +56,13 @@ public: XMLNode& state (bool full); int set_state (const XMLNode&, int version); - static void apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target); - static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target); + static void apply_gain (BufferSet& bufs, framecnt_t nframes, gain_t initial, gain_t target); + static void apply_simple_gain(BufferSet& bufs, framecnt_t nframes, gain_t target); - static void apply_gain (AudioBuffer& buf, nframes_t nframes, gain_t initial, gain_t target); - static void apply_simple_gain(AudioBuffer& buf, nframes_t nframes, gain_t target); + static void apply_gain (AudioBuffer& buf, framecnt_t nframes, gain_t initial, gain_t target); + static void apply_simple_gain(AudioBuffer& buf, framecnt_t nframes, gain_t target); - static void declick (BufferSet& bufs, nframes_t nframes, int dir); + static void declick (BufferSet& bufs, framecnt_t nframes, int dir); gain_t gain () const { return _gain_control->user_double(); } diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 65eb38d6db..6c5a0a0832 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -30,7 +30,7 @@ public: AudioBuffer(size_t capacity); ~AudioBuffer(); - void silence (nframes_t len, nframes_t offset = 0) { + void silence (framecnt_t len, framecnt_t offset = 0) { if (!_silent) { assert(_capacity > 0); assert(offset + len <= _capacity); @@ -43,7 +43,7 @@ public: } /** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ - void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { + void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { assert(&src != this); assert(_capacity > 0); assert(src.type() == DataType::AUDIO); @@ -58,14 +58,14 @@ public: } /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ - void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { + void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { const AudioBuffer* ab = dynamic_cast<const AudioBuffer*>(&src); assert (ab); accumulate_from (*ab, len, dst_offset, src_offset); } /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ - void accumulate_from (const AudioBuffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) { + void accumulate_from (const AudioBuffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -80,7 +80,7 @@ public: /** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset * scaling by @a gain_coeff */ - void accumulate_with_gain_from (const AudioBuffer& src, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0, nframes_t src_offset = 0) { + void accumulate_with_gain_from (const AudioBuffer& src, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -100,7 +100,7 @@ public: /** Accumulate (add) @a len frames FROM THE START OF @a src into self * scaling by @a gain_coeff */ - void accumulate_with_gain_from (const Sample* src_raw, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0) { + void accumulate_with_gain_from (const Sample* src_raw, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -113,7 +113,7 @@ public: _written = true; } - void apply_gain (gain_t gain, nframes_t len) { + void apply_gain (gain_t gain, framecnt_t len) { apply_gain_to_buffer (_data, len, gain); } @@ -137,12 +137,12 @@ public: void resize (size_t nframes); - const Sample* data (nframes_t offset = 0) const { + const Sample* data (framecnt_t offset = 0) const { assert(offset <= _capacity); return _data + offset; } - Sample* data (nframes_t offset = 0) { + Sample* data (framecnt_t offset = 0) { assert(offset <= _capacity); return _data + offset; } diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index 4106602b63..2bd44d62a6 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -139,7 +139,7 @@ class AudioDiskstream : public Diskstream } } - static void swap_by_ptr (Sample *first, Sample *last, nframes_t n) { + static void swap_by_ptr (Sample *first, Sample *last, framecnt_t n) { while (n--) { Sample tmp = *first; *first++ = *last; @@ -161,7 +161,7 @@ class AudioDiskstream : public Diskstream void set_pending_overwrite(bool); int overwrite_existing_buffers (); - void set_block_size (nframes_t); + void set_block_size (pframes_t); int internal_playback_seek (framecnt_t distance); int can_internal_playback_seek (framecnt_t distance); int rename_write_sources (); @@ -177,17 +177,17 @@ class AudioDiskstream : public Diskstream protected: friend class AudioTrack; - int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); - bool commit (nframes_t nframes); + int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); + bool commit (framecnt_t nframes); private: struct ChannelInfo : public boost::noncopyable { - ChannelInfo (nframes_t playback_buffer_size, - nframes_t capture_buffer_size, - nframes_t speed_buffer_size, - nframes_t wrap_buffer_size); + ChannelInfo (framecnt_t playback_buffer_size, + framecnt_t capture_buffer_size, + framecnt_t speed_buffer_size, + framecnt_t wrap_buffer_size); ~ChannelInfo (); Sample *playback_wrap_buffer; @@ -216,15 +216,15 @@ class AudioDiskstream : public Diskstream RingBufferNPT<CaptureTransition> * capture_transition_buf; // the following are used in the butler thread only - nframes_t curr_capture_cnt; + framecnt_t curr_capture_cnt; - void resize_playback (nframes_t); - void resize_capture (nframes_t); + void resize_playback (framecnt_t); + void resize_capture (framecnt_t); }; typedef std::vector<ChannelInfo*> ChannelList; - void process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c); + void process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c); /* The two central butler operations */ int do_flush (RunContext context, bool force = false); @@ -233,7 +233,7 @@ class AudioDiskstream : public Diskstream int do_refill_with_alloc (); int read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, - framepos_t& start, nframes_t cnt, + framepos_t& start, framecnt_t cnt, ChannelInfo* channel_info, int channel, bool reversed); void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>); diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h index 895cae99a6..748ef8263b 100644 --- a/libs/ardour/ardour/audio_port.h +++ b/libs/ardour/ardour/audio_port.h @@ -35,25 +35,25 @@ class AudioPort : public Port return DataType::AUDIO; } - void cycle_start (nframes_t); - void cycle_end (nframes_t); + void cycle_start (pframes_t); + void cycle_end (pframes_t); void cycle_split (); - size_t raw_buffer_size(jack_nframes_t nframes) const; + size_t raw_buffer_size (pframes_t nframes) const; - Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) { + Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) { return get_audio_buffer (nframes, offset); } - AudioBuffer& get_audio_buffer (nframes_t nframes, nframes_t offset = 0); + AudioBuffer& get_audio_buffer (framecnt_t nframes, framecnt_t offset = 0); - static nframes_t port_offset() { return _port_offset; } + static framecnt_t port_offset() { return _port_offset; } - static void set_port_offset (nframes_t off) { + static void set_port_offset (framecnt_t off) { _port_offset = off; } - static void increment_port_offset (nframes_t n) { + static void increment_port_offset (framecnt_t n) { _port_offset += n; } @@ -65,7 +65,7 @@ class AudioPort : public Port private: AudioBuffer* _buffer; - static nframes_t _port_offset; + static framecnt_t _port_offset; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 8e31db34fd..b9c60d5107 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -39,7 +39,7 @@ class AudioTrack : public Track int set_mode (TrackMode m); bool can_use_mode (TrackMode m, bool& bounce_required); - int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler); void use_new_diskstream (); @@ -55,7 +55,7 @@ class AudioTrack : public Track void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); - boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); + boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing); int set_state(const XMLNode&, int version); diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 048e6b978b..b00c23b1dc 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -71,7 +71,7 @@ class AUPlugin : public ARDOUR::Plugin const char * maker () const { return _info->creator.c_str(); } uint32_t parameter_count () const; float default_value (uint32_t port); - nframes_t signal_latency() const; + framecnt_t signal_latency() const; void set_parameter (uint32_t which, float val); float get_parameter (uint32_t which) const; @@ -80,11 +80,11 @@ class AUPlugin : public ARDOUR::Plugin void activate (); void deactivate (); void flush (); - int set_block_size (nframes_t nframes); + int set_block_size (pframes_t nframes); int connect_and_run (BufferSet& bufs, ChanMapping in, ChanMapping out, - nframes_t nframes, nframes_t offset); + pframes_t nframes, framecnt_t offset); std::set<Evoral::Parameter> automatable() const; std::string describe_parameter (Evoral::Parameter); std::string state_node_name () const { return "audiounit"; } @@ -150,8 +150,8 @@ class AUPlugin : public ARDOUR::Plugin int32_t input_channels; int32_t output_channels; std::vector<std::pair<int,int> > io_configs; - nframes_t _current_block_size; - nframes_t _last_nframes; + pframes_t _current_block_size; + framecnt_t _last_nframes; bool _requires_fixed_size_buffers; AudioBufferList* buffers; bool _has_midi_input; @@ -181,10 +181,10 @@ class AUPlugin : public ARDOUR::Plugin std::vector<std::pair<uint32_t, uint32_t> > parameter_map; uint32_t current_maxbuf; - nframes_t current_offset; - nframes_t cb_offset; + framecnt_t current_offset; + framecnt_t cb_offset; BufferSet* current_buffers; - nframes_t frames_processed; + framecnt_t frames_processed; std::vector<AUParameterDescriptor> descriptors; void init (); diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h index f16a2b1e49..27a03ce805 100644 --- a/libs/ardour/ardour/audioanalyser.h +++ b/libs/ardour/ardour/audioanalyser.h @@ -56,8 +56,8 @@ class AudioAnalyser : public boost::noncopyable { AnalysisPlugin* plugin; AnalysisPluginKey plugin_key; - nframes_t bufsize; - nframes_t stepsize; + framecnt_t bufsize; + framecnt_t stepsize; int initialize_plugin (AnalysisPluginKey name, float sample_rate); int analyse (const std::string& path, Readable*, uint32_t channel); diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 523a05b4c1..f55a7e334e 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -91,46 +91,57 @@ class AudioEngine : public SessionHandlePtr Glib::Mutex& process_lock() { return _process_lock; } - nframes_t frame_rate() const; - nframes_t frames_per_cycle() const; + framecnt_t frame_rate () const; + framecnt_t frames_per_cycle () const; size_t raw_buffer_size(DataType t); int usecs_per_cycle () const { return _usecs_per_cycle; } - bool get_sync_offset (nframes_t& offset) const; + bool get_sync_offset (pframes_t & offset) const; - nframes_t frames_since_cycle_start () { + pframes_t frames_since_cycle_start () { jack_client_t* _priv_jack = _jack; - if (!_running || !_priv_jack) return 0; + if (!_running || !_priv_jack) { + return 0; + } return jack_frames_since_cycle_start (_priv_jack); } - nframes_t frame_time () { + + pframes_t frame_time () { jack_client_t* _priv_jack = _jack; - if (!_running || !_priv_jack) return 0; + if (!_running || !_priv_jack) { + return 0; + } return jack_frame_time (_priv_jack); } - nframes_t frame_time_at_cycle_start () { + pframes_t frame_time_at_cycle_start () { jack_client_t* _priv_jack = _jack; - if (!_running || !_priv_jack) return 0; + if (!_running || !_priv_jack) { + return 0; + } return jack_last_frame_time (_priv_jack); } - nframes_t transport_frame () const { + pframes_t transport_frame () const { const jack_client_t* _priv_jack = _jack; - if (!_running || !_priv_jack) return 0; + if (!_running || !_priv_jack) { + return 0; + } return jack_get_current_transport_frame (_priv_jack); } - int request_buffer_size (nframes_t); + int request_buffer_size (pframes_t); - nframes_t set_monitor_check_interval (nframes_t); - nframes_t processed_frames() const { return _processed_frames; } + framecnt_t set_monitor_check_interval (framecnt_t); + framecnt_t processed_frames() const { return _processed_frames; } float get_cpu_load() { jack_client_t* _priv_jack = _jack; - if (!_running || !_priv_jack) return 0; + if (!_running || !_priv_jack) { + return 0; + } return jack_cpu_load (_priv_jack); } @@ -159,7 +170,7 @@ class AudioEngine : public SessionHandlePtr Port *register_output_port (DataType, const std::string& portname); int unregister_port (Port &); - void split_cycle (nframes_t offset); + void split_cycle (pframes_t offset); int connect (const std::string& source, const std::string& destination); int disconnect (const std::string& source, const std::string& destination); @@ -189,7 +200,7 @@ class AudioEngine : public SessionHandlePtr void transport_start (); void transport_stop (); - void transport_locate (nframes_t); + void transport_locate (framepos_t); TransportState transport_state (); int reset_timebase (); @@ -203,7 +214,7 @@ class AudioEngine : public SessionHandlePtr _ the regular process() call to session->process() is not made. */ - PBD::Signal1<int,nframes_t> Freewheel; + PBD::Signal1<int, pframes_t> Freewheel; PBD::Signal0<void> Xrun; @@ -218,7 +229,7 @@ _ the regular process() call to session->process() is not made. /* this signal is emitted if the sample rate changes */ - PBD::Signal1<void,nframes_t> SampleRateChanged; + PBD::Signal1<void, framecnt_t> SampleRateChanged; /* this signal is sent if JACK ever disconnects us */ @@ -255,18 +266,18 @@ _ the regular process() call to session->process() is not made. bool session_remove_pending; bool _running; bool _has_run; - mutable nframes_t _buffer_size; + mutable framecnt_t _buffer_size; std::map<DataType,size_t> _raw_buffer_sizes; - mutable nframes_t _frame_rate; + mutable framecnt_t _frame_rate; /// number of frames between each check for changes in monitor input - nframes_t monitor_check_interval; + framecnt_t monitor_check_interval; /// time of the last monitor check in frames - nframes_t last_monitor_check; + framecnt_t last_monitor_check; /// the number of frames processed since start() was called - nframes_t _processed_frames; + framecnt_t _processed_frames; bool _freewheeling; bool _freewheel_pending; - boost::function<int(nframes_t)> freewheel_action; + boost::function<int(framecnt_t)> freewheel_action; bool reconnect_on_halt; int _usecs_per_cycle; @@ -274,7 +285,7 @@ _ the regular process() call to session->process() is not made. Port *register_port (DataType type, const std::string& portname, bool input); - int process_callback (nframes_t nframes); + int process_callback (pframes_t nframes); void* process_thread (); void finish_process_cycle (int status); void remove_all_ports (); @@ -289,20 +300,20 @@ _ the regular process() call to session->process() is not made. static void _session_callback (jack_session_event_t *event, void *arg); #endif static int _graph_order_callback (void *arg); - static int _process_callback (nframes_t nframes, void *arg); + static int _process_callback (pframes_t nframes, void *arg); static void* _process_thread (void *arg); - static int _sample_rate_callback (nframes_t nframes, void *arg); - static int _bufsize_callback (nframes_t nframes, void *arg); - static void _jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int, void*); + static int _sample_rate_callback (pframes_t nframes, void *arg); + static int _bufsize_callback (pframes_t nframes, void *arg); + static void _jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int, void*); static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg); static void _freewheel_callback (int , void *arg); static void _registration_callback (jack_port_id_t, int, void *); static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *); - void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int); + void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int); int jack_sync_callback (jack_transport_state_t, jack_position_t*); - int jack_bufsize_callback (nframes_t); - int jack_sample_rate_callback (nframes_t); + int jack_bufsize_callback (pframes_t); + int jack_sample_rate_callback (pframes_t); int connect_to_jack (std::string client_name, std::string session_uuid); diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index 4f01bf4182..3bd4bbd34c 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -82,7 +82,7 @@ public: static bool is_empty (Session&, std::string path); static void set_bwf_serial_number (int); - static void set_header_position_offset (nframes_t offset ); + static void set_header_position_offset (framecnt_t offset); static PBD::Signal0<void> HeaderPositionOffsetChanged; @@ -104,7 +104,7 @@ protected: int move_dependents_to_trash(); - static Sample* get_interleave_buffer (nframes_t size); + static Sample* get_interleave_buffer (framecnt_t size); static std::string peak_dir; diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index 253329b38e..6c3169070f 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -72,7 +72,7 @@ public: AudioPlaylist (Session&, const XMLNode&, bool hidden = false); AudioPlaylist (Session&, std::string name, bool hidden = false); AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false); - AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false); + AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false); ~AudioPlaylist (); @@ -85,7 +85,7 @@ public: PBD::Signal1<void,boost::shared_ptr<Crossfade> > NewCrossfade; void foreach_crossfade (boost::function<void (boost::shared_ptr<Crossfade>)>); - void crossfades_at (nframes_t frame, Crossfades&); + void crossfades_at (framepos_t frame, Crossfades&); bool destroy_region (boost::shared_ptr<Region>); diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 902e7eb934..a5791c8b30 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -93,8 +93,8 @@ class AudioRegion : public Region boost::shared_ptr<AutomationList> fade_out() { return _fade_out; } boost::shared_ptr<AutomationList> envelope() { return _envelope; } - virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks, - nframes_t offset, nframes_t cnt, + virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks, + framecnt_t offset, framecnt_t cnt, uint32_t chan_n=0, double samples_per_unit= 1.0) const; /* Readable interface */ diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index 08c879d926..22d5d1a724 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -69,7 +69,7 @@ class AudioSource : virtual public Source, uint32_t read_data_count() const { return _read_data_count; } uint32_t write_data_count() const { return _write_data_count; } - void dec_read_data_count(nframes_t); + void dec_read_data_count (framecnt_t); int read_peaks (PeakData *peaks, framecnt_t npeaks, framepos_t start, framecnt_t cnt, double samples_per_visual_peak) const; diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index e7d3347cb6..25a7b91158 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -46,7 +46,7 @@ class Auditioner : public AudioTrack ARDOUR::AudioPlaylist& prepare_playlist (); void audition_current_playlist (); - int play_audition (nframes_t nframes); + int play_audition (framecnt_t nframes); void cancel_audition () { g_atomic_int_set (&_auditioning, 0); @@ -57,10 +57,10 @@ class Auditioner : public AudioTrack private: boost::shared_ptr<AudioRegion> the_region; - nframes_t current_frame; + framepos_t current_frame; mutable gint _auditioning; Glib::Mutex lock; - nframes_t length; + framecnt_t length; bool via_monitor; void drop_ports (); diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index f90f1dec48..541e9d562d 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -60,7 +60,7 @@ public: virtual void add_control(boost::shared_ptr<Evoral::Control>); void clear_controls (); - virtual void automation_snapshot(nframes_t now, bool force); + virtual void automation_snapshot (framepos_t now, bool force); virtual void transport_stopped (framepos_t now); virtual std::string describe_parameter(Evoral::Parameter param); @@ -78,16 +78,16 @@ public: void mark_automation_visible(Evoral::Parameter, bool); - inline bool should_snapshot (nframes_t now) { + inline bool should_snapshot (framepos_t now) { return (_last_automation_snapshot > now || (now - _last_automation_snapshot) > _automation_interval); } - static void set_automation_interval (jack_nframes_t frames) { + static void set_automation_interval (framecnt_t frames) { _automation_interval = frames; } - static jack_nframes_t automation_interval() { + static framecnt_t automation_interval() { return _automation_interval; } @@ -109,8 +109,8 @@ public: std::set<Evoral::Parameter> _visible_controls; std::set<Evoral::Parameter> _can_automate_list; - nframes_t _last_automation_snapshot; - static nframes_t _automation_interval; + framepos_t _last_automation_snapshot; + static framecnt_t _automation_interval; private: PBD::ScopedConnectionList _control_connections; ///< connections to our controls' signals diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index 48fd7f099b..5b76aafca6 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -71,13 +71,13 @@ public: virtual void resize (size_t) = 0; /** Clear (eg zero, or empty) buffer */ - virtual void silence (nframes_t len, nframes_t offset = 0) = 0; + virtual void silence (framecnt_t len, framecnt_t offset = 0) = 0; /** Clear the entire buffer */ virtual void clear() { silence(_capacity, 0); } - virtual void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0; - virtual void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0; + virtual void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0; + virtual void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0; protected: Buffer(DataType type, size_t capacity) diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index 711e2350fd..c3358f4436 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -66,7 +66,7 @@ public: void clear(); - void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset = 0); + void attach_buffers(PortSet& ports, framecnt_t nframes, framecnt_t offset = 0); /* the capacity here is a size_t and has a different interpretation depending on the DataType of the buffers. for audio, its a frame count. for MIDI @@ -83,7 +83,7 @@ public: ChanCount& count() { return _count; } void is_silent(bool yn); - void silence (nframes_t nframes, nframes_t offset); + void silence (framecnt_t nframes, framecnt_t offset); bool is_mirror() const { return _is_mirror; } void set_count(const ChanCount& count) { assert(count <= _available); _count = count; } @@ -115,8 +115,8 @@ public: VstEvents* get_vst_midi (size_t); #endif - void read_from(const BufferSet& in, nframes_t nframes); - void merge_from(const BufferSet& in, nframes_t nframes); + void read_from(const BufferSet& in, framecnt_t nframes); + void merge_from(const BufferSet& in, framecnt_t nframes); template <typename BS, typename B> class iterator_base { @@ -176,7 +176,7 @@ private: ~VSTBuffer (); void clear (); - void push_back (Evoral::MIDIEvent<nframes_t> const &); + void push_back (Evoral::MIDIEvent<framepos_t> const &); VstEvents* events () const { return _events; } diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h index 6ad96dc704..6751f3dcca 100644 --- a/libs/ardour/ardour/butler.h +++ b/libs/ardour/ardour/butler.h @@ -54,8 +54,8 @@ class Butler : public SessionHandleRef float read_data_rate() const; ///< in usec float write_data_rate() const; - nframes_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; } - nframes_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; } + framecnt_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; } + framecnt_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; } uint32_t midi_diskstream_buffer_size() const { return midi_dstream_buffer_size; } static void* _thread_work(void *arg); @@ -76,8 +76,8 @@ class Butler : public SessionHandleRef bool should_run; mutable gint should_do_transport_work; int request_pipe[2]; - nframes_t audio_dstream_capture_buffer_size; - nframes_t audio_dstream_playback_buffer_size; + framecnt_t audio_dstream_capture_buffer_size; + framecnt_t audio_dstream_playback_buffer_size; uint32_t midi_dstream_buffer_size; RingBuffer<CrossThreadPool*> pool_trash; diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h index 5ee1d50194..783588c8ab 100644 --- a/libs/ardour/ardour/click.h +++ b/libs/ardour/ardour/click.h @@ -29,34 +29,34 @@ namespace ARDOUR { struct Click { - nframes_t start; - nframes_t duration; - nframes_t offset; - const Sample *data; - - Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {} + framepos_t start; + framecnt_t duration; + framecnt_t offset; + const Sample *data; + + Click (framepos_t s, framecnt_t d, const Sample *b) : start (s), duration (d), offset (0), data (b) {} - void *operator new (size_t) { - return pool.alloc (); + void *operator new (size_t) { + return pool.alloc (); }; - - void operator delete(void *ptr, size_t /*size*/) { - pool.release (ptr); - } - + + void operator delete(void *ptr, size_t /*size*/) { + pool.release (ptr); + } + private: - static Pool pool; + static Pool pool; }; typedef std::list<Click*> Clicks; class ClickIO : public IO { - public: +public: ClickIO (Session& s, const std::string& name) : IO (s, name, IO::Output) {} ~ClickIO() {} - protected: +protected: uint32_t pans_required () const { return 1; } }; diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index c920fadc2c..e1aa389df7 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -66,21 +66,21 @@ public: bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); /* supplemental method used with MIDI */ - void flush_buffers (nframes_t nframes, framepos_t time); + void flush_buffers (framecnt_t nframes, framepos_t time); void no_outs_cuz_we_no_monitor(bool); - void cycle_start (nframes_t); - void increment_output_offset (nframes_t); + void cycle_start (pframes_t); + void increment_output_offset (framecnt_t); void transport_stopped (framepos_t frame); BufferSet& output_buffers() { return *_output_buffers; } PBD::Signal0<void> MuteChange; - static PBD::Signal1<void,nframes_t> CycleStart; + static PBD::Signal1<void, pframes_t> CycleStart; XMLNode& state (bool full); int set_state (const XMLNode&, int version); @@ -104,7 +104,7 @@ public: Role _role; BufferSet* _output_buffers; gain_t _current_gain; - nframes_t _output_offset; + framecnt_t _output_offset; bool _no_outs_cuz_we_no_monitor; boost::shared_ptr<MuteMaster> _mute_master; bool no_panner_reset; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 4eabe29d85..cd5932b3e5 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -79,8 +79,8 @@ class Diskstream : public SessionObject, public PublicDiskstream void set_align_style (AlignStyle); void set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; } - nframes_t roll_delay() const { return _roll_delay; } - void set_roll_delay (nframes_t); + framecnt_t roll_delay() const { return _roll_delay; } + void set_roll_delay (framecnt_t); bool record_enabled() const { return g_atomic_int_get (&_record_enabled); } virtual void set_record_enabled (bool yn) = 0; @@ -118,8 +118,8 @@ class Diskstream : public SessionObject, public PublicDiskstream ChanCount n_channels() { return _n_channels; } - static nframes_t disk_io_frames() { return disk_io_chunk_frames; } - static void set_disk_io_chunk_frames (uint32_t n) { disk_io_chunk_frames = n; } + static framecnt_t disk_io_frames() { return disk_io_chunk_frames; } + static void set_disk_io_chunk_frames (framecnt_t n) { disk_io_chunk_frames = n; } /* Stateful */ virtual XMLNode& get_state(void) = 0; @@ -127,7 +127,7 @@ class Diskstream : public SessionObject, public PublicDiskstream virtual void monitor_input (bool) {} - nframes_t capture_offset() const { return _capture_offset; } + framecnt_t capture_offset() const { return _capture_offset; } virtual void set_capture_offset (); bool slaved() const { return _slaved; } @@ -144,7 +144,7 @@ class Diskstream : public SessionObject, public PublicDiskstream /** For non-butler contexts (allocates temporary working buffers) */ virtual int do_refill_with_alloc() = 0; - virtual void set_block_size (nframes_t) = 0; + virtual void set_block_size (pframes_t) = 0; bool pending_overwrite () const { return _pending_overwrite; @@ -186,8 +186,8 @@ class Diskstream : public SessionObject, public PublicDiskstream protected: friend class Track; - virtual int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0; - virtual bool commit (nframes_t nframes) = 0; + virtual int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler) = 0; + virtual bool commit (framecnt_t nframes) = 0; //private: @@ -239,9 +239,9 @@ class Diskstream : public SessionObject, public PublicDiskstream virtual void prepare_to_stop (framepos_t pos); void calculate_record_range(OverlapType ot, framepos_t transport_frame, framecnt_t nframes, - nframes_t& rec_nframes, nframes_t& rec_offset); + framecnt_t& rec_nframes, framecnt_t& rec_offset); - static nframes_t disk_io_chunk_frames; + static framecnt_t disk_io_chunk_frames; std::vector<CaptureInfo*> capture_info; mutable Glib::Mutex capture_info_lock; @@ -265,9 +265,9 @@ class Diskstream : public SessionObject, public PublicDiskstream framepos_t capture_start_frame; framecnt_t capture_captured; bool was_recording; - nframes_t adjust_capture_position; - nframes_t _capture_offset; - nframes_t _roll_delay; + framecnt_t adjust_capture_position; + framecnt_t _capture_offset; + framecnt_t _roll_delay; framepos_t first_recordable_frame; framepos_t last_recordable_frame; int last_possibly_recording; @@ -280,8 +280,8 @@ class Diskstream : public SessionObject, public PublicDiskstream bool _pending_overwrite; bool overwrite_queued; IOChange input_change_pending; - nframes_t wrap_buffer_size; - nframes_t speed_buffer_size; + framecnt_t wrap_buffer_size; + framecnt_t speed_buffer_size; double _speed; double _target_speed; @@ -299,10 +299,6 @@ class Diskstream : public SessionObject, public PublicDiskstream Glib::Mutex state_lock; - framepos_t scrub_start; - nframes_t scrub_buffer_size; - nframes_t scrub_offset; - PBD::ScopedConnectionList playlist_connections; PBD::ScopedConnection ic_connection; diff --git a/libs/ardour/ardour/element_importer.h b/libs/ardour/ardour/element_importer.h index 8ffa3b90ba..8c25fd380d 100644 --- a/libs/ardour/ardour/element_importer.h +++ b/libs/ardour/ardour/element_importer.h @@ -109,13 +109,13 @@ class ElementImporter std::string name; /// The sample rate of the session from which we are importing - nframes_t sample_rate; + framecnt_t sample_rate; /// Converts timecode time to a string std::string timecode_to_string (Timecode::Time & time) const; /// Converts samples so that times match the sessions sample rate - nframes_t rate_convert_samples (nframes_t samples) const; + framecnt_t rate_convert_samples (framecnt_t samples) const; /// Converts samples so that times match the sessions sample rate (for straight use in XML) std::string rate_convert_samples (std::string const & samples) const; diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index 51ecabee25..96b9c1eda2 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -43,7 +43,7 @@ class ExportChannel : public boost::less_than_comparable<ExportChannel> virtual ~ExportChannel () {} - virtual void read (Sample * data, nframes_t frames) const = 0; + virtual void read (Sample * data, framecnt_t frames) const = 0; virtual bool empty () const = 0; /// Adds state to node passed @@ -75,7 +75,7 @@ class PortExportChannel : public ExportChannel PortExportChannel () {} - void read (Sample * data, nframes_t frames) const; + void read (Sample * data, framecnt_t frames) const; bool empty () const { return ports.empty(); } void get_state (XMLNode * node) const; @@ -104,23 +104,23 @@ class RegionExportChannelFactory ~RegionExportChannelFactory (); ExportChannelPtr create (uint32_t channel); - void read (uint32_t channel, Sample * data, nframes_t frames_to_read); + void read (uint32_t channel, Sample * data, framecnt_t frames_to_read); private: - int new_cycle_started (nframes_t) { buffers_up_to_date = false; return 0; } - void update_buffers (nframes_t frames); + int new_cycle_started (framecnt_t) { buffers_up_to_date = false; return 0; } + void update_buffers (framecnt_t frames); AudioRegion const & region; AudioTrack & track; Type type; - nframes_t frames_per_cycle; + framecnt_t frames_per_cycle; size_t n_channels; BufferSet buffers; bool buffers_up_to_date; - nframes_t region_start; - nframes_t position; + framecnt_t region_start; + framecnt_t position; Sample * mixdown_buffer; Sample * gain_buffer; @@ -134,7 +134,7 @@ class RegionExportChannel : public ExportChannel friend class RegionExportChannelFactory; public: - void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); } + void read (Sample * data, framecnt_t frames_to_read) const { factory.read (channel, data, frames_to_read); } void get_state (XMLNode * /*node*/) const {}; void set_state (XMLNode * /*node*/, Session & /*session*/) {}; bool empty () const { return false; } diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h index 9594485a91..52ed9769a7 100644 --- a/libs/ardour/ardour/export_format_specification.h +++ b/libs/ardour/ardour/export_format_specification.h @@ -47,7 +47,7 @@ class ExportFormatSpecification : public ExportFormatBase { Time (Session & session) : AnyTime (), session (session) {} Time & operator= (AnyTime const & other); - nframes_t get_frames (nframes_t target_rate) const; + framecnt_t get_frames (framecnt_t target_rate) const; /* Serialization */ @@ -123,11 +123,11 @@ class ExportFormatSpecification : public ExportFormatBase { bool tag () const { return _tag && supports_tagging; } - nframes_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); } - nframes_t silence_end () const { return _silence_end.get_frames (sample_rate()); } + framecnt_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); } + framecnt_t silence_end () const { return _silence_end.get_frames (sample_rate()); } - nframes_t silence_beginning (nframes_t samplerate) const { return _silence_beginning.get_frames (samplerate); } - nframes_t silence_end (nframes_t samplerate) const { return _silence_end.get_frames (samplerate); } + framecnt_t silence_beginning (framecnt_t samplerate) const { return _silence_beginning.get_frames (samplerate); } + framecnt_t silence_end (framecnt_t samplerate) const { return _silence_end.get_frames (samplerate); } AnyTime silence_beginning_time () const { return _silence_beginning; } AnyTime silence_end_time () const { return _silence_end; } diff --git a/libs/ardour/ardour/export_graph_builder.h b/libs/ardour/ardour/export_graph_builder.h index 55fa7133fc..1c49eccd9d 100644 --- a/libs/ardour/ardour/export_graph_builder.h +++ b/libs/ardour/ardour/export_graph_builder.h @@ -62,7 +62,7 @@ class ExportGraphBuilder ExportGraphBuilder (Session const & session); ~ExportGraphBuilder (); - int process (nframes_t frames, bool last_cycle); + int process (framecnt_t frames, bool last_cycle); bool process_normalize (); // returns true when finished void reset (); @@ -102,7 +102,7 @@ class ExportGraphBuilder class SFC { public: // This constructor so that this can be constructed like a Normalizer - SFC (ExportGraphBuilder &, FileSpec const & new_config, nframes_t max_frames); + SFC (ExportGraphBuilder &, FileSpec const & new_config, framecnt_t max_frames); FloatSinkPtr sink (); void add_child (FileSpec const & new_config); bool operator== (FileSpec const & other_config) const; @@ -124,7 +124,7 @@ class ExportGraphBuilder class Normalizer { public: - Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); + Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames); FloatSinkPtr sink (); void add_child (FileSpec const & new_config); bool operator== (FileSpec const & other_config) const; @@ -144,7 +144,7 @@ class ExportGraphBuilder ExportGraphBuilder & parent; FileSpec config; - nframes_t max_frames_out; + framecnt_t max_frames_out; BufferPtr buffer; PeakReaderPtr peak_reader; @@ -159,7 +159,7 @@ class ExportGraphBuilder // sample rate converter class SRC { public: - SRC (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); + SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames); FloatSinkPtr sink (); void add_child (FileSpec const & new_config); bool operator== (FileSpec const & other_config) const; @@ -175,13 +175,13 @@ class ExportGraphBuilder boost::ptr_list<SFC> children; boost::ptr_list<Normalizer> normalized_children; SRConverterPtr converter; - nframes_t max_frames_out; + framecnt_t max_frames_out; }; // Silence trimmer + adder class SilenceHandler { public: - SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, nframes_t max_frames); + SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames); FloatSinkPtr sink (); void add_child (FileSpec const & new_config); bool operator== (FileSpec const & other_config) const; @@ -193,7 +193,7 @@ class ExportGraphBuilder FileSpec config; boost::ptr_list<SRC> children; SilenceTrimmerPtr silence_trimmer; - nframes_t max_frames_in; + framecnt_t max_frames_in; }; // channel configuration @@ -210,7 +210,7 @@ class ExportGraphBuilder FileSpec config; boost::ptr_list<SilenceHandler> children; InterleaverPtr interleaver; - nframes_t max_frames; + framecnt_t max_frames; }; Session const & session; @@ -223,7 +223,7 @@ class ExportGraphBuilder ChannelMap channels; Sample * process_buffer; - nframes_t process_buffer_frames; + framecnt_t process_buffer_frames; std::list<Normalizer *> normalizers; diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h index f826e09bf5..dbc8213eed 100644 --- a/libs/ardour/ardour/export_handler.h +++ b/libs/ardour/ardour/export_handler.h @@ -119,7 +119,7 @@ class ExportHandler : public ExportElementFactory private: - int process (nframes_t frames); + int process (framecnt_t frames); Session & session; GraphBuilderPtr graph_builder; @@ -132,7 +132,7 @@ class ExportHandler : public ExportElementFactory /* Timespan management */ void start_timespan (); - int process_timespan (nframes_t frames); + int process_timespan (framecnt_t frames); int process_normalize (); void finish_timespan (); diff --git a/libs/ardour/ardour/export_profile_manager.h b/libs/ardour/ardour/export_profile_manager.h index b8e86d11df..67ebe2b316 100644 --- a/libs/ardour/ardour/export_profile_manager.h +++ b/libs/ardour/ardour/export_profile_manager.h @@ -136,8 +136,8 @@ class ExportProfileManager typedef boost::shared_ptr<TimespanState> TimespanStatePtr; typedef std::list<TimespanStatePtr> TimespanStateList; - void set_selection_range (nframes_t start = 0, nframes_t end = 0); - std::string set_single_range (nframes_t start, nframes_t end, std::string name); + void set_selection_range (framepos_t start = 0, framepos_t end = 0); + std::string set_single_range (framepos_t start, framepos_t end, std::string name); TimespanStateList const & get_timespans () { return check_list (timespans); } private: diff --git a/libs/ardour/ardour/export_timespan.h b/libs/ardour/ardour/export_timespan.h index 592f36b1a9..ba31fd6f6a 100644 --- a/libs/ardour/ardour/export_timespan.h +++ b/libs/ardour/ardour/export_timespan.h @@ -42,7 +42,7 @@ class ExportTimespan private: friend class ExportElementFactory; - ExportTimespan (ExportStatusPtr status, nframes_t frame_rate); + ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate); public: ~ExportTimespan (); @@ -53,19 +53,19 @@ class ExportTimespan std::string range_id () const { return _range_id; } void set_range_id (std::string range_id) { _range_id = range_id; } - void set_range (nframes_t start, nframes_t end); - nframes_t get_length () const { return end_frame - start_frame; } - nframes_t get_start () const { return start_frame; } - nframes_t get_end () const { return end_frame; } + void set_range (framepos_t start, framepos_t end); + framecnt_t get_length () const { return end_frame - start_frame; } + framepos_t get_start () const { return start_frame; } + framepos_t get_end () const { return end_frame; } private: ExportStatusPtr status; - nframes_t start_frame; - nframes_t end_frame; - nframes_t position; - nframes_t frame_rate; + framepos_t start_frame; + framepos_t end_frame; + framepos_t position; + framecnt_t frame_rate; std::string _name; std::string _range_id; diff --git a/libs/ardour/ardour/gain.h b/libs/ardour/ardour/gain.h index 785475444a..71706a2837 100644 --- a/libs/ardour/ardour/gain.h +++ b/libs/ardour/ardour/gain.h @@ -31,10 +31,10 @@ struct Gain : public AutomationList { Gain (const Gain&); Gain& operator= (const Gain&); - static void fill_linear_fade_in (Gain& curve, nframes_t frames); - static void fill_linear_volume_fade_in (Gain& curve, nframes_t frames); - static void fill_linear_fade_out (Gain& curve, nframes_t frames); - static void fill_linear_volume_fade_out (Gain& curve, nframes_t frames); + static void fill_linear_fade_in (Gain& curve, framecnt_t frames); + static void fill_linear_volume_fade_in (Gain& curve, framecnt_t frames); + static void fill_linear_fade_out (Gain& curve, framecnt_t frames); + static void fill_linear_volume_fade_out (Gain& curve, framecnt_t frames); }; diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h index bb51c99237..6893c08d9d 100644 --- a/libs/ardour/ardour/graph.h +++ b/libs/ardour/ardour/graph.h @@ -71,14 +71,14 @@ class Graph : public SessionHandleRef void helper_thread(); void main_thread(); - int silent_process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool can_record, bool rec_monitors_input, bool& need_butler); + int silent_process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, + bool can_record, bool rec_monitors_input, bool& need_butler); - int process_routes (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, - bool can_record, bool rec_monitors_input, bool& need_butler); + int process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, + bool can_record, bool rec_monitors_input, bool& need_butler); - int routes_no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, - bool non_rt_pending, bool can_record, int declick); + int routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, + bool non_rt_pending, bool can_record, int declick); void process_one_route (Route * route); @@ -118,7 +118,7 @@ class Graph : public SessionHandleRef volatile int _setup_chain; // parameter caches. - nframes_t _process_nframes; + pframes_t _process_nframes; framepos_t _process_start_frame; framepos_t _process_end_frame; bool _process_can_record; diff --git a/libs/ardour/ardour/importable_source.h b/libs/ardour/ardour/importable_source.h index c610d546f2..804b062969 100644 --- a/libs/ardour/ardour/importable_source.h +++ b/libs/ardour/ardour/importable_source.h @@ -30,12 +30,12 @@ public: ImportableSource () {} virtual ~ImportableSource() {} - virtual nframes_t read (Sample* buffer, nframes_t nframes) = 0; + virtual framecnt_t read (Sample* buffer, framecnt_t nframes) = 0; virtual float ratio() const { return 1.0f; } virtual uint32_t channels() const = 0; virtual framecnt_t length() const = 0; - virtual nframes_t samplerate() const = 0; - virtual void seek (nframes_t pos) = 0; + virtual framecnt_t samplerate() const = 0; + virtual void seek (framecnt_t pos) = 0; virtual framepos_t natural_position() const = 0; virtual bool clamped_at_unity () const = 0; diff --git a/libs/ardour/ardour/internal_return.h b/libs/ardour/ardour/internal_return.h index d05e764592..41d09b2805 100644 --- a/libs/ardour/ardour/internal_return.h +++ b/libs/ardour/ardour/internal_return.h @@ -36,21 +36,21 @@ XMLNode& state(bool full); XMLNode& get_state(void); int set_state(const XMLNode&, int version); - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); bool configure_io (ChanCount in, ChanCount out); bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; - int set_block_size (nframes_t); + int set_block_size (pframes_t); BufferSet* get_buffers(); void release_buffers(); - static PBD::Signal1<void,nframes_t> CycleStart; + static PBD::Signal1<void, pframes_t> CycleStart; private: BufferSet buffers; gint user_count; /* atomic */ - void allocate_buffers (nframes_t); - void cycle_start (nframes_t); + void allocate_buffers (pframes_t); + void cycle_start (pframes_t); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index d2a769982c..903e4673df 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -39,11 +39,11 @@ class InternalSend : public Send XMLNode& get_state(void); int set_state(const XMLNode& node, int version); - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); bool feeds (boost::shared_ptr<Route> other) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); - int set_block_size (nframes_t); + int set_block_size (pframes_t); boost::shared_ptr<Route> target_route() const { return _send_to; } const PBD::ID& target_id() const { return _send_to_id; } diff --git a/libs/ardour/ardour/interpolation.h b/libs/ardour/ardour/interpolation.h index 21a47cfcdc..0d79b01d14 100644 --- a/libs/ardour/ardour/interpolation.h +++ b/libs/ardour/ardour/interpolation.h @@ -39,13 +39,13 @@ class Interpolation { }; class LinearInterpolation : public Interpolation { - public: - nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output); +public: + framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output); }; class CubicInterpolation : public Interpolation { - public: - nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output); +public: + framecnt_t interpolate (int channel, framecnt_t nframes, Sample* input, Sample* output); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 9d423f55a5..fd7cb563fd 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -89,7 +89,7 @@ class IO : public SessionObject, public Latent bool set_name (const std::string& str); - virtual void silence (nframes_t); + virtual void silence (framecnt_t); int ensure_io (ChanCount cnt, bool clear, void *src); @@ -109,9 +109,9 @@ class IO : public SessionObject, public Latent bool connected () const; bool physically_connected () const; - nframes_t signal_latency() const { return _own_latency; } - nframes_t latency() const; - void set_port_latency (nframes_t); + framecnt_t signal_latency () const { return _own_latency; } + framecnt_t latency () const; + void set_port_latency (framecnt_t); void update_port_total_latencies (); @@ -188,9 +188,9 @@ class IO : public SessionObject, public Latent /* three utility functions - this just seems to be simplest place to put them */ - void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset); - void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, nframes_t nframes); - void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset); + void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset); + void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, pframes_t nframes); + void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset); /* AudioTrack::deprecated_use_diskstream_connections() needs these */ diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h index 7d1854ced0..cb80b74351 100644 --- a/libs/ardour/ardour/io_processor.h +++ b/libs/ardour/ardour/io_processor.h @@ -62,7 +62,7 @@ class IOProcessor : public Processor void set_input (boost::shared_ptr<IO>); void set_output (boost::shared_ptr<IO>); - void silence (nframes_t nframes); + void silence (framecnt_t nframes); void disconnect (); virtual bool feeds (boost::shared_ptr<Route> other) const; diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h index f4da2bf0a0..968342a909 100644 --- a/libs/ardour/ardour/ladspa_plugin.h +++ b/libs/ardour/ardour/ladspa_plugin.h @@ -39,7 +39,7 @@ class Session; class LadspaPlugin : public ARDOUR::Plugin { public: - LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, nframes_t sample_rate); + LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, framecnt_t sample_rate); LadspaPlugin (const LadspaPlugin &); ~LadspaPlugin (); @@ -51,7 +51,7 @@ class LadspaPlugin : public ARDOUR::Plugin const char* maker() const { return _descriptor->Maker; } uint32_t parameter_count() const { return _descriptor->PortCount; } float default_value (uint32_t port); - nframes_t signal_latency() const; + framecnt_t signal_latency() const; void set_parameter (uint32_t port, float val); float get_parameter (uint32_t port) const; int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const; @@ -81,11 +81,11 @@ class LadspaPlugin : public ARDOUR::Plugin _descriptor->cleanup (_handle); } - int set_block_size (nframes_t /*nframes*/) { return 0; } + int set_block_size (pframes_t /*nframes*/) { return 0; } int connect_and_run (BufferSet& bufs, ChanMapping in, ChanMapping out, - nframes_t nframes, nframes_t offset); + pframes_t nframes, framecnt_t offset); std::string describe_parameter (Evoral::Parameter); std::string state_node_name() const { return "ladspa"; } @@ -122,15 +122,15 @@ class LadspaPlugin : public ARDOUR::Plugin void* _module; const LADSPA_Descriptor* _descriptor; LADSPA_Handle _handle; - nframes_t _sample_rate; + framecnt_t _sample_rate; LADSPA_Data* _control_data; LADSPA_Data* _shadow_data; LADSPA_Data* _latency_control_port; uint32_t _index; bool _was_activated; - void init (void *mod, uint32_t index, nframes_t rate); - void run_in_place (nframes_t nsamples); + void init (void *mod, uint32_t index, framecnt_t rate); + void run_in_place (pframes_t nsamples); void latency_compute_run (); int set_state_2X (const XMLNode&, int version); }; diff --git a/libs/ardour/ardour/latent.h b/libs/ardour/ardour/latent.h index d1e62aaf45..ba2f91d2a2 100644 --- a/libs/ardour/ardour/latent.h +++ b/libs/ardour/ardour/latent.h @@ -10,10 +10,10 @@ class Latent { Latent() : _own_latency (0), _user_latency (0) {} virtual ~Latent() {} - virtual nframes_t signal_latency() const = 0; - nframes_t user_latency () const { return _user_latency; } + virtual framecnt_t signal_latency() const = 0; + framecnt_t user_latency () const { return _user_latency; } - nframes_t effective_latency() const { + framecnt_t effective_latency() const { if (_user_latency) { return _user_latency; } else { @@ -21,12 +21,12 @@ class Latent { } } - virtual void set_latency_delay (nframes_t val) { _own_latency = val; } - virtual void set_user_latency (nframes_t val) { _user_latency = val; } + virtual void set_latency_delay (framecnt_t val) { _own_latency = val; } + virtual void set_user_latency (framecnt_t val) { _user_latency = val; } protected: - nframes_t _own_latency; - nframes_t _user_latency; + framecnt_t _own_latency; + framecnt_t _user_latency; }; } diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 0c8b3e511c..821922903b 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -41,7 +41,7 @@ struct LV2World; class LV2Plugin : public ARDOUR::Plugin { public: - LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, nframes_t sample_rate); + LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, ARDOUR::LV2World&, SLV2Plugin plugin, framecnt_t sample_rate); LV2Plugin (const LV2Plugin &); ~LV2Plugin (); @@ -53,7 +53,7 @@ class LV2Plugin : public ARDOUR::Plugin const char* maker() const { return _author ? slv2_value_as_string(_author) : "Unknown"; } uint32_t parameter_count() const { return slv2_plugin_get_num_ports(_plugin); } float default_value (uint32_t port); - nframes_t signal_latency() const; + framecnt_t signal_latency () const; void set_parameter (uint32_t port, float val); float get_parameter (uint32_t port) const; int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const; @@ -93,11 +93,11 @@ class LV2Plugin : public ARDOUR::Plugin _instance = NULL; } - int set_block_size (nframes_t /*nframes*/) { return 0; } + int set_block_size (pframes_t /*nframes*/) { return 0; } int connect_and_run (BufferSet& bufs, ChanMapping in, ChanMapping out, - nframes_t nframes, nframes_t offset); + pframes_t nframes, framecnt_t offset); std::string describe_parameter (Evoral::Parameter); std::string state_node_name() const { return "lv2"; } @@ -129,7 +129,7 @@ class LV2Plugin : public ARDOUR::Plugin SLV2Value _name; SLV2Value _author; SLV2Instance _instance; - nframes_t _sample_rate; + framecnt_t _sample_rate; float* _control_data; float* _shadow_data; float* _defaults; @@ -149,8 +149,8 @@ class LV2Plugin : public ARDOUR::Plugin static URIMap _uri_map; static uint32_t _midi_event_type; - void init (LV2World& world, SLV2Plugin plugin, nframes_t rate); - void run (nframes_t nsamples); + void init (LV2World& world, SLV2Plugin plugin, framecnt_t rate); + void run (pframes_t nsamples); void latency_compute_run (); }; diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h index dad86d5185..7ff910a91b 100644 --- a/libs/ardour/ardour/meter.h +++ b/libs/ardour/ardour/meter.h @@ -68,7 +68,7 @@ public: void reflect_inputs (const ChanCount& in); /** Compute peaks */ - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); ChanCount input_streams () const { return current_meters; } ChanCount output_streams () const { return current_meters; } diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index b3ed093df7..18a95e9347 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -32,14 +32,14 @@ namespace ARDOUR { class MidiBuffer : public Buffer { public: - typedef nframes_t TimeType; + typedef framepos_t TimeType; MidiBuffer(size_t capacity); ~MidiBuffer(); - void silence (nframes_t nframes, nframes_t offset = 0); - void read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0); - void merge_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0); + void silence (framecnt_t nframes, framecnt_t offset = 0); + void read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0); + void merge_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0); void copy(const MidiBuffer& copy); @@ -55,7 +55,7 @@ public: template<typename BufferType, typename EventType> struct iterator_base { - iterator_base<BufferType, EventType>(BufferType& b, nframes_t o) : buffer(b), offset(o) {} + iterator_base<BufferType, EventType>(BufferType& b, framecnt_t o) : buffer(b), offset(o) {} inline EventType operator*() const { uint8_t* ev_start = buffer._data + offset + sizeof(TimeType); int event_size = Evoral::midi_event_size(ev_start); diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index 126857a858..aea60dc3bf 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -124,7 +124,7 @@ class MidiDiskstream : public Diskstream void set_pending_overwrite(bool); int overwrite_existing_buffers (); - void set_block_size (nframes_t); + void set_block_size (pframes_t); int internal_playback_seek (framecnt_t distance); int can_internal_playback_seek (framecnt_t distance); int rename_write_sources (); @@ -133,7 +133,7 @@ class MidiDiskstream : public Diskstream void non_realtime_input_change (); void non_realtime_locate (framepos_t location); - static void set_readahead_frames(nframes_t frames_ahead) { midi_readahead = frames_ahead; } + static void set_readahead_frames (framecnt_t frames_ahead) { midi_readahead = frames_ahead; } protected: int seek (framepos_t which_sample, bool complete_refill = false); @@ -141,9 +141,9 @@ class MidiDiskstream : public Diskstream protected: friend class MidiTrack; - int process (framepos_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); - bool commit (nframes_t nframes); - static nframes_t midi_readahead; + int process (framepos_t transport_frame, pframes_t nframes, bool can_record, bool rec_monitors_input, bool& need_butler); + bool commit (framecnt_t nframes); + static framecnt_t midi_readahead; private: @@ -153,7 +153,7 @@ class MidiDiskstream : public Diskstream int do_refill_with_alloc(); - int read (framepos_t& start, nframes_t cnt, bool reversed); + int read (framepos_t& start, framecnt_t cnt, bool reversed); void finish_capture (bool rec_monitors_input); void transport_stopped_wallclock (struct tm&, time_t, bool abort); @@ -181,11 +181,11 @@ class MidiDiskstream : public Diskstream void engage_record_enable (); void disengage_record_enable (); - MidiRingBuffer<nframes_t>* _playback_buf; - MidiRingBuffer<nframes_t>* _capture_buf; + MidiRingBuffer<framepos_t>* _playback_buf; + MidiRingBuffer<framepos_t>* _capture_buf; MidiPort* _source_port; boost::shared_ptr<SMFSource> _write_source; - nframes_t _last_flush_frame; + framepos_t _last_flush_frame; NoteMode _note_mode; volatile gint _frames_written_to_ringbuffer; volatile gint _frames_read_from_ringbuffer; diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index ccadb39e92..6170e9271f 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -43,13 +43,13 @@ public: MidiPlaylist (Session&, const XMLNode&, bool hidden = false); MidiPlaylist (Session&, std::string name, bool hidden = false); MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, std::string name, bool hidden = false); - MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t cnt, + MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false); ~MidiPlaylist (); - nframes_t read (MidiRingBuffer<nframes_t>& buf, - nframes_t start, nframes_t cnt, uint32_t chan_n=0); + framecnt_t read (MidiRingBuffer<framepos_t>& buf, + framepos_t start, framecnt_t cnt, uint32_t chan_n = 0); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h index 8b6095c470..7a019e5a20 100644 --- a/libs/ardour/ardour/midi_port.h +++ b/libs/ardour/ardour/midi_port.h @@ -37,20 +37,20 @@ class MidiPort : public Port { return DataType::MIDI; } - void cycle_start (nframes_t nframes); - void cycle_end (nframes_t nframes); + void cycle_start (pframes_t nframes); + void cycle_end (pframes_t nframes); void cycle_split (); - void flush_buffers (nframes_t nframes, framepos_t time, nframes_t offset = 0); + void flush_buffers (pframes_t nframes, framepos_t time, framecnt_t offset = 0); void transport_stopped (); - size_t raw_buffer_size(jack_nframes_t nframes) const; + size_t raw_buffer_size (pframes_t nframes) const; - Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) { + Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) { return get_midi_buffer (nframes, offset); } - MidiBuffer& get_midi_buffer (nframes_t nframes, nframes_t offset = 0); + MidiBuffer& get_midi_buffer (framecnt_t nframes, framecnt_t offset = 0); protected: friend class AudioEngine; diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index dbbf6d80d1..853272d349 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -70,14 +70,14 @@ class MidiRegion : public Region virtual framecnt_t read (Sample*, framepos_t /*pos*/, framecnt_t /*cnt*/, int /*channel*/) const { return 0; } virtual framecnt_t readable_length() const { return length(); } - framecnt_t read_at (Evoral::EventSink<nframes_t>& dst, + framecnt_t read_at (Evoral::EventSink<framepos_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n = 0, NoteMode mode = Sustained, MidiStateTracker* tracker = 0) const; - framepos_t master_read_at (MidiRingBuffer<nframes_t>& dst, + framepos_t master_read_at (MidiRingBuffer<framepos_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n = 0, @@ -114,7 +114,7 @@ class MidiRegion : public Region MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset = 0, bool offset_relative = true); private: - framecnt_t _read_at (const SourceList&, Evoral::EventSink<nframes_t>& dst, + framecnt_t _read_at (const SourceList&, Evoral::EventSink<framepos_t>& dst, framepos_t position, framecnt_t dur, uint32_t chan_n = 0, diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h index 2de611f4d6..a809226a30 100644 --- a/libs/ardour/ardour/midi_ring_buffer.h +++ b/libs/ardour/ardour/midi_ring_buffer.h @@ -50,7 +50,7 @@ public: inline bool read_prefix(T* time, Evoral::EventType* type, uint32_t* size); inline bool read_contents(uint32_t size, uint8_t* buf); - size_t read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset=0); + size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0); void dump(std::ostream& dst); /** Set the channel filtering mode. diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h index 0c2759b96d..e40ccff291 100644 --- a/libs/ardour/ardour/midi_source.h +++ b/libs/ardour/ardour/midi_source.h @@ -58,19 +58,19 @@ class MidiSource : virtual public Source * \param cnt Length of range to be read (in audio frames) * \param tracker an optional pointer to MidiStateTracker object, for note on/off tracking */ - virtual nframes_t midi_read (Evoral::EventSink<nframes_t>& dst, - framepos_t source_start, - framepos_t start, nframes_t cnt, - MidiStateTracker*, - std::set<Evoral::Parameter> const &) const; + virtual framecnt_t midi_read (Evoral::EventSink<framepos_t>& dst, + framepos_t source_start, + framepos_t start, framecnt_t cnt, + MidiStateTracker*, + std::set<Evoral::Parameter> const &) const; - virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src, - framepos_t source_start, - nframes_t cnt); + virtual framecnt_t midi_write (MidiRingBuffer<framepos_t>& src, + framepos_t source_start, + framecnt_t cnt); virtual void append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& ev) = 0; - virtual void append_event_unlocked_frames(const Evoral::Event<nframes_t>& ev, + virtual void append_event_unlocked_frames(const Evoral::Event<framepos_t>& ev, framepos_t source_start) = 0; virtual bool empty () const; @@ -130,14 +130,14 @@ class MidiSource : virtual public Source protected: virtual void flush_midi() = 0; - virtual nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst, - framepos_t position, - framepos_t start, nframes_t cnt, - MidiStateTracker* tracker) const = 0; + virtual framepos_t read_unlocked (Evoral::EventSink<framepos_t>& dst, + framepos_t position, + framepos_t start, framecnt_t cnt, + MidiStateTracker* tracker) const = 0; - virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst, - framepos_t position, - nframes_t cnt) = 0; + virtual framepos_t write_unlocked (MidiRingBuffer<framepos_t>& dst, + framepos_t position, + framecnt_t cnt) = 0; std::string _captured_for; mutable uint32_t _read_data_count; ///< modified in read() diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h index 9720649a10..f6acb88f23 100644 --- a/libs/ardour/ardour/midi_state_tracker.h +++ b/libs/ardour/ardour/midi_state_tracker.h @@ -42,7 +42,7 @@ public: void add (uint8_t note, uint8_t chn); void remove (uint8_t note, uint8_t chn); void resolve_notes (MidiBuffer& buffer, framepos_t time); - void resolve_notes (Evoral::EventSink<nframes_t>& buffer, framepos_t time); + void resolve_notes (Evoral::EventSink<framepos_t>& buffer, framepos_t time); void resolve_notes (MidiSource& src, Evoral::MusicalTime time); void dump (std::ostream&); void reset (); diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index 91ccc4b1fe..554f5b3385 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -39,7 +39,7 @@ public: MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal); ~MidiTrack (); - int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler); void handle_transport_stopped (bool abort, bool did_locate, bool flush_processors); @@ -52,16 +52,17 @@ public: return DataType::MIDI; } - void set_latency_delay (nframes_t); + void set_latency_delay (framecnt_t); - int export_stuff (BufferSet& bufs, nframes_t nframes, framepos_t end_frame); + int export_stuff (BufferSet& bufs, framecnt_t nframes, framepos_t end_frame); void freeze_me (InterThreadInfo&); void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); - boost::shared_ptr<Region> bounce_range ( - nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); + boost::shared_ptr<Region> bounce_range ( + framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing + ); int set_state(const XMLNode&, int version); @@ -86,7 +87,7 @@ public: bool step_editing() const { return _step_editing; } void set_step_editing (bool yn); - MidiRingBuffer<nframes_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; } + MidiRingBuffer<framepos_t>& step_edit_ring_buffer() { return _step_edit_ring_buffer; } PBD::Signal1<void,bool> StepEditStatusChange; @@ -112,21 +113,21 @@ protected: private: boost::shared_ptr<MidiDiskstream> midi_diskstream () const; - void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes); + void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, framecnt_t nframes); void set_state_part_two (); void set_state_part_three (); - MidiRingBuffer<nframes_t> _immediate_events; - MidiRingBuffer<nframes_t> _step_edit_ring_buffer; + MidiRingBuffer<framepos_t> _immediate_events; + MidiRingBuffer<framepos_t> _step_edit_ring_buffer; NoteMode _note_mode; bool _step_editing; uint8_t _default_channel; bool _midi_thru; - int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input); - void push_midi_input_to_step_edit_ringbuffer (nframes_t nframes); + void push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes); void diskstream_data_recorded (boost::shared_ptr<MidiBuffer>, boost::weak_ptr<MidiSource>); PBD::ScopedConnection _diskstream_data_recorded_connection; diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h index 72b414d09c..2118b819b5 100644 --- a/libs/ardour/ardour/mix.h +++ b/libs/ardour/ardour/mix.h @@ -26,39 +26,39 @@ extern "C" { /* SSE functions */ - float x86_sse_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current); - void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain); - void x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain); - void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes); + float x86_sse_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current); + void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain); + void x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain); + void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); } -void x86_sse_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max); +void x86_sse_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max); /* debug wrappers for SSE functions */ -float debug_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current); -void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain); -void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain); -void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes); +float debug_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current); +void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain); +void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain); +void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); #endif #if defined (__APPLE__) -float veclib_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current); -void veclib_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max); -void veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain); -void veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain); -void veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes); +float veclib_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current); +void veclib_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max); +void veclib_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain); +void veclib_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain); +void veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); #endif /* non-optimized functions */ -float default_compute_peak (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float current); -void default_find_peaks (const ARDOUR::Sample * buf, ARDOUR::nframes_t nsamples, float *min, float *max); -void default_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::nframes_t nframes, float gain); -void default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes, float gain); -void default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::nframes_t nframes); +float default_compute_peak (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float current); +void default_find_peaks (const ARDOUR::Sample * buf, ARDOUR::pframes_t nsamples, float *min, float *max); +void default_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain); +void default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain); +void default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); #endif /* __ardour_mix_h__ */ diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h index 0f23d7029f..f8675bde2e 100644 --- a/libs/ardour/ardour/monitor_processor.h +++ b/libs/ardour/ardour/monitor_processor.h @@ -110,7 +110,7 @@ class MonitorProcessor : public Processor bool display_to_user() const; - void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/); + void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/); XMLNode& state (bool full); int set_state (const XMLNode&, int /* version */); diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h index 3bfe2cf713..4550aab5a5 100644 --- a/libs/ardour/ardour/panner.h +++ b/libs/ardour/ardour/panner.h @@ -56,8 +56,8 @@ class StreamPanner : public PBD::Stateful void set_position (const PBD::AngularVector&, bool link_call = false); void set_diffusion (double); - void distribute (AudioBuffer &, BufferSet &, gain_t, nframes_t); - void distribute_automated (AudioBuffer &, BufferSet &, nframes_t, nframes_t, nframes_t, pan_t **); + void distribute (AudioBuffer &, BufferSet &, gain_t, pframes_t); + void distribute_automated (AudioBuffer &, BufferSet &, framepos_t, framepos_t, pframes_t, pan_t **); /* the basic StreamPanner API */ @@ -69,9 +69,9 @@ class StreamPanner : public PBD::Stateful * @param gain_coeff Gain coefficient to apply to output samples. * @param nframes Number of frames in the input. */ - virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes) = 0; + virtual void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes) = 0; virtual void do_distribute_automated (AudioBuffer& src, BufferSet& obufs, - nframes_t start, nframes_t end, nframes_t nframes, + framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers) = 0; boost::shared_ptr<AutomationControl> pan_control() { return _control; } @@ -135,7 +135,7 @@ class BaseStereoPanner : public StreamPanner and a type name. See EqualPowerStereoPanner as an example. */ - void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes); + void do_distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes); static double azimuth_to_lr_fract (double azi) { /* 180.0 degrees=> left => 0.0 */ @@ -169,7 +169,7 @@ class EqualPowerStereoPanner : public BaseStereoPanner ~EqualPowerStereoPanner (); void do_distribute_automated (AudioBuffer& src, BufferSet& obufs, - nframes_t start, nframes_t end, nframes_t nframes, + framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers); void get_current_coefficients (pan_t*) const; @@ -219,7 +219,7 @@ public: bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; }; /// The fundamental Panner function - void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, nframes_t nframes); + void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes); bool bypassed() const { return _bypassed; } void set_bypassed (bool yn); @@ -300,7 +300,7 @@ public: /* disallow copy construction */ Panner (Panner const &); - void distribute_no_automation(BufferSet& src, BufferSet& dest, nframes_t nframes, gain_t gain_coeff); + void distribute_no_automation(BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff); std::vector<StreamPanner*> _streampanners; ///< one StreamPanner per input std::vector<Output> outputs; uint32_t current_outs; diff --git a/libs/ardour/ardour/peak.h b/libs/ardour/ardour/peak.h index 2283f50118..ab99889dd3 100644 --- a/libs/ardour/ardour/peak.h +++ b/libs/ardour/ardour/peak.h @@ -25,9 +25,9 @@ #include "ardour/utils.h" static inline float -default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::nframes_t nsamples, float current) +default_compute_peak (const ARDOUR::Sample * const buf, ARDOUR::pframes_t nsamples, float current) { - for (ARDOUR::nframes_t i = 0; i < nsamples; ++i) { + for (ARDOUR::pframes_t i = 0; i < nsamples; ++i) { current = f_max (current, fabsf (buf[i])); } return current; diff --git a/libs/ardour/ardour/playlist_factory.h b/libs/ardour/ardour/playlist_factory.h index 17645ad8a3..8b5d9d6a23 100644 --- a/libs/ardour/ardour/playlist_factory.h +++ b/libs/ardour/ardour/playlist_factory.h @@ -36,7 +36,7 @@ class PlaylistFactory { static boost::shared_ptr<Playlist> create (Session&, const XMLNode&, bool hidden = false, bool unused = false); static boost::shared_ptr<Playlist> create (DataType type, Session&, std::string name, bool hidden = false); static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, std::string name, bool hidden = false); - static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false); + static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false); }; } diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index 3d7c8d9c33..bab2b71f31 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -112,11 +112,11 @@ class Plugin : public PBD::StatefulDestructible, public Latent virtual void deactivate () = 0; virtual void flush () { deactivate(); activate(); } - virtual int set_block_size (nframes_t nframes) = 0; + virtual int set_block_size (pframes_t nframes) = 0; virtual int connect_and_run (BufferSet& bufs, ChanMapping in, ChanMapping out, - nframes_t nframes, nframes_t offset) = 0; + pframes_t nframes, framecnt_t offset) = 0; virtual std::set<Evoral::Parameter> automatable() const = 0; virtual std::string describe_parameter (Evoral::Parameter) = 0; diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 9b65ba41f5..e4a42d8165 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -52,14 +52,14 @@ class PluginInsert : public Processor XMLNode& get_state(void); int set_state(const XMLNode&, int version); - void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); - void silence (nframes_t nframes); + void run (BufferSet& in, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); + void silence (framecnt_t nframes); void activate (); void deactivate (); void flush (); - int set_block_size (nframes_t nframes); + int set_block_size (pframes_t nframes); ChanCount output_streams() const; ChanCount input_streams() const; @@ -101,11 +101,11 @@ class PluginInsert : public Processor std::string describe_parameter (Evoral::Parameter param); - nframes_t signal_latency() const; + framecnt_t signal_latency () const; boost::shared_ptr<Plugin> get_impulse_analysis_plugin(); - void collect_signal_for_analysis(nframes_t nframes); + void collect_signal_for_analysis (framecnt_t nframes); PBD::Signal2<void,BufferSet*, BufferSet*> AnalysisDataGathered; @@ -125,14 +125,14 @@ class PluginInsert : public Processor boost::weak_ptr<Plugin> _impulseAnalysisPlugin; - nframes_t _signal_analysis_collected_nframes; - nframes_t _signal_analysis_collect_nframes_max; + framecnt_t _signal_analysis_collected_nframes; + framecnt_t _signal_analysis_collect_nframes_max; BufferSet _signal_analysis_inputs; BufferSet _signal_analysis_outputs; - void automation_run (BufferSet& bufs, nframes_t nframes); - void connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now = 0); + void automation_run (BufferSet& bufs, pframes_t nframes); + void connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now = 0); void set_automatable (); void control_list_automation_state_changed (Evoral::Parameter, AutoState); diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 23b42a55ea..ffdc1d4721 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -45,7 +45,7 @@ public: virtual ~Port (); - static void set_buffer_size (nframes_t sz) { + static void set_buffer_size (pframes_t sz) { _buffer_size = sz; } static void set_connecting_blocked( bool yn ) { @@ -93,24 +93,24 @@ public: void ensure_monitor_input (bool); bool monitoring_input () const; - nframes_t total_latency () const; + framecnt_t total_latency () const; int reestablish (); int reconnect (); void request_monitor_input (bool); - void set_latency (nframes_t); + void set_latency (framecnt_t); virtual void reset (); /** @return the size of the raw buffer (bytes) for duration @a nframes (audio frames) */ - virtual size_t raw_buffer_size(jack_nframes_t nframes) const = 0; + virtual size_t raw_buffer_size (pframes_t nframes) const = 0; virtual DataType type () const = 0; - virtual void cycle_start (nframes_t) = 0; - virtual void cycle_end (nframes_t) = 0; + virtual void cycle_start (pframes_t) = 0; + virtual void cycle_end (pframes_t) = 0; virtual void cycle_split () = 0; - virtual Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) = 0; - virtual void flush_buffers (nframes_t nframes, framepos_t /*time*/, nframes_t offset = 0) { - assert(offset < nframes); + virtual Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) = 0; + virtual void flush_buffers (pframes_t nframes, framepos_t /*time*/, framecnt_t offset = 0) { + assert (offset < nframes); } virtual void transport_stopped () {} @@ -126,8 +126,8 @@ protected: jack_port_t* _jack_port; ///< JACK port - static nframes_t _buffer_size; - static bool _connecting_blocked; + static pframes_t _buffer_size; + static bool _connecting_blocked; static AudioEngine* _engine; ///< the AudioEngine diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h index f4e20a8045..d460aa5546 100644 --- a/libs/ardour/ardour/port_insert.h +++ b/libs/ardour/ardour/port_insert.h @@ -50,9 +50,9 @@ class PortInsert : public IOProcessor XMLNode& get_state(void); int set_state (const XMLNode&, int version); - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); - nframes_t signal_latency() const; + framecnt_t signal_latency () const; bool set_name (const std::string& name); @@ -68,8 +68,8 @@ class PortInsert : public IOProcessor void stop_latency_detection (); MTDM* mtdm () const { return _mtdm; } - void set_measured_latency (nframes_t); - nframes_t latency() const; + void set_measured_latency (framecnt_t); + framecnt_t latency () const; private: /* disallow copy construction */ @@ -77,11 +77,12 @@ class PortInsert : public IOProcessor boost::shared_ptr<Delivery> _out; - uint32_t bitslot; - MTDM* _mtdm; - bool _latency_detect; - nframes_t _latency_flush_frames; - nframes_t _measured_latency;}; + uint32_t bitslot; + MTDM* _mtdm; + bool _latency_detect; + framecnt_t _latency_flush_frames; + framecnt_t _measured_latency; +}; } // namespace ARDOUR diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h index 09505e3f72..182208e560 100644 --- a/libs/ardour/ardour/processor.h +++ b/libs/ardour/ardour/processor.h @@ -61,16 +61,16 @@ class Processor : public SessionObject, public Automatable, public Latent bool get_next_ab_is_active () const { return _next_ab_is_active; } void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; } - virtual nframes_t signal_latency() const { return 0; } + virtual framecnt_t signal_latency() const { return 0; } - virtual int set_block_size (nframes_t /*nframes*/) { return 0; } + virtual int set_block_size (pframes_t /*nframes*/) { return 0; } virtual bool requires_fixed_sized_buffers() const { return false; } /** @param result_required true if, on return from this method, bufs is required to contain valid data; * if false, the method need not bother writing to bufs if it doesn't want to. */ - virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, nframes_t /*nframes*/, bool /*result_required*/) {} - virtual void silence (nframes_t /*nframes*/) {} + virtual void run (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t /*nframes*/, bool /*result_required*/) {} + virtual void silence (framecnt_t /*nframes*/) {} virtual void activate () { _pending_active = true; ActiveChanged(); } virtual void deactivate () { _pending_active = false; ActiveChanged(); } diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 9348544c27..d06edac230 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -102,8 +102,8 @@ CONFIG_VARIABLE (bool, stop_recording_on_xrun, "stop-recording-on-xrun", false) CONFIG_VARIABLE (bool, create_xrun_marker, "create-xrun-marker", true) CONFIG_VARIABLE (bool, stop_at_session_end, "stop-at-session-end", true) CONFIG_VARIABLE (bool, seamless_loop, "seamless-loop", false) -CONFIG_VARIABLE (nframes_t, preroll, "preroll", 0) -CONFIG_VARIABLE (nframes_t, postroll, "postroll", 0) +CONFIG_VARIABLE (framecnt_t, preroll, "preroll", 0) +CONFIG_VARIABLE (framecnt_t, postroll, "postroll", 0) CONFIG_VARIABLE (float, rf_speed, "rf-speed", 2.0f) CONFIG_VARIABLE (float, shuttle_speed_factor, "shuttle-speed-factor", 1.0f) CONFIG_VARIABLE (float, shuttle_speed_threshold, "shuttle-speed-threshold", 5.0f) diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index ef86dce4b2..3ad61919b1 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -193,8 +193,8 @@ class Region void trim_end (framepos_t new_position, void *src); void trim_to (framepos_t position, framecnt_t length, void *src); - void cut_front (nframes_t new_position, void *src); - void cut_end (nframes_t new_position, void *src); + void cut_front (framepos_t new_position, void *src); + void cut_end (framepos_t new_position, void *src); void set_layer (layer_t l); /* ONLY Playlist can call this */ void raise (); @@ -321,8 +321,8 @@ class Region void trim_to_internal (framepos_t position, framecnt_t length, void *src); virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute); - void modify_front (nframes_t new_position, bool reset_fade, void* src); - void modify_end (nframes_t new_position, bool reset_fade, void* src); + void modify_front (framepos_t new_position, bool reset_fade, void* src); + void modify_end (framepos_t new_position, bool reset_fade, void* src); void maybe_uncopy (); void first_edit (); diff --git a/libs/ardour/ardour/resampled_source.h b/libs/ardour/ardour/resampled_source.h index 6d630bc44b..b315430b46 100644 --- a/libs/ardour/ardour/resampled_source.h +++ b/libs/ardour/ardour/resampled_source.h @@ -30,16 +30,16 @@ namespace ARDOUR { class ResampledImportableSource : public ImportableSource { public: - ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality); + ResampledImportableSource (boost::shared_ptr<ImportableSource>, framecnt_t rate, SrcQuality); ~ResampledImportableSource (); - nframes_t read (Sample* buffer, nframes_t nframes); + framecnt_t read (Sample* buffer, framecnt_t nframes); float ratio() const { return src_data.src_ratio; } uint32_t channels() const { return source->channels(); } framecnt_t length() const { return source->length(); } - nframes_t samplerate() const { return source->samplerate(); } - void seek (nframes_t); + framecnt_t samplerate() const { return source->samplerate(); } + void seek (framecnt_t); framepos_t natural_position() const; bool clamped_at_unity () const { diff --git a/libs/ardour/ardour/return.h b/libs/ardour/ardour/return.h index cf709ed2f2..8ec4c9b8b5 100644 --- a/libs/ardour/ardour/return.h +++ b/libs/ardour/ardour/return.h @@ -42,7 +42,7 @@ public: uint32_t bit_slot() const { return _bitslot; } - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); boost::shared_ptr<Amp> amp() const { return _amp; } boost::shared_ptr<PeakMeter> meter() const { return _meter; } @@ -71,10 +71,10 @@ private: /* disallow copy construction */ Return (const Return&); - uint32_t _bitslot; + uint32_t _bitslot; - void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset=ChanCount::ZERO); - void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); + void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset = ChanCount::ZERO); + void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 7702901523..afa6c0e527 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -102,13 +102,13 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, /* these are the core of the API of a Route. see the protected sections as well */ - virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + virtual int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler); - virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input); - virtual int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + virtual int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool can_record, bool rec_monitors_input, bool& need_butler); virtual void toggle_monitor_input (); @@ -243,10 +243,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, void all_processors_flip(); void all_processors_active (Placement, bool state); - virtual nframes_t update_total_latency(); - void set_latency_delay (nframes_t); - void set_user_latency (nframes_t); - nframes_t initial_delay() const { return _initial_delay; } + virtual framecnt_t update_total_latency(); + void set_latency_delay (framecnt_t); + void set_user_latency (framecnt_t); + framecnt_t initial_delay() const { return _initial_delay; } PBD::Signal0<void> active_changed; PBD::Signal0<void> phase_invert_changed; @@ -365,7 +365,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, boost::shared_ptr<Panner> panner() const; boost::shared_ptr<AutomationControl> gain_control() const; - void automation_snapshot (nframes_t now, bool force=false); + void automation_snapshot (framepos_t now, bool force=false); void protect_automation (); void set_remote_control_id (uint32_t id, bool notify_class_listeners = true); @@ -390,28 +390,28 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, void mod_solo_by_others_downstream (int32_t); bool has_external_redirects() const; void curve_reallocate (); - void just_meter_input (framepos_t start_frame, framepos_t end_frame, nframes_t nframes); - virtual void set_block_size (nframes_t nframes); + void just_meter_input (framepos_t start_frame, framepos_t end_frame, pframes_t nframes); + virtual void set_block_size (pframes_t nframes); protected: - nframes_t check_initial_delay (nframes_t, nframes_t&); + framecnt_t check_initial_delay (framecnt_t, framecnt_t&); void passthru (framepos_t start_frame, framepos_t end_frame, - nframes_t nframes, int declick); + pframes_t nframes, int declick); virtual void write_out_of_band_data (BufferSet& /* bufs */, framepos_t /* start_frame */, framepos_t /* end_frame */, - nframes_t /* nframes */) {} + framecnt_t /* nframes */) {} virtual void process_output_buffers (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, - nframes_t nframes, bool with_processors, int declick); + pframes_t nframes, bool with_processors, int declick); boost::shared_ptr<IO> _input; boost::shared_ptr<IO> _output; bool _active; - nframes_t _initial_delay; - nframes_t _roll_delay; + framecnt_t _initial_delay; + framecnt_t _roll_delay; ProcessorList _processors; mutable Glib::RWLock _processor_lock; @@ -453,10 +453,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, int configure_processors (ProcessorStreams*); void passthru_silence (framepos_t start_frame, framepos_t end_frame, - nframes_t nframes, int declick); + pframes_t nframes, int declick); - void silence (nframes_t); - void silence_unlocked (nframes_t); + void silence (framecnt_t); + void silence_unlocked (framecnt_t); ChanCount processor_max_streams; uint32_t _remote_control_id; diff --git a/libs/ardour/ardour/runtime_functions.h b/libs/ardour/ardour/runtime_functions.h index 147d697fca..8882d721d7 100644 --- a/libs/ardour/ardour/runtime_functions.h +++ b/libs/ardour/ardour/runtime_functions.h @@ -24,11 +24,11 @@ namespace ARDOUR { - typedef float (*compute_peak_t) (const ARDOUR::Sample *, nframes_t, float); - typedef void (*find_peaks_t) (const ARDOUR::Sample *, nframes_t, float *, float*); - typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, nframes_t, float); - typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t, float); - typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, nframes_t); + typedef float (*compute_peak_t) (const ARDOUR::Sample *, pframes_t, float); + typedef void (*find_peaks_t) (const ARDOUR::Sample *, pframes_t, float *, float*); + typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, pframes_t, float); + typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float); + typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t); extern compute_peak_t compute_peak; extern find_peaks_t find_peaks; diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index e66c72367a..bf5c5d7370 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -55,7 +55,7 @@ class Send : public Delivery uint32_t pans_required() const { return _configured_input.n_audio(); } - void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool); + void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; bool configure_io (ChanCount in, ChanCount out); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index f1a79ba4f3..4966c19b69 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -190,7 +190,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi std::string new_source_path_from_name (DataType type, const std::string&, bool as_stub = false); RouteList new_route_from_template (uint32_t how_many, const std::string& template_path); - void process (nframes_t nframes); + void process (pframes_t nframes); BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO); BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO); @@ -297,7 +297,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void request_play_loop (bool yn, bool leave_rolling = false); bool get_play_loop () const { return play_loop; } - nframes_t last_transport_start() const { return _last_roll_location; } + framepos_t last_transport_start () const { return _last_roll_location; } void goto_end (); void goto_start (); void use_rf_shuttle_speed (); @@ -317,14 +317,14 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi std::pair<framepos_t, framepos_t> get_extent () const; framepos_t current_end_frame () const; framepos_t current_start_frame () const; - /// "actual" sample rate of session, set by current audioengine rate, pullup/down etc. - nframes_t frame_rate() const { return _current_frame_rate; } - /// "native" sample rate of session, regardless of current audioengine rate, pullup/down etc - nframes_t nominal_frame_rate() const { return _nominal_frame_rate; } - nframes_t frames_per_hour() const { return _frames_per_hour; } + /** "actual" sample rate of session, set by current audioengine rate, pullup/down etc. */ + framecnt_t frame_rate () const { return _current_frame_rate; } + /** "native" sample rate of session, regardless of current audioengine rate, pullup/down etc */ + framecnt_t nominal_frame_rate () const { return _nominal_frame_rate; } + framecnt_t frames_per_hour () const { return _frames_per_hour; } double frames_per_timecode_frame() const { return _frames_per_timecode_frame; } - nframes_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; } + framecnt_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; } MIDI::byte get_mtc_timecode_bits() const { return mtc_timecode_bits; /* encoding of SMTPE type for MTC */ @@ -347,10 +347,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void reset_input_monitor_state (); - nframes_t get_block_size() const { return current_block_size; } - nframes_t worst_output_latency () const { return _worst_output_latency; } - nframes_t worst_input_latency () const { return _worst_input_latency; } - nframes_t worst_track_latency () const { return _worst_track_latency; } + pframes_t get_block_size() const { return current_block_size; } + framecnt_t worst_output_latency () const { return _worst_output_latency; } + framecnt_t worst_input_latency () const { return _worst_input_latency; } + framecnt_t worst_track_latency () const { return _worst_track_latency; } #ifdef HAVE_JACK_SESSION void jack_session_event (jack_session_event_t* event); @@ -449,17 +449,17 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void sync_time_vars(); - void bbt_time (nframes_t when, BBT_Time&); + void bbt_time (framepos_t when, BBT_Time&); void timecode_to_sample(Timecode::Time& timecode, framepos_t& sample, bool use_offset, bool use_subframes) const; void sample_to_timecode(framepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const; void timecode_time (Timecode::Time &); - void timecode_time (nframes_t when, Timecode::Time&); - void timecode_time_subframes (nframes_t when, Timecode::Time&); + void timecode_time (framepos_t when, Timecode::Time&); + void timecode_time_subframes (framepos_t when, Timecode::Time&); void timecode_duration (framecnt_t, Timecode::Time&) const; void timecode_duration_string (char *, framecnt_t) const; - nframes_t convert_to_frames_at (nframes_t position, AnyTime const &); + framecnt_t convert_to_frames_at (framepos_t position, AnyTime const &); static PBD::Signal1<void, framepos_t> StartTimeChanged; static PBD::Signal1<void, framepos_t> EndTimeChanged; @@ -475,12 +475,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void set_silent (bool yn); bool silent () { return _silent; } - int jack_slave_sync (nframes_t); - TempoMap& tempo_map() { return *_tempo_map; } /// signals the current transport position in frames, bbt and timecode time (in that order) - PBD::Signal3<void,const nframes_t&, const BBT_Time&, const Timecode::Time&> tick; + PBD::Signal3<void, const framepos_t &, const BBT_Time&, const Timecode::Time&> tick; /* region info */ @@ -501,9 +499,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr<ExportHandler> get_export_handler (); boost::shared_ptr<ExportStatus> get_export_status (); - int start_audio_export (nframes_t position, bool realtime); + int start_audio_export (framepos_t position, bool realtime); - PBD::Signal1<int,nframes_t> ProcessExport; + PBD::Signal1<int, framecnt_t> ProcessExport; static PBD::Signal2<void,std::string, std::string> Exported; void add_source (boost::shared_ptr<Source>); @@ -525,7 +523,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /** handlers should return 0 for "ignore the rate mismatch", !0 for "do not use this session" */ - static PBD::Signal2<int,nframes_t, nframes_t> AskAboutSampleRateMismatch; + static PBD::Signal2<int, framecnt_t, framecnt_t> AskAboutSampleRateMismatch; /** handlers should return !0 for use pending state, 0 for ignore it. */ @@ -641,14 +639,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void midi_panic (); - /* Scrubbing */ - - void start_scrub (nframes_t where); - void stop_scrub (); - void set_scrub_speed (float); - nframes_t scrub_buffer_size() const; - PBD::Signal0<void> ScrubReady; - /* History (for editors, mixers, UIs etc.) */ /** Undo some transactions. @@ -809,8 +799,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi protected: friend class AudioEngine; - void set_block_size (nframes_t nframes); - void set_frame_rate (nframes_t nframes); + void set_block_size (pframes_t nframes); + void set_frame_rate (framecnt_t nframes); protected: friend class Route; @@ -832,16 +822,16 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi maximise cache hits */ - typedef void (Session::*process_function_type)(nframes_t); + typedef void (Session::*process_function_type)(pframes_t); AudioEngine& _engine; mutable gint processing_prohibited; process_function_type process_function; process_function_type last_process_function; bool waiting_for_sync_offset; - nframes_t _base_frame_rate; - nframes_t _current_frame_rate; //this includes video pullup offset - nframes_t _nominal_frame_rate; //ignores audioengine setting, "native" SR + framecnt_t _base_frame_rate; + framecnt_t _current_frame_rate; //this includes video pullup offset + framecnt_t _nominal_frame_rate; //ignores audioengine setting, "native" SR int transport_sub_state; mutable gint _record_status; framepos_t _transport_frame; @@ -857,12 +847,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi bool auto_play_legal; framepos_t _last_slave_transport_frame; - nframes_t maximum_output_latency; + framecnt_t maximum_output_latency; framepos_t _requested_return_frame; - nframes_t current_block_size; - nframes_t _worst_output_latency; - nframes_t _worst_input_latency; - nframes_t _worst_track_latency; + pframes_t current_block_size; + framecnt_t _worst_output_latency; + framecnt_t _worst_input_latency; + framecnt_t _worst_track_latency; bool _have_captured; float _meter_hold; float _meter_falloff; @@ -881,12 +871,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void ensure_buffers (ChanCount howmany = ChanCount::ZERO); - void process_scrub (nframes_t); - void process_without_events (nframes_t); - void process_with_events (nframes_t); - void process_audition (nframes_t); - void process_export (nframes_t); - int process_export_fw (nframes_t); + void process_scrub (pframes_t); + void process_without_events (pframes_t); + void process_with_events (pframes_t); + void process_audition (pframes_t); + void process_export (pframes_t); + int process_export_fw (pframes_t); void block_processing() { g_atomic_int_set (&processing_prohibited, 1); } void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); } @@ -905,20 +895,20 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi bool have_first_delta_accumulator; SlaveState _slave_state; - nframes_t slave_wait_end; + framepos_t slave_wait_end; void reset_slave_state (); - bool follow_slave (nframes_t); - void calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta); - void track_slave_state(float slave_speed, nframes_t slave_transport_frame, nframes_t this_delta); - void follow_slave_silently(nframes_t nframes, float slave_speed); + bool follow_slave (pframes_t); + void calculate_moving_average_of_slave_delta (int dir, framecnt_t this_delta); + void track_slave_state (float slave_speed, framepos_t slave_transport_frame, framecnt_t this_delta); + void follow_slave_silently (pframes_t nframes, float slave_speed); void switch_to_sync_source (SyncSource); /* !RT context */ void drop_sync_source (); /* !RT context */ void use_sync_source (Slave*); /* RT context */ bool post_export_sync; - nframes_t post_export_position; + framepos_t post_export_position; bool _exporting; bool _export_rolling; @@ -933,8 +923,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi PBD::ScopedConnection export_freewheel_connection; void get_track_statistics (); - int process_routes (nframes_t, bool& need_butler); - int silent_process_routes (nframes_t, bool& need_butler); + int process_routes (pframes_t, bool& need_butler); + int silent_process_routes (pframes_t, bool& need_butler); bool get_rec_monitors_input () { if (actively_recording()) { @@ -959,8 +949,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi } } - bool maybe_stop (nframes_t limit); - bool maybe_sync_start (nframes_t&); + bool maybe_stop (framepos_t limit); + bool maybe_sync_start (pframes_t &); void check_declick_out (); @@ -971,7 +961,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi bool session_midi_feedback; bool play_loop; bool loop_changing; - nframes_t last_loopend; + framepos_t last_loopend; boost::scoped_ptr<SessionDirectory> _session_dir; @@ -989,12 +979,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi int load_options (const XMLNode&); int load_state (std::string snapshot_name); - nframes_t _last_roll_location; - nframes_t _last_roll_or_reversal_location; - nframes_t _last_record_location; + framepos_t _last_roll_location; + framepos_t _last_roll_or_reversal_location; + framepos_t _last_record_location; bool pending_locate_roll; - nframes_t pending_locate_frame; + framepos_t pending_locate_frame; bool pending_locate_flush; bool pending_abort; bool pending_auto_loop; @@ -1045,7 +1035,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi uint32_t rf_scale; void set_rf_speed (float speed); - void reset_rf_scale (nframes_t frames_moved); + void reset_rf_scale (framecnt_t frames_moved); Locations* _locations; void locations_changed (); @@ -1099,9 +1089,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* MIDI Machine Control */ - void spp_start (MIDI::Parser&, nframes_t timestamp); - void spp_continue (MIDI::Parser&, nframes_t timestamp); - void spp_stop (MIDI::Parser&, nframes_t timestamp); + void spp_start (MIDI::Parser&, framepos_t timestamp); + void spp_continue (MIDI::Parser&, framepos_t timestamp); + void spp_stop (MIDI::Parser&, framepos_t timestamp); void mmc_deferred_play (MIDI::MachineControl &); void mmc_stop (MIDI::MachineControl &); @@ -1129,30 +1119,28 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi MIDI::byte mtc_msg[16]; MIDI::byte mtc_timecode_bits; /* encoding of SMTPE type for MTC */ MIDI::byte midi_msg[16]; - nframes_t outbound_mtc_timecode_frame; + framepos_t outbound_mtc_timecode_frame; Timecode::Time transmitting_timecode_time; int next_quarter_frame_to_send; double _frames_per_timecode_frame; /* has to be floating point because of drop frame */ - nframes_t _frames_per_hour; - nframes_t _timecode_frames_per_hour; + framecnt_t _frames_per_hour; + framecnt_t _timecode_frames_per_hour; /* cache the most-recently requested time conversions. This helps when we * have multiple clocks showing the same time (e.g. the transport frame) */ - bool last_timecode_valid; - nframes_t last_timecode_when; - Timecode::Time last_timecode; + bool last_timecode_valid; + framepos_t last_timecode_when; + Timecode::Time last_timecode; bool _send_timecode_update; ///< Flag to send a full frame (Timecode) MTC message this cycle - int send_midi_time_code_for_cycle(nframes_t nframes); - - nframes_t adjust_apparent_position (nframes_t frames); + int send_midi_time_code_for_cycle (pframes_t nframes); void reset_record_status (); - int no_roll (nframes_t nframes); - int fail_roll (nframes_t nframes); + int no_roll (pframes_t nframes); + int fail_roll (pframes_t nframes); bool non_realtime_work_pending() const { return static_cast<bool>(post_transport_work()); } bool process_can_proceed() const { return !(post_transport_work() & ProcessCannotProceedMask); } @@ -1166,7 +1154,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void unset_play_loop (); void overwrite_some_buffers (Track *); void flush_all_inserts (); - int micro_locate (nframes_t distance); + int micro_locate (framecnt_t distance); void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true); void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false); void force_locate (framepos_t frame, bool with_roll = false); @@ -1294,7 +1282,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* FLATTEN */ - int flatten_one_track (AudioTrack&, nframes_t start, nframes_t cnt); + int flatten_one_track (AudioTrack&, framepos_t start, framecnt_t cnt); /* INSERT AND SEND MANAGEMENT */ @@ -1344,7 +1332,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi UndoHistory _history; std::stack<UndoTransaction*> _current_trans; - void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int); + void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int); int jack_sync_callback (jack_transport_state_t, jack_position_t*); void reset_jack_connection (jack_client_t* jack); void process_rtop (SessionEvent*); @@ -1358,19 +1346,19 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr<IO> _click_io; Sample* click_data; Sample* click_emphasis_data; - nframes_t click_length; - nframes_t click_emphasis_length; + framecnt_t click_length; + framecnt_t click_emphasis_length; mutable Glib::RWLock click_lock; - static const Sample default_click[]; - static const nframes_t default_click_length; - static const Sample default_click_emphasis[]; - static const nframes_t default_click_emphasis_length; + static const Sample default_click[]; + static const framecnt_t default_click_length; + static const Sample default_click_emphasis[]; + static const framecnt_t default_click_emphasis_length; Click *get_click(); void setup_click_sounds (int which); void clear_clicks (); - void click (nframes_t start, nframes_t nframes); + void click (framepos_t start, framecnt_t nframes); std::vector<Route*> master_outs; @@ -1448,7 +1436,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /** temporary list of Diskstreams used only during load of 2.X sessions */ std::list<boost::shared_ptr<Diskstream> > _diskstreams_2X; - void add_session_range_location (nframes_t, nframes_t); + void add_session_range_location (framepos_t, framepos_t); void setup_midi_machine_control (); void cleanup_stubfiles (); diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index 5c31217045..738de46a86 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -83,7 +83,7 @@ struct SessionEvent { boost::shared_ptr<Region> region; - SessionEvent (Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false, bool yn2 = false) + SessionEvent (Type t, Action a, framepos_t when, framepos_t where, double spd, bool yn = false, bool yn2 = false) : type (t) , action (a) , action_frame (when) @@ -112,7 +112,7 @@ struct SessionEvent { void* operator new (size_t); void operator delete (void *ptr, size_t /*size*/); - static const nframes_t Immediate = 0; + static const framepos_t Immediate = 0; static void create_per_thread_pool (const std::string& n, uint32_t nitems); static void init_event_pool (); diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h index d24aa9d136..46ddda3985 100644 --- a/libs/ardour/ardour/silentfilesource.h +++ b/libs/ardour/ardour/silentfilesource.h @@ -31,7 +31,7 @@ public: int flush_header () { return 0; } float sample_rate () const { return _sample_rate; } - void set_length (nframes_t len) { _length = len; } + void set_length (framecnt_t len) { _length = len; } bool destructive() const { return false; } bool can_be_analysed() const { return false; } diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 74cf4371b0..45ab00a44f 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -143,7 +143,7 @@ class Slave { * @return - the timing resolution of the Slave - If the distance of ARDOURs transport * to the slave becomes greater than the resolution, sound will stop */ - virtual nframes_t resolution() const = 0; + virtual framecnt_t resolution() const = 0; /** * @return - when returning true, ARDOUR will wait for seekahead_distance() before transport @@ -174,11 +174,11 @@ class Slave { class ISlaveSessionProxy { public: virtual ~ISlaveSessionProxy() {} - virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); } - virtual nframes_t frame_rate() const { return 0; } + virtual TempoMap& tempo_map() const { return *((TempoMap *) 0); } + virtual framecnt_t frame_rate() const { return 0; } virtual framepos_t audible_frame () const { return 0; } virtual framepos_t transport_frame () const { return 0; } - virtual nframes_t frames_since_cycle_start () const { return 0; } + virtual pframes_t frames_since_cycle_start () const { return 0; } virtual framepos_t frame_time () const { return 0; } virtual void request_locate (framepos_t /*frame*/, bool with_roll = false) { @@ -195,11 +195,11 @@ class SlaveSessionProxy : public ISlaveSessionProxy { public: SlaveSessionProxy(Session &s) : session(s) {} - TempoMap& tempo_map() const; - nframes_t frame_rate() const; + TempoMap& tempo_map() const; + framecnt_t frame_rate() const; framepos_t audible_frame () const; framepos_t transport_frame () const; - nframes_t frames_since_cycle_start () const; + pframes_t frames_since_cycle_start () const; framepos_t frame_time () const; void request_locate (framepos_t frame, bool with_roll = false); @@ -234,7 +234,7 @@ class MTC_Slave : public Slave { bool ok() const; void handle_locate (const MIDI::byte*); - nframes_t resolution() const; + framecnt_t resolution () const; bool requires_seekahead () const { return true; } framepos_t seekahead_distance() const; bool give_slave_full_control_over_transport_speed() const; @@ -271,8 +271,8 @@ class MTC_Slave : public Slave { void queue_reset (bool with_pos); void maybe_reset (); - void update_mtc_qtr (MIDI::Parser&, int, nframes_t); - void update_mtc_time (const MIDI::byte *, bool, nframes_t); + void update_mtc_qtr (MIDI::Parser&, int, framepos_t); + void update_mtc_time (const MIDI::byte *, bool, framepos_t); void update_mtc_status (MIDI::MTC_Status); void read_current (SafeTime *) const; void reset_window (framepos_t); @@ -295,7 +295,7 @@ class MIDIClock_Slave : public Slave { bool ok() const; bool starting() const; - nframes_t resolution() const; + framecnt_t resolution () const; bool requires_seekahead () const { return false; } bool give_slave_full_control_over_transport_speed() const { return true; } @@ -313,10 +313,10 @@ class MIDIClock_Slave : public Slave { double one_ppqn_in_frames; /// the timestamp of the first MIDI clock message - nframes_t first_timestamp; + framepos_t first_timestamp; /// the time stamp and should-be transport position of the last inbound MIDI clock message - nframes_t last_timestamp; + framepos_t last_timestamp; double should_be_position; /// the number of midi clock messages received (zero-based) @@ -375,7 +375,7 @@ class JACK_Slave : public Slave bool starting() const { return _starting; } bool locked() const; bool ok() const; - nframes_t resolution() const { return 1; } + framecnt_t resolution () const { return 1; } bool requires_seekahead () const { return false; } void reset_client (jack_client_t* jack); bool is_always_synced() const { return true; } diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h index bd1428a129..32163551a0 100644 --- a/libs/ardour/ardour/smf_source.h +++ b/libs/ardour/ardour/smf_source.h @@ -52,7 +52,7 @@ public: bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); } void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev); - void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, framepos_t source_start); + void append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t source_start); void mark_streaming_midi_write_started (NoteMode mode, framepos_t start_time); void mark_streaming_write_completed (); @@ -65,7 +65,7 @@ public: void flush_midi (); - static void set_header_position_offset (nframes_t offset, bool negative); + static void set_header_position_offset (framecnt_t offset, bool negative); static bool safe_midi_file_extension (const std::string& path); @@ -73,15 +73,15 @@ public: void set_path (const std::string& newpath); private: - nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst, - framepos_t position, - framepos_t start, - nframes_t cnt, - MidiStateTracker* tracker) const; - - nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src, - framepos_t position, - nframes_t cnt); + framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst, + framepos_t position, + framepos_t start, + framecnt_t cnt, + MidiStateTracker* tracker) const; + + framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& src, + framepos_t position, + framecnt_t cnt); double _last_ev_time_beats; framepos_t _last_ev_time_frames; diff --git a/libs/ardour/ardour/sndfileimportable.h b/libs/ardour/ardour/sndfileimportable.h index aab8b6ac59..2b5535e29f 100644 --- a/libs/ardour/ardour/sndfileimportable.h +++ b/libs/ardour/ardour/sndfileimportable.h @@ -33,11 +33,11 @@ class SndFileImportableSource : public ImportableSource { SndFileImportableSource (const std::string& path); virtual ~SndFileImportableSource(); - nframes_t read (Sample* buffer, nframes_t nframes); + framecnt_t read (Sample* buffer, framecnt_t nframes); uint32_t channels() const; framecnt_t length() const; - nframes_t samplerate() const; - void seek (nframes_t pos); + framecnt_t samplerate() const; + void seek (framecnt_t pos); framepos_t natural_position() const; bool clamped_at_unity () const; diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index ff15608d70..f08b0be4c0 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -35,7 +35,7 @@ class SndFileSource : public AudioFileSource { /* Constructor to be called for new in-session files */ SndFileSource (Session&, const std::string& path, const std::string& origin, - SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, + SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate, Flag flags = SndFileSource::default_writable_flags); /** Constructor to be called for existing in-session files */ @@ -60,7 +60,7 @@ class SndFileSource : public AudioFileSource { bool clamped_at_unity () const; - static void setup_standard_crossfades (Session const &, nframes_t sample_rate); + static void setup_standard_crossfades (Session const &, framecnt_t sample_rate); static const Source::Flag default_writable_flags; static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg); diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h index c59dab9223..c5994027ce 100644 --- a/libs/ardour/ardour/source_factory.h +++ b/libs/ardour/ardour/source_factory.h @@ -49,7 +49,7 @@ class SourceFactory { static boost::shared_ptr<Source> createWritable (DataType type, Session&, const std::string& path, const std::string& origin, - bool destructive, nframes_t rate, bool announce = true, bool async = false); + bool destructive, framecnt_t rate, bool announce = true, bool async = false); static Glib::Cond* PeaksToBuild; static Glib::StaticMutex peak_building_lock; diff --git a/libs/ardour/ardour/strip_silence.h b/libs/ardour/ardour/strip_silence.h index e77aa7111c..91374be88a 100644 --- a/libs/ardour/ardour/strip_silence.h +++ b/libs/ardour/ardour/strip_silence.h @@ -25,14 +25,14 @@ namespace ARDOUR { class StripSilence : public Filter { public: - StripSilence (Session &, double, nframes_t, nframes_t); + StripSilence (Session &, double, framecnt_t, framecnt_t); int run (boost::shared_ptr<ARDOUR::Region>, Progress* progress = 0); private: double _threshold; ///< silence threshold, in dBFS - nframes_t _minimum_length; ///< minimum length to be considered silence, in samples - nframes_t _fade_length; ///< fade in/out to use on trimmed regions, in samples + framecnt_t _minimum_length; ///< minimum length to be considered silence, in samples + framecnt_t _fade_length; ///< fade in/out to use on trimmed regions, in samples }; } diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index e692334234..a1ad8d1f31 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -44,7 +44,7 @@ class Tempo { double beats_per_minute () const { return _beats_per_minute;} double note_type () const { return _note_type;} - double frames_per_beat (nframes_t sr, const Meter& meter) const; + double frames_per_beat (framecnt_t sr, const Meter& meter) const; protected: double _beats_per_minute; @@ -61,7 +61,7 @@ class Meter { double beats_per_bar () const { return _beats_per_bar; } double note_divisor() const { return _note_type; } - double frames_per_bar (const Tempo&, nframes_t sr) const; + double frames_per_bar (const Tempo&, framecnt_t sr) const; protected: /** The number of beats in a bar. This is a real value because @@ -168,7 +168,7 @@ class TempoMetric { class TempoMap : public PBD::StatefulDestructible { public: - TempoMap (nframes_t frame_rate); + TempoMap (framecnt_t frame_rate); ~TempoMap(); /* measure-based stuff */ @@ -258,15 +258,15 @@ class TempoMap : public PBD::StatefulDestructible int n_tempos () const; int n_meters () const; - nframes_t frame_rate () const { return _frame_rate; } + framecnt_t frame_rate () const { return _frame_rate; } private: static Tempo _default_tempo; static Meter _default_meter; Metrics* metrics; - nframes_t _frame_rate; - framepos_t last_bbt_when; + framecnt_t _frame_rate; + framepos_t last_bbt_when; bool last_bbt_valid; BBT_Time last_bbt; mutable Glib::RWLock lock; diff --git a/libs/ardour/ardour/thread_buffers.h b/libs/ardour/ardour/thread_buffers.h index 3c312176a8..8e927471a0 100644 --- a/libs/ardour/ardour/thread_buffers.h +++ b/libs/ardour/ardour/thread_buffers.h @@ -25,7 +25,7 @@ class ThreadBuffers { uint32_t npan_buffers; private: - void allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force); + void allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force); }; } // namespace diff --git a/libs/ardour/ardour/ticker.h b/libs/ardour/ardour/ticker.h index f5cda677ed..0a24070608 100644 --- a/libs/ardour/ardour/ticker.h +++ b/libs/ardour/ardour/ticker.h @@ -43,8 +43,8 @@ public: Ticker() {}; virtual ~Ticker() {} - virtual void tick( - const nframes_t& transport_frames, + virtual void tick ( + const framepos_t& transport_frames, const BBT_Time& transport_bbt, const Timecode::Time& transport_timecode) = 0; @@ -68,7 +68,7 @@ public: } void tick( - const nframes_t& transport_frames, + const framepos_t& transport_frames, const BBT_Time& transport_bbt, const Timecode::Time& transport_timecode); @@ -82,7 +82,7 @@ public: void transport_state_changed(); /// slot for the signal session::PositionChanged - void position_changed(nframes_t position); + void position_changed (framepos_t position); /// slot for the signal session::TransportLooped void transport_looped(); @@ -95,12 +95,12 @@ private: int _ppqn; double _last_tick; - double one_ppqn_in_frames(nframes_t transport_position); + double one_ppqn_in_frames (framepos_t transport_position); - void send_midi_clock_event(nframes_t offset); - void send_start_event(nframes_t offset); - void send_continue_event(nframes_t offset); - void send_stop_event(nframes_t offset); + void send_midi_clock_event (framecnt_t offset); + void send_start_event (framecnt_t offset); + void send_continue_event (framecnt_t offset); + void send_stop_event (framecnt_t offset); }; } diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index ff1b57950a..5087ddda3a 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -48,13 +48,13 @@ class Track : public Route, public PublicDiskstream virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; } PBD::Signal0<void> TrackModeChanged; - virtual int no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing, bool can_record, bool rec_monitors_input); - int silent_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + int silent_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool can_record, bool rec_monitors_input, bool& need_butler); - virtual int roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, + virtual int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool can_record, bool rec_monitors_input, bool& need_butler) = 0; bool needs_butler() const { return _needs_butler; } @@ -67,8 +67,8 @@ class Track : public Route, public PublicDiskstream virtual void use_new_diskstream () = 0; virtual void set_diskstream (boost::shared_ptr<Diskstream>); - nframes_t update_total_latency(); - void set_latency_delay (nframes_t); + framecnt_t update_total_latency(); + void set_latency_delay (framecnt_t); enum FreezeState { NoFreeze, @@ -82,7 +82,7 @@ class Track : public Route, public PublicDiskstream virtual void unfreeze () = 0; virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0; - virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0; + virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, bool enable_processing = true) = 0; XMLNode& get_state(); XMLNode& get_template(); @@ -97,7 +97,7 @@ class Track : public Route, public PublicDiskstream /* XXX: unfortunate that this is exposed */ PBD::ID const & diskstream_id () const; - void set_block_size (nframes_t); + void set_block_size (pframes_t); /* PublicDiskstream interface */ boost::shared_ptr<Playlist> playlist (); diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index d452cd6b54..1f16ce6313 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -52,7 +52,7 @@ namespace ARDOUR { typedef float gain_t; typedef uint32_t layer_t; typedef uint64_t microseconds_t; - typedef uint32_t nframes_t; + typedef jack_nframes_t pframes_t; /* Any position measured in audio frames. Assumed to be non-negative but not enforced. @@ -213,7 +213,7 @@ namespace ARDOUR { BBT_Time bbt; union { - nframes_t frames; + framecnt_t frames; double seconds; }; @@ -221,13 +221,13 @@ namespace ARDOUR { }; struct AudioRange { - nframes_t start; - nframes_t end; + framepos_t start; + framepos_t end; uint32_t id; - AudioRange (nframes_t s, nframes_t e, uint32_t i) : start (s), end (e) , id (i) {} + AudioRange (framepos_t s, framepos_t e, uint32_t i) : start (s), end (e) , id (i) {} - nframes_t length() { return end - start + 1; } + framecnt_t length() { return end - start + 1; } bool operator== (const AudioRange& other) const { return start == other.start && end == other.end && id == other.id; @@ -237,7 +237,7 @@ namespace ARDOUR { return start == other.start && end == other.end; } - OverlapType coverage (nframes_t s, nframes_t e) const { + OverlapType coverage (framepos_t s, framepos_t e) const { return ARDOUR::coverage (start, end, s, e); } }; @@ -560,9 +560,8 @@ track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed) return (ARDOUR::framepos_t)( (double)track_frame / speed ); } -/* for now, break the rules and use "using" to make these "global" */ +/* for now, break the rules and use "using" to make this "global" */ -using ARDOUR::nframes_t; using ARDOUR::framepos_t; diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index 8c3145a28b..06dc6d6bd9 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -62,7 +62,7 @@ std::string path_expand (std::string); std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0); bool path_is_paired (std::string path, std::string& pair_base); -void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out); +void compute_equal_power_fades (ARDOUR::framecnt_t nframes, float* in, float* out); const char* sync_source_to_string (ARDOUR::SyncSource src); ARDOUR::SyncSource string_to_sync_source (std::string str); diff --git a/libs/ardour/ardour/vbap.h b/libs/ardour/ardour/vbap.h index 4b6b42e732..063bcb82d6 100644 --- a/libs/ardour/ardour/vbap.h +++ b/libs/ardour/ardour/vbap.h @@ -37,9 +37,9 @@ public: static StreamPanner* factory (Panner& parent, Evoral::Parameter param, Speakers& s); static std::string name; - void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes); + void do_distribute (AudioBuffer&, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes); void do_distribute_automated (AudioBuffer& src, BufferSet& obufs, - nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers); + framepos_t start, framepos_t end, pframes_t nframes, pan_t** buffers); void set_azimuth_elevation (double azimuth, double elevation); |