ReadOpsFades = 0x8
};
- virtual nframes64_t read (Sample*, nframes64_t pos, nframes64_t cnt, int channel) const;
- virtual nframes64_t read_with_ops (Sample*, nframes64_t pos, nframes64_t cnt, int channel, ReadOps rops) const;
+ virtual nframes_t read (Sample*, sframes_t pos, nframes_t cnt, int channel) const;
+ virtual nframes_t read_with_ops (Sample*, sframes_t pos, nframes_t cnt, int channel, ReadOps rops) const;
virtual nframes64_t readable_length() const { return length(); }
- virtual nframes_t read_at (Sample *buf, Sample *mixdown_buf,
- float *gain_buf, nframes_t position, nframes_t cnt,
+ virtual nframes_t read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf,
+ sframes_t position,
+ nframes_t cnt,
uint32_t chan_n = 0,
nframes_t read_frames = 0,
nframes_t skip_frames = 0) const;
- virtual nframes_t master_read_at (Sample *buf, Sample *mixdown_buf,
- float *gain_buf,
- nframes_t position, nframes_t cnt, uint32_t chan_n=0) const;
+ virtual nframes_t master_read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf,
+ sframes_t position, nframes_t cnt, uint32_t chan_n=0) const;
- virtual nframes_t read_raw_internal (Sample*, nframes_t, nframes_t) const;
+ virtual nframes_t read_raw_internal (Sample*, sframes_t, nframes_t) const;
XMLNode& state (bool);
int set_state (const XMLNode&);
void recompute_gain_at_start ();
nframes_t _read_at (const SourceList&, nframes_t limit,
- Sample *buf, Sample *mixdown_buffer,
- float *gain_buffer, nframes_t position, nframes_t cnt,
+ Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
+ sframes_t position, nframes_t cnt,
uint32_t chan_n = 0,
nframes_t read_frames = 0,
nframes_t skip_frames = 0,
virtual nframes_t available_peaks (double zoom) const;
- /** Stopgap for Readable until nframes_t becomes nframes64_t. */
- virtual nframes64_t read (Sample *dst, nframes64_t start, nframes64_t cnt, int channel) const {
- /* XXX currently ignores channel, assuming that source is always mono, which
- historically has been true.
- */
- return read (dst, (nframes_t) start, (nframes_t) cnt);
- }
-
- virtual nframes_t read (Sample *dst, sframes_t start, nframes_t cnt) const;
+ virtual nframes_t read (Sample *dst, sframes_t start, nframes_t cnt, int channel=0) const;
virtual nframes_t write (Sample *src, nframes_t cnt);
virtual float sample_rate () const = 0;
boost::shared_ptr<ARDOUR::AudioRegion> out() const { return _out; }
nframes_t read_at (Sample *buf, Sample *mixdown_buffer,
- float *gain_buffer, nframes_t position, nframes_t cnt,
+ float *gain_buffer, sframes_t position, nframes_t cnt,
uint32_t chan_n,
nframes_t read_frames = 0,
nframes_t skip_frames = 0) const;
bool update ();
protected:
- nframes_t read_raw_internal (Sample*, nframes_t, nframes_t) const;
+ nframes_t read_raw_internal (Sample*, sframes_t, nframes_t) const;
};
boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const;
/* Stub Readable interface */
- virtual nframes64_t read (Sample*, nframes64_t pos, nframes64_t cnt, int channel) const { return 0; }
- virtual nframes64_t readable_length() const { return length(); }
+ virtual nframes_t read (Sample*, sframes_t pos, nframes_t cnt, int channel) const { return 0; }
+ virtual sframes_t readable_length() const { return length(); }
nframes_t read_at (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
- nframes_t dur,
- uint32_t chan_n = 0,
- NoteMode mode = Sustained) const;
+ sframes_t position,
+ nframes_t dur,
+ uint32_t chan_n = 0,
+ NoteMode mode = Sustained) const;
nframes_t master_read_at (MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
+ sframes_t position,
nframes_t dur,
uint32_t chan_n = 0,
NoteMode mode = Sustained) const;
Readable () {}
virtual ~Readable() {}
- virtual nframes64_t read (Sample*, nframes64_t pos, nframes64_t cnt, int channel) const = 0;
- virtual nframes64_t readable_length() const = 0;
- virtual uint32_t n_channels () const = 0;
+ virtual nframes_t read (Sample*, sframes_t pos, nframes_t cnt, int channel) const = 0;
+ virtual sframes_t readable_length() const = 0;
+ virtual uint32_t n_channels () const = 0;
};
}
listen_to_my_sources ();
}
-/* constructor for use by derived types only */
+/** Constructor for use by derived types only */
AudioRegion::AudioRegion (Session& s, nframes_t start, nframes_t length, string name)
: Region (s, start, length, name, DataType::AUDIO)
, _automatable(s)
init ();
}
-/* Basic AudioRegion constructor (many channels) */
+/** Basic AudioRegion constructor (many channels) */
AudioRegion::AudioRegion (const SourceList& srcs, nframes_t start, nframes_t length, const string& name, layer_t layer, Flag flags)
: Region (srcs, start, length, name, DataType::AUDIO, layer, flags)
, _automatable(srcs[0]->session())
}
}
-nframes64_t
-AudioRegion::read (Sample* buf, nframes64_t timeline_position, nframes64_t cnt, int channel) const
+nframes_t
+AudioRegion::read (Sample* buf, sframes_t timeline_position, nframes_t cnt, int channel) const
{
/* raw read, no fades, no gain, nada */
return _read_at (_sources, _length, buf, 0, 0, _position + timeline_position, cnt, channel, 0, 0, ReadOps (0));
}
-nframes64_t
-AudioRegion::read_with_ops (Sample* buf, nframes64_t file_position, nframes64_t cnt, int channel, ReadOps rops) const
+nframes_t
+AudioRegion::read_with_ops (Sample* buf, sframes_t file_position, nframes_t cnt, int channel, ReadOps rops) const
{
return _read_at (_sources, _length, buf, 0, 0, file_position, cnt, channel, 0, 0, rops);
}
nframes_t
-AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nframes_t file_position,
- nframes_t cnt,
- uint32_t chan_n, nframes_t read_frames, nframes_t skip_frames) const
+AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
+ sframes_t file_position, nframes_t cnt, uint32_t chan_n,
+ nframes_t read_frames, nframes_t skip_frames) const
{
/* regular diskstream/butler read complete with fades etc */
return _read_at (_sources, _length, buf, mixdown_buffer, gain_buffer, file_position, cnt, chan_n, read_frames, skip_frames, ReadOps (~0));
}
nframes_t
-AudioRegion::master_read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nframes_t position,
- nframes_t cnt, uint32_t chan_n) const
+AudioRegion::master_read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
+ sframes_t position, nframes_t cnt, uint32_t chan_n) const
{
return _read_at (_master_sources, _master_sources.front()->length(), buf, mixdown_buffer, gain_buffer, position, cnt, chan_n, 0, 0);
}
nframes_t
AudioRegion::_read_at (const SourceList& srcs, nframes_t limit,
- Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
- nframes_t position, nframes_t cnt,
- uint32_t chan_n,
- nframes_t read_frames,
- nframes_t skip_frames,
- ReadOps rops) const
+ Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
+ sframes_t position, nframes_t cnt,
+ uint32_t chan_n,
+ nframes_t read_frames,
+ nframes_t skip_frames,
+ ReadOps rops) const
{
nframes_t internal_offset;
nframes_t buf_offset;
}
nframes_t
-AudioRegion::read_raw_internal (Sample* buf, nframes_t pos, nframes_t cnt) const
+AudioRegion::read_raw_internal (Sample* buf, sframes_t pos, nframes_t cnt) const
{
return audio_source()->read (buf, pos, cnt);
}
}
nframes_t
-AudioSource::read (Sample *dst, sframes_t start, nframes_t cnt) const
+AudioSource::read (Sample *dst, sframes_t start, nframes_t cnt, int channel) const
{
Glib::Mutex::Lock lm (_lock);
return read_unlocked (dst, start, cnt);
}
nframes_t
-Crossfade::read_raw_internal (Sample* buf, nframes_t start, nframes_t cnt) const
+Crossfade::read_raw_internal (Sample* buf, sframes_t start, nframes_t cnt) const
{
+ // FIXME: Why is this disabled?
#if 0
Sample* mixdown = new Sample[cnt];
float* gain = new float[cnt];
nframes_t
Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
- float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n,
+ float *gain_buffer, sframes_t start, nframes_t cnt, uint32_t chan_n,
nframes_t read_frames, nframes_t skip_frames) const
{
nframes_t offset;
} else {
- to_write = min (_length - (start - _position), cnt);
+ to_write = min (nframes_t(_length - (start - _position)), cnt);
}
}
nframes_t
-MidiRegion::read_at (MidiRingBuffer<nframes_t>& out, nframes_t position, nframes_t dur, uint32_t chan_n, NoteMode mode) const
+MidiRegion::read_at (MidiRingBuffer<nframes_t>& out, sframes_t position, nframes_t dur, uint32_t chan_n, NoteMode mode) const
{
return _read_at (_sources, out, position, dur, chan_n, mode);
}
nframes_t
-MidiRegion::master_read_at (MidiRingBuffer<nframes_t>& out, nframes_t position, nframes_t dur, uint32_t chan_n, NoteMode mode) const
+MidiRegion::master_read_at (MidiRingBuffer<nframes_t>& out, sframes_t position, nframes_t dur, uint32_t chan_n, NoteMode mode) const
{
return _read_at (_master_sources, out, position, dur, chan_n, mode);
}