Add support for recording to .flac
This commit is contained in:
parent
1ca76c4e18
commit
2991afaf0d
@ -543,6 +543,7 @@ enum HeaderFormat {
|
||||
RF64,
|
||||
RF64_WAV,
|
||||
MBWF,
|
||||
FLAC,
|
||||
};
|
||||
|
||||
struct PeakData {
|
||||
|
@ -380,6 +380,7 @@ setup_enum_writer ()
|
||||
REGISTER_ENUM (RF64);
|
||||
REGISTER_ENUM (RF64_WAV);
|
||||
REGISTER_ENUM (MBWF);
|
||||
REGISTER_ENUM (FLAC);
|
||||
REGISTER (_HeaderFormat);
|
||||
|
||||
REGISTER_ENUM (AudioUnit);
|
||||
|
@ -1947,6 +1947,7 @@ LuaBindings::common (lua_State* L)
|
||||
.addConst ("RF64", ARDOUR::HeaderFormat(RF64))
|
||||
.addConst ("RF64_WAV", ARDOUR::HeaderFormat(RF64_WAV))
|
||||
.addConst ("MBWF", ARDOUR::HeaderFormat(MBWF))
|
||||
.addConst ("FLAC", ARDOUR::HeaderFormat(FLAC))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("InsertMergePolicy")
|
||||
|
@ -133,6 +133,15 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
|
||||
_flags = Flag (_flags & ~Broadcast);
|
||||
break;
|
||||
|
||||
case FLAC:
|
||||
fmt = SF_FORMAT_FLAC;
|
||||
if (sfmt == FormatFloat) {
|
||||
sfmt = FormatInt24;
|
||||
}
|
||||
_flags = Flag (_flags & ~Broadcast);
|
||||
_flags = Flag (_flags & ~Destructive); // XXX or force WAV if destructive?
|
||||
break;
|
||||
|
||||
case AIFF:
|
||||
fmt = SF_FORMAT_AIFF;
|
||||
_flags = Flag (_flags & ~Broadcast);
|
||||
@ -384,8 +393,8 @@ SndFileSource::open ()
|
||||
}
|
||||
|
||||
if ((_info.format & SF_FORMAT_TYPEMASK ) == SF_FORMAT_FLAC) {
|
||||
assert (!writable());
|
||||
_sndfile = sf_open_fd (fd, SFM_READ, &_info, true);
|
||||
assert (!destructive());
|
||||
_sndfile = sf_open_fd (fd, writable () ? SFM_WRITE : SFM_READ, &_info, true);
|
||||
} else {
|
||||
_sndfile = sf_open_fd (fd, writable() ? SFM_RDWR : SFM_READ, &_info, true);
|
||||
}
|
||||
|
@ -568,6 +568,8 @@ ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type)
|
||||
return ".aif";
|
||||
case iXML:
|
||||
return ".ixml";
|
||||
case FLAC:
|
||||
return ".flac";
|
||||
case RF64:
|
||||
case RF64_WAV:
|
||||
case MBWF:
|
||||
|
Loading…
Reference in New Issue
Block a user