/** Files created this way are never writable or removable */
SndFileSource::SndFileSource (Session& s, const string& path, int chn, Flag flags)
: Source(s, DataType::AUDIO, path, flags)
+ /* note that the origin of an external file is itself */
, AudioFileSource (s, path, Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))
{
_channel = chn;
}
/** This constructor is used to construct new files, not open existing ones. */
-SndFileSource::SndFileSource (Session& s, const string& path,
- SampleFormat sfmt, HeaderFormat hf, nframes_t rate, Flag flags)
+SndFileSource::SndFileSource (Session& s, const string& path, const string& origin,
+ SampleFormat sfmt, HeaderFormat hf, framecnt_t rate, Flag flags)
: Source(s, DataType::AUDIO, path, flags)
- , AudioFileSource (s, path, flags, sfmt, hf)
+ , AudioFileSource (s, path, origin, flags, sfmt, hf)
{
int fmt = 0;
so we don't want to see this message.
*/
+ cerr << "failed to open " << _path << " with name " << _name << endl;
+
error << string_compose(_("SndFileSource: cannot open file \"%1\" for %2 (%3)"),
_path, (writable() ? "read+write" : "reading"), errbuf) << endmsg;
#endif
}
if (_info.channels == 1) {
- nframes_t ret = sf_read_float (sf, dst, file_cnt);
+ framecnt_t ret = sf_read_float (sf, dst, file_cnt);
_read_data_count = ret * sizeof(float);
if (ret != file_cnt) {
char errbuf[256];
file_pos = capture_start_frame - _timeline_position;
// split cnt in half
- nframes_t subcnt = cnt / 2;
- nframes_t ofilepos = file_pos;
+ framecnt_t subcnt = cnt / 2;
+ framecnt_t ofilepos = file_pos;
// fade in
if (crossfade (data, subcnt, 1) != subcnt) {
}
void
-SndFileSource::setup_standard_crossfades (Session const & s, nframes_t rate)
+SndFileSource::setup_standard_crossfades (Session const & s, framecnt_t rate)
{
/* This static method is assumed to have been called by the Session
before any DFS's are created.