summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-13 20:43:28 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-13 20:43:28 +0000
commit8c4ce1e2ce35571aed5a686671431fdfffae7f8c (patch)
tree180a152d46b78d4f1022df83074f136c90c762e7 /libs/ardour/source.cc
parentc221b09560842b71773eee15972d87c222baf6a1 (diff)
writable session patch, forward ported from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@5770 d708f5d6-7413-0410-9779-e7cbd77b26cf
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 ()
{