+ if ((prop = node.property (X_("flags"))) != 0) {
+ _flags = Flag (string_2_enum (prop->value(), _flags));
+ } else {
+ _flags = Flag (0);
+
+ }
+
+ /* old style, from the period when we had DestructiveFileSource */
+ if ((prop = node.property (X_("destructive"))) != 0) {
+ _flags = Flag (_flags | Destructive);
+ }
+
+ if (version < 3000) {
+ /* a source with an XML node must necessarily already exist,
+ and therefore cannot be removable/writable etc. etc.; 2.X
+ sometimes marks sources as removable which shouldn't be.
+ */
+ if (!(_flags & Destructive)) {
+ _flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
+ }
+ }
+
+ return 0;
+}
+
+bool
+Source::has_been_analysed() const
+{
+ Glib::Threads::Mutex::Lock lm (_analysis_lock);
+ return _analysed;
+}
+
+void
+Source::set_been_analysed (bool yn)
+{
+ {
+ Glib::Threads::Mutex::Lock lm (_analysis_lock);
+ _analysed = yn;
+ }
+
+ if (yn) {
+ load_transients (get_transients_path());
+ AnalysisChanged(); // EMIT SIGNAL
+ }
+}
+
+int
+Source::load_transients (const string& path)
+{
+ ifstream file (path.c_str());
+
+ if (!file) {
+ return -1;
+ }
+
+ transients.clear ();
+
+ stringstream strstr;
+ double val;
+
+ while (file.good()) {
+ file >> val;
+
+ if (!file.fail()) {
+ framepos_t frame = (framepos_t) floor (val * _session.frame_rate());
+ transients.push_back (frame);
+ }
+ }
+