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);
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
}
int
-AudioSource::initialize_peakfile (bool newfile, string audio_path)
+AudioSource::initialize_peakfile (string audio_path)
{
struct stat statbuf;
/* 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);
}
}
}
- if (!newfile && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) {
+ if (!empty() && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) {
build_peaks_from_scratch ();
}
{
_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) {