- try {
- boost::shared_ptr<Source> ret (new CoreAudioSource (s, idstr, flags));
- if (setup_peakfile (ret)) {
+ return boost::shared_ptr<Source>();
+}
+
+boost::shared_ptr<Source>
+SourceFactory::createWritable (DataType type, Session& s, const std::string& path,
+ bool destructive, samplecnt_t rate, bool announce, bool defer_peaks)
+{
+ /* this might throw failed_constructor(), which is OK */
+
+ if (type == DataType::AUDIO) {
+ Source* src = new SndFileSource (s, path, string(),
+ s.config.get_native_file_data_format(),
+ s.config.get_native_file_header_format(),
+ rate,
+ (destructive
+ ? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive)
+ : SndFileSource::default_writable_flags));
+#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
+ // boost_debug_shared_ptr_mark_interesting (src, "Source");
+#endif
+ boost::shared_ptr<Source> ret (src);
+
+ if (setup_peakfile (ret, defer_peaks)) {