diff options
author | Robin Gareus <robin@gareus.org> | 2019-12-06 18:18:33 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-12-06 18:18:54 +0100 |
commit | d0b6c437ce0c4e2d1eb41cf3d41f0834a752f302 (patch) | |
tree | 9e5e41982179f6d520fdd66a13360a46af935f67 /libs/ardour/source_factory.cc | |
parent | bef74c267ef50c93aa726b2f60e63259b2c3799c (diff) |
Implement mp3 import, using minimp3
Diffstat (limited to 'libs/ardour/source_factory.cc')
-rw-r--r-- | libs/ardour/source_factory.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 3375ff9f0d..cd3c9ef1e8 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -34,6 +34,7 @@ #include "ardour/boost_debug.h" #include "ardour/midi_playlist.h" #include "ardour/midi_playlist_source.h" +#include "ardour/mp3filesource.h" #include "ardour/source.h" #include "ardour/source_factory.h" #include "ardour/sndfilesource.h" @@ -281,6 +282,19 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, } catch (...) { } #endif + /* only create mp3s for audition: no announce, no peaks */ + if (!announce && (!AudioFileSource::get_build_peakfiles () || defer_peaks)) { + try { + Source* src = new Mp3FileSource (s, path, chn, flags); +#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS + // boost_debug_shared_ptr_mark_interesting (src, "Source"); +#endif + boost::shared_ptr<Source> ret (src); + return ret; + + } catch (failed_constructor& err) { } + } + } else { // eh? } |