diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-28 19:08:47 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-28 19:08:47 -0400 |
commit | 2cb3cbe491b2a0782968b53e04c781dd1fcc9b04 (patch) | |
tree | 8b625f770e0b1b57832f94958cb80fb9c96b7d98 /libs/ardour/audiofilesource.cc | |
parent | 1291f3d2e826bf6c3ceb2fe100b38ebdd90c2001 (diff) |
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.
Diffstat (limited to 'libs/ardour/audiofilesource.cc')
-rw-r--r-- | libs/ardour/audiofilesource.cc | 13 |
1 files changed, 12 insertions, 1 deletions
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); } |