Browse Source

Put all classes provided by DPF inside the namespace

gh-pages
falkTX 10 years ago
parent
commit
b30b92c0aa
7 changed files with 29 additions and 11 deletions
  1. +11
    -7
      distrho/extra/d_leakdetector.hpp
  2. +4
    -0
      distrho/extra/d_mutex.hpp
  3. +4
    -0
      distrho/extra/d_scopedpointer.hpp
  4. +4
    -0
      distrho/extra/d_string.hpp
  5. +2
    -0
      distrho/src/DistrhoPluginJack.cpp
  6. +2
    -2
      distrho/src/DistrhoPluginLV2.cpp
  7. +2
    -2
      distrho/src/DistrhoPluginVST.cpp

+ 11
- 7
distrho/extra/d_leakdetector.hpp View File

@@ -19,6 +19,8 @@


#include "../DistrhoUtils.hpp" #include "../DistrhoUtils.hpp"


START_NAMESPACE_DISTRHO

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// The following code was based from juce-core LeakDetector class // The following code was based from juce-core LeakDetector class
// Copyright (C) 2013 Raw Material Software Ltd. // Copyright (C) 2013 Raw Material Software Ltd.
@@ -45,10 +47,10 @@
}; };
\endcode \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; } \ 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) \ #define DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ClassName) \
DISTRHO_DECLARE_NON_COPY_CLASS(ClassName) \ DISTRHO_DECLARE_NON_COPY_CLASS(ClassName) \
@@ -67,14 +69,14 @@
class declaration. class declaration.
*/ */
template<class OwnerClass> template<class OwnerClass>
class DistrhoLeakedObjectDetector
class LeakedObjectDetector
{ {
public: 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) if (--(getCounter().numObjects) < 0)
{ {
@@ -134,4 +136,6 @@ private:


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


END_NAMESPACE_DISTRHO

#endif // DISTRHO_LEAK_DETECTOR_HPP_INCLUDED #endif // DISTRHO_LEAK_DETECTOR_HPP_INCLUDED

+ 4
- 0
distrho/extra/d_mutex.hpp View File

@@ -26,6 +26,8 @@


#include <pthread.h> #include <pthread.h>


START_NAMESPACE_DISTRHO

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Mutex class // Mutex class


@@ -223,4 +225,6 @@ typedef ScopedUnlocker<RecursiveMutex> RecursiveMutexUnlocker;


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


END_NAMESPACE_DISTRHO

#endif // DISTRHO_MUTEX_HPP_INCLUDED #endif // DISTRHO_MUTEX_HPP_INCLUDED

+ 4
- 0
distrho/extra/d_scopedpointer.hpp View File

@@ -21,6 +21,8 @@


#include <algorithm> #include <algorithm>


START_NAMESPACE_DISTRHO

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// The following code was based from juce-core ScopedPointer class // The following code was based from juce-core ScopedPointer class
// Copyright (C) 2013 Raw Material Software Ltd. // 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 #endif // DISTRHO_SCOPED_POINTER_HPP_INCLUDED

+ 4
- 0
distrho/extra/d_string.hpp View File

@@ -19,6 +19,8 @@


#include "d_leakdetector.hpp" #include "d_leakdetector.hpp"


START_NAMESPACE_DISTRHO

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// d_string class // 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 #endif // DISTRHO_STRING_HPP_INCLUDED

+ 2
- 0
distrho/src/DistrhoPluginJack.cpp View File

@@ -374,6 +374,8 @@ END_NAMESPACE_DISTRHO


int main() int main()
{ {
USE_NAMESPACE_DISTRHO;

jack_status_t status = jack_status_t(0x0); jack_status_t status = jack_status_t(0x0);
jack_client_t* client = jack_client_open(DISTRHO_PLUGIN_NAME, JackNoStartServer, &status); jack_client_t* client = jack_client_open(DISTRHO_PLUGIN_NAME, JackNoStartServer, &status);




+ 2
- 2
distrho/src/DistrhoPluginLV2.cpp View File

@@ -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_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) #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 START_NAMESPACE_DISTRHO


typedef std::map<d_string,d_string> StringMap;

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


class PluginLv2 class PluginLv2


+ 2
- 2
distrho/src/DistrhoPluginVST.cpp View File

@@ -63,10 +63,10 @@ struct ERect {
# warning VST TimePos still TODO (only basic BBT working) # warning VST TimePos still TODO (only basic BBT working)
#endif #endif


typedef std::map<d_string,d_string> StringMap;

START_NAMESPACE_DISTRHO START_NAMESPACE_DISTRHO


typedef std::map<d_string,d_string> StringMap;

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


void strncpy(char* const dst, const char* const src, const size_t size) void strncpy(char* const dst, const char* const src, const size_t size)


Loading…
Cancel
Save