#include "ardour/diskstream.h"
#include "ardour/io.h"
#include "ardour/pannable.h"
+#include "ardour/profile.h"
#include "ardour/playlist.h"
#include "ardour/session.h"
#include "ardour/track.h"
, i_am_the_modifier (0)
, _track (0)
, _record_enabled (0)
+ , _record_safe (0)
, _visible_speed (1.0f)
, _actual_speed (1.0f)
, _buffer_reallocation_required (false)
, i_am_the_modifier (0)
, _track (0)
, _record_enabled (0)
+ , _record_safe (0)
, _visible_speed (1.0f)
, _actual_speed (1.0f)
, _buffer_reallocation_required (false)
snprintf (buf, sizeof(buf), "%f", _visible_speed);
node->add_property ("speed", buf);
node->add_property ("capture-alignment", enum_2_string (_alignment_choice));
+ node->add_property ("record-safe", _record_safe ? "yes" : "no");
if (_extra_xml) {
node->add_child_copy (*_extra_xml);
_flags = Flag (string_2_enum (prop->value(), _flags));
}
+ if (Profile->get_trx() && (_flags & Destructive)) {
+ error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
+ return -1;
+ }
+
if ((prop = node.property (X_("capture-alignment"))) != 0) {
set_align_choice (AlignChoice (string_2_enum (prop->value(), _alignment_choice)), true);
} else {
non_realtime_set_speed ();
}
}
+
+ if ((prop = node.property ("record-safe")) != 0) {
+ _record_safe = PBD::string_is_affirmative (prop->value()) ? 1 : 0;
+ }
- return 0;
+ return 0;
}
void
g_atomic_int_set (&_record_enabled, 0);
}
+void
+Diskstream::engage_record_safe ()
+{
+ g_atomic_int_set (&_record_safe, 1);
+}
+
+void
+Diskstream::disengage_record_safe ()
+{
+ g_atomic_int_set (&_record_safe, 0);
+}
+
framecnt_t
Diskstream::default_disk_read_chunk_frames()
{