summaryrefslogtreecommitdiff
path: root/libs/ardour/source_factory.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-25 22:23:30 +0100
committerRobin Gareus <robin@gareus.org>2020-02-25 22:23:30 +0100
commitbcfe16610ac588dffb5b639b033d60fa59a29717 (patch)
tree25f868d0f96d12a318d2156a50927efc90dda0b6 /libs/ardour/source_factory.cc
parent9e6435ff145ed7c99312e0d51d9dd23a1a8c3997 (diff)
Consolidate shared-ptr debugging
Diffstat (limited to 'libs/ardour/source_factory.cc')
-rw-r--r--libs/ardour/source_factory.cc46
1 files changed, 11 insertions, 35 deletions
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index de9d255a70..4eaf0b40fd 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -46,8 +46,6 @@
#include "ardour/coreaudiosource.h"
#endif
-// #define BOOST_DEBUG_SOURCE
-
#include "pbd/i18n.h"
using namespace ARDOUR;
@@ -141,10 +139,8 @@ boost::shared_ptr<Source>
SourceFactory::createSilent (Session& s, const XMLNode& node, samplecnt_t nframes, float sr)
{
Source* src = new SilentFileSource (s, node, nframes, sr);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
// no analysis data - the file is non-existent
SourceCreated (ret);
return ret;
@@ -186,10 +182,8 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
try {
Source* src = new SndFileSource (s, node);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
@@ -201,10 +195,8 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
#ifdef HAVE_COREAUDIO
try {
Source* src = new CoreAudioSource (s, node);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
@@ -224,9 +216,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
boost::shared_ptr<SMFSource> src (new SMFSource (s, node));
Source::Lock lock(src->mutex());
src->load_model (lock, true);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting (src.get(), "Source");
-#endif
+ BOOST_MARK_SOURCE (src);
src->check_for_analysis_data_on_disk ();
SourceCreated (src);
return src;
@@ -247,10 +237,8 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
try {
Source* src = new SndFileSource (s, path, chn, flags);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
@@ -264,10 +252,8 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
#ifdef HAVE_COREAUDIO
try {
Source* src = new CoreAudioSource (s, path, chn, flags);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
@@ -283,10 +269,8 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
if (!announce && (!AudioFileSource::get_build_peakfiles () || defer_peaks)) {
try {
Source* src = new Mp3FileSource (s, path, chn, flags);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
return ret;
} catch (failed_constructor& err) { }
@@ -305,9 +289,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
boost::shared_ptr<SMFSource> src (new SMFSource (s, path));
Source::Lock lock(src->mutex());
src->load_model (lock, true);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting (src.get(), "Source");
-#endif
+ BOOST_MARK_SOURCE (src);
if (announce) {
SourceCreated (src);
@@ -336,10 +318,8 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat
(destructive
? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive)
: SndFileSource::default_writable_flags));
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
@@ -361,9 +341,7 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat
Source::Lock lock(src->mutex());
src->load_model (lock, true);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting (src.get(), "Source");
-#endif
+ BOOST_MARK_SOURCE (src);
// no analysis data - this is a new file
@@ -388,10 +366,8 @@ SourceFactory::createForRecovery (DataType type, Session& s, const std::string&
if (type == DataType::AUDIO) {
Source* src = new SndFileSource (s, path, chn);
-#if defined BOOST_SP_ENABLE_DEBUG_HOOKS && defined BOOST_DEBUG_SOURCE
- boost_debug_shared_ptr_mark_interesting ((void*)src, "Source");
-#endif
boost::shared_ptr<Source> ret (src);
+ BOOST_MARK_SOURCE (ret);
if (setup_peakfile (ret, false)) {
return boost::shared_ptr<Source>();