From 8c4ce1e2ce35571aed5a686671431fdfffae7f8c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 13 Oct 2009 20:43:28 +0000 Subject: writable session patch, forward ported from 2.X git-svn-id: svn://localhost/ardour2/branches/3.0@5770 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/source.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/ardour/source.cc') 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 () { -- cgit v1.2.3