summaryrefslogtreecommitdiff
path: root/libs/ardour/audiofilesource.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-10-09 15:50:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-10-09 15:50:44 +0000
commit0d0f71ee92fb7ce53fbcb8c7b0cd93b1cdf3529f (patch)
treeae37075200040cbbd430b98ee3cbce59eaef51ca /libs/ardour/audiofilesource.cc
parent8011cbf5f8e4181ac39e4140e681fcad531f4a7c (diff)
fix abort-capture path, including many subtle issues with shared_ptr<>; remove old automation feedback code; make new automation feedback code slightly configurable ; fix zoom focus options for playhead + edit cursor ; prevent zoom < 2 samples per pixel to avoid crashes ; peak building now uses shared_ptr<Source> not Source*
git-svn-id: svn://localhost/ardour2/trunk@959 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audiofilesource.cc')
-rw-r--r--libs/ardour/audiofilesource.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index 9564fff53b..0eb416e905 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -59,8 +59,11 @@ string AudioFileSource::search_path;
sigc::signal<void> AudioFileSource::HeaderPositionOffsetChanged;
uint64_t AudioFileSource::header_position_offset = 0;
+/* XXX turn this into a Config option */
char AudioFileSource::bwf_country_code[3] = "US";
+/* XXX turn this into a Config option */
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 +123,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 +290,8 @@ AudioFileSource::mark_for_remove ()
if (!writable()) {
return;
}
- _flags = Flag (_flags | RemoveAtDestroy);
+
+ _flags = Flag (_flags | Removable | RemoveAtDestroy);
}
void
@@ -518,8 +524,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 +577,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;
+ }
+}