Browse Source

More random work&fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
0ef21036be
16 changed files with 362 additions and 264 deletions
  1. +20
    -15
      Makefile
  2. +64
    -68
      data/windows/build-win32.sh
  3. +3
    -0
      doc/Carla-TODO
  4. +3
    -2
      source/Makefile.mk
  5. +36
    -20
      source/backend/CarlaBackend.hpp
  6. +10
    -0
      source/backend/CarlaNative.hpp
  7. +4
    -3
      source/backend/native/zynaddsubfx.cpp
  8. +8
    -7
      source/carla_backend.py
  9. +27
    -12
      source/discovery/Makefile
  10. +2
    -1
      source/includes/CarlaDefines.hpp
  11. +1
    -1
      source/includes/CarlaMIDI.h
  12. +21
    -12
      source/includes/ladspa_rdf.hpp
  13. +137
    -86
      source/includes/lv2_rdf.hpp
  14. +4
    -0
      source/libs/Makefile
  15. +17
    -29
      source/widgets/digitalpeakmeter.cpp
  16. +5
    -8
      source/widgets/digitalpeakmeter.hpp

+ 20
- 15
Makefile View File

@@ -53,7 +53,7 @@ posix64:
$(MAKE) -C source/discovery posix64

win32:
$(MAKE) -C source/bridges win32
# $(MAKE) -C source/bridges win32
$(MAKE) -C source/discovery win32

win64:
@@ -286,8 +286,8 @@ else
endif
# --- Others ---
endif
@echo ""
endif
@echo ""

@echo "\033[36m---> Plugin formats: \033[0m"
@echo "Internal:$(ANS_YES)"
@@ -306,38 +306,43 @@ endif

ifeq ($(CARLA_PLUGIN_SUPPORT),true)
@echo "\033[36m---> LV2 UI toolkit support: \033[0m"
@echo "ExternalUI:$(ANS_YES) (direct)"
ifeq ($(MACOS),true)
# --- MacOS ---
@echo "Cocoa:$(ANS_YES)"
@echo "CocoaUI: $(ANS_YES) (direct+bridge)"
# --- MacOS ---
else
# --- Win32 ---
ifeq ($(WIN32),true)
# --- Win32 ---
@echo "Windows:$(ANS_YES)"
@echo "WindowsUI: $(ANS_YES) (direct+bridge)"
else
# --- Others ---
ifeq ($(HAVE_GTK2),true)
@echo "Gtk2:$(ANS_YES)"
@echo "GtkUI: $(ANS_YES) (bridge)"
else
@echo "Gtk2:$(ANS_NO) $(mS)Gtk2 missing$(mE)"
@echo "GtkUI: $(ANS_NO) $(mS)Gtk2 missing$(mE)"
endif
ifeq ($(HAVE_GTK3),true)
@echo "Gtk3:$(ANS_YES)"
@echo "Gtk3UI: $(ANS_YES) (bridge)"
else
@echo "Gtk3:$(ANS_NO) $(mS)Gtk3 missing$(mE)"
@echo "Gtk3UI: $(ANS_NO) $(mS)Gtk3 missing$(mE)"
endif
ifeq ($(HAVE_QT4),true)
@echo "Qt4: $(ANS_YES)"
@echo "Qt4UI: $(ANS_YES) (direct+bridge)"
else
@echo "Qt4: $(ANS_NO) $(mS)Qt4 missing$(mE)"
@echo "Qt4UI: $(ANS_NO) $(mS)Qt4 missing$(mE)"
endif
ifeq ($(HAVE_QT5),true)
@echo "Qt5: $(ANS_YES)"
ifeq ($(HAVE_QT4),true)
@echo "Qt5UI: $(ANS_YES) (bridge)"
else
@echo "Qt5UI: $(ANS_YES) (direct+bridge)"
endif
else
@echo "Qt5: $(ANS_NO) $(mS)Qt5 missing$(mE)"
@echo "Qt5UI: $(ANS_NO) $(mS)Qt5 missing$(mE)"
endif
@echo "X11: $(ANS_YES)"
@echo "X11UI: $(ANS_YES) (direct+bridge)"
endif
# --- Others ---
endif
@@ -373,10 +378,10 @@ ifeq ($(HAVE_AF_DEPS),true)
ifeq ($(HAVE_FFMPEG),true)
@echo "AudioFile: $(ANS_YES) (with ffmpeg)"
else
@echo "AudioFIle: $(ANS_YES) (without ffmpeg) $(mS)ffmpeg/libav missing$(mE)"
@echo "AudioFile: $(ANS_YES) (without ffmpeg) $(mS)ffmpeg/libav missing$(mE)"
endif
else
@echo "AudioFIle: $(ANS_NO) $(mS)libsndfile missing$(mE)"
@echo "AudioFile: $(ANS_NO) $(mS)libsndfile missing$(mE)"
endif

ifeq ($(HAVE_MF_DEPS),true)


+ 64
- 68
data/windows/build-win32.sh View File

@@ -11,9 +11,9 @@ if [ ! -f Makefile ]; then
cd ../..
fi

ln -s -f $MINGW_PATH/bin/$MINGW-pkg-config ./data/windows/pkg-config
export WIN32=true

export PATH=`pwd`/data/windows:$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH
export PATH=$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH
export AR=$MINGW-ar
export CC=$MINGW-gcc
export CXX=$MINGW-g++
@@ -23,89 +23,85 @@ export UIC=$MINGW-uic
export STRIP=$MINGW-strip
export WINDRES=$MINGW-windres

export PKG_CONFIG_PATH=$MINGW_PATH/lib/pkgconfig

export WINEPREFIX=~/.winepy3

export PYTHON_EXE="C:\\\\Python33\\\\python.exe"

export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze"
export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py"
export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3"

export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include"
export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -I$MINGW_PATH/include"
export EXTRA_LIBS1="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg"
export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a $MINGW_PATH/lib/qt4/plugins/iconengines/libqsvgicon.a"
export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a"

# Clean build
make clean
# make clean

# Build PyQt4 resources
make $JOBS UI RES WIDGETS
# make $JOBS UI RES WIDGETS

# Build discovery
make $JOBS -C source/discovery WIN32=true EXTRA_LIBS="$EXTRA_LIBS1"
mv source/discovery/carla-discovery-native source/discovery/carla-discovery-win32.exe
make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS1"
cp source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe

# Build backend
make $JOBS -C source/backend/standalone ../libcarla_standalone.dll WIN32=true EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2"

rm -rf ./data/windows/Carla
cp ./source/carla.py ./source/carla.pyw
$CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw"
rm -f ./source/carla.pyw

rm -rf ./data/windows/CarlaControl
cp ./source/carla_control.py ./source/carla_control.pyw
$CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw"
rm -f ./source/carla_control.pyw

cd data/windows
mkdir Carla/backend
mkdir Carla/bridges
mkdir Carla/discovery
cp ../../source/backend/*.dll Carla/backend/
cp ../../source/discovery/*.exe Carla/discovery/
mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe

cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/

cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/

rm -f pkg-config
# make $JOBS -C source/backend/standalone ../libcarla_standalone.dll WIN32=true EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2"

# export WINEPREFIX=~/.winepy3
#
# export PYTHON_EXE="C:\\\\Python33\\\\python.exe"
#
# export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze"
# export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py"
# export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3"

# rm -rf ./data/windows/Carla
# cp ./source/carla.py ./source/carla.pyw
# $CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw"
# rm -f ./source/carla.pyw
#
# rm -rf ./data/windows/CarlaControl
# cp ./source/carla_control.py ./source/carla_control.pyw
# $CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw"
# rm -f ./source/carla_control.pyw

# cd data/windows
# mkdir Carla/backend
# mkdir Carla/bridges
# mkdir Carla/discovery
# cp ../../source/backend/*.dll Carla/backend/
# cp ../../source/discovery/*.exe Carla/discovery/
# mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe
#
# cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/
#
# cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/
# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/
# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/
# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/

# Build unzipfx
make -C unzipfx-carla -f Makefile.win32
make -C unzipfx-carla-control -f Makefile.win32
# make -C unzipfx-carla -f Makefile.win32
# make -C unzipfx-carla-control -f Makefile.win32

# Create static build
rm -f Carla.zip CarlaControl.zip
zip -r -9 Carla.zip Carla
zip -r -9 CarlaControl.zip CarlaControl
rm -f Carla.exe CarlaControl.exe
cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe
chmod +x Carla.exe
chmod +x CarlaControl.exe
# rm -f Carla.zip CarlaControl.zip
# zip -r -9 Carla.zip Carla
# zip -r -9 CarlaControl.zip CarlaControl
#
# rm -f Carla.exe CarlaControl.exe
# cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
# cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe
# chmod +x Carla.exe
# chmod +x CarlaControl.exe

# Cleanup
make -C unzipfx-carla -f Makefile.win32 clean
make -C unzipfx-carla-control -f Makefile.win32 clean
rm -f Carla.zip CarlaControl.zip
rm -f unzipfx-*/*.exe
# make -C unzipfx-carla -f Makefile.win32 clean
# make -C unzipfx-carla-control -f Makefile.win32 clean
# rm -f Carla.zip CarlaControl.zip
# rm -f unzipfx-*/*.exe

# Testing:
echo "export WINEPREFIX=~/.winepy3"


+ 3
- 0
doc/Carla-TODO View File

@@ -1,5 +1,8 @@
# Carla TODO

MAKEFILE:
- "strip" usage

GENERAL:
- add direct program access on ui-dialogs (needed for standalone bridges), maybe add extra buttons too (reset plugin, fix ui size)
- implement osc-based uis in bridge mode


+ 3
- 2
source/Makefile.mk View File

@@ -33,7 +33,7 @@ BASE_FLAGS = -Wall -Wextra -fPIC -pipe
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -mfpmath=sse

ifeq ($(RASPPI),true)
# RaspberryPi build flags
# Raspberry-Pi optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif

@@ -41,6 +41,7 @@ ifeq ($(DEBUG),true)
BASE_FLAGS += -DDEBUG -O0 -g
else
BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
# BASE_FLAGS += -DCARLA_NO_ASSERTS
endif

32BIT_FLAGS = -m32
@@ -61,7 +62,7 @@ HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil
HAVE_OPENGL = $(shell pkg-config --exists gl && echo true)
HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
HAVE_QT4 = $(shell pkg-config --exists QtCore && echo true)
# HAVE_QT4 = $(shell pkg-config --exists QtCore && echo true)
HAVE_QT5 = $(shell pkg-config --exists Qt5Core && echo true)

HAVE_AF_DEPS = $(shell pkg-config --exists sndfile && echo true)


+ 36
- 20
source/backend/CarlaBackend.hpp View File

@@ -143,16 +143,16 @@ enum BinaryType {
* Some plugin classes might provide more than 1 plugin type.
*/
enum PluginType {
PLUGIN_NONE = 0, //!< Null plugin type.
PLUGIN_INTERNAL = 1, //!< Internal plugin.
PLUGIN_LADSPA = 2, //!< LADSPA plugin.
PLUGIN_DSSI = 3, //!< DSSI plugin.
PLUGIN_LV2 = 4, //!< LV2 plugin.
PLUGIN_VST = 5, //!< VST1/2 plugin.
PLUGIN_VST3 = 6, //!< VST3 plugin.
PLUGIN_GIG = 7, //!< GIG sound kit, implemented via LinuxSampler.
PLUGIN_SF2 = 8, //!< SF2 sound kit (aka SoundFont), implemented via FluidSynth.
PLUGIN_SFZ = 9 //!< SFZ sound kit, implemented via LinuxSampler.
PLUGIN_NONE = 0, //!< Null plugin type
PLUGIN_INTERNAL = 1, //!< Internal plugin
PLUGIN_LADSPA = 2, //!< LADSPA plugin
PLUGIN_DSSI = 3, //!< DSSI plugin
PLUGIN_LV2 = 4, //!< LV2 plugin
PLUGIN_VST = 5, //!< VST1/2 plugin
PLUGIN_VST3 = 6, //!< VST3 plugin
PLUGIN_GIG = 7, //!< GIG sound kit
PLUGIN_SF2 = 8, //!< SF2 sound kit (aka SoundFont)
PLUGIN_SFZ = 9 //!< SFZ sound kit
};

/*!
@@ -493,7 +493,7 @@ enum CallbackType {
/*!
* The plugin's custom GUI state has changed.
*
* \param value1 State, as follows:.\n
* \param value1 State, as follows:\n
* 0: GUI has been closed or hidden\n
* 1: GUI has been shown\n
* -1: GUI has crashed and should not be shown again
@@ -590,39 +590,47 @@ enum CallbackType {
CALLBACK_PATCHBAY_CONNECTION_REMOVED = 25,

/*!
* Non-Session-Manager Announce message.
* Engine buffer-size changed.
*/
CALLBACK_BUFFER_SIZE_CHANGED = 26,

/*!
* Non-Session-Manager Announce message.
* Engine sample-rate changed.
*/
CALLBACK_SAMPLE_RATE_CHANGED = 27,

/*!
* Engine process mode changed.
*
* \param value1 New process mode
* \see ProcessMode
*/
CALLBACK_PROCESS_MODE_CHANGED = 28,

/*!
* Non-Session-Manager Announce message.
*/
CALLBACK_NSM_ANNOUNCE = 28,
CALLBACK_NSM_ANNOUNCE = 29,

/*!
* Non-Session-Manager Open message.
*/
CALLBACK_NSM_OPEN = 29,
CALLBACK_NSM_OPEN = 30,

/*!
* Non-Session-Manager Save message.
*/
CALLBACK_NSM_SAVE = 30,
CALLBACK_NSM_SAVE = 31,

/*!
* An error occurred, show \a valueStr as an error to user.
*/
CALLBACK_ERROR = 31,
CALLBACK_ERROR = 32,

/*!
* The engine has crashed or malfunctioned and will no longer work.
*/
CALLBACK_QUIT = 32
CALLBACK_QUIT = 33
};

/*!
@@ -643,8 +651,8 @@ enum ProcessMode {
*/
enum TransportMode {
TRANSPORT_MODE_INTERNAL = 0, //!< Internal transport mode.
TRANSPORT_MODE_JACK = 1, //!< JACK transport, only available if driver name is "JACK"
TRANSPORT_MODE_PLUGIN = 2, //!< Plugin transport from host, used when Carla is a plugin
TRANSPORT_MODE_JACK = 1, //!< Transport from JACK, only available if driver name is "JACK"
TRANSPORT_MODE_PLUGIN = 2, //!< Transport from host, used when Carla is a plugin
TRANSPORT_MODE_BRIDGE = 3 //!< Special mode, used in plugin-bridges only.
};

@@ -674,6 +682,8 @@ struct ParameterData {
hints(0x0),
midiChannel(0),
midiCC(-1) {}

CARLA_LEAK_DETECTOR(ParameterData)
#endif
};

@@ -696,6 +706,8 @@ struct ParameterRanges {
step(0.01f),
stepSmall(0.0001f),
stepLarge(0.1f) {}

CARLA_LEAK_DETECTOR(ParameterRanges)
#endif

void fixDefault()
@@ -751,6 +763,8 @@ struct MidiProgramData {
: bank(0),
program(0),
name(nullptr) {}

CARLA_LEAK_DETECTOR(MidiProgramData)
#endif
};

@@ -770,6 +784,8 @@ struct CustomData {
: type(nullptr),
key(nullptr),
value(nullptr) {}

CARLA_LEAK_DETECTOR(CustomData)
#endif
};



+ 10
- 0
source/backend/CarlaNative.hpp View File

@@ -49,6 +49,16 @@ protected:
return kHost;
}

const char* hostResourceDir() const
{
CARLA_ASSERT(kHost != nullptr);

if (kHost != nullptr)
return kHost->resource_dir;

return nullptr;
}

const char* hostUiName() const
{
CARLA_ASSERT(kHost != nullptr);


+ 4
- 3
source/backend/native/zynaddsubfx.cpp View File

@@ -662,8 +662,8 @@ public:
#ifdef WANT_ZYNADDSUBFX_UI
if (gPixmapPath.isEmpty())
{
gPixmapPath = host->resource_dir;
gPixmapPath += PIXMAP_PATH;
gPixmapPath = host->resource_dir;
gPixmapPath += PIXMAP_PATH;
gUiPixmapPath = gPixmapPath;
}
#endif
@@ -710,10 +710,11 @@ int ZynAddSubFxPlugin::sInstanceCount = 0;
NonRtList<ZynAddSubFxPlugin::ProgramInfo*> ZynAddSubFxPlugin::sPrograms;

static const struct ProgramsDestructor {
ProgramsDestructor() {}
~ProgramsDestructor() {
ZynAddSubFxPlugin::_clearPrograms();
}
} programsDestructor;
} _programsDestructor;

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



+ 8
- 7
source/carla_backend.py View File

@@ -245,13 +245,14 @@ CALLBACK_PATCHBAY_PORT_REMOVED = 22
CALLBACK_PATCHBAY_PORT_RENAMED = 23
CALLBACK_PATCHBAY_CONNECTION_ADDED = 24
CALLBACK_PATCHBAY_CONNECTION_REMOVED = 25
CALLBACK_BUFFER_SIZE_CHANGED = 26
CALLBACK_SAMPLE_RATE_CHANGED = 27
CALLBACK_NSM_ANNOUNCE = 28
CALLBACK_NSM_OPEN = 29
CALLBACK_NSM_SAVE = 30
CALLBACK_ERROR = 31
CALLBACK_QUIT = 32
CALLBACK_BUFFER_SIZE_CHANGED = 26
CALLBACK_SAMPLE_RATE_CHANGED = 27
CALLBACK_PROCESS_MODE_CHANGED = 28
CALLBACK_NSM_ANNOUNCE = 29
CALLBACK_NSM_OPEN = 30
CALLBACK_NSM_SAVE = 31
CALLBACK_ERROR = 32
CALLBACK_QUIT = 33

# Process Mode
PROCESS_MODE_SINGLE_CLIENT = 0


+ 27
- 12
source/discovery/Makefile View File

@@ -43,7 +43,7 @@ POSIX_LINK_FLAGS = $(LINK_FLAGS) -ldl
WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS)
WIN_32BIT_FLAGS = $(32BIT_FLAGS)
WIN_64BIT_FLAGS = $(64BIT_FLAGS)
WIN_LINK_FLAGS = $(LINK_FLAGS) $(EXTRA_LIBS) -lole32 -luuid -lws2_32 -static
WIN_LINK_FLAGS = $(LINK_FLAGS) $(EXTRA_LIBS) -lole32 -luuid -lws2_32

ifeq ($(HAVE_FLUIDSYNTH),true)
WIN_LINK_FLAGS += -ldsound -lwinmm
@@ -53,14 +53,6 @@ ifeq ($(HAVE_LINUXSAMPLER),true)
WIN_LINK_FLAGS += -lrpcrt4
endif

ifeq ($(WIN32),true)
NATIVE_BUILD_FLAGS = $(WIN_BUILD_FLAGS)
NATIVE_LINK_FLAGS = $(WIN_LINK_FLAGS)
else
NATIVE_BUILD_FLAGS = $(POSIX_BUILD_FLAGS)
NATIVE_LINK_FLAGS = $(POSIX_LINK_FLAGS)
endif

ifeq ($(CARLA_PLUGIN_SUPPORT),true)
LIBS = ../libs/lilv.a
LIBS_posix32 = ../libs/lilv.posix32.a
@@ -73,7 +65,11 @@ OBJS = carla-discovery.cpp

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

ifeq ($(WIN32),true)
all: carla-discovery-native.exe
else
all: carla-discovery-native
endif

posix32: carla-discovery-posix32
posix64: carla-discovery-posix64
@@ -83,7 +79,10 @@ win64: carla-discovery-win64.exe
# --------------------------------------------------------------

carla-discovery-native: $(OBJS) $(LIBS)
$(CXX) $^ $(NATIVE_BUILD_FLAGS) $(NATIVE_FLAGS) $(NATIVE_LINK_FLAGS) -o $@ && $(STRIP) $@
$(CXX) $^ $(POSIX_BUILD_FLAGS) $(NATIVE_FLAGS) $(POSIX_LINK_FLAGS) -o $@ && $(STRIP) $@

carla-discovery-native.exe: $(OBJS) $(LIBS)
$(CXX) $^ $(WIN_BUILD_FLAGS) $(NATIVE_FLAGS) $(WIN_LINK_FLAGS) -o $@ && $(STRIP) $@

carla-discovery-posix32: $(OBJS) $(LIBS_posix32)
$(CXX) $^ $(POSIX_BUILD_FLAGS) $(POSIX_32BIT_FLAGS) $(POSIX_LINK_FLAGS) -o $@ && $(STRIP) $@
@@ -107,5 +106,21 @@ debug:

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

../libs/%:
$(MAKE) -C ../libs $*
../libs/lilv.a:
$(MAKE) -C ../libs lilv

../libs/lilv.posix32.a:
$(MAKE) -C ../libs lilv_posix32

../libs/lilv.posix64.a:
$(MAKE) -C ../libs lilv_posix32

../libs/lilv.win32.a:
$(MAKE) -C ../libs lilv_win32

../libs/lilv.win64.a:
$(MAKE) -C ../libs lilv_win64

.PHONY: ../libs/lilv.a \
../libs/lilv.posix32.a ../libs/lilv.posix64.a \
../libs/lilv.win32.a ../libs/lilv.win64.a

+ 2
- 1
source/includes/CarlaDefines.hpp View File

@@ -109,11 +109,12 @@
# define BINARY_NATIVE BINARY_OTHER
#endif

// Define CARLA_ASSERT*
// Define CARLA_SAFE_ASSERT*
#define CARLA_SAFE_ASSERT(cond) ((!(cond)) ? carla_assert(#cond, __FILE__, __LINE__) : pass())
#define CARLA_SAFE_ASSERT_INT(cond, value) ((!(cond)) ? carla_assert_int(#cond, __FILE__, __LINE__, value) : pass())
#define CARLA_SAFE_ASSERT_INT2(cond, v1, v2) ((!(cond)) ? carla_assert_int2(#cond, __FILE__, __LINE__, v1, v2) : pass())

// Define CARLA_ASSERT*
#if defined(CARLA_NO_ASSERTS)
# define CARLA_ASSERT(cond)
# define CARLA_ASSERT_INT(cond, value)


+ 1
- 1
source/includes/CarlaMIDI.h View File

@@ -111,7 +111,7 @@
#define MIDI_CONTROL_OMNI_MODE_OFF 0x7C // 0 (+ all notes off)
#define MIDI_CONTROL_OMNI_MODE_ON 0x7D // 0 (+ all notes off)
#define MIDI_CONTROL_MONO_MODE_ON 0x7E // ...
#define MIDI_CONTROL_POLY_MODE_ON 0x7F // 0 ( + mono off, + all notes off)
#define MIDI_CONTROL_POLY_MODE_ON 0x7F // 0 (+ mono off, + all notes off)

#define MIDI_CONTROL_SOUND_VARIATION MIDI_CONTROL_SOUND_CONTROLLER_1
#define MIDI_CONTROL_TIMBRE MIDI_CONTROL_SOUND_CONTROLLER_2


+ 21
- 12
source/includes/ladspa_rdf.hpp View File

@@ -127,13 +127,13 @@ struct LADSPA_RDF_ScalePoint {
~LADSPA_RDF_ScalePoint()
{
if (Label != nullptr)
{
delete[] Label;
Label = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LADSPA_RDF_ScalePoint(LADSPA_RDF_ScalePoint&) = delete;
LADSPA_RDF_ScalePoint(const LADSPA_RDF_ScalePoint&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LADSPA_RDF_ScalePoint)
};

// Port
@@ -159,15 +159,18 @@ struct LADSPA_RDF_Port {
~LADSPA_RDF_Port()
{
if (Label != nullptr)
{
delete[] Label;
Label = nullptr;
}
if (ScalePoints != nullptr)
{
delete[] ScalePoints;
ScalePoints = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LADSPA_RDF_Port(LADSPA_RDF_Port&) = delete;
LADSPA_RDF_Port(const LADSPA_RDF_Port&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LADSPA_RDF_Port)
};

// Plugin
@@ -191,17 +194,23 @@ struct LADSPA_RDF_Descriptor {
~LADSPA_RDF_Descriptor()
{
if (Title != nullptr)
{
delete[] Title;
Title = nullptr;
}
if (Creator != nullptr)
{
delete[] Creator;
Creator = nullptr;
}
if (Ports != nullptr)
{
delete[] Ports;
Ports = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LADSPA_RDF_Descriptor(LADSPA_RDF_Descriptor&) = delete;
LADSPA_RDF_Descriptor(const LADSPA_RDF_Descriptor&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LADSPA_RDF_Descriptor)
};

#endif // LADSPA_RDF_INCLUDED

+ 137
- 86
source/includes/lv2_rdf.hpp View File

@@ -29,8 +29,8 @@ typedef const char* LV2_URI;
typedef uint32_t LV2_Property;

// Port Midi Map Types
#define LV2_PORT_MIDI_MAP_CC 0x1
#define LV2_PORT_MIDI_MAP_NRPN 0x2
#define LV2_PORT_MIDI_MAP_CC 1
#define LV2_PORT_MIDI_MAP_NRPN 2

#define LV2_IS_PORT_MIDI_MAP_CC(x) ((x) == LV2_PORT_MIDI_MAP_CC)
#define LV2_IS_PORT_MIDI_MAP_NRPN(x) ((x) == LV2_PORT_MIDI_MAP_NRPN)
@@ -56,30 +56,30 @@ typedef uint32_t LV2_Property;
#define LV2_HAVE_PORT_UNIT_UNIT(x) ((x) & LV2_PORT_UNIT_UNIT)

// Port Unit Unit
#define LV2_PORT_UNIT_BAR 0x01
#define LV2_PORT_UNIT_BEAT 0x02
#define LV2_PORT_UNIT_BPM 0x03
#define LV2_PORT_UNIT_CENT 0x04
#define LV2_PORT_UNIT_CM 0x05
#define LV2_PORT_UNIT_COEF 0x06
#define LV2_PORT_UNIT_DB 0x07
#define LV2_PORT_UNIT_DEGREE 0x08
#define LV2_PORT_UNIT_FRAME 0x09
#define LV2_PORT_UNIT_HZ 0x0A
#define LV2_PORT_UNIT_INCH 0x0B
#define LV2_PORT_UNIT_KHZ 0x0C
#define LV2_PORT_UNIT_KM 0x0D
#define LV2_PORT_UNIT_M 0x0E
#define LV2_PORT_UNIT_MHZ 0x0F
#define LV2_PORT_UNIT_MIDINOTE 0x10
#define LV2_PORT_UNIT_MILE 0x11
#define LV2_PORT_UNIT_MIN 0x12
#define LV2_PORT_UNIT_MM 0x13
#define LV2_PORT_UNIT_MS 0x14
#define LV2_PORT_UNIT_OCT 0x15
#define LV2_PORT_UNIT_PC 0x16
#define LV2_PORT_UNIT_S 0x17
#define LV2_PORT_UNIT_SEMITONE 0x18
#define LV2_PORT_UNIT_BAR 1
#define LV2_PORT_UNIT_BEAT 2
#define LV2_PORT_UNIT_BPM 3
#define LV2_PORT_UNIT_CENT 4
#define LV2_PORT_UNIT_CM 5
#define LV2_PORT_UNIT_COEF 6
#define LV2_PORT_UNIT_DB 7
#define LV2_PORT_UNIT_DEGREE 8
#define LV2_PORT_UNIT_FRAME 9
#define LV2_PORT_UNIT_HZ 10
#define LV2_PORT_UNIT_INCH 11
#define LV2_PORT_UNIT_KHZ 12
#define LV2_PORT_UNIT_KM 13
#define LV2_PORT_UNIT_M 14
#define LV2_PORT_UNIT_MHZ 15
#define LV2_PORT_UNIT_MIDINOTE 16
#define LV2_PORT_UNIT_MILE 17
#define LV2_PORT_UNIT_MIN 18
#define LV2_PORT_UNIT_MM 19
#define LV2_PORT_UNIT_MS 20
#define LV2_PORT_UNIT_OCT 21
#define LV2_PORT_UNIT_PC 22
#define LV2_PORT_UNIT_S 23
#define LV2_PORT_UNIT_SEMITONE 24

#define LV2_IS_PORT_UNIT_BAR(x) ((x) == LV2_PORT_UNIT_BAR)
#define LV2_IS_PORT_UNIT_BEAT(x) ((x) == LV2_PORT_UNIT_BEAT)
@@ -167,19 +167,19 @@ typedef uint32_t LV2_Property;
#define LV2_IS_PORT_TRIGGER(x) ((x) & LV2_PORT_TRIGGER)

// Port Designation
#define LV2_PORT_DESIGNATION_CONTROL 0x1
#define LV2_PORT_DESIGNATION_FREEWHEELING 0x2
#define LV2_PORT_DESIGNATION_LATENCY 0x3
#define LV2_PORT_DESIGNATION_SAMPLE_RATE 0x4
#define LV2_PORT_DESIGNATION_TIME_BAR 0x5
#define LV2_PORT_DESIGNATION_TIME_BAR_BEAT 0x6
#define LV2_PORT_DESIGNATION_TIME_BEAT 0x7
#define LV2_PORT_DESIGNATION_TIME_BEAT_UNIT 0x8
#define LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR 0x9
#define LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE 0xA
#define LV2_PORT_DESIGNATION_TIME_FRAME 0xB
#define LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND 0xC
#define LV2_PORT_DESIGNATION_TIME_SPEED 0xD
#define LV2_PORT_DESIGNATION_CONTROL 1
#define LV2_PORT_DESIGNATION_FREEWHEELING 2
#define LV2_PORT_DESIGNATION_LATENCY 3
#define LV2_PORT_DESIGNATION_SAMPLE_RATE 4
#define LV2_PORT_DESIGNATION_TIME_BAR 5
#define LV2_PORT_DESIGNATION_TIME_BAR_BEAT 6
#define LV2_PORT_DESIGNATION_TIME_BEAT 7
#define LV2_PORT_DESIGNATION_TIME_BEAT_UNIT 8
#define LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR 9
#define LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE 10
#define LV2_PORT_DESIGNATION_TIME_FRAME 11
#define LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND 12
#define LV2_PORT_DESIGNATION_TIME_SPEED 13

#define LV2_IS_PORT_DESIGNATION_CONTROL(x) ((x) == LV2_PORT_DESIGNATION_CONTROL)
#define LV2_IS_PORT_DESIGNATION_FREEWHEELING(x) ((x) == LV2_PORT_DESIGNATION_FREEWHEELING)
@@ -197,22 +197,22 @@ typedef uint32_t LV2_Property;
#define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_SPEED)

// Feature Types
#define LV2_FEATURE_OPTIONAL 0x1
#define LV2_FEATURE_REQUIRED 0x2
#define LV2_FEATURE_OPTIONAL 1
#define LV2_FEATURE_REQUIRED 2

#define LV2_IS_FEATURE_OPTIONAL(x) ((x) == LV2_FEATURE_OPTIONAL)
#define LV2_IS_FEATURE_REQUIRED(x) ((x) == LV2_FEATURE_REQUIRED)

// UI Types
#define LV2_UI_GTK2 0x1
#define LV2_UI_GTK3 0x2
#define LV2_UI_QT4 0x3
#define LV2_UI_QT5 0x4
#define LV2_UI_COCOA 0x5
#define LV2_UI_WINDOWS 0x6
#define LV2_UI_X11 0x7
#define LV2_UI_EXTERNAL 0x8
#define LV2_UI_OLD_EXTERNAL 0x9
#define LV2_UI_GTK2 1
#define LV2_UI_GTK3 2
#define LV2_UI_QT4 3
#define LV2_UI_QT5 4
#define LV2_UI_COCOA 5
#define LV2_UI_WINDOWS 6
#define LV2_UI_X11 7
#define LV2_UI_EXTERNAL 8
#define LV2_UI_OLD_EXTERNAL 9

#define LV2_IS_UI_GTK2(x) ((x) == LV2_UI_GTK2)
#define LV2_IS_UI_GTK3(x) ((x) == LV2_UI_GTK3)
@@ -299,10 +299,7 @@ struct LV2_RDF_PortMidiMap {
: Type(0),
Number(0) {}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_PortMidiMap(LV2_RDF_PortMidiMap&) = delete;
LV2_RDF_PortMidiMap(const LV2_RDF_PortMidiMap&) = delete;
#endif
CARLA_LEAK_DETECTOR(LV2_RDF_PortMidiMap)
};

// Port Points
@@ -318,10 +315,7 @@ struct LV2_RDF_PortPoints {
Minimum(0.0f),
Maximum(1.0f) {}

#if 0 // def CARLA_PROPER_CPP11_SUPPORT FIXME!
LV2_RDF_PortPoints(LV2_RDF_PortPoints&) = delete;
LV2_RDF_PortPoints(const LV2_RDF_PortPoints&) = delete;
#endif
CARLA_LEAK_DETECTOR(LV2_RDF_PortPoints)
};

// Port Unit
@@ -342,17 +336,23 @@ struct LV2_RDF_PortUnit {
~LV2_RDF_PortUnit()
{
if (Name != nullptr)
{
delete[] Name;
Name = nullptr;
}
if (Render != nullptr)
{
delete[] Render;
Render = nullptr;
}
if (Symbol != nullptr)
{
delete[] Symbol;
Symbol = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_PortUnit(LV2_RDF_PortUnit&) = delete;
LV2_RDF_PortUnit(const LV2_RDF_PortUnit&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_PortUnit)
};

// Port Scale Point
@@ -367,13 +367,13 @@ struct LV2_RDF_PortScalePoint {
~LV2_RDF_PortScalePoint()
{
if (Label != nullptr)
{
delete[] Label;
Label = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_PortScalePoint(LV2_RDF_PortScalePoint&) = delete;
LV2_RDF_PortScalePoint(const LV2_RDF_PortScalePoint&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_PortScalePoint)
};

// Port
@@ -403,17 +403,23 @@ struct LV2_RDF_Port {
~LV2_RDF_Port()
{
if (Name != nullptr)
{
delete[] Name;
Name = nullptr;
}
if (Symbol != nullptr)
{
delete[] Symbol;
Symbol = nullptr;
}
if (ScalePoints != nullptr)
{
delete[] ScalePoints;
ScalePoints = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_Port(LV2_RDF_Port&) = delete;
LV2_RDF_Port(const LV2_RDF_Port&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Port)
};

// Preset
@@ -428,15 +434,18 @@ struct LV2_RDF_Preset {
~LV2_RDF_Preset()
{
if (URI != nullptr)
{
delete[] URI;
URI = nullptr;
}
if (Label != nullptr)
{
delete[] Label;
Label = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_Preset(LV2_RDF_Preset&) = delete;
LV2_RDF_Preset(const LV2_RDF_Preset&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Preset)
};

// Feature
@@ -451,13 +460,13 @@ struct LV2_RDF_Feature {
~LV2_RDF_Feature()
{
if (URI != nullptr)
{
delete[] URI;
URI = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_Feature(LV2_RDF_Feature&) = delete;
LV2_RDF_Feature(const LV2_RDF_Feature&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Feature)
};

// UI
@@ -486,21 +495,33 @@ struct LV2_RDF_UI {
~LV2_RDF_UI()
{
if (URI != nullptr)
{
delete[] URI;
URI = nullptr;
}
if (Binary != nullptr)
{
delete[] Binary;
Binary = nullptr;
}
if (Bundle != nullptr)
{
delete[] Bundle;
Bundle = nullptr;
}
if (Features != nullptr)
{
delete[] Features;
Features = nullptr;
}
if (Extensions != nullptr)
{
delete[] Extensions;
Extensions = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_UI(LV2_RDF_UI&) = delete;
LV2_RDF_UI(const LV2_RDF_UI&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_UI)
};

// Plugin
@@ -561,33 +582,63 @@ struct LV2_RDF_Descriptor {
~LV2_RDF_Descriptor()
{
if (URI != nullptr)
{
delete[] URI;
URI = nullptr;
}
if (Name != nullptr)
{
delete[] Name;
Name = nullptr;
}
if (Author != nullptr)
{
delete[] Author;
Author = nullptr;
}
if (License != nullptr)
{
delete[] License;
License = nullptr;
}
if (Binary != nullptr)
{
delete[] Binary;
Binary = nullptr;
}
if (Bundle != nullptr)
{
delete[] Bundle;
Bundle = nullptr;
}
if (Ports != nullptr)
{
delete[] Ports;
Ports = nullptr;
}
if (Presets != nullptr)
{
delete[] Presets;
Presets = nullptr;
}
if (Features != nullptr)
{
delete[] Features;
Features = nullptr;
}
if (Extensions != nullptr)
{
delete[] Extensions;
Extensions = nullptr;
}
if (UIs != nullptr)
{
delete[] UIs;
UIs = nullptr;
}
}

#ifdef CARLA_PROPER_CPP11_SUPPORT
LV2_RDF_Descriptor(LV2_RDF_Descriptor&) = delete;
LV2_RDF_Descriptor(const LV2_RDF_Descriptor&) = delete;
#endif
CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Descriptor)
};

#endif // LV2_RDF_INCLUDED

+ 4
- 0
source/libs/Makefile View File

@@ -66,3 +66,7 @@ clean:
$(MAKE) clean -C rtmempool
$(MAKE) clean -C ../theme
$(MAKE) clean -C ../widgets

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

.PHONY: lilv rtmempool

+ 17
- 29
source/widgets/digitalpeakmeter.cpp View File

@@ -33,15 +33,10 @@ DigitalPeakMeter::DigitalPeakMeter(QWidget* parent)
fColorBase(93, 231, 61),
fColorBaseAlt(15, 110, 15, 100),
fChannelsData(nullptr),
fLastValueData(nullptr),
fPaintTimer(this)
fLastValueData(nullptr)
{
setChannels(0);
setColor(GREEN);

fPaintTimer.setInterval(60);
connect(&fPaintTimer, SIGNAL(timeout()), this, SLOT(update()));
fPaintTimer.start();
}

DigitalPeakMeter::~DigitalPeakMeter()
@@ -60,12 +55,23 @@ void DigitalPeakMeter::displayMeter(int meter, float level)
if (meter <= 0 || meter > fChannels || fChannelsData == nullptr)
return qCritical("DigitalPeakMeter::displayMeter(%i, %f) - invalid meter number", meter, level);

if (level < 0.0f)
level = -level;
else if (level > 1.0f)
int i = meter - 1;

if (fSmoothMultiplier > 0)
level = (fLastValueData[i] * fSmoothMultiplier + level) / float(fSmoothMultiplier + 1);

if (level < 0.001f)
level = 0.0f;
else if (level > 0.999f)
level = 1.0f;

fChannelsData[meter-1] = level;
if (fChannelsData[i] != level)
{
fChannelsData[i] = level;
update();
}

fLastValueData[i] = level;
}

void DigitalPeakMeter::setChannels(int channels)
@@ -146,15 +152,6 @@ void DigitalPeakMeter::setOrientation(Orientation orientation)
updateSizes();
}

void DigitalPeakMeter::setRefreshRate(int rate)
{
Q_ASSERT(rate > 0);

fPaintTimer.stop();
fPaintTimer.setInterval(rate);
fPaintTimer.start();
}

void DigitalPeakMeter::setSmoothRelease(int value)
{
Q_ASSERT(value >= 0 && value <= 5);
@@ -169,7 +166,7 @@ void DigitalPeakMeter::setSmoothRelease(int value)

QSize DigitalPeakMeter::minimumSizeHint() const
{
return QSize(30, 30);
return QSize(10, 10);
}

QSize DigitalPeakMeter::sizeHint() const
@@ -216,9 +213,6 @@ void DigitalPeakMeter::paintEvent(QPaintEvent* event)
{
float value, level = fChannelsData[i];

if (level == fLastValueData[i])
continue;

if (fOrientation == HORIZONTAL)
value = level * float(fWidth);
else if (fOrientation == VERTICAL)
@@ -226,18 +220,12 @@ void DigitalPeakMeter::paintEvent(QPaintEvent* event)
else
value = 0.0f;

if (value < 0.0f)
value = 0.0f;
else if (fSmoothMultiplier > 0)
value = (fLastValueData[i] * float(fSmoothMultiplier) + value) / float(fSmoothMultiplier + 1);

if (fOrientation == HORIZONTAL)
painter.drawRect(0, meterX, int(value), fSizeMeter);
else if (fOrientation == VERTICAL)
painter.drawRect(meterX, int(value), fSizeMeter, fHeight);

meterX += fSizeMeter;
fLastValueData[i] = value;
}

painter.setBrush(Qt::black);


+ 5
- 8
source/widgets/digitalpeakmeter.hpp View File

@@ -42,23 +42,22 @@ public:
};

DigitalPeakMeter(QWidget* parent);
~DigitalPeakMeter();
~DigitalPeakMeter() override;

void displayMeter(int meter, float level);
void setChannels(int channels);
void setColor(Color color);
void setOrientation(Orientation orientation);
void setRefreshRate(int rate);
void setSmoothRelease(int value);

QSize minimumSizeHint() const;
QSize sizeHint() const;
QSize minimumSizeHint() const override;
QSize sizeHint() const override;

protected:
void updateSizes();

void paintEvent(QPaintEvent* event);
void resizeEvent(QResizeEvent* event);
void paintEvent(QPaintEvent* event) override;
void resizeEvent(QResizeEvent* event) override;

private:
int fChannels;
@@ -75,8 +74,6 @@ private:
float* fChannelsData;
float* fLastValueData;

QTimer fPaintTimer;

CARLA_LEAK_DETECTOR(DigitalPeakMeter)
};



Loading…
Cancel
Save