X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsource_factory.cc;h=6d2bb80b30be8859716bb09fea2a3d17b6e27c07;hb=9254e80c396265f484adb3b7bf5f0b502d096107;hp=0729f21592040c615edc9bf9154247cc59404f6c;hpb=eb853b79c448a29ce7954fba0eb58c4c7608e034;p=ardour.git diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 0729f21592..6d2bb80b30 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -272,7 +272,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, } else if (type == DataType::MIDI) { - boost::shared_ptr src (new SMFSource (s, path, SMFSource::Flag(0))); + boost::shared_ptr src (new SMFSource (s, path)); src->load_model (true, true); #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS // boost_debug_shared_ptr_mark_interesting (src, "Source"); @@ -341,6 +341,39 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat return boost::shared_ptr (); } +boost::shared_ptr +SourceFactory::createForRecovery (DataType type, Session& s, const std::string& path, int chn) +{ + /* this might throw failed_constructor(), which is OK */ + + if (type == DataType::AUDIO) { + Source* src = new SndFileSource (s, path, chn); + +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS + // boost_debug_shared_ptr_mark_interesting (src, "Source"); +#endif + boost::shared_ptr ret (src); + + if (setup_peakfile (ret, false)) { + return boost::shared_ptr(); + } + + // no analysis data - this is still basically a new file (we + // crashed while recording. + + // always announce these files + + SourceCreated (ret); + + return ret; + + } else if (type == DataType::MIDI) { + error << _("Recovery attempted on a MIDI file - not implemented") << endmsg; + } + + return boost::shared_ptr (); +} + boost::shared_ptr SourceFactory::createFromPlaylist (DataType type, Session& s, boost::shared_ptr p, const PBD::ID& orig, const std::string& name, uint32_t chn, frameoffset_t start, framecnt_t len, bool copy, bool defer_peaks)