From 9e799c61469fceee9eeb4b45d9e5eff0ec9cbb60 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 20 Jan 2014 13:38:28 +0100 Subject: [PATCH] open external [read-only] midi-files on construction --- libs/ardour/smf_source.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 830fd75fdf..3a1029fd73 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -66,6 +66,15 @@ SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags) } /* file is not opened until write */ + + if (flags & Writable) { + return; + } + + if (open(_path)) { + throw failed_constructor (); + } + _open = true; } /** Constructor used for existing internal-to-session files. */