From f4401c59284258c6aa56707da64e3da32756329f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 23 Jun 2010 20:14:07 +0000 Subject: midway snapshot of work done on managing Region & Source lifetimes correctly. may fix missing MIDI file bug ; save empty playlists because they may be referred to by the history file ; undo commands auto-delete when objects they refer to die (currently not commands built from XML deserialization); Sources now know how many regions are using them for something, meaning that we know if we can delete the files holding any data for the source git-svn-id: svn://localhost/ardour2/branches/3.0@7291 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/evoral/src/SMF.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/evoral/src/SMF.cpp') diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index b8705afbf0..cf838455ce 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -275,6 +275,16 @@ SMF::begin_write() void SMF::end_write() THROW_FILE_ERROR { +#if 0 + /* don't create empty MIDI files + */ + + smf_rewind (_smf); // smf_save() would have done this anyway + if (smf_peek_next_event (_smf) == 0) { + return; + } +#endif + PBD::StdioFileDescriptor d (_file_path, "w+"); FILE* f = d.allocate (); if (f == 0) { -- cgit v1.2.3