From efbc00651f722b9fc556d8dfaeff1dbf611ca7ec Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 9 Mar 2015 19:01:24 +0100 Subject: [PATCH] NOOP, add header-guards and namespace to CA backend --- libs/backends/coreaudio/coreaudio_pcmio.cc | 2 ++ libs/backends/coreaudio/coreaudio_pcmio.h | 11 ++++++++++- libs/backends/coreaudio/coremidi_io.cc | 7 +++++-- libs/backends/coreaudio/coremidi_io.h | 11 ++++++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/libs/backends/coreaudio/coreaudio_pcmio.cc b/libs/backends/coreaudio/coreaudio_pcmio.cc index 19c1e3a8f9..0b31a9a3ff 100644 --- a/libs/backends/coreaudio/coreaudio_pcmio.cc +++ b/libs/backends/coreaudio/coreaudio_pcmio.cc @@ -19,6 +19,8 @@ #include #include "coreaudio_pcmio.h" +using namespace ARDOUR; + /* abstraction for deprecated CoreAudio */ static OSStatus GetPropertyWrapper ( diff --git a/libs/backends/coreaudio/coreaudio_pcmio.h b/libs/backends/coreaudio/coreaudio_pcmio.h index 80702f1570..76b5e76e1b 100644 --- a/libs/backends/coreaudio/coreaudio_pcmio.h +++ b/libs/backends/coreaudio/coreaudio_pcmio.h @@ -16,6 +16,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __libbackend_coreaudio_pcmio_h__ +#define __libbackend_coreaudio_pcmio_h__ + #include #include #include @@ -31,6 +34,8 @@ #define AUHAL_INPUT_ELEMENT 1 +namespace ARDOUR { + class CoreAudioPCM { public: CoreAudioPCM (void); @@ -142,7 +147,7 @@ private: AudioDeviceID *created_device); - AudioUnit _auhal; + ::AudioUnit _auhal; AudioDeviceID* _device_ids; AudioBufferList* _input_audio_buffer_list; AudioBufferList* _output_audio_buffer_list; @@ -188,3 +193,7 @@ private: pthread_mutex_t _discovery_lock; }; + +} // namespace + +#endif /* __libbackend_coreaudio_pcmio_h__ */ diff --git a/libs/backends/coreaudio/coremidi_io.cc b/libs/backends/coreaudio/coremidi_io.cc index c83d51d7f3..365bde9457 100644 --- a/libs/backends/coreaudio/coremidi_io.cc +++ b/libs/backends/coreaudio/coremidi_io.cc @@ -17,9 +17,12 @@ */ #include -#include "coremidi_io.h" #include +#include "coremidi_io.h" + +using namespace ARDOUR; + static void notifyProc (const MIDINotification *message, void *refCon) { CoreMidiIo *self = static_cast(refCon); self->notify_proc(message); @@ -45,7 +48,7 @@ static void midiInputCallback(const MIDIPacketList *list, void *procRef, void *s static std::string getPropertyString (MIDIObjectRef object, CFStringRef key) { - CFStringRef name = nil; + CFStringRef name = NULL; std::string rv = ""; if (noErr == MIDIObjectGetStringProperty(object, key, &name)) { const CFIndex size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(name), kCFStringEncodingUTF8); diff --git a/libs/backends/coreaudio/coremidi_io.h b/libs/backends/coreaudio/coremidi_io.h index e74b495f7c..b5eda1c2fd 100644 --- a/libs/backends/coreaudio/coremidi_io.h +++ b/libs/backends/coreaudio/coremidi_io.h @@ -16,6 +16,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef __libbackend_coremidi_io_h__ +#define __libbackend_coremidi_io_h__ + #include #include #include @@ -30,7 +33,9 @@ #include #include "pbd/ringbuffer.h" -typedef struct _CoreMIDIPacket { +namespace ARDOUR { + +typedef struct _CoreMIDIPacket { MIDITimeStamp timeStamp; UInt16 length; Byte data[256]; @@ -113,3 +118,7 @@ private: pthread_mutex_t _discovery_lock; }; + +} // namespace + +#endif /* __libbackend_coremidi_io */