-
- if (open()) {
- throw failed_constructor();
- }
-
- if (writable() && (_flags & Broadcast)) {
-
- SNDFILE* sf = _descriptor->allocate ();
- if (sf == 0) {
- error << string_compose (_("could not allocate file %1"), _path) << endmsg;
- throw failed_constructor ();
- }
-
- if (!_broadcast_info) {
- _broadcast_info = new BroadcastInfo;
- }
-
- _broadcast_info->set_from_session (s, header_position_offset);
- _broadcast_info->set_description (string_compose ("BWF %1", _name));
-
- if (!_broadcast_info->write_to_file (sf)) {
- error << string_compose (_("cannot set broadcast info for audio file %1 (%2); dropping broadcast info for this file"),
- _path, _broadcast_info->get_error())
- << endmsg;
- _flags = Flag (_flags & ~Broadcast);
- delete _broadcast_info;
- _broadcast_info = 0;
- }
-
- _descriptor->release ();
- }