Browse Source

Merge remote-tracking branch 'bsp2/v0.6' into v0.6-linux-lglw

pull/1639/head
Cameron Leger 6 years ago
parent
commit
43717e8b54
6 changed files with 72 additions and 9 deletions
  1. +8
    -5
      setenv_linux.sh
  2. +10
    -0
      src/app/ModuleWidget.cpp
  3. +13
    -1
      src/app/ParamWidget.cpp
  4. +24
    -1
      src/engine.cpp
  5. +5
    -0
      src/vst2_main.cpp
  6. +12
    -2
      src/widgets/QuantityWidget.cpp

+ 8
- 5
setenv_linux.sh View File

@@ -21,12 +21,15 @@ if [ "${USER}" = "cameron" ]; then
CPU_ARCH=skylake-avx512
fi

# Extra compiler flags (C and C++)
#EXTRA_FLAGS=-DUSE_LOG_PRINTF
EXTRA_FLAGS=""

# Extra C compiler flags
export EXTRA_CFLAGS=-march=${CPU_ARCH}
#-DUSE_LOG_PRINTF
export EXTRA_CFLAGS="-march=${CPU_ARCH} ${EXTRA_FLAGS}"

# Extra C++ compiler flags
export EXTRA_CPPFLAGS=-march=${CPU_ARCH}
export EXTRA_CPPFLAGS="-march=${CPU_ARCH} ${EXTRA_FLAGS}"

# Extra optimization flags (C/C++)
export EXTRA_OPTFLAGS=
@@ -39,5 +42,5 @@ export VST2_SDK_DIR=/mnt/dev/vstsdk2.4/pluginterfaces/vst2.x/

# n = build the plugin w/o 3rd party modules (only useful for debugging purposes)
# y = statically link 3rd party modules
#export RACK_STATIC_MODULES=y
export RACK_STATIC_MODULES=n
export RACK_STATIC_MODULES=y
#export RACK_STATIC_MODULES=n

+ 10
- 0
src/app/ModuleWidget.cpp View File

@@ -13,6 +13,15 @@
#endif // USE_VST2


#ifdef USE_LOG_PRINTF
extern void log_printf(const char *logData, ...);
#undef Dprintf
#define Dprintf log_printf
#else
#define Dprintf printf
#endif // USE_LOG_PRINTF


namespace rack {


@@ -185,6 +194,7 @@ void ModuleWidget::fromJson(json_t *rootJ) {
if (!paramIdJ)
continue;
int paramId = json_integer_value(paramIdJ);
// Dprintf("fromJson: paramId=%d\n", paramId);
// Find ParamWidget(s) with paramId
for (ParamWidget *paramWidget : params) {
if (paramWidget->paramId == paramId)


+ 13
- 1
src/app/ParamWidget.cpp View File

@@ -4,6 +4,14 @@
#include "global.hpp"
#include "global_ui.hpp"

#ifdef USE_LOG_PRINTF
extern void log_printf(const char *logData, ...);
#undef Dprintf
#define Dprintf log_printf
#else
#define Dprintf printf
#endif // USE_LOG_PRINTF


namespace rack {

@@ -21,7 +29,11 @@ json_t *ParamWidget::toJson() {
void ParamWidget::fromJson(json_t *rootJ) {
json_t *valueJ = json_object_get(rootJ, "value");
if (valueJ)
setValue(json_number_value(valueJ));
{
float numberVal = json_number_value(valueJ);
// Dprintf("ParamWidget::fromJson: numberVal=%f\n", numberVal);
setValue(numberVal);
}
}

void ParamWidget::reset() {


+ 24
- 1
src/engine.cpp View File

@@ -21,6 +21,14 @@
#include <fenv.h>
#endif

#ifdef USE_LOG_PRINTF
extern void log_printf(const char *logData, ...);
#undef Dprintf
#define Dprintf log_printf
#else
#define Dprintf printf
#endif // USE_LOG_PRINTF

namespace rack {


@@ -369,6 +377,7 @@ void vst2_handle_queued_params(void) {
if(paramRange > 0.0f)
{
float value = (qp.value * paramRange) + paramWidget->minValue;
// Dprintf("vst2_handle_queued_params: paramId=%d value=%f min=%f max=%f\n", paramId, value, paramWidget->minValue, paramWidget->maxValue);
engineSetParam(module, paramId, value, false/*bVSTAutomate*/);

// Update UI widget
@@ -405,7 +414,21 @@ float vst2_get_param(int uniqueParamId) {
{
if(sUI(paramId) < sUI(module->params.size())) // paranoia
{
return module->params[paramId].value;
ModuleWidget *moduleWidget = global_ui->app.gRackWidget->findModuleWidgetByModule(module);
if(NULL != moduleWidget)
{
// Find
ParamWidget *paramWidget = moduleWidget->findParamWidgetByParamId(paramId);
if(NULL != paramWidget)
{
if(isfinite(paramWidget->minValue) && isfinite(paramWidget->maxValue))
{
float value = module->params[paramId].value;
value = (value - paramWidget->minValue) / (paramWidget->maxValue - paramWidget->minValue);
return value;
}
}
}
}
}
return 0.0f;


+ 5
- 0
src/vst2_main.cpp View File

@@ -1983,6 +1983,11 @@ VstIntPtr VSTPluginDispatcher(VSTPlugin *vstPlugin,
}
break;

case 56:
case 66:
// (todo) what are these ? Bitwig (Linux) sends a lot of them
break;

default:
// ignoring all other opcodes
Dprintf("vstrack_plugin:dispatcher: unhandled opCode %d [ignored] \n", opCode);


+ 12
- 2
src/widgets/QuantityWidget.cpp View File

@@ -1,5 +1,13 @@
#include "widgets.hpp"

#ifdef USE_LOG_PRINTF
extern void log_printf(const char *logData, ...);
#undef Dprintf
#define Dprintf log_printf
#else
#define Dprintf printf
#endif // USE_LOG_PRINTF


namespace rack {

@@ -9,21 +17,23 @@ QuantityWidget::QuantityWidget() {
}

void QuantityWidget::setValue(float value) {
// printf("xxx QuantityWidget::setValue: value=%f\n", value);
// Dprintf("xxx QuantityWidget::setValue: value=%f\n", value);
if(isfinite(minValue) && isfinite(maxValue))
{
// Dprintf("xxx QuantityWidget::setValue: isfinite value=%f\n", value);
this->value = clamp(value, fminf(minValue, maxValue), fmaxf(minValue, maxValue));
EventChange e;
onChange(e);
}
else
{
// Dprintf("xxx QuantityWidget::setValue: !isfinite value=%f\n", value);
// Rotary knob
this->value = value;
EventChange e;
onChange(e);
}
// printf("xxx QuantityWidget::setValue: LEAVE value=%f\n", value);
// Dprintf("xxx QuantityWidget::setValue: LEAVE value=%f\n", value);
}

void QuantityWidget::setLimits(float minValue, float maxValue) {


Loading…
Cancel
Save