Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

Commit 28e0f78

Browse files
committed
dev
1 parent 05f2484 commit 28e0f78

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ elseif(APPLE AND NOT IOS)
307307
set(CPACK_GENERATOR "productbuild")
308308
set(CPACK_PACKAGING_INSTALL_PREFIX "/Applications")
309309
set(APP_DEST "${PRODUCT_NAME}/" )
310-
# set(NDILIB_DEST "../Library/Application Support/${PRODUCT_NAME}" )
311-
set(NDILIB_DEST "../Library/Application Support/${PRODUCT_NAME}/" )
310+
# set(NDILIB_DEST "../Library/Application Support/${PRODUCT_NAME}/" )
311+
set(NDILIB_DEST "../usr/local/lib" )
312312
set(VST3_DEST "../Library/Audio/Plug-Ins/VST3" )
313313
set(AU_DEST "../Library/Audio/Plug-Ins/Components" )
314314
set(AAX_DEST "../Library/Application Support/Avid/Audio/Plug-Ins")
315315

316316
# set_target_properties(${PROJECT_NAME}_Standalone PROPERTIES INSTALL_RPATH ${PROJECT_SOURCE_DIR}/external/ndi5-sdk/lib)
317317
set(CMAKE_MACOSX_RPATH 1)
318-
set(CMAKE_INSTALL_NAME_DIR "/Library/Application Support/${PRODUCT_NAME}/")
318+
set(CMAKE_INSTALL_NAME_DIR "/usr/local/lib")
319319
set_target_properties(${PROJECT_NAME}_Standalone PROPERTIES BUNDLE TRUE)
320320

321321
install(TARGETS ${PROJECT_NAME}_Standalone RUNTIME DESTINATION . BUNDLE DESTINATION . COMPONENT Standalone)

Source/PluginProcessor.cpp

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
#include "PluginProcessor.h"
22
#include "PluginEditor.h"
33

4-
std::mutex NdiAudioProcessor::init_mutex {};
4+
std::mutex NdiAudioProcessor::init_mutex{};
55

66
//==============================================================================
77
NdiAudioProcessor::NdiAudioProcessor()
88
// : AudioProcessor()
99
: AudioProcessor(
1010
BusesProperties()
1111
.withInput("Input", juce::AudioChannelSet::stereo(), true)
12-
.withOutput("Output", juce::AudioChannelSet::stereo(), true))
13-
, apvts {*this, nullptr, juce::Identifier("APVTS"), createParameterLayout()}
12+
.withOutput("Output", juce::AudioChannelSet::stereo(), true)),
13+
apvts{*this, nullptr, juce::Identifier("APVTS"), createParameterLayout()}
1414
{
1515
std::scoped_lock init_lock(init_mutex);
1616

17-
std::string ndi_runtime_path {};
17+
std::string ndi_runtime_path{};
1818
auto ndi_runtime_path_included =
1919
#ifdef __linux__
2020
File::getSpecialLocation(File::userApplicationDataDirectory)
2121
#else
2222
File::getSpecialLocation(File::commonApplicationDataDirectory)
23-
#endif
24-
#ifdef __APPLE__
25-
.getChildFile("Application Support")
2623
#endif
2724
.getChildFile(JucePlugin_Name)
2825
.getChildFile(NDILIB_LIBRARY_NAME)
2926
.getFullPathName();
3027

28+
#ifdef __APPLE__
29+
ndi_runtime_path_included =
30+
File::File("/usr/local/lib")
31+
.getChildFile(NDILIB_LIBRARY_NAME)
32+
.getFullPathName();
33+
#endif
34+
3135
#ifdef __linux__
3236
// linux and macos
3337
goto linux_load;
3438
linux_load:
3539
#define dynamic_load 1
3640
hNDILib = nullptr;
37-
const char* p_ndi_runtime_v5 = getenv(NDILIB_REDIST_FOLDER);
41+
const char *p_ndi_runtime_v5 = getenv(NDILIB_REDIST_FOLDER);
3842
if (p_ndi_runtime_v5)
3943
{
4044
ndi_runtime_path = p_ndi_runtime_v5;
@@ -58,10 +62,10 @@ NdiAudioProcessor::NdiAudioProcessor()
5862
hNDILib = dlopen(ndi_runtime_path.c_str(), RTLD_LOCAL | RTLD_LAZY);
5963

6064
// The main NDI entry point for dynamic loading if we got the librari
61-
const NDIlib_v5* (*NDIlib_v5_load)(void) = nullptr;
65+
const NDIlib_v5 *(*NDIlib_v5_load)(void) = nullptr;
6266
if (hNDILib)
6367
{
64-
*((void**)&NDIlib_v5_load) = dlsym(hNDILib, "NDIlib_v5_load");
68+
*((void **)&NDIlib_v5_load) = dlsym(hNDILib, "NDIlib_v5_load");
6569
}
6670
if (!NDIlib_v5_load)
6771
{
@@ -82,7 +86,7 @@ NdiAudioProcessor::NdiAudioProcessor()
8286
// Windows 32 and 64
8387
#define dynamic_load 1
8488

85-
char* p_ndi_runtime_v5 = nullptr;
89+
char *p_ndi_runtime_v5 = nullptr;
8690
size_t sz = 0;
8791
auto err = _dupenv_s(&p_ndi_runtime_v5, &sz, NDILIB_REDIST_FOLDER);
8892
if (!err && p_ndi_runtime_v5 != nullptr)
@@ -109,10 +113,10 @@ NdiAudioProcessor::NdiAudioProcessor()
109113
}
110114
hNDILib = LoadLibraryA(ndi_runtime_path.c_str());
111115

112-
const NDIlib_v5* (*NDIlib_v5_load)(void) = nullptr;
116+
const NDIlib_v5 *(*NDIlib_v5_load)(void) = nullptr;
113117
if (hNDILib)
114118
{
115-
*((FARPROC*)&NDIlib_v5_load) =
119+
*((FARPROC *)&NDIlib_v5_load) =
116120
GetProcAddress(hNDILib, "NDIlib_v5_load");
117121
}
118122

@@ -276,7 +280,7 @@ const juce::String NdiAudioProcessor::getProgramName(int index)
276280
}
277281

278282
void NdiAudioProcessor::changeProgramName(int index,
279-
const juce::String& newName)
283+
const juce::String &newName)
280284
{
281285
(void)index;
282286
(void)newName;
@@ -350,7 +354,7 @@ void NdiAudioProcessor::releaseResources()
350354
}
351355

352356
#ifndef JucePlugin_PreferredChannelConfigurations
353-
bool NdiAudioProcessor::isBusesLayoutSupported(const BusesLayout& layouts) const
357+
bool NdiAudioProcessor::isBusesLayoutSupported(const BusesLayout &layouts) const
354358
{
355359
(void)layouts;
356360
// This checks if the input layout matches the output layout
@@ -360,8 +364,8 @@ bool NdiAudioProcessor::isBusesLayoutSupported(const BusesLayout& layouts) const
360364
#endif
361365

362366
template <typename T>
363-
void NdiAudioProcessor::processBlock2(juce::AudioBuffer<T>& buffer,
364-
juce::MidiBuffer& midiMessages)
367+
void NdiAudioProcessor::processBlock2(juce::AudioBuffer<T> &buffer,
368+
juce::MidiBuffer &midiMessages)
365369
{
366370
(void)midiMessages;
367371

@@ -432,7 +436,7 @@ void NdiAudioProcessor::processBlock2(juce::AudioBuffer<T>& buffer,
432436
recv_channels.size() <= totalNumOutputChannels)
433437
{
434438
select_channels_ok = true;
435-
for (auto&& i : recv_channels)
439+
for (auto &&i : recv_channels)
436440
{
437441
if (i > num_source_channels)
438442
select_channels_ok = false;
@@ -478,13 +482,13 @@ bool NdiAudioProcessor::hasEditor() const
478482
return true; // (change this to false if you choose to not supply an editor)
479483
}
480484

481-
juce::AudioProcessorEditor* NdiAudioProcessor::createEditor()
485+
juce::AudioProcessorEditor *NdiAudioProcessor::createEditor()
482486
{
483487
return new NdiAudioProcessorEditor(*this);
484488
}
485489

486490
//================================================================= =
487-
void NdiAudioProcessor::getStateInformation(juce::MemoryBlock& destData)
491+
void NdiAudioProcessor::getStateInformation(juce::MemoryBlock &destData)
488492
{
489493
// block. You should use this method to store your parameters in
490494
// the memory block. You could do that either as raw data, or use the X
@@ -499,7 +503,7 @@ void NdiAudioProcessor::getStateInformation(juce::MemoryBlock& destData)
499503
copyXmlToBinary(*xml, destData);
500504
}
501505

502-
void NdiAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
506+
void NdiAudioProcessor::setStateInformation(const void *data, int sizeInBytes)
503507
{
504508
// memory You should use this method to restore your paramete
505509
// rs from this memory block, whose contents will have been created by the
@@ -522,7 +526,7 @@ void NdiAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
522526
return;
523527
}
524528

525-
void NdiAudioProcessor::parameterChanged(const String& parameterID,
529+
void NdiAudioProcessor::parameterChanged(const String &parameterID,
526530
float newValue)
527531
{
528532
if (!p_NDILib)
@@ -596,7 +600,7 @@ void NdiAudioProcessor::parameterChanged(const String& parameterID,
596600

597601
//==============================================================================
598602
// This creates new instances of the plugin..
599-
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
603+
juce::AudioProcessor *JUCE_CALLTYPE createPluginFilter()
600604
{
601605
return new NdiAudioProcessor();
602606
}

0 commit comments

Comments
 (0)