commit 0a36c5e3099346e185d3fe73fbb97da937799c12
parent 2312c48bf5fca0b284560502562213eb14931513
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Thu, 13 Feb 2014 14:42:02 -0500
Remove All Paths to mutex
- The mutex is dead
- DSSI is disabled as it needs to be rebuilt to use the new interface
Diffstat:
6 files changed, 3 insertions(+), 41 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -339,7 +339,7 @@ target_link_libraries(zynaddsubfx
${AUDIO_LIBRARIES}
)
-if (DssiEnable)
+if (DssiEnable AND FALSE)
add_library(zynaddsubfx_dssi SHARED
Output/DSSIaudiooutput.cpp
)
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -162,7 +162,6 @@ Master::Master()
the_master = this;
swaplr = 0;
- pthread_mutex_init(&mutex, NULL);
fft = new FFTwrapper(synth->oscilsize);
shutup = 0;
@@ -319,21 +318,6 @@ void Master::setController(char chan, int type, int par)
}
}
-void Master::setProgram(char chan, unsigned int pgm)
-{
- for(int npart = 0; npart < NUM_MIDI_PARTS; ++npart)
- if(chan == part[npart]->Prcvchn) {
- bank.loadfromslot(pgm, part[npart]);
-
- //Hack to get pad note parameters to update
- //this is not real time safe and makes assumptions about the calling
- //convention of this function...
- pthread_mutex_unlock(&mutex);
- part[npart]->applyparameters();
- pthread_mutex_lock(&mutex);
- }
-}
-
void Master::vuUpdate(const float *outl, const float *outr)
{
//Peak computation (for vumeters)
@@ -457,12 +441,9 @@ void Master::AudioOut(float *outl, float *outr)
memset(outr, 0, synth->bufferbytes);
//Compute part samples and store them part[npart]->partoutl,partoutr
- for(int npart = 0; npart < NUM_MIDI_PARTS; ++npart) {
- if(part[npart]->Penabled != 0 && !pthread_mutex_trylock(&part[npart]->load_mutex)) {
+ for(int npart = 0; npart < NUM_MIDI_PARTS; ++npart)
+ if(part[npart]->Penabled)
part[npart]->ComputePartSmps();
- pthread_mutex_unlock(&part[npart]->load_mutex);
- }
- }
//Insertion effects
for(int nefx = 0; nefx < NUM_INS_EFX; ++nefx)
@@ -655,8 +636,6 @@ Master::~Master()
delete sysefx[nefx];
delete fft;
-
- pthread_mutex_destroy(&mutex);
}
@@ -786,9 +765,7 @@ int Master::getalldata(char **data)
xml->beginbranch("MASTER");
- pthread_mutex_lock(&mutex);
add2XML(xml);
- pthread_mutex_unlock(&mutex);
xml->endbranch();
@@ -808,9 +785,7 @@ void Master::putalldata(char *data, int /*size*/)
if(xml->enterbranch("MASTER") == 0)
return;
- pthread_mutex_lock(&mutex);
getfromXML(xml);
- pthread_mutex_unlock(&mutex);
xml->exitbranch();
diff --git a/src/Misc/Master.h b/src/Misc/Master.h
@@ -85,7 +85,6 @@ class Master
void noteOff(char chan, char note);
void polyphonicAftertouch(char chan, char note, char velocity);
void setController(char chan, int type, int par);
- void setProgram(char chan, unsigned int pgm);
//void NRPN...
@@ -150,7 +149,6 @@ class Master
Bank bank;
class FFTwrapper * fft;
- pthread_mutex_t mutex;
static rtosc::Ports &ports;
float volume;
diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp
@@ -138,7 +138,6 @@ Part::Part(Microtonal *microtonal_, FFTwrapper *fft_)
{
microtonal = microtonal_;
fft = fft_;
- pthread_mutex_init(&load_mutex, NULL);
partoutl = new float [synth->buffersize];
partoutr = new float [synth->buffersize];
diff --git a/src/Misc/Part.h b/src/Misc/Part.h
@@ -30,7 +30,6 @@
#include "../Misc/Microtonal.h"
#include <list> // For the monomemnotes list.
-#include <pthread.h>
class EffectMgr;
class ADnoteParameters;
@@ -153,9 +152,6 @@ class Part
unsigned char Pefxroute[NUM_PART_EFX]; //how the effect's output is routed(to next effect/to out)
bool Pefxbypass[NUM_PART_EFX]; //if the effects are bypassed
-
- pthread_mutex_t load_mutex;
-
int lastnote;
static rtosc::Ports &ports;
diff --git a/src/Nio/OutMgr.cpp b/src/Nio/OutMgr.cpp
@@ -56,11 +56,6 @@ OutMgr::~OutMgr()
*/
const Stereo<float *> OutMgr::tick(unsigned int frameSize)
{
- if(pthread_mutex_trylock(&(master->mutex))) {
- puts("failed to get the mater mutex...");
- pthread_mutex_lock(&(master->mutex));
- }
-
InMgr::getInstance().flush();
//SysEv->execute();
removeStaleSmps();
@@ -68,7 +63,6 @@ const Stereo<float *> OutMgr::tick(unsigned int frameSize)
master->AudioOut(outl, outr);
addSmps(outl, outr);
}
- pthread_mutex_unlock(&(master->mutex));
stales = frameSize;
return priBuf;
}