From 05de65177adfa94b7ca2572f71f2b4d6e1279497 Mon Sep 17 00:00:00 2001 From: ak5k <42914711+ak5k@users.noreply.github.com> Date: Sun, 24 Sep 2023 04:45:25 +0300 Subject: [PATCH] dev --- .gitignore | 7 ++++++- .vscode/launch.json | 12 +++++++++++- Source/PluginProcessor.cpp | 22 +++++++++------------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index f3d61f1..3b2ac46 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.vscode/launch.json b/.vscode/launch.json index b2fbadd..de0a247 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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", diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index a9eea9a..945ba9b 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -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(); @@ -325,14 +321,14 @@ void NdipluginAudioProcessor::processBlock(juce::AudioBuffer& buffer, const auto numSamples = buffer.getNumSamples(); const auto sampleRate = static_cast(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) @@ -386,7 +382,7 @@ void NdipluginAudioProcessor::processBlock(juce::AudioBuffer& buffer, p_NDILib->framesync_free_audio_v2(ndi_framesync, &rx_audio_frame); } - ndi_mutex.unlock(); + // ndi_mutex.unlock(); } //==============================================================================