From 78ff3c05a3f5c5d532162b45bdd8857bc402011e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 8 Sep 2015 20:13:56 +0200 Subject: remove Ardour broken peak-file support Ardour-2.0 put peak-files in a "broken" location for several months. Since then Ardour renamed those files. No more. When loading ancient sessions peak-files are now re-created (in the background). --- libs/ardour/audiofilesource.cc | 77 ------------------------------------------ 1 file changed, 77 deletions(-) (limited to 'libs/ardour/audiofilesource.cc') diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 633292b157..45ec162f09 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -169,83 +169,6 @@ AudioFileSource::construct_peak_filepath (const string& audio_path) const return _session.construct_peak_filepath (audio_path); } -string -AudioFileSource::find_broken_peakfile (const string& peak_path, const string& audio_path) -{ - string str; - - /* check for the broken location in use by 2.0 for several months */ - - str = broken_peak_path (audio_path); - - if (Glib::file_test (str, Glib::FILE_TEST_EXISTS)) { - - if (!within_session()) { - - /* it would be nice to rename it but the nature of - the bug means that we can't reliably use it. - */ - - return str; - - } else { - /* all native files are mono, so we can just rename - it. - */ - ::rename (str.c_str(), peak_path.c_str()); - } - - } else { - /* Nasty band-aid for older sessions that were created before we - used libsndfile for all audio files. - */ -#ifndef PLATFORM_WINDOWS // there's no old_peak_path() for windows - str = old_peak_path (audio_path); - if (Glib::file_test (str, Glib::FILE_TEST_EXISTS)) { - return str; - } -#endif - } - - return peak_path; -} - -string -AudioFileSource::broken_peak_path (const string& audio_path) -{ - return _session.construct_peak_filepath (basename_nosuffix (audio_path)); -} - -string -AudioFileSource::old_peak_path (const string& audio_path) -{ - /* XXX hardly bombproof! fix me */ - - struct stat stat_file; - struct stat stat_mount; - - string mp = mountpoint (audio_path); - - stat (audio_path.c_str(), &stat_file); - stat (mp.c_str(), &stat_mount); - - char buf[32]; -#ifdef __APPLE__ - snprintf (buf, sizeof (buf), "%llu-%llu-%d.peak", - (unsigned long long)stat_mount.st_ino, - (unsigned long long)stat_file.st_ino, - _channel); -#else - snprintf (buf, sizeof (buf), "%" PRId64 "-%" PRId64 "-%d.peak", (int64_t) stat_mount.st_ino, (int64_t) stat_file.st_ino, _channel); -#endif - - string res = peak_dir; - res += buf; - res += peakfile_suffix; - - return res; -} - bool AudioFileSource::get_soundfile_info (const string& path, SoundFileInfo& _info, string& error_msg) { -- cgit v1.2.3