Skip to content

Commit e19cb2b

Browse files
committed
Use CF_EXTERN_C_BEGIN and CF_EXTERN_C_END
1 parent e836702 commit e19cb2b

File tree

5 files changed

+39
-34
lines changed

5 files changed

+39
-34
lines changed

Sources/CAudioKitEX/Nodes/CallbackInstrumentDSP.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "DSPBase.h"
44
#import "Internals/RingBuffer.h"
5+
#import "CAudioKit.h"
56

67
using AudioKit::RingBuffer;
78

@@ -70,7 +71,7 @@ void setCallback(CMIDICallback func) {
7071
CMIDICallback callback = nullptr;
7172
};
7273

73-
AK_API void akCallbackInstrumentSetCallback(DSPRef dsp, CMIDICallback callback) {
74+
void akCallbackInstrumentSetCallback(DSPRef dsp, CMIDICallback callback) {
7475
static_cast<CallbackInstrumentDSP*>(dsp)->setCallback(callback);
7576
}
7677

Sources/CAudioKitEX/include/CAudioKit.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ FOUNDATION_EXPORT const unsigned char AudioKitVersionString[];
3232
// Swift/ObjC/C/C++ Inter-operability
3333
#import "Interop.h"
3434

35+
CF_EXTERN_C_BEGIN
3536
typedef void (^CMIDICallback)(uint8_t, uint8_t, uint8_t);
36-
AK_API void akCallbackInstrumentSetCallback(DSPRef dsp, CMIDICallback callback);
37+
void akCallbackInstrumentSetCallback(DSPRef dsp, CMIDICallback callback);
38+
CF_EXTERN_C_END
3739

3840
// Misc
3941
#import "BufferedAudioBus.h"

Sources/CAudioKitEX/include/DSPBase.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,37 @@
77

88
#include <stdarg.h>
99

10-
AK_API DSPRef akCreateDSP(OSType code);
11-
AK_API AUParameterAddress akGetParameterAddress(const char* name);
10+
CF_EXTERN_C_BEGIN
1211

13-
AK_API AUInternalRenderBlock internalRenderBlockDSP(DSPRef pDSP);
12+
DSPRef akCreateDSP(OSType code);
13+
AUParameterAddress akGetParameterAddress(const char* name);
1414

15-
AK_API size_t inputBusCountDSP(DSPRef pDSP);
16-
AK_API bool canProcessInPlaceDSP(DSPRef pDSP);
15+
AUInternalRenderBlock internalRenderBlockDSP(DSPRef pDSP);
1716

18-
AK_API void setBufferDSP(DSPRef pDSP, AudioBufferList* buffer, size_t busIndex);
19-
AK_API void allocateRenderResourcesDSP(DSPRef pDSP, uint32_t channelCount, double sampleRate);
20-
AK_API void deallocateRenderResourcesDSP(DSPRef pDSP);
21-
AK_API void resetDSP(DSPRef pDSP);
17+
size_t inputBusCountDSP(DSPRef pDSP);
18+
bool canProcessInPlaceDSP(DSPRef pDSP);
2219

23-
AK_API void setParameterValueDSP(DSPRef pDSP, AUParameterAddress address, AUValue value);
24-
AK_API AUValue getParameterValueDSP(DSPRef pDSP, AUParameterAddress address);
20+
void setBufferDSP(DSPRef pDSP, AudioBufferList* buffer, size_t busIndex);
21+
void allocateRenderResourcesDSP(DSPRef pDSP, uint32_t channelCount, double sampleRate);
22+
void deallocateRenderResourcesDSP(DSPRef pDSP);
23+
void resetDSP(DSPRef pDSP);
2524

26-
AK_API void setBypassDSP(DSPRef pDSP, bool bypassed);
27-
AK_API bool getBypassDSP(DSPRef pDSP);
25+
void setParameterValueDSP(DSPRef pDSP, AUParameterAddress address, AUValue value);
26+
AUValue getParameterValueDSP(DSPRef pDSP, AUParameterAddress address);
2827

29-
AK_API void initializeConstantDSP(DSPRef pDSP, AUValue value);
28+
void setBypassDSP(DSPRef pDSP, bool bypassed);
29+
bool getBypassDSP(DSPRef pDSP);
3030

31-
AK_API void setWavetableDSP(DSPRef pDSP, const float* table, size_t length, int index);
31+
void initializeConstantDSP(DSPRef pDSP, AUValue value);
3232

33-
AK_API void deleteDSP(DSPRef pDSP);
33+
void setWavetableDSP(DSPRef pDSP, const float* table, size_t length, int index);
34+
35+
void deleteDSP(DSPRef pDSP);
3436

3537
/// Reset random seed to ensure deterministic results in tests.
36-
AK_API void akSetSeed(unsigned int);
38+
void akSetSeed(unsigned int);
39+
40+
CF_EXTERN_C_END
3741

3842
#ifdef __cplusplus
3943

Sources/CAudioKitEX/include/Interop.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
/// Pointer to an instance of an DSPBase subclass
66
typedef struct DSPBase* DSPRef;
77

8-
#ifdef __cplusplus
9-
#define AK_API extern "C"
10-
#else
11-
#define AK_API
12-
#endif
13-
148
/// MIDI Constants
159
#define MIDI_NOTE_ON 0x90
1610
#define MIDI_NOTE_OFF 0x80

Sources/CAudioKitEX/include/SequencerEngine.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,36 @@ typedef struct {
3030

3131
typedef struct SequencerEngine* SequencerEngineRef;
3232

33+
CF_EXTERN_C_BEGIN
34+
3335
/// Creates the audio-thread-only state for the sequencer.
34-
AK_API SequencerEngineRef akSequencerEngineCreate(void);
36+
SequencerEngineRef akSequencerEngineCreate(void);
3537

3638
/// Release ownership of the sequencer. Sequencer is deallocated when no render observers are live.
37-
AK_API void akSequencerEngineRelease(SequencerEngineRef engine);
39+
void akSequencerEngineRelease(SequencerEngineRef engine);
3840

3941
/// Updates the sequence and returns a new render observer.
40-
AK_API AURenderObserver akSequencerEngineUpdateSequence(SequencerEngineRef engine,
42+
AURenderObserver akSequencerEngineUpdateSequence(SequencerEngineRef engine,
4143
const SequenceEvent* events,
4244
size_t eventCount,
4345
SequenceSettings settings,
4446
double sampleRate,
4547
AUScheduleMIDIEventBlock block);
4648

4749
/// Returns the sequencer playhead position in beats.
48-
AK_API double akSequencerEngineGetPosition(SequencerEngineRef engine);
50+
double akSequencerEngineGetPosition(SequencerEngineRef engine);
4951

5052
/// Move the playhead to a location in beats.
51-
AK_API void akSequencerEngineSeekTo(SequencerEngineRef engine, double position);
53+
void akSequencerEngineSeekTo(SequencerEngineRef engine, double position);
5254

53-
AK_API void akSequencerEngineSetPlaying(SequencerEngineRef engine, bool playing);
55+
void akSequencerEngineSetPlaying(SequencerEngineRef engine, bool playing);
5456

55-
AK_API bool akSequencerEngineIsPlaying(SequencerEngineRef engine);
57+
bool akSequencerEngineIsPlaying(SequencerEngineRef engine);
5658

5759
/// Stop all notes currently playing.
58-
AK_API void akSequencerEngineStopPlayingNotes(SequencerEngineRef engine);
60+
void akSequencerEngineStopPlayingNotes(SequencerEngineRef engine);
5961

6062
/// Update sequencer tempo.
61-
AK_API void akSequencerEngineSetTempo(SequencerEngineRef engine, double tempo);
63+
void akSequencerEngineSetTempo(SequencerEngineRef engine, double tempo);
64+
65+
CF_EXTERN_C_END

0 commit comments

Comments
 (0)