summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_diskstream.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-13 11:12:22 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-14 13:05:21 -0400
commitb49bb451d25ec11535282ca80a6f0be127fb6107 (patch)
tree02bb469898836f9e73b962f4c8bf1281a2e0cdc8 /libs/ardour/midi_diskstream.cc
parent0d5f4c553a7365612a44e1e0997a6d0e14d8b7ff (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.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index 21b5aa0a34..c38c08d72e 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -1229,12 +1229,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;