Browse Source

Parameter consistency check; misc changes

tags/1.9.4
falkTX 12 years ago
parent
commit
184ce248a5
8 changed files with 34 additions and 34 deletions
  1. +2
    -0
      source/backend/CarlaEngine.hpp
  2. +1
    -1
      source/backend/CarlaPlugin.hpp
  3. +0
    -2
      source/backend/Makefile.mk
  4. +4
    -4
      source/backend/engine/carla_engine.cpp
  5. +1
    -1
      source/backend/plugin/carla_plugin.cpp
  6. +23
    -23
      source/backend/standalone/CarlaStandalone.cpp
  7. +2
    -2
      source/backend/standalone/Makefile
  8. +1
    -1
      source/tests/ANSI.cpp

+ 2
- 0
source/backend/CarlaEngine.hpp View File

@@ -826,11 +826,13 @@ public:


/*! /*!
* TODO. * TODO.
* \a id must be either 1 or 2.
*/ */
float getInputPeak(const unsigned int pluginId, const unsigned short id) const; float getInputPeak(const unsigned int pluginId, const unsigned short id) const;


/*! /*!
* TODO. * TODO.
* \a id must be either 1 or 2.
*/ */
float getOutputPeak(const unsigned int pluginId, const unsigned short id) const; float getOutputPeak(const unsigned int pluginId, const unsigned short id) const;




+ 1
- 1
source/backend/CarlaPlugin.hpp View File

@@ -234,7 +234,7 @@ public:
/*! /*!
* Get the number of custom data sets. * Get the number of custom data sets.
*/ */
size_t customDataCount() const;
uint32_t customDataCount() const;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (current data) // Information (current data)


+ 0
- 2
source/backend/Makefile.mk View File

@@ -10,8 +10,6 @@ include ../../Makefile.mk


BUILD_C_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes BUILD_C_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../libs -I../../utils BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../libs -I../../utils
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore)
LINK_FLAGS += $(shell pkg-config --libs QtCore)


# -------------------------------------------------------------- # --------------------------------------------------------------




+ 4
- 4
source/backend/engine/carla_engine.cpp View File

@@ -1014,17 +1014,17 @@ bool CarlaEngine::saveProject(const char* const filename)
float CarlaEngine::getInputPeak(const unsigned int pluginId, const unsigned short id) const float CarlaEngine::getInputPeak(const unsigned int pluginId, const unsigned short id) const
{ {
CARLA_ASSERT(pluginId < kData->curPluginCount); CARLA_ASSERT(pluginId < kData->curPluginCount);
CARLA_ASSERT(id < MAX_PEAKS);
CARLA_ASSERT(id-1 < MAX_PEAKS);


return kData->plugins[pluginId].insPeak[id];
return kData->plugins[pluginId].insPeak[id-1];
} }


float CarlaEngine::getOutputPeak(const unsigned int pluginId, const unsigned short id) const float CarlaEngine::getOutputPeak(const unsigned int pluginId, const unsigned short id) const
{ {
CARLA_ASSERT(pluginId < kData->curPluginCount); CARLA_ASSERT(pluginId < kData->curPluginCount);
CARLA_ASSERT(id < MAX_PEAKS);
CARLA_ASSERT(id-1 < MAX_PEAKS);


return kData->plugins[pluginId].outsPeak[id];
return kData->plugins[pluginId].outsPeak[id-1];
} }


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


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

@@ -184,7 +184,7 @@ uint32_t CarlaPlugin::midiProgramCount() const
return kData->midiprog.count; return kData->midiprog.count;
} }


size_t CarlaPlugin::customDataCount() const
uint32_t CarlaPlugin::customDataCount() const
{ {
return kData->custom.count(); return kData->custom.count();
} }


source/backend/standalone/carla_standalone.cpp → source/backend/standalone/CarlaStandalone.cpp View File

@@ -128,7 +128,7 @@ unsigned int carla_get_internal_plugin_count()
{ {
carla_debug("carla_get_internal_plugin_count()"); carla_debug("carla_get_internal_plugin_count()");


return CarlaPlugin::getNativePluginCount();
return static_cast<unsigned int>(CarlaPlugin::getNativePluginCount());
} }


const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId) const CarlaNativePluginInfo* carla_get_internal_plugin_info(unsigned int internalPluginId)
@@ -212,17 +212,17 @@ bool carla_engine_init(const char* driverName, const char* clientName)
standalone.engine->setCallback(standalone.callback, nullptr); standalone.engine->setCallback(standalone.callback, nullptr);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
standalone.engine->setOption(CarlaBackend::OPTION_PROCESS_MODE, standalone.options.processMode, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_FORCE_STEREO, standalone.options.forceStereo, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES, standalone.options.preferPluginBridges, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFER_UI_BRIDGES, standalone.options.preferUiBridges, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PROCESS_MODE, standalone.options.processMode ? 1 : 0, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_FORCE_STEREO, standalone.options.forceStereo ? 1 : 0, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES, standalone.options.preferPluginBridges ? 1 : 0, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFER_UI_BRIDGES, standalone.options.preferUiBridges ? 1 : 0, nullptr);
# ifdef WANT_DSSI # ifdef WANT_DSSI
standalone.engine->setOption(CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS, standalone.options.useDssiVstChunks, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS, standalone.options.useDssiVstChunks ? 1 : 0, nullptr);
# endif # endif
standalone.engine->setOption(CarlaBackend::OPTION_MAX_PARAMETERS, standalone.options.maxParameters, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE, standalone.options.preferredBufferSize, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE, standalone.options.preferredSampleRate, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_OSC_UI_TIMEOUT, standalone.options.oscUiTimeout, nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_MAX_PARAMETERS, static_cast<int>(standalone.options.maxParameters), nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE, static_cast<int>(standalone.options.preferredBufferSize), nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE, static_cast<int>(standalone.options.preferredSampleRate), nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_OSC_UI_TIMEOUT, static_cast<int>(standalone.options.oscUiTimeout), nullptr);
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_NATIVE, 0, standalone.options.bridge_native); standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_NATIVE, 0, standalone.options.bridge_native);
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX32, 0, standalone.options.bridge_posix32); standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX32, 0, standalone.options.bridge_posix32);
standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX64, 0, standalone.options.bridge_posix64); standalone.engine->setOption(CarlaBackend::OPTION_PATH_BRIDGE_POSIX64, 0, standalone.options.bridge_posix64);
@@ -734,7 +734,7 @@ const char* carla_get_chunk_data(unsigned int pluginId)


if (data != nullptr && dataSize >= 4) if (data != nullptr && dataSize >= 4)
{ {
chunkData.importBinaryAsBase64((const uint8_t*)data, dataSize);
chunkData.importBinaryAsBase64((const uint8_t*)data, static_cast<size_t>(dataSize));
return (const char*)chunkData; return (const char*)chunkData;
} }
else else
@@ -1012,7 +1012,7 @@ float carla_get_input_peak_value(unsigned int pluginId, unsigned short portId)
} }


if (portId == 1 || portId == 2) if (portId == 1 || portId == 2)
return standalone.engine->getInputPeak(pluginId, portId-1);
return standalone.engine->getInputPeak(pluginId, portId);


carla_stderr2("carla_get_input_peak_value(%i, %i) - invalid port value", pluginId, portId); carla_stderr2("carla_get_input_peak_value(%i, %i) - invalid port value", pluginId, portId);
return 0.0f; return 0.0f;
@@ -1033,7 +1033,7 @@ float carla_get_output_peak_value(unsigned int pluginId, unsigned short portId)
} }


if (portId == 1 || portId == 2) if (portId == 1 || portId == 2)
return standalone.engine->getOutputPeak(pluginId, portId-1);
return standalone.engine->getOutputPeak(pluginId, portId);


carla_stderr2("carla_get_output_peak_value(%i, %i) - invalid port value", pluginId, portId); carla_stderr2("carla_get_output_peak_value(%i, %i) - invalid port value", pluginId, portId);
return 0.0f; return 0.0f;
@@ -1216,7 +1216,7 @@ void carla_set_program(unsigned int pluginId, uint32_t programId)
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId))
{ {
if (programId < plugin->programCount()) if (programId < plugin->programCount())
return plugin->setProgram(programId, true, true, false, true);
return plugin->setProgram(static_cast<int32_t>(programId), true, true, false, true);


carla_stderr2("carla_set_program(%i, %i) - programId out of bounds", pluginId, programId); carla_stderr2("carla_set_program(%i, %i) - programId out of bounds", pluginId, programId);
return; return;
@@ -1236,7 +1236,7 @@ void carla_set_midi_program(unsigned int pluginId, uint32_t midiProgramId)
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId))
{ {
if (midiProgramId < plugin->midiProgramCount()) if (midiProgramId < plugin->midiProgramCount())
return plugin->setMidiProgram(midiProgramId, true, true, false, true);
return plugin->setMidiProgram(static_cast<int32_t>(midiProgramId), true, true, false, true);


carla_stderr2("carla_set_midi_program(%i, %i) - midiProgramId out of bounds", pluginId, midiProgramId); carla_stderr2("carla_set_midi_program(%i, %i) - midiProgramId out of bounds", pluginId, midiProgramId);
return; return;
@@ -1407,37 +1407,37 @@ void carla_set_option(CarlaBackend::OptionsType option, int value, const char* v
break; break;


case CarlaBackend::OPTION_FORCE_STEREO: case CarlaBackend::OPTION_FORCE_STEREO:
standalone.options.forceStereo = value;
standalone.options.forceStereo = (value != 0);
break; break;


case CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES: case CarlaBackend::OPTION_PREFER_PLUGIN_BRIDGES:
standalone.options.preferPluginBridges = value;
standalone.options.preferPluginBridges = (value != 0);
break; break;


case CarlaBackend::OPTION_PREFER_UI_BRIDGES: case CarlaBackend::OPTION_PREFER_UI_BRIDGES:
standalone.options.preferUiBridges = value;
standalone.options.preferUiBridges = (value != 0);
break; break;


#ifdef WANT_DSSI #ifdef WANT_DSSI
case CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS: case CarlaBackend::OPTION_USE_DSSI_VST_CHUNKS:
standalone.options.useDssiVstChunks = value;
standalone.options.useDssiVstChunks = (value != 0);
break; break;
#endif #endif


case CarlaBackend::OPTION_MAX_PARAMETERS: case CarlaBackend::OPTION_MAX_PARAMETERS:
standalone.options.maxParameters = (value > 0) ? value : CarlaBackend::MAX_DEFAULT_PARAMETERS;
standalone.options.maxParameters = (value > 0) ? static_cast<unsigned int>(value) : CarlaBackend::MAX_DEFAULT_PARAMETERS;
break; break;


case CarlaBackend::OPTION_OSC_UI_TIMEOUT: case CarlaBackend::OPTION_OSC_UI_TIMEOUT:
standalone.options.oscUiTimeout = value;
standalone.options.oscUiTimeout = static_cast<unsigned int>(value);
break; break;


case CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE: case CarlaBackend::OPTION_PREFERRED_BUFFER_SIZE:
standalone.options.preferredBufferSize = value;
standalone.options.preferredBufferSize = static_cast<unsigned int>(value);
break; break;


case CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE: case CarlaBackend::OPTION_PREFERRED_SAMPLE_RATE:
standalone.options.preferredSampleRate = value;
standalone.options.preferredSampleRate = static_cast<unsigned int>(value);
break; break;


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE

+ 2
- 2
source/backend/standalone/Makefile View File

@@ -9,7 +9,7 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Common # Common


LINK_FLAGS += $(shell pkg-config --libs liblo QtGui)
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui)


# -------------------------------------------------------------- # --------------------------------------------------------------
# Engine # Engine
@@ -54,7 +54,7 @@ LIBS += ../libcarla_native.a
LIBS += ../../libs/rtmempool.a LIBS += ../../libs/rtmempool.a


OBJS = \ OBJS = \
carla_standalone.cpp.o
CarlaStandalone.cpp.o


SHARED = ../libcarla_standalone.so SHARED = ../libcarla_standalone.so
STATIC = ../libcarla_standalone.a STATIC = ../libcarla_standalone.a


+ 1
- 1
source/tests/ANSI.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the GPL.txt file * For a full copy of the GNU General Public License see the GPL.txt file
*/ */


#include "standalone/carla_standalone.cpp"
#include "standalone/CarlaStandalone.cpp"


#if 0 #if 0
#include "CarlaDefines.hpp" #include "CarlaDefines.hpp"


Loading…
Cancel
Save