summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/audiosource.h2
-rw-r--r--libs/ardour/audio_playlist_source.cc2
-rw-r--r--libs/ardour/audiofilesource.cc2
-rw-r--r--libs/ardour/audiosource.cc6
-rw-r--r--libs/ardour/file_source.cc28
5 files changed, 16 insertions, 24 deletions
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index 344541d945..d5c85a6bf8 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -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);
diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc
index f82cb7de00..5e8dc09d45 100644
--- a/libs/ardour/audio_playlist_source.cc
+++ b/libs/ardour/audio_playlist_source.cc
@@ -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
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index e7d69d2258..13b03f8f48 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -320,7 +320,7 @@ int
AudioFileSource::setup_peakfile ()
{
if (!(_flags & NoPeakFile)) {
- return initialize_peakfile (_origin.empty(), _path);
+ return initialize_peakfile (_path);
} else {
return 0;
}
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 5b60c577ee..74dd52d504 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -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 ();
}
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index e3a442b0de..0aa0a4ade8 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -111,28 +111,20 @@ FileSource::init (const string& pathstr, bool must_exist)
{
_timeline_position = 0;
- if (!_file_is_new) {
-
- 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)) {
- throw MissingSource (pathstr, _type);
- }
+ 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 {
+ 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) {