From 390ea007c5b6b647e33c924b3429bf49ae83b1ca Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 10 Sep 2015 00:48:10 +0200 Subject: rework peakfile handling: - copy old peak-files to new (do not require re-calc) - keep old peak-files (for now, backwards compat) - fix cleanup-sources to remove *new* peak-file - include channel-number in hash (like it was done before) see also 624f76b TODO: add Session > Cleanup > remove/re-create peaks --- libs/ardour/audiofilesource.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libs/ardour/audiofilesource.cc') diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 45ec162f09..0c921dae8d 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -164,9 +164,17 @@ AudioFileSource::init (const string& pathstr, bool must_exist) } string -AudioFileSource::construct_peak_filepath (const string& audio_path) const +AudioFileSource::construct_peak_filepath (const string& audio_path, bool oldformat) const { - return _session.construct_peak_filepath (audio_path); + string base; + if (oldformat) { + base = audio_path.substr (0, audio_path.find_last_of ('.')); + } else { + base = audio_path; + } + base += '%'; + base += (char) ('A' + _channel); + return _session.construct_peak_filepath (base, oldformat); } bool -- cgit v1.2.3