mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 06:36:29 +01:00
more work on the suprisingly ongoing filename/path/origin issue
This commit is contained in:
parent
153e572696
commit
8388e82fd3
5 changed files with 16 additions and 24 deletions
|
|
@ -128,7 +128,7 @@ class AudioSource : virtual public Source,
|
|||
std::string peakpath;
|
||||
std::string _captured_for;
|
||||
|
||||
int initialize_peakfile (bool newfile, std::string path);
|
||||
int initialize_peakfile (std::string path);
|
||||
int build_peaks_from_scratch ();
|
||||
int compute_and_write_peaks (Sample* buf, framecnt_t first_frame, framecnt_t cnt,
|
||||
bool force, bool intermediate_peaks_ready_signal);
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ int
|
|||
AudioPlaylistSource::setup_peakfile ()
|
||||
{
|
||||
_peak_path = Glib::build_filename (_session.session_directory().peak_path(), name() + ARDOUR::peakfile_suffix);
|
||||
return initialize_peakfile (false, string());
|
||||
return initialize_peakfile (string());
|
||||
}
|
||||
|
||||
string
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ int
|
|||
AudioFileSource::setup_peakfile ()
|
||||
{
|
||||
if (!(_flags & NoPeakFile)) {
|
||||
return initialize_peakfile (_origin.empty(), _path);
|
||||
return initialize_peakfile (_path);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ AudioSource::rename_peakfile (string newpath)
|
|||
}
|
||||
|
||||
int
|
||||
AudioSource::initialize_peakfile (bool newfile, string audio_path)
|
||||
AudioSource::initialize_peakfile (string audio_path)
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
||||
|
|
@ -215,7 +215,7 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path)
|
|||
|
||||
/* if the peak file should be there, but isn't .... */
|
||||
|
||||
if (!newfile && !Glib::file_test (peakpath.c_str(), Glib::FILE_TEST_EXISTS)) {
|
||||
if (!empty() && !Glib::file_test (peakpath.c_str(), Glib::FILE_TEST_EXISTS)) {
|
||||
peakpath = find_broken_peakfile (peakpath, audio_path);
|
||||
}
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path)
|
|||
}
|
||||
}
|
||||
|
||||
if (!newfile && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) {
|
||||
if (!empty() && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) {
|
||||
build_peaks_from_scratch ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,28 +111,20 @@ FileSource::init (const string& pathstr, bool must_exist)
|
|||
{
|
||||
_timeline_position = 0;
|
||||
|
||||
if (!_file_is_new) {
|
||||
cerr << "FileSource looking for " << pathstr << endl;
|
||||
|
||||
if (Stateful::loading_state_version < 3000) {
|
||||
if (!find_2X (_session, _type, pathstr, must_exist, _file_is_new, _channel, _path)) {
|
||||
throw MissingSource (pathstr, _type);
|
||||
}
|
||||
} else {
|
||||
string look_for;
|
||||
|
||||
if (!_origin.empty()) {
|
||||
look_for = _origin;
|
||||
} else {
|
||||
look_for = pathstr;
|
||||
}
|
||||
|
||||
if (!find (_session, _type, look_for, must_exist, _file_is_new, _channel, _path)) {
|
||||
if (!find (_session, _type, pathstr, must_exist, _file_is_new, _channel, _path)) {
|
||||
throw MissingSource (pathstr, _type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_within_session_from_path (_path);
|
||||
|
||||
_name = Glib::path_get_basename (_path);
|
||||
|
||||
if (must_exist) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue