summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-12-16 01:56:25 +0000
committerTim E. Real <termtech@rogers.com>2012-12-16 01:56:25 +0000
commita2ae7e06099f1ceb38d752909e3c17055fbc59ca (patch)
tree05d72e62dc981f60876eae6be24993d336276b0f /muse2/muse
parentb776676ee0feb412a0c2aa917847231985b32563 (diff)
Fix some Release build warnings. Several more to do.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/audiotrack.cpp37
-rw-r--r--muse2/muse/driver/dummyaudio.cpp8
-rw-r--r--muse2/muse/dssihost.cpp22
-rw-r--r--muse2/muse/mixer/astrip.cpp63
-rw-r--r--muse2/muse/node.cpp18
-rw-r--r--muse2/muse/plugin.cpp18
-rw-r--r--muse2/muse/vst_native.cpp21
7 files changed, 139 insertions, 48 deletions
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index 91b07063..0b1e94b2 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -23,6 +23,7 @@
#include <limits.h>
#include <stdlib.h>
+#include <stdio.h>
#include <map>
#include <QMessageBox>
@@ -117,7 +118,14 @@ AudioTrack::AudioTrack(TrackType t)
_totalOutChannels = MAX_CHANNELS;
outBuffers = new float*[_totalOutChannels];
for (int i = 0; i < _totalOutChannels; ++i)
- posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: AudioTrack ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
// This is only set by multi-channel syntis...
_totalInChannels = 0;
@@ -1725,7 +1733,14 @@ AudioAux::AudioAux()
for(int i = 0; i < MAX_CHANNELS; ++i)
{
if(i < channels())
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
else
buffer[i] = 0;
}
@@ -1738,7 +1753,14 @@ AudioAux::AudioAux(const AudioAux& t, int flags)
for(int i = 0; i < MAX_CHANNELS; ++i)
{
if(i < channels())
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: AudioAux ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
else
buffer[i] = 0;
}
@@ -1830,7 +1852,14 @@ void AudioAux::setChannels(int n)
if(n > channels())
{
for(int i = channels(); i < n; ++i)
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: AudioAux::setChannels: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
}
else if(n < channels())
{
diff --git a/muse2/muse/driver/dummyaudio.cpp b/muse2/muse/driver/dummyaudio.cpp
index 21bb425f..172638b4 100644
--- a/muse2/muse/driver/dummyaudio.cpp
+++ b/muse2/muse/driver/dummyaudio.cpp
@@ -227,7 +227,13 @@ DummyAudioDevice::DummyAudioDevice()
// Added by Tim. p3.3.15
// p3.3.30
//posix_memalign((void**)&buffer, 16, sizeof(float) * dummyFrames);
- posix_memalign((void**)&buffer, 16, sizeof(float) * MusEGlobal::config.dummyAudioBufSize);
+
+ int rv = posix_memalign((void**)&buffer, 16, sizeof(float) * MusEGlobal::config.dummyAudioBufSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: DummyAudioDevice ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
dummyThread = 0;
realtimeFlag = false;
diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp
index 4391dfd9..6b55c7e7 100644
--- a/muse2/muse/dssihost.cpp
+++ b/muse2/muse/dssihost.cpp
@@ -37,6 +37,7 @@
#include <signal.h>
#include <dlfcn.h>
#include <stdlib.h>
+#include <stdio.h>
#include <sys/stat.h>
#include <QDir>
@@ -486,13 +487,23 @@ bool DssiSynthIF::init(DssiSynth* s)
int inports = synth->_inports;
if(inports != 0)
{
- posix_memalign((void**)&audioInSilenceBuf, 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&audioInSilenceBuf, 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: DssiSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(audioInSilenceBuf, 0, sizeof(float) * MusEGlobal::segmentSize);
audioInBuffers = new float*[inports];
for(int k = 0; k < inports; ++k)
{
- posix_memalign((void**)&audioInBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&audioInBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: DssiSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(audioInBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
ld->connect_port(handle, synth->iIdx[k], audioInBuffers[k]);
}
@@ -504,7 +515,12 @@ bool DssiSynthIF::init(DssiSynth* s)
audioOutBuffers = new float*[outports];
for(int k = 0; k < outports; ++k)
{
- posix_memalign((void**)&audioOutBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&audioOutBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: DssiSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(audioOutBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
ld->connect_port(handle, synth->oIdx[k], audioOutBuffers[k]);
}
diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp
index 243df29c..32504cc8 100644
--- a/muse2/muse/mixer/astrip.cpp
+++ b/muse2/muse/mixer/astrip.cpp
@@ -23,6 +23,8 @@
//=========================================================
#include <fastlog.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <QLayout>
#include <QApplication>
@@ -676,45 +678,46 @@ void AudioStrip::updateChannels()
MusEGui::Knob* AudioStrip::addKnob(Knob::KnobType type, int id, MusEGui::DoubleLabel** dlabel, QLabel *name)
{
- MusEGui::Knob* knob = new Knob(this);
- knob->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
- MusEGui::DoubleLabel* knobLabel;
- if (type == Knob::panType)
- {
- knob->setRange(-1.0, +1.0);
- knob->setToolTip(tr("panorama"));
- knobLabel = new MusEGui::DoubleLabel(0, -1.0, +1.0, this);
-
- } else if (type == Knob::auxType)
- {
- knob->setRange(MusEGlobal::config.minSlider-0.1, 10.0);
- knob->setToolTip(tr("aux send level"));
- knob->setFaceColor(Qt::blue);
- knobLabel = new MusEGui::DoubleLabel(0.0, MusEGlobal::config.minSlider, 10.1, this);
-
- } else if (type == Knob::gainType)
+ MusEGui::Knob* knob = NULL;
+ MusEGui::DoubleLabel* knobLabel = NULL;
+ switch(type)
{
- knob->setRange(1.0, 20.0);
- knob->setFaceColor(Qt::yellow);
- knob->setToolTip(tr("calibration gain"));
- knobLabel = new MusEGui::DoubleLabel(1.0, 1.0, 30.0, this);
+ case Knob::panType:
+ knob = new Knob(this);
+ knob->setRange(-1.0, +1.0);
+ knob->setToolTip(tr("panorama"));
+ knobLabel = new MusEGui::DoubleLabel(0, -1.0, +1.0, this);
+ knobLabel->setPrecision(2);
+ break;
+ case Knob::auxType:
+ knob = new Knob(this);
+ knob->setRange(MusEGlobal::config.minSlider-0.1, 10.0);
+ knob->setToolTip(tr("aux send level"));
+ knob->setFaceColor(Qt::blue);
+ knobLabel = new MusEGui::DoubleLabel(0.0, MusEGlobal::config.minSlider, 10.1, this);
+ knobLabel->setPrecision(0);
+ break;
+ case Knob::gainType:
+ knob = new Knob(this);
+ knob->setRange(1.0, 20.0);
+ knob->setFaceColor(Qt::yellow);
+ knob->setToolTip(tr("calibration gain"));
+ knobLabel = new MusEGui::DoubleLabel(1.0, 1.0, 30.0, this);
+ knobLabel->setPrecision(1);
+ break;
+ default:
+ fprintf(stderr, "FIXME: AudioStrip::addKnob(): Unknown type. Aborting!\n");
+ abort();
}
+
+ knob->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
knob->setBackgroundRole(QPalette::Mid);
if (dlabel)
*dlabel = knobLabel;
knobLabel->setSlider(knob);
- ///pl->setFont(MusEGlobal::config.fonts[1]);
knobLabel->setBackgroundRole(QPalette::Mid);
knobLabel->setFrame(true);
- if (type == Knob::panType)
- knobLabel->setPrecision(2);
- else if (type == Knob::auxType){
- knobLabel->setPrecision(0);
- }
- else if (type == Knob::gainType){
- knobLabel->setPrecision(1);
- }
knobLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
name->setParent(this);
diff --git a/muse2/muse/node.cpp b/muse2/muse/node.cpp
index ffc26ee9..f2598430 100644
--- a/muse2/muse/node.cpp
+++ b/muse2/muse/node.cpp
@@ -25,6 +25,7 @@
#include <cmath>
#include <sndfile.h>
#include <stdlib.h>
+#include <stdio.h>
#include <QString>
@@ -1576,8 +1577,8 @@ bool Fifo::put(int segs, unsigned long samples, float** src, unsigned pos)
free(b->buffer);
b->buffer = 0;
}
- posix_memalign((void**)&(b->buffer), 16, sizeof(float) * n);
- if(!b->buffer)
+ int rv = posix_memalign((void**)&(b->buffer), 16, sizeof(float) * n);
+ if(rv != 0 || !b->buffer)
{
printf("Fifo::put could not allocate buffer segs:%d samples:%lu pos:%u\n", segs, samples, pos);
return true;
@@ -1666,8 +1667,8 @@ bool Fifo::getWriteBuffer(int segs, unsigned long samples, float** buf, unsigned
b->buffer = 0;
}
- posix_memalign((void**)&(b->buffer), 16, sizeof(float) * n);
- if(!b->buffer)
+ int rv = posix_memalign((void**)&(b->buffer), 16, sizeof(float) * n);
+ if(rv != 0 || !b->buffer)
{
printf("Fifo::getWriteBuffer could not allocate buffer segs:%d samples:%lu pos:%u\n", segs, samples, pos);
return true;
@@ -1742,7 +1743,14 @@ void AudioTrack::setTotalOutChannels(int num)
outBuffers = new float*[chans];
for (int i = 0; i < chans; ++i)
- posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: AudioTrack::setTotalOutChannels: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
}
chans = num;
// Limit the actual track (meters, copying etc, all 'normal' operation) to two-channel stereo.
diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp
index 203aac63..3029e618 100644
--- a/muse2/muse/plugin.cpp
+++ b/muse2/muse/plugin.cpp
@@ -1166,7 +1166,14 @@ Pipeline::Pipeline()
: std::vector<PluginI*>()
{
for (int i = 0; i < MAX_CHANNELS; ++i)
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: Pipeline ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
for (int i = 0; i < PipelineDepth; ++i)
push_back(0);
@@ -1180,7 +1187,14 @@ Pipeline::Pipeline(const Pipeline& /*p*/)
: std::vector<PluginI*>()
{
for (int i = 0; i < MAX_CHANNELS; ++i)
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ {
+ int rv = posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: Pipeline copy ctor: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
+ }
// TODO: Copy plug-ins !
for (int i = 0; i < PipelineDepth; ++i)
diff --git a/muse2/muse/vst_native.cpp b/muse2/muse/vst_native.cpp
index c22799d6..de206313 100644
--- a/muse2/muse/vst_native.cpp
+++ b/muse2/muse/vst_native.cpp
@@ -789,7 +789,12 @@ bool VstNativeSynthIF::init(Synth* s)
_audioOutBuffers = new float*[outports];
for(unsigned long k = 0; k < outports; ++k)
{
- posix_memalign((void**)&_audioOutBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&_audioOutBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: VstNativeSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(_audioOutBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
}
}
@@ -800,12 +805,22 @@ bool VstNativeSynthIF::init(Synth* s)
_audioInBuffers = new float*[inports];
for(unsigned long k = 0; k < inports; ++k)
{
- posix_memalign((void**)&_audioInBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&_audioInBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: VstNativeSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(_audioInBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
_iUsedIdx.push_back(false); // Start out with all false.
}
- posix_memalign((void**)&_audioInSilenceBuf, 16, sizeof(float) * MusEGlobal::segmentSize);
+ int rv = posix_memalign((void**)&_audioInSilenceBuf, 16, sizeof(float) * MusEGlobal::segmentSize);
+ if(rv != 0)
+ {
+ fprintf(stderr, "ERROR: VstNativeSynthIF::init: posix_memalign returned error:%d. Aborting!\n", rv);
+ abort();
+ }
memset(_audioInSilenceBuf, 0, sizeof(float) * MusEGlobal::segmentSize);
}