Fixes #821 Fixes #822 Signed-off-by: falkTX <falktx@gmail.com>tags/v2.1-alpha2
| @@ -170,30 +170,30 @@ endif | |||||
| # Strict test build | # Strict test build | ||||
| ifeq ($(TESTBUILD),true) | ifeq ($(TESTBUILD),true) | ||||
| BASE_FLAGS += -Werror -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization -Wfloat-equal -Wformat=2 -Winit-self -Wmissing-declarations | |||||
| BASE_FLAGS += -Woverlength-strings -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wundef -Wuninitialized -Wunused | |||||
| BASE_FLAGS += -Werror -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization | |||||
| BASE_FLAGS += -Wdouble-promotion -Wfloat-equal -Wlogical-op -Wpointer-arith -Wsign-conversion | |||||
| BASE_FLAGS += -Wformat=2 -Woverlength-strings | |||||
| BASE_FLAGS += -Wmissing-declarations -Wredundant-decls | |||||
| BASE_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused | |||||
| BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing | BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing | ||||
| BASE_FLAGS += -Wstrict-overflow -fstrict-overflow | BASE_FLAGS += -Wstrict-overflow -fstrict-overflow | ||||
| CFLAGS += -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings | |||||
| CXXFLAGS += -Wc++0x-compat -Wc++11-compat -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wzero-as-null-pointer-constant | |||||
| BASE_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference | |||||
| CFLAGS += -Winit-self -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wwrite-strings | |||||
| CXXFLAGS += -Wc++0x-compat -Wc++11-compat -Weffc++ | |||||
| CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual | |||||
| # CXXFLAGS += -Wold-style-cast -Wuseless-cast | |||||
| CXXFLAGS += -Wzero-as-null-pointer-constant | |||||
| ifeq ($(LINUX),true) | ifeq ($(LINUX),true) | ||||
| BASE_FLAGS += -isystem /opt/kxstudio/include | BASE_FLAGS += -isystem /opt/kxstudio/include | ||||
| CXXFLAGS += -isystem /usr/include/glib-2.0 | |||||
| CXXFLAGS += -isystem /usr/include/glib-2.0/glib | |||||
| CXXFLAGS += -isystem /usr/include/gtk-2.0 | |||||
| CXXFLAGS += -isystem /usr/include/gtk-2.0/gio | |||||
| CXXFLAGS += -isystem /usr/include/qt5 | |||||
| endif | endif | ||||
| ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
| BASE_FLAGS += -isystem /opt/kxstudio/include | |||||
| CXXFLAGS += -isystem /System/Library/Frameworks | CXXFLAGS += -isystem /System/Library/Frameworks | ||||
| endif | endif | ||||
| ifeq ($(WIN64),true) | |||||
| BASE_FLAGS += -isystem /opt/mingw64/include | |||||
| else | |||||
| ifeq ($(WIN32),true) | ifeq ($(WIN32),true) | ||||
| BASE_FLAGS += -isystem /opt/mingw32/include | BASE_FLAGS += -isystem /opt/mingw32/include | ||||
| endif | endif | ||||
| ifeq ($(WIN64),true) | |||||
| BASE_FLAGS += -isystem /opt/mingw64/include | |||||
| endif | endif | ||||
| endif | endif | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Plugin Host | * Carla Plugin Host | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -240,6 +240,7 @@ CARLA_EXPORT bool carla_pipe_client_flush_and_unlock(CarlaPipeClientHandle handl | |||||
| */ | */ | ||||
| CARLA_EXPORT void carla_pipe_client_destroy(CarlaPipeClientHandle handle); | CARLA_EXPORT void carla_pipe_client_destroy(CarlaPipeClientHandle handle); | ||||
| #ifndef CARLA_HOST_H_INCLUDED | |||||
| /* ------------------------------------------------------------------------------------------------------------ | /* ------------------------------------------------------------------------------------------------------------ | ||||
| * info about current library */ | * info about current library */ | ||||
| @@ -252,6 +253,7 @@ CARLA_EXPORT const char* carla_get_library_filename(); | |||||
| * Get the folder where this carla library resides. | * Get the folder where this carla library resides. | ||||
| */ | */ | ||||
| CARLA_EXPORT const char* carla_get_library_folder(); | CARLA_EXPORT const char* carla_get_library_folder(); | ||||
| #endif | |||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| // TESTING | // TESTING | ||||
| @@ -953,7 +953,7 @@ protected: | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| std::sprintf(tmpBuf, "%f\n", plugin->getInternalParameterValue(i)); | |||||
| std::sprintf(tmpBuf, "%f\n", static_cast<double>(plugin->getInternalParameterValue(i))); | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| @@ -993,7 +993,13 @@ protected: | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| std::sprintf(tmpBuf, "%f:%f:%f:%f:%f:%f\n", paramRanges.def, paramRanges.min, paramRanges.max, paramRanges.step, paramRanges.stepSmall, paramRanges.stepLarge); | |||||
| std::sprintf(tmpBuf, "%f:%f:%f:%f:%f:%f\n", | |||||
| static_cast<double>(paramRanges.def), | |||||
| static_cast<double>(paramRanges.min), | |||||
| static_cast<double>(paramRanges.max), | |||||
| static_cast<double>(paramRanges.step), | |||||
| static_cast<double>(paramRanges.stepSmall), | |||||
| static_cast<double>(paramRanges.stepLarge)); | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| @@ -1001,7 +1007,7 @@ protected: | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| std::sprintf(tmpBuf, "%f\n", plugin->getParameterValue(i)); | |||||
| std::sprintf(tmpBuf, "%f\n", static_cast<double>(plugin->getParameterValue(i))); | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -1186,7 +1192,7 @@ protected: | |||||
| return; | return; | ||||
| { | { | ||||
| const ScopedLocale csl; | const ScopedLocale csl; | ||||
| std::sprintf(tmpBuf, "%f\n", value3); | |||||
| std::sprintf(tmpBuf, "%f\n", static_cast<double>(value3)); | |||||
| } | } | ||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| @@ -1844,7 +1850,10 @@ protected: | |||||
| return; | return; | ||||
| std::sprintf(tmpBuf, "%f:%f:%f:%f\n", | std::sprintf(tmpBuf, "%f:%f:%f:%f\n", | ||||
| plugData.peaks[0], plugData.peaks[1], plugData.peaks[2], plugData.peaks[3]); | |||||
| static_cast<double>(plugData.peaks[0]), | |||||
| static_cast<double>(plugData.peaks[1]), | |||||
| static_cast<double>(plugData.peaks[2]), | |||||
| static_cast<double>(plugData.peaks[3])); | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| @@ -1859,7 +1868,7 @@ protected: | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| std::sprintf(tmpBuf, "%f\n", plugin->getParameterValue(j)); | |||||
| std::sprintf(tmpBuf, "%f\n", static_cast<double>(plugin->getParameterValue(j))); | |||||
| if (! fUiServer.writeMessage(tmpBuf)) | if (! fUiServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| @@ -2020,7 +2029,7 @@ public: | |||||
| handlePtr->bufferSizeChanged(static_cast<uint32_t>(value)); | handlePtr->bufferSizeChanged(static_cast<uint32_t>(value)); | ||||
| return 0; | return 0; | ||||
| case NATIVE_PLUGIN_OPCODE_SAMPLE_RATE_CHANGED: | case NATIVE_PLUGIN_OPCODE_SAMPLE_RATE_CHANGED: | ||||
| CARLA_SAFE_ASSERT_RETURN(opt > 0.0, 0); | |||||
| CARLA_SAFE_ASSERT_RETURN(opt > 0.0f, 0); | |||||
| handlePtr->sampleRateChanged(static_cast<double>(opt)); | handlePtr->sampleRateChanged(static_cast<double>(opt)); | ||||
| return 0; | return 0; | ||||
| case NATIVE_PLUGIN_OPCODE_OFFLINE_CHANGED: | case NATIVE_PLUGIN_OPCODE_OFFLINE_CHANGED: | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Plugin Host | * Carla Plugin Host | ||||
| * Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -401,7 +401,10 @@ void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept | |||||
| std::strcpy(targetPath, pData->oscData->path); | std::strcpy(targetPath, pData->oscData->path); | ||||
| std::strcat(targetPath, "/set_peaks"); | std::strcat(targetPath, "/set_peaks"); | ||||
| try_lo_send(pData->oscData->target, targetPath, "iffff", static_cast<int32_t>(pluginId), | try_lo_send(pData->oscData->target, targetPath, "iffff", static_cast<int32_t>(pluginId), | ||||
| epData.peaks[0], epData.peaks[1], epData.peaks[2], epData.peaks[3]); | |||||
| static_cast<double>(epData.peaks[0]), | |||||
| static_cast<double>(epData.peaks[1]), | |||||
| static_cast<double>(epData.peaks[2]), | |||||
| static_cast<double>(epData.peaks[3])); | |||||
| } | } | ||||
| void CarlaEngine::oscSend_control_exit() const noexcept | void CarlaEngine::oscSend_control_exit() const noexcept | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Plugin Host | * Carla Plugin Host | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -25,9 +25,26 @@ | |||||
| #include "jackbridge/JackBridge.hpp" | #include "jackbridge/JackBridge.hpp" | ||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic push | |||||
| # pragma clang diagnostic ignored "-Wconversion" | |||||
| # pragma clang diagnostic ignored "-Weffc++" | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic push | |||||
| # pragma GCC diagnostic ignored "-Wconversion" | |||||
| # pragma GCC diagnostic ignored "-Weffc++" | |||||
| # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
| #endif | |||||
| #include "rtaudio/RtAudio.h" | #include "rtaudio/RtAudio.h" | ||||
| #include "rtmidi/RtMidi.h" | #include "rtmidi/RtMidi.h" | ||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic pop | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic pop | |||||
| #endif | |||||
| CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Plugin | * Carla Plugin | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -463,7 +463,7 @@ void CarlaPlugin::randomizeParameters() noexcept | |||||
| if (paramData.hints & PARAMETER_IS_BOOLEAN) | if (paramData.hints & PARAMETER_IS_BOOLEAN) | ||||
| { | { | ||||
| random = static_cast<float>(std::rand()) / static_cast<float>(RAND_MAX); | random = static_cast<float>(std::rand()) / static_cast<float>(RAND_MAX); | ||||
| value = random > 0.5 ? paramRanges.max : paramRanges.min; | |||||
| value = random > 0.5f ? paramRanges.max : paramRanges.min; | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -2195,7 +2195,7 @@ void CarlaPlugin::registerToOscClient() noexcept | |||||
| if (--paramIns == 0) | if (--paramIns == 0) | ||||
| break; | break; | ||||
| } | } | ||||
| else if (paramData.type == PARAMETER_INPUT) | |||||
| else if (paramData.type == PARAMETER_OUTPUT) | |||||
| { | { | ||||
| if (--paramOuts == 0) | if (--paramOuts == 0) | ||||
| break; | break; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Plugin Bridge | * Carla Plugin Bridge | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -574,7 +574,7 @@ public: | |||||
| } | } | ||||
| if (! waitForParameterText()) | if (! waitForParameterText()) | ||||
| std::snprintf(strBuf, STR_MAX, "%f", fParams[parameterId].value); | |||||
| std::snprintf(strBuf, STR_MAX, "%f", static_cast<double>(fParams[parameterId].value)); | |||||
| } | } | ||||
| void getParameterSymbol(const uint32_t parameterId, char* const strBuf) const noexcept override | void getParameterSymbol(const uint32_t parameterId, char* const strBuf) const noexcept override | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla FluidSynth Plugin | * Carla FluidSynth Plugin | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -79,16 +79,25 @@ public: | |||||
| // set default values | // set default values | ||||
| fluid_synth_set_reverb_on(fSynth, 1); | fluid_synth_set_reverb_on(fSynth, 1); | ||||
| fluid_synth_set_reverb(fSynth, sFluidDefaults[FluidSynthReverbRoomSize], sFluidDefaults[FluidSynthReverbDamp], sFluidDefaults[FluidSynthReverbWidth], sFluidDefaults[FluidSynthReverbLevel]); | |||||
| fluid_synth_set_reverb(fSynth, | |||||
| sFluidDefaults[FluidSynthReverbRoomSize], | |||||
| sFluidDefaults[FluidSynthReverbDamp], | |||||
| sFluidDefaults[FluidSynthReverbWidth], | |||||
| sFluidDefaults[FluidSynthReverbLevel]); | |||||
| fluid_synth_set_chorus_on(fSynth, 1); | fluid_synth_set_chorus_on(fSynth, 1); | ||||
| fluid_synth_set_chorus(fSynth, sFluidDefaults[FluidSynthChorusNr], sFluidDefaults[FluidSynthChorusLevel], sFluidDefaults[FluidSynthChorusSpeedHz], sFluidDefaults[FluidSynthChorusDepthMs], sFluidDefaults[FluidSynthChorusType]); | |||||
| fluid_synth_set_chorus(fSynth, | |||||
| static_cast<int>(sFluidDefaults[FluidSynthChorusNr] + 0.5f), | |||||
| sFluidDefaults[FluidSynthChorusLevel], | |||||
| sFluidDefaults[FluidSynthChorusSpeedHz], | |||||
| sFluidDefaults[FluidSynthChorusDepthMs], | |||||
| static_cast<int>(sFluidDefaults[FluidSynthChorusType] + 0.5f)); | |||||
| fluid_synth_set_polyphony(fSynth, FLUID_DEFAULT_POLYPHONY); | fluid_synth_set_polyphony(fSynth, FLUID_DEFAULT_POLYPHONY); | ||||
| fluid_synth_set_gain(fSynth, 1.0f); | fluid_synth_set_gain(fSynth, 1.0f); | ||||
| for (int i=0; i < MAX_MIDI_CHANNELS; ++i) | for (int i=0; i < MAX_MIDI_CHANNELS; ++i) | ||||
| fluid_synth_set_interp_method(fSynth, i, sFluidDefaults[FluidSynthInterpolation]); | |||||
| fluid_synth_set_interp_method(fSynth, i, static_cast<int>(sFluidDefaults[FluidSynthInterpolation] + 0.5f)); | |||||
| } | } | ||||
| ~CarlaPluginFluidSynth() override | ~CarlaPluginFluidSynth() override | ||||
| @@ -1736,9 +1745,7 @@ private: | |||||
| #endif | #endif | ||||
| // misc. defaults | // misc. defaults | ||||
| sFluidDefaults[FluidSynthPolyphony] = (float)fluid_synth_get_polyphony(fSynth); | |||||
| sFluidDefaults[FluidSynthInterpolation] = FLUID_INTERP_DEFAULT; | sFluidDefaults[FluidSynthInterpolation] = FLUID_INTERP_DEFAULT; | ||||
| sFluidDefaults[FluidSynthVoiceCount] = 0.0f; | |||||
| } | } | ||||
| enum FluidSynthParameters { | enum FluidSynthParameters { | ||||
| @@ -1779,7 +1786,9 @@ private: | |||||
| }; | }; | ||||
| bool CarlaPluginFluidSynth::sFluidDefaultsStored = false; | bool CarlaPluginFluidSynth::sFluidDefaultsStored = false; | ||||
| float CarlaPluginFluidSynth::sFluidDefaults[FluidSynthParametersMax]; | |||||
| float CarlaPluginFluidSynth::sFluidDefaults[FluidSynthParametersMax] = { | |||||
| 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, | |||||
| }; | |||||
| CARLA_BACKEND_END_NAMESPACE | CARLA_BACKEND_END_NAMESPACE | ||||
| @@ -958,7 +958,7 @@ public: | |||||
| return; | return; | ||||
| } | } | ||||
| rindex -= fRdfDescriptor->PortCount; | |||||
| rindex -= static_cast<int32_t>(fRdfDescriptor->PortCount); | |||||
| if (rindex < static_cast<int32_t>(fRdfDescriptor->ParameterCount)) | if (rindex < static_cast<int32_t>(fRdfDescriptor->ParameterCount)) | ||||
| { | { | ||||
| @@ -982,7 +982,7 @@ public: | |||||
| return; | return; | ||||
| } | } | ||||
| rindex -= fRdfDescriptor->PortCount; | |||||
| rindex -= static_cast<int32_t>(fRdfDescriptor->PortCount); | |||||
| if (rindex < static_cast<int32_t>(fRdfDescriptor->ParameterCount)) | if (rindex < static_cast<int32_t>(fRdfDescriptor->ParameterCount)) | ||||
| { | { | ||||
| @@ -1401,7 +1401,7 @@ public: | |||||
| if (! fPipeServer.writeMessage(tmpBuf)) | if (! fPipeServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| std::snprintf(tmpBuf, 0xff, "%f\n", getParameterValue(i)); | |||||
| std::snprintf(tmpBuf, 0xff, "%f\n", static_cast<double>(getParameterValue(i))); | |||||
| if (! fPipeServer.writeMessage(tmpBuf)) | if (! fPipeServer.writeMessage(tmpBuf)) | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugin | * Carla Native Plugin | ||||
| * Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -1150,8 +1150,6 @@ public: | |||||
| if (min > max) | if (min > max) | ||||
| max = min; | max = min; | ||||
| else if (max < min) | |||||
| min = max; | |||||
| if (carla_isEqual(min, max)) | if (carla_isEqual(min, max)) | ||||
| { | { | ||||
| @@ -2481,7 +2479,7 @@ public: | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (label == nullptr && label[0] != '\0') | |||||
| if (label == nullptr || label[0] != '\0') | |||||
| { | { | ||||
| pData->engine->setLastError("null label"); | pData->engine->setLastError("null label"); | ||||
| return false; | return false; | ||||
| @@ -333,7 +333,7 @@ public: | |||||
| dispatcher(effGetParamDisplay, static_cast<int32_t>(parameterId), 0, strBuf); | dispatcher(effGetParamDisplay, static_cast<int32_t>(parameterId), 0, strBuf); | ||||
| if (strBuf[0] == '\0') | if (strBuf[0] == '\0') | ||||
| std::snprintf(strBuf, STR_MAX, "%f", getParameterValue(parameterId)); | |||||
| std::snprintf(strBuf, STR_MAX, "%f", static_cast<double>(getParameterValue(parameterId))); | |||||
| } | } | ||||
| void getParameterUnit(const uint32_t parameterId, char* const strBuf) const noexcept override | void getParameterUnit(const uint32_t parameterId, char* const strBuf) const noexcept override | ||||
| @@ -1165,8 +1165,8 @@ public: | |||||
| CARLA_SAFE_ASSERT_INT(timeInfo.bbt.bar > 0, timeInfo.bbt.bar); | CARLA_SAFE_ASSERT_INT(timeInfo.bbt.bar > 0, timeInfo.bbt.bar); | ||||
| CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat); | CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat); | ||||
| const double ppqBar = double(timeInfo.bbt.bar - 1) * timeInfo.bbt.beatsPerBar; | |||||
| const double ppqBeat = double(timeInfo.bbt.beat - 1); | |||||
| const double ppqBar = static_cast<double>(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1); | |||||
| const double ppqBeat = static_cast<double>(timeInfo.bbt.beat - 1.0); | |||||
| const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat; | const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat; | ||||
| // PPQ Pos | // PPQ Pos | ||||
| @@ -15,13 +15,11 @@ | |||||
| * For a full copy of the GNU General Public License see the doc/GPL.txt file. | * For a full copy of the GNU General Public License see the doc/GPL.txt file. | ||||
| */ | */ | ||||
| #include "CarlaHost.h" | |||||
| #include "CarlaUtils.h" | #include "CarlaUtils.h" | ||||
| #include "CarlaString.hpp" | #include "CarlaString.hpp" | ||||
| #include "rtaudio/RtAudio.h" | |||||
| #include "rtmidi/RtMidi.h" | |||||
| #ifdef HAVE_FLUIDSYNTH | #ifdef HAVE_FLUIDSYNTH | ||||
| # include <fluidsynth.h> | # include <fluidsynth.h> | ||||
| #endif | #endif | ||||
| @@ -29,6 +27,28 @@ | |||||
| #ifdef USING_JUCE | #ifdef USING_JUCE | ||||
| # include "AppConfig.h" | # include "AppConfig.h" | ||||
| # include "juce_core/juce_core.h" | # include "juce_core/juce_core.h" | ||||
| #else | |||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic push | |||||
| # pragma clang diagnostic ignored "-Wconversion" | |||||
| # pragma clang diagnostic ignored "-Weffc++" | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic push | |||||
| # pragma GCC diagnostic ignored "-Wconversion" | |||||
| # pragma GCC diagnostic ignored "-Weffc++" | |||||
| # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
| #endif | |||||
| #include "rtaudio/RtAudio.h" | |||||
| #include "rtmidi/RtMidi.h" | |||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic pop | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic pop | |||||
| #endif | |||||
| #endif | #endif | ||||
| #include "water/files/File.h" | #include "water/files/File.h" | ||||
| @@ -422,7 +422,8 @@ protected: | |||||
| default: | default: | ||||
| carla_stdout("engineCallback(%i:%s, %u, %i, %i, %f, %s)", | carla_stdout("engineCallback(%i:%s, %u, %i, %i, %f, %s)", | ||||
| action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valueStr); | |||||
| action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, | |||||
| static_cast<double>(value3), valueStr); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -139,7 +139,7 @@ struct Lv2PluginOptions { | |||||
| LV2_Options_Option opts[Count]; | LV2_Options_Option opts[Count]; | ||||
| Lv2PluginOptions() noexcept | Lv2PluginOptions() noexcept | ||||
| : sampleRate(gInitialSampleRate), | |||||
| : sampleRate(static_cast<float>(gInitialSampleRate)), | |||||
| transientWinId(0), | transientWinId(0), | ||||
| windowTitle(kNullWindowTitle) | windowTitle(kNullWindowTitle) | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Bridge UI | * Carla Bridge UI | ||||
| * Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -85,7 +85,7 @@ public: | |||||
| fApp = new QApplication(qargc, qargv); | fApp = new QApplication(qargc, qargv); | ||||
| fWindow = new QMainWindow(nullptr); | |||||
| fWindow = new QMainWindow(nullptr, nullptr); | |||||
| fWindow->resize(30, 30); | fWindow->resize(30, 30); | ||||
| fWindow->hide(); | fWindow->hide(); | ||||
| @@ -259,7 +259,14 @@ private: | |||||
| #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | ||||
| # include "CarlaBridgeToolkitQt5.moc" | # include "CarlaBridgeToolkitQt5.moc" | ||||
| #else | #else | ||||
| # if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic push | |||||
| # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
| # endif | |||||
| # include "CarlaBridgeToolkitQt4.moc" | # include "CarlaBridgeToolkitQt4.moc" | ||||
| # if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic pop | |||||
| # endif | |||||
| #endif | #endif | ||||
| // ------------------------------------------------------------------------- | // ------------------------------------------------------------------------- | ||||
| @@ -275,13 +282,12 @@ CARLA_BRIDGE_UI_END_NAMESPACE | |||||
| // ------------------------------------------------------------------------- | // ------------------------------------------------------------------------- | ||||
| // missing declaration | |||||
| int qInitResources(); | |||||
| int qCleanupResources(); | |||||
| #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) | #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) | ||||
| # include "resources.qt5.cpp" | # include "resources.qt5.cpp" | ||||
| #else | #else | ||||
| // missing declaration | |||||
| int qInitResources(); | |||||
| int qCleanupResources(); | |||||
| # include "resources.qt4.cpp" | # include "resources.qt4.cpp" | ||||
| #endif | #endif | ||||
| @@ -54,6 +54,13 @@ LINK_GTK3_FLAGS += -lX11 | |||||
| LINK_QT4_FLAGS += -lX11 | LINK_QT4_FLAGS += -lX11 | ||||
| endif | endif | ||||
| ifeq ($(TESTBUILD),true) | |||||
| BUILD_GTK2_FLAGS += -isystem /usr/include/glib-2.0 | |||||
| BUILD_GTK3_FLAGS += -isystem /usr/include/glib-2.0 | |||||
| BUILD_QT4_FLAGS += -isystem /usr/include/qt4 | |||||
| BUILD_QT5_FLAGS += -isystem /usr/include/x86_64-linux-gnu/qt5 | |||||
| endif | |||||
| # --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
| ifneq ($(MACOS_OR_WIN32),true) | ifneq ($(MACOS_OR_WIN32),true) | ||||
| @@ -441,11 +441,11 @@ static void do_dssi_check(lib_t& libHandle, const char* const filename, const bo | |||||
| while ((descriptor = descFn(i++)) != nullptr) | while ((descriptor = descFn(i++)) != nullptr) | ||||
| { | { | ||||
| const LADSPA_Descriptor* const ldescriptor(descriptor->LADSPA_Plugin); | |||||
| const LADSPA_Descriptor* const ldescriptor = descriptor->LADSPA_Plugin; | |||||
| if (ldescriptor == nullptr) | if (ldescriptor == nullptr) | ||||
| { | { | ||||
| DISCOVERY_OUT("error", "Plugin '" << ldescriptor->Name << "' has no LADSPA interface"); | |||||
| DISCOVERY_OUT("error", "Plugin has no LADSPA interface"); | |||||
| continue; | continue; | ||||
| } | } | ||||
| if (descriptor->DSSI_API_Version != DSSI_VERSION_MAJOR) | if (descriptor->DSSI_API_Version != DSSI_VERSION_MAJOR) | ||||
| @@ -838,7 +838,8 @@ static intptr_t vstHostCanDo(const char* const feature) | |||||
| // Host-side callback | // Host-side callback | ||||
| static intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt) | static intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt) | ||||
| { | { | ||||
| carla_debug("vstHostCallback(%p, %i:%s, %i, " P_INTPTR ", %p, %f)", effect, opcode, vstMasterOpcode2str(opcode), index, value, ptr, opt); | |||||
| carla_debug("vstHostCallback(%p, %i:%s, %i, " P_INTPTR ", %p, %f)", | |||||
| effect, opcode, vstMasterOpcode2str(opcode), index, value, ptr, static_cast<double>(opt)); | |||||
| static VstTimeInfo timeInfo; | static VstTimeInfo timeInfo; | ||||
| intptr_t ret = 0; | intptr_t ret = 0; | ||||
| @@ -948,7 +949,8 @@ static intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t | |||||
| break; | break; | ||||
| default: | default: | ||||
| carla_stdout("vstHostCallback(%p, %i:%s, %i, " P_INTPTR ", %p, %f)", effect, opcode, vstMasterOpcode2str(opcode), index, value, ptr, opt); | |||||
| carla_stdout("vstHostCallback(%p, %i:%s, %i, " P_INTPTR ", %p, %f)", | |||||
| effect, opcode, vstMasterOpcode2str(opcode), index, value, ptr, static_cast<double>(opt)); | |||||
| break; | break; | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Custom types to store LV2 information | * Custom types to store LV2 information | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -460,7 +460,10 @@ struct LV2_RDF_Parameter { | |||||
| Range(nullptr), | Range(nullptr), | ||||
| Input(true), | Input(true), | ||||
| Label(nullptr), | Label(nullptr), | ||||
| Comment(nullptr) {} | |||||
| Comment(nullptr), | |||||
| MidiMap(), | |||||
| Points(), | |||||
| Unit() {} | |||||
| ~LV2_RDF_Parameter() noexcept | ~LV2_RDF_Parameter() noexcept | ||||
| { | { | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Interposer for JACK Applications X11 control | * Carla Interposer for JACK Applications X11 control | ||||
| * Copyright (C) 2014-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2014-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -20,6 +20,11 @@ | |||||
| #include <dlfcn.h> | #include <dlfcn.h> | ||||
| #include <X11/Xlib.h> | #include <X11/Xlib.h> | ||||
| CARLA_EXPORT | |||||
| int jack_carla_interposed_action(int action, int value, void* ptr); | |||||
| // -------------------------------------------------------------------------------------------------------------------- | |||||
| struct ScopedLibOpen { | struct ScopedLibOpen { | ||||
| void* handle; | void* handle; | ||||
| long long winId; | long long winId; | ||||
| @@ -52,6 +57,8 @@ struct ScopedLibOpen { | |||||
| static const ScopedLibOpen slo; | static const ScopedLibOpen slo; | ||||
| return slo; | return slo; | ||||
| } | } | ||||
| CARLA_DECLARE_NON_COPY_STRUCT(ScopedLibOpen); | |||||
| }; | }; | ||||
| // -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Interposer for unsafe backend functions | * Carla Interposer for unsafe backend functions | ||||
| * Copyright (C) 2014-2017 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2014-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -24,6 +24,13 @@ | |||||
| #define PREVENTED_FUNC_MSG carla_stderr2("Carla prevented a plugin from calling '%s', bad plugin!", __FUNCTION__) | #define PREVENTED_FUNC_MSG carla_stderr2("Carla prevented a plugin from calling '%s', bad plugin!", __FUNCTION__) | ||||
| // ----------------------------------------------------------------------- | |||||
| // Gtk stuff | |||||
| CARLA_EXPORT void gtk_init(int*, char***); | |||||
| CARLA_EXPORT int gtk_init_check(int*, char***); | |||||
| CARLA_EXPORT int gtk_init_with_args(int*, char***, const char*, void*, const char*, void**); | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| // Our custom functions | // Our custom functions | ||||
| @@ -3,7 +3,7 @@ | |||||
| This file is part of the Water library. | This file is part of the Water library. | ||||
| Copyright (c) 2016 ROLI Ltd. | Copyright (c) 2016 ROLI Ltd. | ||||
| Copyright (C) 2017 Filipe Coelho <falktx@falktx.com> | |||||
| Copyright (C) 2017-2019 Filipe Coelho <falktx@falktx.com> | |||||
| Permission is granted to use this software under the terms of the ISC license | Permission is granted to use this software under the terms of the ISC license | ||||
| http://www.isc.org/downloads/software-support-policy/isc-license/ | http://www.isc.org/downloads/software-support-policy/isc-license/ | ||||
| @@ -33,7 +33,7 @@ MidiMessageSequence::MidiMessageSequence() | |||||
| MidiMessageSequence::MidiMessageSequence (const MidiMessageSequence& other) | MidiMessageSequence::MidiMessageSequence (const MidiMessageSequence& other) | ||||
| { | { | ||||
| list.addCopiesOf (other.list); | |||||
| addSequence(other, 0.0); | |||||
| updateMatchedPairs(); | updateMatchedPairs(); | ||||
| } | } | ||||
| @@ -3,7 +3,7 @@ | |||||
| This file is part of the Water library. | This file is part of the Water library. | ||||
| Copyright (c) 2016 ROLI Ltd. | Copyright (c) 2016 ROLI Ltd. | ||||
| Copyright (C) 2017 Filipe Coelho <falktx@falktx.com> | |||||
| Copyright (C) 2017-2019 Filipe Coelho <falktx@falktx.com> | |||||
| Permission is granted to use this software under the terms of the ISC license | Permission is granted to use this software under the terms of the ISC license | ||||
| http://www.isc.org/downloads/software-support-policy/isc-license/ | http://www.isc.org/downloads/software-support-policy/isc-license/ | ||||
| @@ -102,6 +102,8 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| friend class MidiMessageSequence; | friend class MidiMessageSequence; | ||||
| MidiEventHolder (const MidiMessage&); | MidiEventHolder (const MidiMessage&); | ||||
| CARLA_DECLARE_NON_COPY_CLASS(MidiEventHolder); | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -240,8 +240,8 @@ static void lfo_process(NativePluginHandle handle, float** inBuffer, float** out | |||||
| break; | break; | ||||
| } | } | ||||
| value *= handlePtr->multiplier; | |||||
| value += handlePtr->baseStart; | |||||
| value *= (double)handlePtr->multiplier; | |||||
| value += (double)handlePtr->baseStart; | |||||
| if (value <= 0.0) | if (value <= 0.0) | ||||
| handlePtr->value = 0.0f; | handlePtr->value = 0.0f; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -130,7 +130,7 @@ static void midichannelize_process(NativePluginHandle handle, float** inBuffer, | |||||
| tmpEvent.port = midiEvent->port; | tmpEvent.port = midiEvent->port; | ||||
| tmpEvent.time = midiEvent->time; | tmpEvent.time = midiEvent->time; | ||||
| tmpEvent.data[0] = status | (channel - 1); | |||||
| tmpEvent.data[0] = (uint8_t)(status | (channel - 1)); | |||||
| tmpEvent.data[1] = midiEvent->data[1]; | tmpEvent.data[1] = midiEvent->data[1]; | ||||
| tmpEvent.data[2] = midiEvent->data[2]; | tmpEvent.data[2] = midiEvent->data[2]; | ||||
| tmpEvent.data[3] = midiEvent->data[3]; | tmpEvent.data[3] = midiEvent->data[3]; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -55,6 +55,9 @@ protected: | |||||
| { | { | ||||
| const NativeTimeInfo* const timePos(getTimeInfo()); | const NativeTimeInfo* const timePos(getTimeInfo()); | ||||
| if (timePos == nullptr) | |||||
| return; | |||||
| if (fWasPlayingBefore != timePos->playing) | if (fWasPlayingBefore != timePos->playing) | ||||
| { | { | ||||
| fNeedsAllNotesOff = true; | fNeedsAllNotesOff = true; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -52,7 +52,7 @@ public: | |||||
| fParameters[kParameterDefLength] = 4.0f; | fParameters[kParameterDefLength] = 4.0f; | ||||
| fParameters[kParameterQuantize] = 4.0f; | fParameters[kParameterQuantize] = 4.0f; | ||||
| fMaxTicks = 48.0*fTimeSigNum*fParameters[kParameterMeasures] /2; // FIXME: why /2 ? | |||||
| fMaxTicks = 48.0 * fTimeSigNum * 4 /* kParameterMeasures */ / 2; // FIXME: why / 2 ? | |||||
| } | } | ||||
| protected: | protected: | ||||
| @@ -192,15 +192,17 @@ protected: | |||||
| fTimeSigNum = 5; | fTimeSigNum = 5; | ||||
| else if (value > 2.5f) | else if (value > 2.5f) | ||||
| fTimeSigNum = 4; | fTimeSigNum = 4; | ||||
| /* FIXME | |||||
| else if (value > 2.5f) | else if (value > 2.5f) | ||||
| fTimeSigNum = 3; | fTimeSigNum = 3; | ||||
| */ | |||||
| else if (value > 1.5f) | else if (value > 1.5f) | ||||
| fTimeSigNum = 2; | fTimeSigNum = 2; | ||||
| else | else | ||||
| fTimeSigNum = 1; | fTimeSigNum = 1; | ||||
| // fall through | // fall through | ||||
| case kParameterMeasures: | case kParameterMeasures: | ||||
| fMaxTicks = 48.0*fTimeSigNum*fParameters[kParameterMeasures] /2; // FIXME: why /2 ? | |||||
| fMaxTicks = 48.0 * fTimeSigNum * static_cast<double>(fParameters[kParameterMeasures]) /2; // FIXME: why /2 ? | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -290,9 +292,9 @@ protected: | |||||
| char strBuf[0xff+1]; | char strBuf[0xff+1]; | ||||
| strBuf[0xff] = '\0'; | strBuf[0xff] = '\0'; | ||||
| const float beatsPerBar = fTimeInfo.bbt.valid ? fTimeInfo.bbt.beatsPerBar : 4.0f; | |||||
| const double beatsPerBar = fTimeInfo.bbt.valid ? static_cast<double>(fTimeInfo.bbt.beatsPerBar) : 4.0; | |||||
| const double beatsPerMinute = fTimeInfo.bbt.valid ? fTimeInfo.bbt.beatsPerMinute : 120.0; | const double beatsPerMinute = fTimeInfo.bbt.valid ? fTimeInfo.bbt.beatsPerMinute : 120.0; | ||||
| const float beatType = fTimeInfo.bbt.valid ? fTimeInfo.bbt.beatType : 4.0f; | |||||
| const float beatType = fTimeInfo.bbt.valid ? fTimeInfo.bbt.beatType : 4.0f; | |||||
| const double ticksPerBeat = 48.0; | const double ticksPerBeat = 48.0; | ||||
| const double ticksPerFrame = ticksPerBeat / (60.0 / beatsPerMinute * getSampleRate()); | const double ticksPerFrame = ticksPerBeat / (60.0 / beatsPerMinute * getSampleRate()); | ||||
| @@ -300,7 +302,7 @@ protected: | |||||
| const double fullBeats = fullTicks / ticksPerBeat; | const double fullBeats = fullTicks / ticksPerBeat; | ||||
| const uint32_t tick = static_cast<uint32_t>(std::floor(std::fmod(fullTicks, ticksPerBeat))); | const uint32_t tick = static_cast<uint32_t>(std::floor(std::fmod(fullTicks, ticksPerBeat))); | ||||
| const uint32_t beat = static_cast<uint32_t>(std::floor(std::fmod(fullBeats, static_cast<double>(beatsPerBar)))); | |||||
| const uint32_t beat = static_cast<uint32_t>(std::floor(std::fmod(fullBeats, beatsPerBar))); | |||||
| const uint32_t bar = static_cast<uint32_t>(std::floor(fullBeats/beatsPerBar)); | const uint32_t bar = static_cast<uint32_t>(std::floor(fullBeats/beatsPerBar)); | ||||
| const CarlaMutexLocker cml(getPipeLock()); | const CarlaMutexLocker cml(getPipeLock()); | ||||
| @@ -315,7 +317,10 @@ protected: | |||||
| if (! writeMessage(strBuf)) | if (! writeMessage(strBuf)) | ||||
| return; | return; | ||||
| std::sprintf(strBuf, "%f:%f:%f\n", beatsPerMinute, beatsPerBar, beatType); | |||||
| std::sprintf(strBuf, "%f:%f:%f\n", | |||||
| static_cast<double>(beatsPerMinute), | |||||
| static_cast<double>(beatsPerBar), | |||||
| static_cast<double>(beatType)); | |||||
| if (! writeMessage(strBuf)) | if (! writeMessage(strBuf)) | ||||
| return; | return; | ||||
| @@ -314,22 +314,22 @@ $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp | |||||
| $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp | $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp | ||||
| -@mkdir -p $(OBJDIR) | -@mkdir -p $(OBJDIR) | ||||
| @echo "Compiling $< (PatchbaySynth 16ch)" | @echo "Compiling $< (PatchbaySynth 16ch)" | ||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH=1 -c -o $@ | |||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH -c -o $@ | |||||
| $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp | $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp | ||||
| -@mkdir -p $(OBJDIR) | -@mkdir -p $(OBJDIR) | ||||
| @echo "Compiling $< (PatchbaySynth 32ch)" | @echo "Compiling $< (PatchbaySynth 32ch)" | ||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH=1 -c -o $@ | |||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH -c -o $@ | |||||
| $(OBJDIR)/carla-vst.cpp.shell.o: carla-vst.cpp | $(OBJDIR)/carla-vst.cpp.shell.o: carla-vst.cpp | ||||
| -@mkdir -p $(OBJDIR) | -@mkdir -p $(OBJDIR) | ||||
| @echo "Compiling $< (VstShell)" | @echo "Compiling $< (VstShell)" | ||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@ | |||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL -DCARLA_PLUGIN_SYNTH=1 -c -o $@ | |||||
| $(OBJDIR)/carla-vst.cpp.shellfx.o: carla-vst.cpp | $(OBJDIR)/carla-vst.cpp.shellfx.o: carla-vst.cpp | ||||
| -@mkdir -p $(OBJDIR) | -@mkdir -p $(OBJDIR) | ||||
| @echo "Compiling $< (VstShell)" | @echo "Compiling $< (VstShell)" | ||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@ | |||||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL -DCARLA_PLUGIN_SYNTH=0 -c -o $@ | |||||
| $(OBJDIR)/carla-vst-export-bridged.cpp.fx.o: carla-vst-export-bridged.cpp | $(OBJDIR)/carla-vst-export-bridged.cpp.fx.o: carla-vst-export-bridged.cpp | ||||
| -@mkdir -p $(OBJDIR) | -@mkdir -p $(OBJDIR) | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -67,14 +67,14 @@ static const String nameToSymbol(const String& name, const uint32_t portIndex) | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if (std::isdigit(trimmedName[0])) | |||||
| if (std::isdigit(static_cast<int>(trimmedName[0]))) | |||||
| symbol += "_"; | symbol += "_"; | ||||
| for (int i=0; i < trimmedName.length(); ++i) | for (int i=0; i < trimmedName.length(); ++i) | ||||
| { | { | ||||
| const water_uchar c = trimmedName[i]; | const water_uchar c = trimmedName[i]; | ||||
| if (std::isalpha(c) || std::isdigit(c)) | |||||
| if (std::isalpha(static_cast<int>(c)) || std::isdigit(static_cast<int>(c))) | |||||
| symbol += c; | symbol += c; | ||||
| else | else | ||||
| symbol += "_"; | symbol += "_"; | ||||
| @@ -562,10 +562,10 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc) | |||||
| text += " lv2:name \"Port " + String(i+1) + "\" ;\n"; | text += " lv2:name \"Port " + String(i+1) + "\" ;\n"; | ||||
| if ((paramInfo->hints & NATIVE_PARAMETER_IS_OUTPUT) == 0) | if ((paramInfo->hints & NATIVE_PARAMETER_IS_OUTPUT) == 0) | ||||
| text += " lv2:default " + String::formatted("%f", paramInfo->ranges.def) + " ;\n"; | |||||
| text += " lv2:default " + String::formatted("%f", static_cast<double>(paramInfo->ranges.def)) + " ;\n"; | |||||
| text += " lv2:minimum " + String::formatted("%f", paramInfo->ranges.min) + " ;\n"; | |||||
| text += " lv2:maximum " + String::formatted("%f", paramInfo->ranges.max) + " ;\n"; | |||||
| text += " lv2:minimum " + String::formatted("%f", static_cast<double>(paramInfo->ranges.min)) + " ;\n"; | |||||
| text += " lv2:maximum " + String::formatted("%f", static_cast<double>(paramInfo->ranges.max)) + " ;\n"; | |||||
| if ((paramInfo->hints & NATIVE_PARAMETER_IS_AUTOMABLE) == 0) | if ((paramInfo->hints & NATIVE_PARAMETER_IS_AUTOMABLE) == 0) | ||||
| text += " lv2:portProperty <" LV2_PORT_PROPS__expensive "> ;\n"; | text += " lv2:portProperty <" LV2_PORT_PROPS__expensive "> ;\n"; | ||||
| @@ -592,7 +592,7 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc) | |||||
| text += " [ "; | text += " [ "; | ||||
| text += "rdfs:label \"" + String(scalePoint->label) + "\" ;\n"; | text += "rdfs:label \"" + String(scalePoint->label) + "\" ;\n"; | ||||
| text += " rdf:value " + String::formatted("%f", scalePoint->value) + " "; | |||||
| text += " rdf:value " + String::formatted("%f", static_cast<double>(scalePoint->value)) + " "; | |||||
| if (j+1 == paramInfo->scalePointCount) | if (j+1 == paramInfo->scalePointCount) | ||||
| text += "] ;\n"; | text += "] ;\n"; | ||||
| @@ -665,7 +665,7 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc) | |||||
| presetText += " lv2:port [\n"; | presetText += " lv2:port [\n"; | ||||
| presetText += " lv2:symbol \"" + nameToSymbol(paramName, j) + "\" ;\n"; | presetText += " lv2:symbol \"" + nameToSymbol(paramName, j) + "\" ;\n"; | ||||
| presetText += " pset:value " + String::formatted("%f", pluginDesc->get_parameter_value(pluginHandle, j)) + " ;\n"; | |||||
| presetText += " pset:value " + String::formatted("%f", static_cast<double>(pluginDesc->get_parameter_value(pluginHandle, j))) + " ;\n"; | |||||
| if (j+1 == paramCount) | if (j+1 == paramCount) | ||||
| presetText += " ] ;\n\n"; | presetText += " ] ;\n\n"; | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Native Plugins | * Carla Native Plugins | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -138,7 +138,7 @@ public: | |||||
| { | { | ||||
| const ScopedLocale csl; | const ScopedLocale csl; | ||||
| std::snprintf(msg, 127, "control %u %f", portIndex, *valuePtr); | |||||
| std::snprintf(msg, 127, "control %u %f", portIndex, static_cast<double>(*valuePtr)); | |||||
| } | } | ||||
| msg[127] = '\0'; | msg[127] = '\0'; | ||||
| @@ -264,11 +264,11 @@ protected: | |||||
| carla_zeroChars(atomBuf, atomSize); | carla_zeroChars(atomBuf, atomSize); | ||||
| LV2_Atom* const atom = (LV2_Atom*)atomBuf; | LV2_Atom* const atom = (LV2_Atom*)atomBuf; | ||||
| atom->size = msgSize; | |||||
| atom->size = static_cast<uint32_t>(msgSize); | |||||
| atom->type = fUridTranser2; | atom->type = fUridTranser2; | ||||
| std::memcpy(atomBuf+sizeof(LV2_Atom), msg, msgSize); | std::memcpy(atomBuf+sizeof(LV2_Atom), msg, msgSize); | ||||
| fUI.writeFunction(fUI.controller, 0, atomSize, fUridTranser, atomBuf); | |||||
| fUI.writeFunction(fUI.controller, 0, static_cast<uint32_t>(atomSize), fUridTranser, atomBuf); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -276,11 +276,11 @@ protected: | |||||
| carla_zeroChars(atomBuf, atomSize); | carla_zeroChars(atomBuf, atomSize); | ||||
| LV2_Atom* const atom = (LV2_Atom*)atomBuf; | LV2_Atom* const atom = (LV2_Atom*)atomBuf; | ||||
| atom->size = msgSize; | |||||
| atom->size = static_cast<uint32_t>(msgSize); | |||||
| atom->type = fUridTranser2; | atom->type = fUridTranser2; | ||||
| std::memcpy(atomBuf+sizeof(LV2_Atom), msg, msgSize); | std::memcpy(atomBuf+sizeof(LV2_Atom), msg, msgSize); | ||||
| fUI.writeFunction(fUI.controller, 0, atomSize, fUridTranser, atomBuf); | |||||
| fUI.writeFunction(fUI.controller, 0, static_cast<uint32_t>(atomSize), fUridTranser, atomBuf); | |||||
| delete[] atomBuf; | delete[] atomBuf; | ||||
| } | } | ||||
| @@ -317,6 +317,8 @@ private: | |||||
| name = nullptr; | name = nullptr; | ||||
| } | } | ||||
| } | } | ||||
| CARLA_DECLARE_NON_COPY_STRUCT(UI); | |||||
| } fUI; | } fUI; | ||||
| // ---------------------------------------------------------------------------------------------------------------- | // ---------------------------------------------------------------------------------------------------------------- | ||||
| @@ -236,7 +236,7 @@ public: | |||||
| fWorkerUISignal = 1; | fWorkerUISignal = 1; | ||||
| const char* const msg((const char*)(event + 1)); | const char* const msg((const char*)(event + 1)); | ||||
| const size_t msgSize = std::strlen(msg); | const size_t msgSize = std::strlen(msg); | ||||
| fWorker->schedule_work(fWorker->handle, msgSize+1, msg); | |||||
| fWorker->schedule_work(fWorker->handle, static_cast<uint32_t>(msgSize + 1U), msg); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -411,19 +411,19 @@ public: | |||||
| char strBufIndex[8]; | char strBufIndex[8]; | ||||
| carla_zeroChars(strBufIndex, 8); | carla_zeroChars(strBufIndex, 8); | ||||
| std::strncpy(strBufIndex, msgIndex, msgSplit-msgIndex); | |||||
| std::strncpy(strBufIndex, msgIndex, static_cast<size_t>(msgSplit - msgIndex)); | |||||
| const int index = std::atoi(msgIndex) - fPorts.indexOffset; | |||||
| const int index = std::atoi(msgIndex) - static_cast<int>(fPorts.indexOffset); | |||||
| CARLA_SAFE_ASSERT_RETURN(index >= 0, LV2_WORKER_ERR_UNKNOWN); | CARLA_SAFE_ASSERT_RETURN(index >= 0, LV2_WORKER_ERR_UNKNOWN); | ||||
| double value; | |||||
| float value; | |||||
| { | { | ||||
| const ScopedLocale csl; | const ScopedLocale csl; | ||||
| value = std::atof(msgSplit+1); | |||||
| value = static_cast<float>(std::atof(msgSplit+1)); | |||||
| } | } | ||||
| fDescriptor->ui_set_parameter_value(fHandle, index, value); | |||||
| fDescriptor->ui_set_parameter_value(fHandle, static_cast<uint32_t>(index), value); | |||||
| } | } | ||||
| } | } | ||||
| else if (std::strcmp(msg, "show") == 0) | else if (std::strcmp(msg, "show") == 0) | ||||
| @@ -929,7 +929,7 @@ static LV2_Worker_Status lv2_work(LV2_Handle instance, LV2_Worker_Respond_Functi | |||||
| return instancePtr->lv2_work(respond, handle, size, data); | return instancePtr->lv2_work(respond, handle, size, data); | ||||
| } | } | ||||
| LV2_Worker_Status lv2_work_resp(LV2_Handle instance, uint32_t size, const void* body) | |||||
| static LV2_Worker_Status lv2_work_resp(LV2_Handle instance, uint32_t size, const void* body) | |||||
| { | { | ||||
| carla_debug("work_resp(%p, %u, %p)", instance, size, body); | carla_debug("work_resp(%p, %u, %p)", instance, size, body); | ||||
| return instancePtr->lv2_work_resp(size, body); | return instancePtr->lv2_work_resp(size, body); | ||||
| @@ -26,7 +26,7 @@ | |||||
| #ifndef CARLA_PLUGIN_PATCHBAY | #ifndef CARLA_PLUGIN_PATCHBAY | ||||
| #error CARLA_PLUGIN_PATCHBAY undefined | #error CARLA_PLUGIN_PATCHBAY undefined | ||||
| #endif | #endif | ||||
| #if CARLA_PLUGIN_32CH || CARLA_PLUGIN_16CH | |||||
| #if defined(CARLA_PLUGIN_32CH) || defined(CARLA_PLUGIN_16CH) | |||||
| #if ! CARLA_PLUGIN_SYNTH | #if ! CARLA_PLUGIN_SYNTH | ||||
| #error CARLA_PLUGIN_16/32CH requires CARLA_PLUGIN_SYNTH | #error CARLA_PLUGIN_16/32CH requires CARLA_PLUGIN_SYNTH | ||||
| #endif | #endif | ||||
| @@ -460,7 +460,9 @@ public: | |||||
| fTimeInfo.bbt.beatType = 4.0f; | fTimeInfo.bbt.beatType = 4.0f; | ||||
| } | } | ||||
| fTimeInfo.bbt.barStartTick = fTimeInfo.bbt.ticksPerBeat*fTimeInfo.bbt.beatsPerBar*(fTimeInfo.bbt.bar-1); | |||||
| fTimeInfo.bbt.barStartTick = fTimeInfo.bbt.ticksPerBeat * | |||||
| static_cast<double>(fTimeInfo.bbt.beatsPerBar) * | |||||
| (fTimeInfo.bbt.bar - 1); | |||||
| } | } | ||||
| fMidiOutEvents.numEvents = 0; | fMidiOutEvents.numEvents = 0; | ||||
| @@ -720,7 +722,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| const NativePluginDescriptor* pluginDesc = nullptr; | const NativePluginDescriptor* pluginDesc = nullptr; | ||||
| PluginListManager& plm(PluginListManager::getInstance()); | PluginListManager& plm(PluginListManager::getInstance()); | ||||
| #if CARLA_VST_SHELL | |||||
| #ifdef CARLA_VST_SHELL | |||||
| if (effect->uniqueID == 0) | if (effect->uniqueID == 0) | ||||
| effect->uniqueID = kShellUniqueID; | effect->uniqueID = kShellUniqueID; | ||||
| @@ -737,13 +739,13 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| const int32_t plugIndex = effect->uniqueID - kShellUniqueID - 1; | const int32_t plugIndex = effect->uniqueID - kShellUniqueID - 1; | ||||
| CARLA_SAFE_ASSERT_RETURN(plugIndex >= 0, 0); | CARLA_SAFE_ASSERT_RETURN(plugIndex >= 0, 0); | ||||
| pluginDesc = plm.descs.getAt(plugIndex, nullptr); | |||||
| pluginDesc = plm.descs.getAt(static_cast<size_t>(plugIndex), nullptr); | |||||
| #else // CARLA_VST_SHELL | #else // CARLA_VST_SHELL | ||||
| # if CARLA_PLUGIN_32CH | |||||
| # if defined(CARLA_PLUGIN_32CH) | |||||
| const char* const pluginLabel = "carlapatchbay32"; | const char* const pluginLabel = "carlapatchbay32"; | ||||
| # elif CARLA_PLUGIN_16CH | |||||
| # elif defined(CARLA_PLUGIN_16CH) | |||||
| const char* const pluginLabel = "carlapatchbay16"; | const char* const pluginLabel = "carlapatchbay16"; | ||||
| # elif CARLA_PLUGIN_PATCHBAY | # elif CARLA_PLUGIN_PATCHBAY | ||||
| const char* const pluginLabel = "carlapatchbay"; | const char* const pluginLabel = "carlapatchbay"; | ||||
| @@ -766,11 +768,11 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| CARLA_SAFE_ASSERT_RETURN(pluginDesc != nullptr, 0); | CARLA_SAFE_ASSERT_RETURN(pluginDesc != nullptr, 0); | ||||
| #if CARLA_VST_SHELL | |||||
| #ifdef CARLA_VST_SHELL | |||||
| effect->numParams = 0; | effect->numParams = 0; | ||||
| effect->numPrograms = 0; | effect->numPrograms = 0; | ||||
| effect->numInputs = pluginDesc->audioIns; | |||||
| effect->numOutputs = pluginDesc->audioOuts; | |||||
| effect->numInputs = static_cast<int>(pluginDesc->audioIns); | |||||
| effect->numOutputs = static_cast<int>(pluginDesc->audioOuts); | |||||
| if (pluginDesc->hints & NATIVE_PLUGIN_HAS_UI) | if (pluginDesc->hints & NATIVE_PLUGIN_HAS_UI) | ||||
| effect->flags |= effFlagsHasEditor; | effect->flags |= effFlagsHasEditor; | ||||
| @@ -818,7 +820,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| return 0; | return 0; | ||||
| case effGetPlugCategory: | case effGetPlugCategory: | ||||
| #if CARLA_VST_SHELL | |||||
| #ifdef CARLA_VST_SHELL | |||||
| if (validPlugin) | if (validPlugin) | ||||
| { | { | ||||
| #if CARLA_PLUGIN_SYNTH | #if CARLA_PLUGIN_SYNTH | ||||
| @@ -839,7 +841,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| case effGetEffectName: | case effGetEffectName: | ||||
| if (char* const cptr = (char*)ptr) | if (char* const cptr = (char*)ptr) | ||||
| { | { | ||||
| #if CARLA_VST_SHELL | |||||
| #if defined(CARLA_VST_SHELL) | |||||
| if (validPlugin) | if (validPlugin) | ||||
| { | { | ||||
| const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | ||||
| @@ -849,9 +851,9 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| { | { | ||||
| std::strncpy(cptr, "Carla-VstShell", 32); | std::strncpy(cptr, "Carla-VstShell", 32); | ||||
| } | } | ||||
| #elif CARLA_PLUGIN_32CH | |||||
| #elif defined(CARLA_PLUGIN_32CH) | |||||
| std::strncpy(cptr, "Carla-Patchbay32", 32); | std::strncpy(cptr, "Carla-Patchbay32", 32); | ||||
| #elif CARLA_PLUGIN_16CH | |||||
| #elif defined(CARLA_PLUGIN_16CH) | |||||
| std::strncpy(cptr, "Carla-Patchbay16", 32); | std::strncpy(cptr, "Carla-Patchbay16", 32); | ||||
| #elif CARLA_PLUGIN_PATCHBAY | #elif CARLA_PLUGIN_PATCHBAY | ||||
| # if CARLA_PLUGIN_SYNTH | # if CARLA_PLUGIN_SYNTH | ||||
| @@ -873,7 +875,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| case effGetVendorString: | case effGetVendorString: | ||||
| if (char* const cptr = (char*)ptr) | if (char* const cptr = (char*)ptr) | ||||
| { | { | ||||
| #if CARLA_VST_SHELL | |||||
| #ifdef CARLA_VST_SHELL | |||||
| if (validPlugin) | if (validPlugin) | ||||
| { | { | ||||
| const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | ||||
| @@ -889,7 +891,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| case effGetProductString: | case effGetProductString: | ||||
| if (char* const cptr = (char*)ptr) | if (char* const cptr = (char*)ptr) | ||||
| { | { | ||||
| #if CARLA_VST_SHELL | |||||
| #if defined(CARLA_VST_SHELL) | |||||
| if (validPlugin) | if (validPlugin) | ||||
| { | { | ||||
| const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | const NativePluginDescriptor* const desc = pluginPtr->getDescriptor(); | ||||
| @@ -899,9 +901,9 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| { | { | ||||
| std::strncpy(cptr, "CarlaVstShell", 32); | std::strncpy(cptr, "CarlaVstShell", 32); | ||||
| } | } | ||||
| #elif CARLA_PLUGIN_32CH | |||||
| #elif defined(CARLA_PLUGIN_32CH) | |||||
| std::strncpy(cptr, "CarlaPatchbay32", 32); | std::strncpy(cptr, "CarlaPatchbay32", 32); | ||||
| #elif CARLA_PLUGIN_16CH | |||||
| #elif defined(CARLA_PLUGIN_16CH) | |||||
| std::strncpy(cptr, "CarlaPatchbay16", 32); | std::strncpy(cptr, "CarlaPatchbay16", 32); | ||||
| #elif CARLA_PLUGIN_PATCHBAY | #elif CARLA_PLUGIN_PATCHBAY | ||||
| # if CARLA_PLUGIN_SYNTH | # if CARLA_PLUGIN_SYNTH | ||||
| @@ -926,7 +928,7 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| case effGetVstVersion: | case effGetVstVersion: | ||||
| return kVstVersion; | return kVstVersion; | ||||
| #if CARLA_VST_SHELL | |||||
| #ifdef CARLA_VST_SHELL | |||||
| case effShellGetNextPlugin: | case effShellGetNextPlugin: | ||||
| if (char* const cptr = (char*)ptr) | if (char* const cptr = (char*)ptr) | ||||
| { | { | ||||
| @@ -937,15 +939,15 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index, | |||||
| for (;;) | for (;;) | ||||
| { | { | ||||
| const uint index = effect->uniqueID - kShellUniqueID; | |||||
| const uint index2 = static_cast<uint>(effect->uniqueID - kShellUniqueID); | |||||
| if (index >= plm.descs.count()) | |||||
| if (index2 >= plm.descs.count()) | |||||
| { | { | ||||
| effect->uniqueID = kShellUniqueID; | effect->uniqueID = kShellUniqueID; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| const NativePluginDescriptor* const desc = plm.descs.getAt(index, nullptr); | |||||
| const NativePluginDescriptor* const desc = plm.descs.getAt(index2, nullptr); | |||||
| CARLA_SAFE_ASSERT_RETURN(desc != nullptr, 0); | CARLA_SAFE_ASSERT_RETURN(desc != nullptr, 0); | ||||
| ++effect->uniqueID; | ++effect->uniqueID; | ||||
| @@ -1001,14 +1003,14 @@ void vst_processReplacingCallback(AEffect* effect, float** inputs, float** outpu | |||||
| const AEffect* VSTPluginMainInit(AEffect* const effect) | const AEffect* VSTPluginMainInit(AEffect* const effect) | ||||
| { | { | ||||
| #if CARLA_VST_SHELL | |||||
| #if defined(CARLA_VST_SHELL) | |||||
| if (const intptr_t uniqueID = VSTAudioMaster(effect, audioMasterCurrentId, 0, 0, nullptr, 0.0f)) | if (const intptr_t uniqueID = VSTAudioMaster(effect, audioMasterCurrentId, 0, 0, nullptr, 0.0f)) | ||||
| effect->uniqueID = uniqueID; | |||||
| effect->uniqueID = static_cast<int>(uniqueID); | |||||
| else | else | ||||
| effect->uniqueID = kShellUniqueID; | effect->uniqueID = kShellUniqueID; | ||||
| #elif CARLA_PLUGIN_32CH | |||||
| #elif defined(CARLA_PLUGIN_32CH) | |||||
| effect->uniqueID = kBaseUniqueID+6; | effect->uniqueID = kBaseUniqueID+6; | ||||
| #elif CARLA_PLUGIN_16CH | |||||
| #elif defined(CARLA_PLUGIN_16CH) | |||||
| effect->uniqueID = kBaseUniqueID+5; | effect->uniqueID = kBaseUniqueID+5; | ||||
| #elif CARLA_PLUGIN_PATCHBAY | #elif CARLA_PLUGIN_PATCHBAY | ||||
| # if CARLA_PLUGIN_SYNTH | # if CARLA_PLUGIN_SYNTH | ||||
| @@ -1027,13 +1029,13 @@ const AEffect* VSTPluginMainInit(AEffect* const effect) | |||||
| // plugin fields | // plugin fields | ||||
| effect->numParams = 0; | effect->numParams = 0; | ||||
| effect->numPrograms = 0; | effect->numPrograms = 0; | ||||
| #if CARLA_VST_SHELL | |||||
| #if defined(CARLA_VST_SHELL) | |||||
| effect->numInputs = 0; | effect->numInputs = 0; | ||||
| effect->numOutputs = 0; | effect->numOutputs = 0; | ||||
| #elif CARLA_PLUGIN_32CH | |||||
| #elif defined(CARLA_PLUGIN_32CH) | |||||
| effect->numInputs = 32; | effect->numInputs = 32; | ||||
| effect->numOutputs = 32; | effect->numOutputs = 32; | ||||
| #elif CARLA_PLUGIN_16CH | |||||
| #elif defined(CARLA_PLUGIN_16CH) | |||||
| effect->numInputs = 16; | effect->numInputs = 16; | ||||
| effect->numOutputs = 16; | effect->numOutputs = 16; | ||||
| #else | #else | ||||
| @@ -1044,7 +1046,7 @@ const AEffect* VSTPluginMainInit(AEffect* const effect) | |||||
| // plugin flags | // plugin flags | ||||
| effect->flags |= effFlagsCanReplacing; | effect->flags |= effFlagsCanReplacing; | ||||
| effect->flags |= effFlagsProgramChunks; | effect->flags |= effFlagsProgramChunks; | ||||
| #if ! CARLA_VST_SHELL | |||||
| #ifndef CARLA_VST_SHELL | |||||
| effect->flags |= effFlagsHasEditor; | effect->flags |= effFlagsHasEditor; | ||||
| #endif | #endif | ||||
| #if CARLA_PLUGIN_SYNTH | #if CARLA_PLUGIN_SYNTH | ||||
| @@ -19,6 +19,7 @@ | |||||
| #include "dgl/ImageWidgets.hpp" | #include "dgl/ImageWidgets.hpp" | ||||
| #include "CarlaNative.h" | #include "CarlaNative.h" | ||||
| #include "ui_launcher_res.hpp" | #include "ui_launcher_res.hpp" | ||||
| #include "CarlaDefines.h" | |||||
| // -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -63,6 +64,8 @@ private: | |||||
| ImageButton startButton; | ImageButton startButton; | ||||
| const NativePluginDescriptor* const descriptor; | const NativePluginDescriptor* const descriptor; | ||||
| const NativePluginHandle handle; | const NativePluginHandle handle; | ||||
| CARLA_DECLARE_NON_COPY_CLASS(CarlaButtonWidget); | |||||
| }; | }; | ||||
| END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla LV2 utils | * Carla LV2 utils | ||||
| * Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -546,9 +546,11 @@ public: | |||||
| #if defined(__clang__) | #if defined(__clang__) | ||||
| # pragma clang diagnostic push | # pragma clang diagnostic push | ||||
| # pragma clang diagnostic ignored "-Weffc++" | # pragma clang diagnostic ignored "-Weffc++" | ||||
| # pragma clang diagnostic ignored "-Wnon-virtual-dtor" | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | ||||
| # pragma GCC diagnostic push | # pragma GCC diagnostic push | ||||
| # pragma GCC diagnostic ignored "-Weffc++" | # pragma GCC diagnostic ignored "-Weffc++" | ||||
| # pragma GCC diagnostic ignored "-Wnon-virtual-dtor" | |||||
| #endif | #endif | ||||
| template<class TimeInfoStruct> | template<class TimeInfoStruct> | ||||
| class Lv2PluginBaseClass : public LV2_External_UI_Widget_Compat | class Lv2PluginBaseClass : public LV2_External_UI_Widget_Compat | ||||
| @@ -755,7 +757,7 @@ public: | |||||
| fTimeInfo.playing = carla_isNotZero(fLastPositionData.speed); | fTimeInfo.playing = carla_isNotZero(fLastPositionData.speed); | ||||
| if (fTimeInfo.playing && fLastPositionData.beatsPerMinute > 0.0f) | |||||
| if (fTimeInfo.playing && fLastPositionData.beatsPerMinute > 0.0) | |||||
| { | { | ||||
| fTimeInfo.bbt.beatsPerMinute = fLastPositionData.beatsPerMinute* | fTimeInfo.bbt.beatsPerMinute = fLastPositionData.beatsPerMinute* | ||||
| std::abs(fLastPositionData.speed); | std::abs(fLastPositionData.speed); | ||||
| @@ -914,9 +916,9 @@ public: | |||||
| carla_stderr("Invalid lv2 frame value"); | carla_stderr("Invalid lv2 frame value"); | ||||
| } | } | ||||
| fTimeInfo.bbt.barStartTick = fTimeInfo.bbt.ticksPerBeat* | |||||
| fTimeInfo.bbt.beatsPerBar* | |||||
| (fTimeInfo.bbt.bar-1); | |||||
| fTimeInfo.bbt.barStartTick = static_cast<double>(fTimeInfo.bbt.ticksPerBeat) * | |||||
| static_cast<double>(fTimeInfo.bbt.beatsPerBar) * | |||||
| (fTimeInfo.bbt.bar-1); | |||||
| fTimeInfo.bbt.valid = (fLastPositionData.beatsPerMinute > 0.0 && | fTimeInfo.bbt.valid = (fLastPositionData.beatsPerMinute > 0.0 && | ||||
| fLastPositionData.beatUnit > 0 && | fLastPositionData.beatUnit > 0 && | ||||
| @@ -1002,7 +1004,7 @@ public: | |||||
| fLastPositionData.beatsPerBar); | fLastPositionData.beatsPerBar); | ||||
| const double rest = std::fmod(fLastPositionData.barBeat, 1.0f); | const double rest = std::fmod(fLastPositionData.barBeat, 1.0f); | ||||
| fTimeInfo.bbt.beat = static_cast<int32_t>(fLastPositionData.barBeat-rest+1.0); | |||||
| fTimeInfo.bbt.beat = static_cast<int32_t>(static_cast<double>(fLastPositionData.barBeat)-rest+1.0); | |||||
| fTimeInfo.bbt.tick = static_cast<int32_t>(rest*fTimeInfo.bbt.ticksPerBeat+0.5); | fTimeInfo.bbt.tick = static_cast<int32_t>(rest*fTimeInfo.bbt.ticksPerBeat+0.5); | ||||
| if (fLastPositionData.bar_f >= 0.0f) | if (fLastPositionData.bar_f >= 0.0f) | ||||
| @@ -1022,8 +1024,8 @@ public: | |||||
| fTimeInfo.bbt.bar = fLastPositionData.bar + 1; | fTimeInfo.bbt.bar = fLastPositionData.bar + 1; | ||||
| fTimeInfo.bbt.barStartTick = fTimeInfo.bbt.ticksPerBeat * | |||||
| fTimeInfo.bbt.beatsPerBar * | |||||
| fTimeInfo.bbt.barStartTick = static_cast<double>(fTimeInfo.bbt.ticksPerBeat) * | |||||
| static_cast<double>(fTimeInfo.bbt.beatsPerBar) * | |||||
| (fTimeInfo.bbt.bar-1); | (fTimeInfo.bbt.bar-1); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1550,18 +1552,24 @@ private: | |||||
| static void extui_run(LV2_External_UI_Widget_Compat* handle) | static void extui_run(LV2_External_UI_Widget_Compat* handle) | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(handle != nullptr,); | |||||
| handlePtr->handleUiRun(); | handlePtr->handleUiRun(); | ||||
| } | } | ||||
| static void extui_show(LV2_External_UI_Widget_Compat* handle) | static void extui_show(LV2_External_UI_Widget_Compat* handle) | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(handle != nullptr,); | |||||
| carla_debug("extui_show(%p)", handle); | carla_debug("extui_show(%p)", handle); | ||||
| handlePtr->handleUiShow(); | handlePtr->handleUiShow(); | ||||
| } | } | ||||
| static void extui_hide(LV2_External_UI_Widget_Compat* handle) | static void extui_hide(LV2_External_UI_Widget_Compat* handle) | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(handle != nullptr,); | |||||
| carla_debug("extui_hide(%p)", handle); | carla_debug("extui_hide(%p)", handle); | ||||
| handlePtr->handleUiHide(); | handlePtr->handleUiHide(); | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla Pipe Utilities | * Carla Pipe Utilities | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -984,7 +984,7 @@ void CarlaPipeCommon::writeControlMessage(const uint32_t index, const float valu | |||||
| { | { | ||||
| const ScopedLocale csl; | const ScopedLocale csl; | ||||
| std::snprintf(tmpBuf, 0xff, "%f\n", value); | |||||
| std::snprintf(tmpBuf, 0xff, "%f\n", static_cast<double>(value)); | |||||
| } | } | ||||
| if (! _writeMsgBuffer(tmpBuf, std::strlen(tmpBuf))) | if (! _writeMsgBuffer(tmpBuf, std::strlen(tmpBuf))) | ||||
| @@ -1,6 +1,6 @@ | |||||
| /* | /* | ||||
| * Carla String | * Carla String | ||||
| * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com> | |||||
| * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com> | |||||
| * | * | ||||
| * This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | ||||
| * modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | ||||
| @@ -176,7 +176,7 @@ public: | |||||
| fBufferAlloc(false) | fBufferAlloc(false) | ||||
| { | { | ||||
| char strBuf[0xff+1]; | char strBuf[0xff+1]; | ||||
| std::snprintf(strBuf, 0xff, "%f", value); | |||||
| std::snprintf(strBuf, 0xff, "%f", static_cast<double>(value)); | |||||
| strBuf[0xff] = '\0'; | strBuf[0xff] = '\0'; | ||||
| _dup(strBuf); | _dup(strBuf); | ||||
| @@ -191,7 +191,7 @@ public: | |||||
| fBufferAlloc(false) | fBufferAlloc(false) | ||||
| { | { | ||||
| char strBuf[0xff+1]; | char strBuf[0xff+1]; | ||||
| std::snprintf(strBuf, 0xff, "%g", value); | |||||
| std::snprintf(strBuf, 0xff, "%f", value); | |||||
| strBuf[0xff] = '\0'; | strBuf[0xff] = '\0'; | ||||
| _dup(strBuf); | _dup(strBuf); | ||||