mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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).
This commit is contained in:
parent
48579d42b0
commit
78ff3c05a3
4 changed files with 0 additions and 91 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue