Browse Source

Minor code style changes

tags/1.9.4
falkTX 11 years ago
parent
commit
26dfde5f16
5 changed files with 14 additions and 13 deletions
  1. +5
    -5
      source/backend/plugin/CarlaPlugin.cpp
  2. +1
    -1
      source/backend/plugin/CarlaPlugin.pro
  3. +1
    -1
      source/backend/plugin/LadspaPlugin.cpp
  4. +6
    -5
      source/backend/plugin/Lv2Plugin.cpp
  5. +1
    -1
      source/backend/plugin/VstPlugin.cpp

+ 5
- 5
source/backend/plugin/CarlaPlugin.cpp View File

@@ -1070,7 +1070,7 @@ void CarlaPlugin::setDryWet(const float value, const bool sendOsc, const bool se
{ {
CARLA_ASSERT(value >= 0.0f && value <= 1.0f); CARLA_ASSERT(value >= 0.0f && value <= 1.0f);


const float fixedValue = carla_fixValue<float>(0.0f, 1.0f, value);
const float fixedValue(carla_fixValue<float>(0.0f, 1.0f, value));


if (kData->postProc.dryWet == fixedValue) if (kData->postProc.dryWet == fixedValue)
return; return;
@@ -1097,7 +1097,7 @@ void CarlaPlugin::setVolume(const float value, const bool sendOsc, const bool se
{ {
CARLA_ASSERT(value >= 0.0f && value <= 1.27f); CARLA_ASSERT(value >= 0.0f && value <= 1.27f);


const float fixedValue = carla_fixValue<float>(0.0f, 1.27f, value);
const float fixedValue(carla_fixValue<float>(0.0f, 1.27f, value));


if (kData->postProc.volume == fixedValue) if (kData->postProc.volume == fixedValue)
return; return;
@@ -1124,7 +1124,7 @@ void CarlaPlugin::setBalanceLeft(const float value, const bool sendOsc, const bo
{ {
CARLA_ASSERT(value >= -1.0f && value <= 1.0f); CARLA_ASSERT(value >= -1.0f && value <= 1.0f);


const float fixedValue = carla_fixValue<float>(-1.0f, 1.0f, value);
const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value));


if (kData->postProc.balanceLeft == fixedValue) if (kData->postProc.balanceLeft == fixedValue)
return; return;
@@ -1151,7 +1151,7 @@ void CarlaPlugin::setBalanceRight(const float value, const bool sendOsc, const b
{ {
CARLA_ASSERT(value >= -1.0f && value <= 1.0f); CARLA_ASSERT(value >= -1.0f && value <= 1.0f);


const float fixedValue = carla_fixValue<float>(-1.0f, 1.0f, value);
const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value));


if (kData->postProc.balanceRight == fixedValue) if (kData->postProc.balanceRight == fixedValue)
return; return;
@@ -1178,7 +1178,7 @@ void CarlaPlugin::setPanning(const float value, const bool sendOsc, const bool s
{ {
CARLA_ASSERT(value >= -1.0f && value <= 1.0f); CARLA_ASSERT(value >= -1.0f && value <= 1.0f);


const float fixedValue = carla_fixValue<float>(-1.0f, 1.0f, value);
const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value));


if (kData->postProc.panning == fixedValue) if (kData->postProc.panning == fixedValue)
return; return;


+ 1
- 1
source/backend/plugin/CarlaPlugin.pro View File

@@ -12,7 +12,7 @@ CONFIG = debug
CONFIG += link_pkgconfig qt shared warn_on CONFIG += link_pkgconfig qt shared warn_on


DEFINES = DEBUG DEFINES = DEBUG
DEFINES += QTCREATOR_TEST
DEFINES += QTCREATOR_TEST MOC_PARSING


# Shared # Shared
DEFINES += WANT_NATIVE DEFINES += WANT_NATIVE


+ 1
- 1
source/backend/plugin/LadspaPlugin.cpp View File

@@ -373,7 +373,7 @@ public:
{ {
CARLA_ASSERT(parameterId < kData->param.count); CARLA_ASSERT(parameterId < kData->param.count);


const float fixedValue = kData->param.fixValue(parameterId, value);
const float fixedValue(kData->param.fixValue(parameterId, value));
fParamBuffers[parameterId] = fixedValue; fParamBuffers[parameterId] = fixedValue;


CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback);


+ 6
- 5
source/backend/plugin/Lv2Plugin.cpp View File

@@ -573,8 +573,6 @@ public:


unsigned int availableOptions() override unsigned int availableOptions() override
{ {
CARLA_ASSERT(fRdfDescriptor != nullptr);

unsigned int options = 0x0; unsigned int options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
@@ -1596,7 +1594,7 @@ public:
j = iCtrl++; j = iCtrl++;
kData->param.data[j].index = j; kData->param.data[j].index = j;
kData->param.data[j].rindex = i; kData->param.data[j].rindex = i;
kData->param.data[j].hints = 0;
kData->param.data[j].hints = 0x0;
kData->param.data[j].midiChannel = 0; kData->param.data[j].midiChannel = 0;
kData->param.data[j].midiCC = -1; kData->param.data[j].midiCC = -1;


@@ -1628,7 +1626,7 @@ public:


if (max - min == 0.0f) if (max - min == 0.0f)
{ {
carla_stderr("Broken plugin parameter: max - min == 0");
carla_stderr2("WARNING - Broken plugin parameter '%s': max - min == 0.0f", fRdfDescriptor->Ports[i].Name);
max = min + 0.1f; max = min + 0.1f;
} }


@@ -1764,7 +1762,7 @@ public:
else else
{ {
kData->param.data[j].type = PARAMETER_UNKNOWN; kData->param.data[j].type = PARAMETER_UNKNOWN;
carla_stderr("WARNING - Got a broken Port (Control, but not input or output)");
carla_stderr2("WARNING - Got a broken Port (Control, but not input or output)");
} }


// extra parameter hints // extra parameter hints
@@ -2664,6 +2662,9 @@ public:
for (i=0; i < kData->audioOut.count; ++i) for (i=0; i < kData->audioOut.count; ++i)
carla_zeroFloat(fAudioOutBuffers[i], frames); carla_zeroFloat(fAudioOutBuffers[i], frames);


// --------------------------------------------------------------------------------------------------------
// Run plugin

fDescriptor->run(fHandle, frames); fDescriptor->run(fHandle, frames);


if (fHandle2 != nullptr) if (fHandle2 != nullptr)


+ 1
- 1
source/backend/plugin/VstPlugin.cpp View File

@@ -1767,7 +1767,7 @@ protected:
else if (fIsProcessing) else if (fIsProcessing)
{ {
// Called from engine // Called from engine
const float fixedValue = kData->param.fixValue(index, opt);
const float fixedValue(kData->param.fixValue(index, opt));


if (kData->engine->isOffline()) if (kData->engine->isOffline())
{ {


Loading…
Cancel
Save