Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ak5k committed Sep 24, 2023
1 parent 7383cca commit 05de651
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
### Project ###
**/*[Bb]uild*/
**/out/
.vscode/
# Created by https://www.toptal.com/developers/gitignore/api/C++,CMake,macos,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=C++,CMake,macos,windows
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

### C++ ###
# Prerequisites
Expand Down
12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"name": "win-standalone",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/NDI-Audio-IO_artefacts/Debug/Standalone/NDI Audio IO.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
},
{
"name": "win-reaper",
"type": "cppvsdbg",
"request": "launch",
"program": "C:/Program Files/REAPER (x64)/reaper.exe",
Expand Down
22 changes: 9 additions & 13 deletions Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ NdipluginAudioProcessor::NdipluginAudioProcessor()
, apvts {*this, nullptr, juce::Identifier("APVTS"), createParameterLayout()}

{
// PropertiesFile::Options opts;
// String path =
// opts.getDefaultFile().getParentDirectory().getFullPathName();

auto path = File::getSpecialLocation(File::userApplicationDataDirectory)
.getChildFile(JucePlugin_Name)
.getFullPathName();
Expand Down Expand Up @@ -325,14 +321,14 @@ void NdipluginAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer,
const auto numSamples = buffer.getNumSamples();
const auto sampleRate = static_cast<int>(getSampleRate());

if (!ndi_mutex.try_lock_for(
std::chrono::milliseconds(1000 * numSamples / sampleRate / 2)))
{
if (is_standalone.load())
for (auto i = 0; i < totalNumOutputChannels; i++)
buffer.clear(i, 0, buffer.getNumSamples());
return;
}
// if (!ndi_mutex.try_lock_for(
// std::chrono::milliseconds(1000 * numSamples / sampleRate / 2)))
// {
// if (is_standalone.load())
// for (auto i = 0; i < totalNumOutputChannels; i++)
// buffer.clear(i, 0, buffer.getNumSamples());
// return;
// }

if (apvts.getRawParameterValue("tx")->load() >= 0.5f &&
tx_ok.load() >= 0.5f)
Expand Down Expand Up @@ -386,7 +382,7 @@ void NdipluginAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer,
p_NDILib->framesync_free_audio_v2(ndi_framesync, &rx_audio_frame);
}

ndi_mutex.unlock();
// ndi_mutex.unlock();
}

//==============================================================================
Expand Down

0 comments on commit 05de651

Please sign in to comment.