X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Faudiofilesource.cc;h=77709e3a3cb58294ac6c29c42937ae3921cbabe4;hb=1bd4c5b3a212460eed1773f6b049d18c89625565;hp=9564fff53b79b6bf7183caf7907ec9f423b320a3;hpb=02115563feabd8d0019bfda605c88552c24f0890;p=ardour.git diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 9564fff53b..77709e3a3c 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -59,8 +59,7 @@ string AudioFileSource::search_path; sigc::signal AudioFileSource::HeaderPositionOffsetChanged; uint64_t AudioFileSource::header_position_offset = 0; -char AudioFileSource::bwf_country_code[3] = "US"; -char AudioFileSource::bwf_organization_code[4] = "LAS"; +/* XXX maybe this too */ char AudioFileSource::bwf_serial_number[13] = "000000000000"; AudioFileSource::AudioFileSource (Session& s, string idstr, Flag flags) @@ -120,7 +119,9 @@ AudioFileSource::init (string pathstr, bool must_exist) _length = 0; timeline_position = 0; next_peak_clear_should_notify = false; - + _peaks_built = false; + file_is_new = false; + if (!find (pathstr, must_exist, is_new)) { return -1; } @@ -285,7 +286,8 @@ AudioFileSource::mark_for_remove () if (!writable()) { return; } - _flags = Flag (_flags | RemoveAtDestroy); + + _flags = Flag (_flags | Removable | RemoveAtDestroy); } void @@ -518,8 +520,14 @@ AudioFileSource::set_timeline_position (nframes_t pos) void AudioFileSource::set_allow_remove_if_empty (bool yn) { - if (writable()) { + if (!writable()) { + return; + } + + if (yn) { _flags = Flag (_flags | RemovableIfEmpty); + } else { + _flags = Flag (_flags & ~RemovableIfEmpty); } } @@ -565,3 +573,12 @@ AudioFileSource::is_empty (Session& s, string path) return ret; } +int +AudioFileSource::setup_peakfile () +{ + if (!(_flags & NoPeakFile)) { + return initialize_peakfile (file_is_new, _path); + } else { + return 0; + } +}