diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-04-13 11:12:22 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-04-14 02:17:30 -0400 |
commit | b81d57f0495e7c5866fcd49e5c9c6483227966c2 (patch) | |
tree | dad9e236147456b65ef87601afc87400d91ecb25 /libs/ardour/midi_diskstream.cc | |
parent | 343b06d8d3522d6b017d887ca754c91aec2430fd (diff) |
further code simplification and rationalization related to MIDI source/file renaming
Diffstat (limited to 'libs/ardour/midi_diskstream.cc')
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index fdf155d78b..4a878c3898 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1228,12 +1228,18 @@ MidiDiskstream::steal_write_source_name () /* this will bump the name of the current write source to the next one * (e.g. "MIDI 1-1" gets renamed to "MIDI 1-2"), thus leaving the * current write source name (e.g. "MIDI 1-1" available). See the - * comments in Session::create_midi_source_for_track() about why we do - * this. + * comments in Session::create_midi_source_by_stealing_name() about why + * we do this. */ - if (_write_source->set_source_name (name(), false)) { - return string(); + try { + string new_name = _session.new_midi_source_name (name()); + + if (_write_source->rename (new_name)) { + return string(); + } + } catch (...) { + return string (); } return our_old_name; |