summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/source.cc')
-rw-r--r--libs/ardour/source.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index b052a5b1fa..d7002f2fe1 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -55,6 +55,7 @@ Source::Source (Session& s, DataType type, const string& name, Flag flags)
_analysed = false;
_timestamp = 0;
_in_use = 0;
+ fix_writable_flags ();
}
Source::Source (Session& s, const XMLNode& node)
@@ -70,6 +71,8 @@ Source::Source (Session& s, const XMLNode& node)
if (set_state (node) || _type == DataType::NIL) {
throw failed_constructor();
}
+
+ fix_writable_flags ();
}
Source::~Source ()
@@ -77,6 +80,15 @@ Source::~Source ()
notify_callbacks ();
}
+
+void
+Source::fix_writable_flags ()
+{
+ if (!_session.writable()) {
+ _flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
+ }
+}
+
XMLNode&
Source::get_state ()
{