Skip to content

Commit

Permalink
only one plugin will write files at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlikeskites committed Feb 6, 2015
1 parent e652a75 commit 699c328
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -20,6 +20,8 @@ SAFEAudioProcessor::AnalysisThread::~AnalysisThread()
//==========================================================================
void SAFEAudioProcessor::AnalysisThread::run()
{
GenericScopedLock <SpinLock> lock (mutex);

WarningID warning;

if (sendToServer)
Expand Down Expand Up @@ -47,6 +49,11 @@ void SAFEAudioProcessor::AnalysisThread::setParameters (String newDescriptors, S
sendToServer = newSendToServer;
}

//==========================================================================
// Lock to ensure only one plug-in saves at a time
//==========================================================================
SpinLock SAFEAudioProcessor::AnalysisThread::mutex;

//==========================================================================
// The Processor Itself
//==========================================================================
Expand Down
5 changes: 5 additions & 0 deletions JuceModules/SAFE_juce_module/PluginUtils/SAFEAudioProcessor.h
Expand Up @@ -33,6 +33,11 @@ class SAFEAudioProcessor : public AudioProcessor,
String descriptors;
SAFEMetaData metaData;
bool sendToServer;

//==========================================================================
// Lock to ensure only one plug-in saves at a time
//==========================================================================
static SpinLock mutex;
};

ScopedPointer <AnalysisThread> analysisThread;
Expand Down

0 comments on commit 699c328

Please sign in to comment.