From 2cb3cbe491b2a0782968b53e04c781dd1fcc9b04 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 28 May 2015 19:08:47 -0400 Subject: change the semantics of AudioFileSource::peak_path() and Session::peak_path() a little. If given a full path that points outside the current session but is within another ardour session, attempt to use the peakfiles present in that other session. --- libs/ardour/audiofilesource.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libs/ardour/audiofilesource.cc') diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 2523a85b1a..19434bd145 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -168,10 +168,21 @@ AudioFileSource::peak_path (string audio_path) { string base; - base = PBD::basename_nosuffix (audio_path); + string::size_type suffix = audio_path.find_last_of ('.'); + + if (suffix != string::npos) { + base = audio_path.substr (0, suffix); + } else { + warning << string_compose (_("Odd audio file path: %1"), audio_path) << endmsg; + base = audio_path; + } + base += '%'; base += (char) ('A' + _channel); + /* pass in the name/path of the source, with no audio file type suffix + */ + return _session.peak_path (base); } -- cgit v1.2.3