static PBD::Signal3<int,std::string,std::string,std::vector<std::string> > AmbiguousFileName;
+ virtual void prevent_deletion ();
+
protected:
FileSource (Session& session, DataType type,
const std::string& path,
std::string _origin;
bool _open;
- void prevent_deletion ();
};
} // namespace ARDOUR
static bool safe_midi_file_extension (const std::string& path);
+ void prevent_deletion ();
+
protected:
void set_path (const std::string& newpath);
#include "ardour/midi_model.h"
#include "ardour/midi_state_tracker.h"
#include "ardour/midi_source.h"
+#include "ardour/file_source.h"
#include "ardour/session.h"
#include "ardour/session_directory.h"
#include "ardour/source_factory.h"
} else {
newsrc->set_model (_model);
}
+
+ /* this file is not removable (but since it is MIDI, it is mutable) */
+
+ boost::dynamic_pointer_cast<FileSource> (newsrc)->prevent_deletion ();
return newsrc;
}
return;
}
- if (open(_path)) {
+ if (open (_path)) {
throw failed_constructor ();
}
+
_open = true;
}
}
}
+void
+SMFSource::prevent_deletion ()
+{
+ /* Unlike the audio case, the MIDI file remains mutable (because we can
+ edit MIDI data)
+ */
+
+ _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
+}