diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-03 03:54:28 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-03 03:54:28 +0000 |
commit | 3225b24854e0810cf62c55a8ce179ff3e659bce4 (patch) | |
tree | b7ea69b6d658db7c441cd992fef9679e22971a88 /libs/ardour/smf_source.cc | |
parent | 36f764167b5356a6eb41a14532d9bc35058635dd (diff) |
move open-on-write call for MIDI into mark_streaming_midi_write_started() so that it works for the fork operation (or any other op that writes a new file)
git-svn-id: svn://localhost/ardour2/branches/3.0@9052 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index c686ae3d27..5ad5c2b745 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -221,11 +221,6 @@ SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, framepos_t framecnt_t SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t position, framecnt_t duration) { - if (!_open && open_for_write()) { - error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg; - return 0; - } - if (!_writing) { mark_streaming_write_started (); } @@ -415,6 +410,12 @@ SMFSource::mark_streaming_midi_write_started (NoteMode mode) { /* CALLER MUST HOLD LOCK */ + if (!_open && open_for_write()) { + error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg; + /* XXX should probably throw or return something */ + return; + } + MidiSource::mark_streaming_midi_write_started (mode); Evoral::SMF::begin_write (); _last_ev_time_beats = 0.0; |