DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit b30b92c0aaab7339cfa2648b35f11dcc2040626b
parent 472e0701fe0d3be0f7a33b6a5b1fdf38b9f1505b
Author: falkTX <falktx@gmail.com>
Date:   Sun, 17 Aug 2014 00:13:37 +0100

Put all classes provided by DPF inside the namespace

Diffstat:
Mdistrho/extra/d_leakdetector.hpp | 18+++++++++++-------
Mdistrho/extra/d_mutex.hpp | 4++++
Mdistrho/extra/d_scopedpointer.hpp | 4++++
Mdistrho/extra/d_string.hpp | 4++++
Mdistrho/src/DistrhoPluginJack.cpp | 2++
Mdistrho/src/DistrhoPluginLV2.cpp | 4++--
Mdistrho/src/DistrhoPluginVST.cpp | 4++--
7 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/distrho/extra/d_leakdetector.hpp b/distrho/extra/d_leakdetector.hpp @@ -19,6 +19,8 @@ #include "../DistrhoUtils.hpp" +START_NAMESPACE_DISTRHO + // ----------------------------------------------------------------------- // The following code was based from juce-core LeakDetector class // Copyright (C) 2013 Raw Material Software Ltd. @@ -45,10 +47,10 @@ }; \endcode */ -#define DISTRHO_LEAK_DETECTOR(ClassName) \ - friend class ::DistrhoLeakedObjectDetector<ClassName>; \ +#define DISTRHO_LEAK_DETECTOR(ClassName) \ + friend class DISTRHO_NAMESPACE::LeakedObjectDetector<ClassName>; \ static const char* getLeakedObjectClassName() noexcept { return #ClassName; } \ - ::DistrhoLeakedObjectDetector<ClassName> DISTRHO_JOIN_MACRO(leakDetector_, ClassName); + DISTRHO_NAMESPACE::LeakedObjectDetector<ClassName> DISTRHO_JOIN_MACRO(leakDetector_, ClassName); #define DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ClassName) \ DISTRHO_DECLARE_NON_COPY_CLASS(ClassName) \ @@ -67,14 +69,14 @@ class declaration. */ template<class OwnerClass> -class DistrhoLeakedObjectDetector +class LeakedObjectDetector { public: //============================================================================== - DistrhoLeakedObjectDetector() noexcept { ++(getCounter().numObjects); } - DistrhoLeakedObjectDetector(const DistrhoLeakedObjectDetector&) noexcept { ++(getCounter().numObjects); } + LeakedObjectDetector() noexcept { ++(getCounter().numObjects); } + LeakedObjectDetector(const LeakedObjectDetector&) noexcept { ++(getCounter().numObjects); } - ~DistrhoLeakedObjectDetector() noexcept + ~LeakedObjectDetector() noexcept { if (--(getCounter().numObjects) < 0) { @@ -134,4 +136,6 @@ private: // ----------------------------------------------------------------------- +END_NAMESPACE_DISTRHO + #endif // DISTRHO_LEAK_DETECTOR_HPP_INCLUDED diff --git a/distrho/extra/d_mutex.hpp b/distrho/extra/d_mutex.hpp @@ -26,6 +26,8 @@ #include <pthread.h> +START_NAMESPACE_DISTRHO + // ----------------------------------------------------------------------- // Mutex class @@ -223,4 +225,6 @@ typedef ScopedUnlocker<RecursiveMutex> RecursiveMutexUnlocker; // ----------------------------------------------------------------------- +END_NAMESPACE_DISTRHO + #endif // DISTRHO_MUTEX_HPP_INCLUDED diff --git a/distrho/extra/d_scopedpointer.hpp b/distrho/extra/d_scopedpointer.hpp @@ -21,6 +21,8 @@ #include <algorithm> +START_NAMESPACE_DISTRHO + // ----------------------------------------------------------------------- // The following code was based from juce-core ScopedPointer class // Copyright (C) 2013 Raw Material Software Ltd. @@ -240,4 +242,6 @@ bool operator!=(const ScopedPointer<ObjectType>& pointer1, ObjectType* const poi // ----------------------------------------------------------------------- +END_NAMESPACE_DISTRHO + #endif // DISTRHO_SCOPED_POINTER_HPP_INCLUDED diff --git a/distrho/extra/d_string.hpp b/distrho/extra/d_string.hpp @@ -19,6 +19,8 @@ #include "d_leakdetector.hpp" +START_NAMESPACE_DISTRHO + // ----------------------------------------------------------------------- // d_string class @@ -743,4 +745,6 @@ d_string operator+(const char* const strBufBefore, const d_string& strAfter) noe // ----------------------------------------------------------------------- +END_NAMESPACE_DISTRHO + #endif // DISTRHO_STRING_HPP_INCLUDED diff --git a/distrho/src/DistrhoPluginJack.cpp b/distrho/src/DistrhoPluginJack.cpp @@ -374,6 +374,8 @@ END_NAMESPACE_DISTRHO int main() { + USE_NAMESPACE_DISTRHO; + jack_status_t status = jack_status_t(0x0); jack_client_t* client = jack_client_open(DISTRHO_PLUGIN_NAME, JackNoStartServer, &status); diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp @@ -50,10 +50,10 @@ #define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_IS_SYNTH || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) #define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI) -typedef std::map<d_string,d_string> StringMap; - START_NAMESPACE_DISTRHO +typedef std::map<d_string,d_string> StringMap; + // ----------------------------------------------------------------------- class PluginLv2 diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp @@ -63,10 +63,10 @@ struct ERect { # warning VST TimePos still TODO (only basic BBT working) #endif -typedef std::map<d_string,d_string> StringMap; - START_NAMESPACE_DISTRHO +typedef std::map<d_string,d_string> StringMap; + // ----------------------------------------------------------------------- void strncpy(char* const dst, const char* const src, const size_t size)