diff plugin/DSSIPluginInstance.cpp @ 690:1424aa29ae95

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:26:52 +0100
parents 06f13a3b9e9e
children 7eb389da7976
line wrap: on
line diff
--- a/plugin/DSSIPluginInstance.cpp	Tue Jun 14 14:47:59 2011 +0100
+++ b/plugin/DSSIPluginInstance.cpp	Tue Jun 14 15:26:52 2011 +0100
@@ -77,7 +77,7 @@
     m_haveLastEventSendTime(false)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::DSSIPluginInstance(" << identifier << ")"
+    SVDEBUG << "DSSIPluginInstance::DSSIPluginInstance(" << identifier << ")"
 	      << endl;
 #endif
 
@@ -177,7 +177,7 @@
 DSSIPluginInstance::getParameter(std::string id) const
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::getParameter(" << id << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::getParameter(" << id << ")" << endl;
 #endif
     for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) {
         if (id == m_descriptor->LADSPA_Plugin->PortNames[m_controlPortsIn[i].first]) {
@@ -186,7 +186,7 @@
 #endif
             float v = getParameterValue(i);
 #ifdef DEBUG_DSSI
-            DEBUG << "Returning " << v << endl;
+            SVDEBUG << "Returning " << v << endl;
 #endif
             return v;
         }
@@ -199,7 +199,7 @@
 DSSIPluginInstance::setParameter(std::string id, float value)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::setParameter(" << id << ", " << value << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::setParameter(" << id << ", " << value << ")" << endl;
 #endif
 
     for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) {
@@ -214,7 +214,7 @@
 DSSIPluginInstance::init()
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::init" << endl;
+    SVDEBUG << "DSSIPluginInstance::init" << endl;
 #endif
 
     // Discover ports numbers and identities
@@ -258,7 +258,7 @@
         }
 #ifdef DEBUG_DSSI
         else
-            DEBUG << "DSSIPluginInstance::DSSIPluginInstance - "
+            SVDEBUG << "DSSIPluginInstance::DSSIPluginInstance - "
                       << "unrecognised port type" << endl;
 #endif
     }
@@ -272,7 +272,7 @@
     size_t latency = 0;
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::getLatency(): m_latencyPort " << m_latencyPort << ", m_run " << m_run << endl;
+    SVDEBUG << "DSSIPluginInstance::getLatency(): m_latencyPort " << m_latencyPort << ", m_run " << m_run << endl;
 #endif
 
     if (m_latencyPort) {
@@ -288,7 +288,7 @@
     }
     
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::getLatency(): latency is " << latency << endl;
+    SVDEBUG << "DSSIPluginInstance::getLatency(): latency is " << latency << endl;
 #endif
 
     return latency;
@@ -313,7 +313,7 @@
 DSSIPluginInstance::setIdealChannelCount(size_t channels)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::setIdealChannelCount: channel count "
+    SVDEBUG << "DSSIPluginInstance::setIdealChannelCount: channel count "
 	      << channels << " (was " << m_idealChannelCount << ")" << endl;
 #endif
 
@@ -401,7 +401,7 @@
 DSSIPluginInstance::~DSSIPluginInstance()
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::~DSSIPluginInstance" << endl;
+    SVDEBUG << "DSSIPluginInstance::~DSSIPluginInstance" << endl;
 #endif
 
     if (m_threads.find(m_instanceHandle) != m_threads.end()) {
@@ -502,7 +502,7 @@
     m_cachedPrograms.clear();
 
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::checkProgramCache" << endl;
+    SVDEBUG << "DSSIPluginInstance::checkProgramCache" << endl;
 #endif
 
     if (!m_descriptor || !m_descriptor->get_program) {
@@ -522,7 +522,7 @@
     }
 
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::checkProgramCache: have " << m_cachedPrograms.size() << " programs" << endl;
+    SVDEBUG << "DSSIPluginInstance::checkProgramCache: have " << m_cachedPrograms.size() << " programs" << endl;
 #endif
 
     m_programCacheValid = true;
@@ -532,7 +532,7 @@
 DSSIPluginInstance::getPrograms() const
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::getPrograms" << endl;
+    SVDEBUG << "DSSIPluginInstance::getPrograms" << endl;
 #endif
 
     if (!m_descriptor) return ProgramList();
@@ -553,7 +553,7 @@
 DSSIPluginInstance::getProgram(int bank, int program) const
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::getProgram(" << bank << "," << program << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::getProgram(" << bank << "," << program << ")" << endl;
 #endif
 
     if (!m_descriptor) return std::string();
@@ -572,7 +572,7 @@
 DSSIPluginInstance::getProgram(std::string name) const
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::getProgram(" << name << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::getProgram(" << name << ")" << endl;
 #endif
 
     if (!m_descriptor) return 0;
@@ -609,7 +609,7 @@
 DSSIPluginInstance::selectProgramAux(std::string program, bool backupPortValues)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::selectProgram(" << program << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::selectProgram(" << program << ")" << endl;
 #endif
 
     if (!m_descriptor) return;
@@ -631,7 +631,7 @@
 	    found = true;
 
 #ifdef DEBUG_DSSI
-	    DEBUG << "DSSIPluginInstance::selectProgram(" << program << "): found at bank " << bankNo << ", program " << programNo << endl;
+	    SVDEBUG << "DSSIPluginInstance::selectProgram(" << program << "): found at bank " << bankNo << ", program " << programNo << endl;
 #endif
 
 	    break;
@@ -647,7 +647,7 @@
     m_processLock.unlock();
 
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::selectProgram(" << program << "): made select_program(" << bankNo << "," << programNo << ") call" << endl;
+    SVDEBUG << "DSSIPluginInstance::selectProgram(" << program << "): made select_program(" << bankNo << "," << programNo << ") call" << endl;
 #endif
 
     if (backupPortValues) {
@@ -661,7 +661,7 @@
 DSSIPluginInstance::activate()
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::activate" << endl;
+    SVDEBUG << "DSSIPluginInstance::activate" << endl;
 #endif
 
     if (!m_descriptor || !m_descriptor->LADSPA_Plugin->activate) return;
@@ -669,14 +669,14 @@
 
     if (m_program != "") {
 #ifdef DEBUG_DSSI
-	DEBUG << "DSSIPluginInstance::activate: restoring program " << m_program << endl;
+	SVDEBUG << "DSSIPluginInstance::activate: restoring program " << m_program << endl;
 #endif
 	selectProgramAux(m_program, false);
     }
 
     for (size_t i = 0; i < m_backupControlPortsIn.size(); ++i) {
 #ifdef DEBUG_DSSI
-	DEBUG << "DSSIPluginInstance::activate: setting port " << m_controlPortsIn[i].first << " to " << m_backupControlPortsIn[i] << endl;
+	SVDEBUG << "DSSIPluginInstance::activate: setting port " << m_controlPortsIn[i].first << " to " << m_backupControlPortsIn[i] << endl;
 #endif
 	*m_controlPortsIn[i].second = m_backupControlPortsIn[i];
     }
@@ -687,7 +687,7 @@
 {
     if (!m_descriptor || !m_descriptor->LADSPA_Plugin->connect_port) return;
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::connectPorts: " << m_audioPortsIn.size() 
+    SVDEBUG << "DSSIPluginInstance::connectPorts: " << m_audioPortsIn.size() 
 	      << " audio ports in, " << m_audioPortsOut.size() << " out, "
 	      << m_outputBufferCount << " output buffers" << endl;
 #endif
@@ -726,7 +726,7 @@
             *m_controlPortsIn[i].second = defaultValue;
             m_backupControlPortsIn[i] = defaultValue;
 #ifdef DEBUG_DSSI
-            DEBUG << "DSSIPluginInstance::connectPorts: set control port " << i << " to default value " << defaultValue << endl;
+            SVDEBUG << "DSSIPluginInstance::connectPorts: set control port " << i << " to default value " << defaultValue << endl;
 #endif
         }
     }
@@ -749,7 +749,7 @@
 DSSIPluginInstance::setParameterValue(unsigned int parameter, float value)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::setParameterValue(" << parameter << ") to " << value << endl;
+    SVDEBUG << "DSSIPluginInstance::setParameterValue(" << parameter << ") to " << value << endl;
 #endif
     if (parameter >= m_controlPortsIn.size()) return;
 
@@ -773,7 +773,7 @@
 DSSIPluginInstance::setPortValueFromController(unsigned int port, int cv)
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::setPortValueFromController(" << port << ") to " << cv << endl;
+    SVDEBUG << "DSSIPluginInstance::setPortValueFromController(" << port << ") to " << cv << endl;
 #endif
 
     const LADSPA_Descriptor *p = m_descriptor->LADSPA_Plugin;
@@ -819,7 +819,7 @@
 DSSIPluginInstance::getParameterValue(unsigned int parameter) const
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::getParameterValue(" << parameter << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::getParameterValue(" << parameter << ")" << endl;
 #endif
     if (parameter >= m_controlPortsIn.size()) return 0.0;
     return (*m_controlPortsIn[parameter].second);
@@ -869,7 +869,7 @@
 	
     
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::configure(" << key << "," << value << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::configure(" << key << "," << value << ")" << endl;
 #endif
 
     char *message = m_descriptor->configure(m_instanceHandle,
@@ -908,7 +908,7 @@
 			      const void *e)
 {
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::sendEvent: last was " << m_lastEventSendTime << " (valid " << m_haveLastEventSendTime << "), this is " << eventTime << endl;
+    SVDEBUG << "DSSIPluginInstance::sendEvent: last was " << m_lastEventSendTime << " (valid " << m_haveLastEventSendTime << "), this is " << eventTime << endl;
 #endif
 
     // The process mechanism only works correctly if the events are
@@ -926,7 +926,7 @@
 
     snd_seq_event_t *event = (snd_seq_event_t *)e;
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::sendEvent at " << eventTime << endl;
+    SVDEBUG << "DSSIPluginInstance::sendEvent at " << eventTime << endl;
 #endif
     snd_seq_event_t ev(*event);
 
@@ -955,7 +955,7 @@
     int controller = ev->data.control.param;
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::handleController " << controller << endl;
+    SVDEBUG << "DSSIPluginInstance::handleController " << controller << endl;
 #endif
 
     if (controller == 0) { // bank select MSB
@@ -1020,12 +1020,12 @@
     }
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::run(" << blockTime << ")" << endl;
+    SVDEBUG << "DSSIPluginInstance::run(" << blockTime << ")" << endl;
 #endif
 
 #ifdef DEBUG_DSSI_PROCESS
     if (m_eventBuffer.getReadSpace() > 0) {
-	DEBUG << "DSSIPluginInstance::run: event buffer has "
+	SVDEBUG << "DSSIPluginInstance::run: event buffer has "
 		  << m_eventBuffer.getReadSpace() << " event(s) in it" << endl;
     }
 #endif
@@ -1044,7 +1044,7 @@
 	}
 
 #ifdef DEBUG_DSSI_PROCESS
-	DEBUG << "DSSIPluginInstance::run: evTime " << evTime << ", blockTime " << blockTime << ", frameOffset " << frameOffset
+	SVDEBUG << "DSSIPluginInstance::run: evTime " << evTime << ", blockTime " << blockTime << ", frameOffset " << frameOffset
 		  << ", blockSize " << m_blockSize << endl;
 	std::cerr << "Type: " << int(ev->type) << ", pitch: " << int(ev->data.note.note) << ", velocity: " << int(ev->data.note.velocity) << std::endl;
 #endif
@@ -1079,19 +1079,19 @@
 	int bank = m_pending.lsb + 128 * m_pending.msb;
 
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::run: making select_program(" << bank << "," << program << ") call" << endl;
+    SVDEBUG << "DSSIPluginInstance::run: making select_program(" << bank << "," << program << ") call" << endl;
 #endif
 
 	m_pending.lsb = m_pending.msb = m_pending.program = -1;
 	m_descriptor->select_program(m_instanceHandle, bank, program);
 
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::run: made select_program(" << bank << "," << program << ") call" << endl;
+    SVDEBUG << "DSSIPluginInstance::run: made select_program(" << bank << "," << program << ") call" << endl;
 #endif
     }
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::run: running with " << evCount << " events"
+    SVDEBUG << "DSSIPluginInstance::run: running with " << evCount << " events"
 	      << endl;
 #endif
 
@@ -1153,7 +1153,7 @@
     PluginSet &s = m_groupMap[m_identifier];
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): this is " << this << "; " << s.size() << " elements in m_groupMap[" << m_identifier << "]" << endl;
+    SVDEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): this is " << this << "; " << s.size() << " elements in m_groupMap[" << m_identifier << "]" << endl;
 #endif
 
     if (m_lastRunTime != blockTime) {
@@ -1161,7 +1161,7 @@
 	    DSSIPluginInstance *instance = *i;
 	    if (instance != this && instance->m_lastRunTime == blockTime) {
 #ifdef DEBUG_DSSI_PROCESS
-		DEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): plugin " << instance << " has already been run" << endl;
+		SVDEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): plugin " << instance << " has already been run" << endl;
 #endif
 		needRun = false;
 	    }
@@ -1170,13 +1170,13 @@
 
     if (!needRun) {
 #ifdef DEBUG_DSSI_PROCESS
-	DEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): already run, returning" << endl;
+	SVDEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): already run, returning" << endl;
 #endif
 	return;
     }
 
 #ifdef DEBUG_DSSI_PROCESS
-    DEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): I'm the first, running" << endl;
+    SVDEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): I'm the first, running" << endl;
 #endif
 
     size_t index = 0;
@@ -1194,7 +1194,7 @@
 	instances[index] = instance->m_instanceHandle;
 
 #ifdef DEBUG_DSSI_PROCESS
-	DEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): running " << instance << endl;
+	SVDEBUG << "DSSIPluginInstance::runGrouped(" << blockTime << "): running " << instance << endl;
 #endif
 
 	if (instance->m_pending.program >= 0 &&
@@ -1220,7 +1220,7 @@
 	    }
 
 #ifdef DEBUG_DSSI_PROCESS
-	    DEBUG << "DSSIPluginInstance::runGrouped: evTime " << evTime << ", frameOffset " << frameOffset
+	    SVDEBUG << "DSSIPluginInstance::runGrouped: evTime " << evTime << ", frameOffset " << frameOffset
 		      << ", block size " << m_blockSize << endl;
 #endif
 
@@ -1259,7 +1259,7 @@
 {
     // This is called from a non-RT context (during instantiate)
 
-    DEBUG << "DSSIPluginInstance::requestMidiSend" << endl;
+    SVDEBUG << "DSSIPluginInstance::requestMidiSend" << endl;
     return 1;
 }
 
@@ -1270,7 +1270,7 @@
 {
     // This is likely to be called from an RT context
 
-    DEBUG << "DSSIPluginInstance::midiSend" << endl;
+    SVDEBUG << "DSSIPluginInstance::midiSend" << endl;
 }
 
 void
@@ -1296,7 +1296,7 @@
 DSSIPluginInstance::deactivate()
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::deactivate " << m_identifier << endl;
+    SVDEBUG << "DSSIPluginInstance::deactivate " << m_identifier << endl;
 #endif
     if (!m_descriptor || !m_descriptor->LADSPA_Plugin->deactivate) return;
 
@@ -1306,7 +1306,7 @@
 
     m_descriptor->LADSPA_Plugin->deactivate(m_instanceHandle);
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::deactivate " << m_identifier << " done" << endl;
+    SVDEBUG << "DSSIPluginInstance::deactivate " << m_identifier << " done" << endl;
 #endif
 
     m_bufferScavenger.scavenge();
@@ -1316,7 +1316,7 @@
 DSSIPluginInstance::cleanup()
 {
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::cleanup " << m_identifier << endl;
+    SVDEBUG << "DSSIPluginInstance::cleanup " << m_identifier << endl;
 #endif
     if (!m_descriptor) return;
 
@@ -1331,7 +1331,7 @@
     m_descriptor->LADSPA_Plugin->cleanup(m_instanceHandle);
     m_instanceHandle = 0;
 #ifdef DEBUG_DSSI
-    DEBUG << "DSSIPluginInstance::cleanup " << m_identifier << " done" << endl;
+    SVDEBUG << "DSSIPluginInstance::cleanup " << m_identifier << " done" << endl;
 #endif
 }