summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audiofilesource.h6
-rw-r--r--libs/ardour/ardour/audiosource.h12
-rw-r--r--libs/ardour/ardour/beats_frames_converter.h14
-rw-r--r--libs/ardour/ardour/midi_source.h24
-rw-r--r--libs/ardour/ardour/silentfilesource.h6
-rw-r--r--libs/ardour/ardour/smf_source.h16
-rw-r--r--libs/ardour/ardour/sndfilesource.h18
-rw-r--r--libs/ardour/ardour/source.h8
-rw-r--r--libs/ardour/ardour/types.h9
9 files changed, 60 insertions, 53 deletions
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h
index 2b59de63ca..0d5f888dd8 100644
--- a/libs/ardour/ardour/audiofilesource.h
+++ b/libs/ardour/ardour/audiofilesource.h
@@ -58,13 +58,13 @@ public:
/* this block of methods do nothing for regular file sources, but are significant
for files used in destructive recording.
*/
- virtual nframes_t last_capture_start_frame() const { return 0; }
- virtual void mark_capture_start (nframes_t) {}
+ virtual sframes_t last_capture_start_frame() const { return 0; }
+ virtual void mark_capture_start (sframes_t) {}
virtual void mark_capture_end () {}
virtual void clear_capture_marks() {}
virtual bool one_of_several_channels () const { return false; }
- virtual int update_header (nframes_t when, struct tm&, time_t) = 0;
+ virtual int update_header (sframes_t when, struct tm&, time_t) = 0;
virtual int flush_header () = 0;
void mark_streaming_write_completed ();
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index 740d9bc7c4..0ed621c6ac 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -65,7 +65,7 @@ class AudioSource : virtual public Source,
return read (dst, (nframes_t) start, (nframes_t) cnt);
}
- virtual nframes_t read (Sample *dst, nframes_t start, nframes_t cnt) const;
+ virtual nframes_t read (Sample *dst, sframes_t start, nframes_t cnt) const;
virtual nframes_t write (Sample *src, nframes_t cnt);
virtual float sample_rate () const = 0;
@@ -81,7 +81,7 @@ class AudioSource : virtual public Source,
uint32_t write_data_count() const { return _write_data_count; }
int read_peaks (PeakData *peaks, nframes_t npeaks,
- nframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
+ sframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
int build_peaks ();
bool peaks_ready (sigc::slot<void>, sigc::connection&) const;
@@ -126,23 +126,23 @@ class AudioSource : virtual public Source,
int initialize_peakfile (bool newfile, Glib::ustring path);
int build_peaks_from_scratch ();
- int compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframes_t cnt,
+ int compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframes_t cnt,
bool force, bool intermediate_peaks_ready_signal);
void truncate_peakfile();
mutable off_t _peak_byte_max; // modified in compute_and_write_peak()
- virtual nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const = 0;
+ virtual nframes_t read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const = 0;
virtual nframes_t write_unlocked (Sample *dst, nframes_t cnt) = 0;
virtual Glib::ustring peak_path(Glib::ustring audio_path) = 0;
virtual Glib::ustring find_broken_peakfile (Glib::ustring missing_peak_path,
Glib::ustring audio_path) = 0;
virtual int read_peaks_with_fpp (PeakData *peaks,
- nframes_t npeaks, nframes_t start, nframes_t cnt,
+ nframes_t npeaks, sframes_t start, nframes_t cnt,
double samples_per_visual_peak, nframes_t fpp) const;
- int compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframes_t cnt,
+ int compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframes_t cnt,
bool force, bool intermediate_peaks_ready_signal, nframes_t frames_per_peak);
private:
diff --git a/libs/ardour/ardour/beats_frames_converter.h b/libs/ardour/ardour/beats_frames_converter.h
index 79972cb4c5..e612830ce9 100644
--- a/libs/ardour/ardour/beats_frames_converter.h
+++ b/libs/ardour/ardour/beats_frames_converter.h
@@ -29,22 +29,22 @@ namespace ARDOUR {
class Session;
-class BeatsFramesConverter : public Evoral::TimeConverter<double,nframes_t> {
+class BeatsFramesConverter : public Evoral::TimeConverter<double,sframes_t> {
public:
- BeatsFramesConverter(Session& session, nframes_t origin)
+ BeatsFramesConverter(Session& session, sframes_t origin)
: _session(session)
, _origin(origin)
{}
- nframes_t to(double beats) const;
- double from(nframes_t frames) const;
+ sframes_t to(double beats) const;
+ double from(sframes_t frames) const;
- nframes_t origin() const { return _origin; }
- void set_origin(nframes_t origin) { _origin = origin; }
+ sframes_t origin() const { return _origin; }
+ void set_origin(sframes_t origin) { _origin = origin; }
private:
Session& _session;
- nframes_t _origin;
+ sframes_t _origin;
};
} /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 1b2188e8dd..ec454803dc 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -57,20 +57,20 @@ class MidiSource : virtual public Source
* \param negative_stamp_offset Offset to subtract from event times written to dst
*/
virtual nframes_t midi_read (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
- nframes_t start, nframes_t cnt,
- nframes_t stamp_offset, nframes_t negative_stamp_offset) const;
+ sframes_t position,
+ sframes_t start, nframes_t cnt,
+ sframes_t stamp_offset, sframes_t negative_stamp_offset) const;
virtual nframes_t midi_write (MidiRingBuffer<nframes_t>& src,
- nframes_t position,
+ sframes_t position,
nframes_t cnt);
virtual void append_event_unlocked_beats(const Evoral::Event<double>& ev) = 0;
virtual void append_event_unlocked_frames(const Evoral::Event<nframes_t>& ev,
- nframes_t position) = 0;
+ sframes_t position) = 0;
- virtual void mark_streaming_midi_write_started (NoteMode mode, nframes_t start_time);
+ virtual void mark_streaming_midi_write_started (NoteMode mode, sframes_t start_time);
virtual void mark_streaming_write_started ();
virtual void mark_streaming_write_completed ();
@@ -85,7 +85,7 @@ class MidiSource : virtual public Source
static sigc::signal<void,MidiSource*> MidiSourceCreated;
// Signal a range of recorded data is available for reading from model()
- mutable sigc::signal<void,nframes_t,nframes_t> ViewDataRangeReady;
+ mutable sigc::signal<void,sframes_t,nframes_t> ViewDataRangeReady;
XMLNode& get_state ();
int set_state (const XMLNode&);
@@ -110,12 +110,12 @@ class MidiSource : virtual public Source
virtual void flush_midi() = 0;
virtual nframes_t read_unlocked (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
- nframes_t start, nframes_t cnt,
- nframes_t stamp_offset, nframes_t negative_stamp_offset) const = 0;
+ sframes_t position,
+ sframes_t start, nframes_t cnt,
+ sframes_t stamp_offset, sframes_t negative_stamp_offset) const = 0;
virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
+ sframes_t position,
nframes_t cnt) = 0;
std::string _captured_for;
@@ -126,7 +126,7 @@ class MidiSource : virtual public Source
bool _writing;
mutable Evoral::Sequence<double>::const_iterator _model_iter;
- mutable nframes_t _last_read_end;
+ mutable sframes_t _last_read_end;
private:
bool file_changed (std::string path);
diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h
index ad433e5f94..58460b9c21 100644
--- a/libs/ardour/ardour/silentfilesource.h
+++ b/libs/ardour/ardour/silentfilesource.h
@@ -27,7 +27,7 @@ namespace ARDOUR {
class SilentFileSource : public AudioFileSource {
public:
- int update_header (nframes_t when, struct tm&, time_t) { return 0; }
+ int update_header (sframes_t when, struct tm&, time_t) { return 0; }
int flush_header () { return 0; }
float sample_rate () const { return _sample_rate; }
@@ -47,7 +47,7 @@ protected:
_length = len;
}
- nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const {
+ nframes_t read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const {
memset (dst, 0, sizeof (Sample) * cnt);
return cnt;
}
@@ -56,7 +56,7 @@ protected:
void set_header_timeline_position () {}
- int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt,
+ int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t start, nframes_t cnt,
double samples_per_unit, nframes_t fpp) const {
memset (peaks, 0, sizeof (PeakData) * npeaks);
return 0;
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 7942a118af..e61b3f9737 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -52,9 +52,9 @@ public:
bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); }
void append_event_unlocked_beats (const Evoral::Event<double>& ev);
- void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, nframes_t position);
+ void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sframes_t position);
- void mark_streaming_midi_write_started (NoteMode mode, nframes_t start_time);
+ void mark_streaming_midi_write_started (NoteMode mode, sframes_t start_time);
void mark_streaming_write_completed ();
XMLNode& get_state ();
@@ -71,20 +71,20 @@ public:
private:
nframes_t read_unlocked (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
- nframes_t start,
+ sframes_t position,
+ sframes_t start,
nframes_t cnt,
- nframes_t stamp_offset,
- nframes_t negative_stamp_offset) const;
+ sframes_t stamp_offset,
+ sframes_t negative_stamp_offset) const;
nframes_t write_unlocked (MidiRingBuffer<nframes_t>& src,
- nframes_t position,
+ sframes_t position,
nframes_t cnt);
void set_default_controls_interpolation ();
double _last_ev_time_beats;
- nframes_t _last_ev_time_frames;
+ sframes_t _last_ev_time_frames;
};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index 5154a7a80c..66544eec8c 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -43,13 +43,13 @@ class SndFileSource : public AudioFileSource {
~SndFileSource ();
float sample_rate () const;
- int update_header (nframes_t when, struct tm&, time_t);
+ int update_header (sframes_t when, struct tm&, time_t);
int flush_header ();
- nframes_t natural_position () const;
+ sframes_t natural_position () const;
- nframes_t last_capture_start_frame() const;
- void mark_capture_start (nframes_t);
+ sframes_t last_capture_start_frame() const;
+ void mark_capture_start (sframes_t);
void mark_capture_end ();
void clear_capture_marks();
@@ -65,10 +65,10 @@ class SndFileSource : public AudioFileSource {
protected:
void set_header_timeline_position ();
- nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const;
+ nframes_t read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const;
nframes_t write_unlocked (Sample *dst, nframes_t cnt);
- nframes_t write_float (Sample* data, nframes_t pos, nframes_t cnt);
+ nframes_t write_float (Sample* data, sframes_t pos, nframes_t cnt);
private:
SNDFILE *sf;
@@ -77,7 +77,7 @@ class SndFileSource : public AudioFileSource {
void init_sndfile ();
int open();
- int setup_broadcast_info (nframes_t when, struct tm&, time_t);
+ int setup_broadcast_info (sframes_t when, struct tm&, time_t);
/* destructive */
@@ -87,8 +87,8 @@ class SndFileSource : public AudioFileSource {
bool _capture_start;
bool _capture_end;
- nframes_t capture_start_frame;
- nframes_t file_pos; // unit is frames
+ sframes_t capture_start_frame;
+ sframes_t file_pos; // unit is frames
nframes_t xfade_out_count;
nframes_t xfade_in_count;
Sample* xfade_buf;
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h
index dd86ebe521..36d7e1fe96 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -61,11 +61,11 @@ class Source : public SessionObject, public boost::noncopyable
time_t timestamp() const { return _timestamp; }
void stamp (time_t when) { _timestamp = when; }
- nframes_t length() const { return _length; }
+ sframes_t length() const { return _length; }
virtual const Glib::ustring& path() const = 0;
- virtual nframes_t natural_position() const { return 0; }
+ virtual sframes_t natural_position() const { return 0; }
void mark_for_remove();
@@ -104,7 +104,7 @@ class Source : public SessionObject, public boost::noncopyable
std::string get_transients_path() const;
int load_transients (const std::string&);
- void update_length (nframes_t pos, nframes_t cnt);
+ void update_length (sframes_t pos, sframes_t cnt);
int64_t timeline_position() const { return _timeline_position; }
virtual void set_timeline_position (int64_t pos);
@@ -118,7 +118,7 @@ class Source : public SessionObject, public boost::noncopyable
DataType _type;
Flag _flags;
time_t _timestamp;
- nframes_t _length;
+ sframes_t _length;
int64_t _timeline_position;
bool _analysed;
mutable Glib::Mutex _lock;
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index bbdf0da1d6..264d0666a7 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -60,6 +60,13 @@ namespace ARDOUR {
typedef uint64_t microseconds_t;
typedef uint32_t nframes_t;
+ /** "Session frames", frames relative to the session timeline.
+ * Everything related to transport position etc. should be of this type.
+ * We might want to make this a compile time option for 32-bitters who
+ * don't want to pay for extremely long session times they don't need...
+ */
+ typedef int64_t sframes_t;
+
enum IOChange {
NoChange = 0,
ConfigurationChanged = 0x1,
@@ -75,7 +82,7 @@ namespace ARDOUR {
};
OverlapType coverage (nframes_t start_a, nframes_t end_a,
- nframes_t start_b, nframes_t end_b);
+ nframes_t start_b, nframes_t end_b);
/** See parameter.h
* XXX: I don't think/hope these hex values matter anymore.