diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-08 20:13:56 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-10 00:55:58 +0200 |
commit | 78ff3c05a3f5c5d532162b45bdd8857bc402011e (patch) | |
tree | 3031a661d367b9111c18ee09d633c75935204603 /libs | |
parent | 48579d42b08bcd2e094d1bc159fba5a97c3fcf69 (diff) |
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).
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/audiofilesource.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/audiosource.h | 2 | ||||
-rw-r--r-- | libs/ardour/audiofilesource.cc | 77 | ||||
-rw-r--r-- | libs/ardour/audiosource.cc | 6 |
4 files changed, 0 insertions, 91 deletions
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index da4f9aaea5..10c47d8658 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -40,8 +40,6 @@ public: virtual ~AudioFileSource (); std::string construct_peak_filepath (const std::string& audio_filepath) const; - std::string find_broken_peakfile (const std::string& missing_peak_path, - const std::string& audio_path); static void set_peak_dir (const std::string& dir) { peak_dir = dir; } @@ -117,10 +115,6 @@ protected: /** Kept up to date with the position of the session location start */ static framecnt_t header_position_offset; - - private: - std::string old_peak_path (const std::string& audio_path); - std::string broken_peak_path (const std::string& audio_path); }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index 40ff27ceb5..0c66cdf0e9 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -137,8 +137,6 @@ class LIBARDOUR_API AudioSource : virtual public Source, virtual framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const = 0; virtual framecnt_t write_unlocked (Sample *dst, framecnt_t cnt) = 0; virtual std::string construct_peak_filepath(const std::string& audio_filepath) const = 0; - virtual std::string find_broken_peakfile (const std::string& /* missing_peak_path */, - const std::string& audio_path) { return construct_peak_filepath (audio_path); } virtual int read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t start, framecnt_t cnt, 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) { diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 9aea6f1e0e..62a632e435 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -244,12 +244,6 @@ AudioSource::initialize_peakfile (const string& audio_path) DEBUG_TRACE(DEBUG::Peaks, string_compose ("Initialize Peakfile %1 for Audio file %2\n", _peakpath, audio_path)); - /* if the peak file should be there, but isn't .... */ - - if (!empty() && !Glib::file_test (_peakpath.c_str(), Glib::FILE_TEST_EXISTS)) { - _peakpath = find_broken_peakfile (_peakpath, audio_path); - } - if (g_stat (_peakpath.c_str(), &statbuf)) { if (errno != ENOENT) { /* it exists in the peaks dir, but there is some kind of error */ |