upgrade to JUCE 5.4.3. Remove (probably) unused JUCE modules. Remove VST2 target (it's been end-of-life'd by Steinberg and by JUCE)

This commit is contained in:
Alex Birch 2019-06-22 20:41:38 +01:00
parent d22c2cd4fa
commit 9ee566b251
No known key found for this signature in database
GPG Key ID: 305EB1F98D44ACBA
1140 changed files with 67534 additions and 105952 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@
<key>description</key> <key>description</key>
<string>Audio plugin to play soundfonts</string> <string>Audio plugin to play soundfonts</string>
<key>factoryFunction</key> <key>factoryFunction</key>
<string>JUCEProjectAUFactory</string> <string>juicysfpluginAUFactory</string>
<key>manufacturer</key> <key>manufacturer</key>
<string>Blbs</string> <string>Blbs</string>
<key>type</key> <key>type</key>
@ -42,6 +42,13 @@
<string>Jspf</string> <string>Jspf</string>
<key>version</key> <key>version</key>
<integer>65536</integer> <integer>65536</integer>
<key>resourceUsage</key>
<dict>
<key>network.client</key>
<true/>
<key>temporary-exception.files.all.read-write</key>
<true/>
</dict>
</dict> </dict>
</array> </array>
</dict> </dict>

9
Builds/CLion/PkgInfo Normal file
View File

@ -0,0 +1,9 @@
# Automatically generated CMakeLists, created by the Projucer
# Do not edit this file! Your changes will be overwritten when you re-save the Projucer project!
cmake_minimum_required (VERSION 3.4.1)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
endif (NOT CMAKE_BUILD_TYPE)

View File

@ -33,7 +33,7 @@
<key>description</key> <key>description</key>
<string>Audio plugin to play soundfonts</string> <string>Audio plugin to play soundfonts</string>
<key>factoryFunction</key> <key>factoryFunction</key>
<string>JUCEProjectAUFactory</string> <string>juicysfpluginAUFactory</string>
<key>manufacturer</key> <key>manufacturer</key>
<string>Blbs</string> <string>Blbs</string>
<key>type</key> <key>type</key>
@ -42,6 +42,13 @@
<string>Jspf</string> <string>Jspf</string>
<key>version</key> <key>version</key>
<integer>65536</integer> <integer>65536</integer>
<key>resourceUsage</key>
<dict>
<key>network.client</key>
<true/>
<key>temporary-exception.files.all.read-write</key>
<true/>
</dict>
</dict> </dict>
</array> </array>
</dict> </dict>

View File

@ -35,22 +35,17 @@ ifeq ($(CONFIG),Debug)
TARGET_ARCH := -march=native TARGET_ARCH := -march=native
endif endif
JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DDEBUG=1 -D_DEBUG=1 -DJUCER_LINUX_MAKE_7346DA2A=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 $(shell pkg-config --cflags alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -pthread -I../../JuceLibraryCode -I/opt/JUCE/modules -I../../include -I../../modules $(CPPFLAGS) JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DDEBUG=1 -D_DEBUG=1 -DJUCER_LINUX_MAKE_7346DA2A=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 $(shell pkg-config --cflags alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -pthread -I../../JuceLibraryCode -I$(HOME)/JUCE/modules -I../../include -I../../modules $(CPPFLAGS)
JUCE_CPPFLAGS_VST := -DJucePlugin_Build_VST=1 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 JUCE_CPPFLAGS_STANDALONE_PLUGIN := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0
JUCE_CFLAGS_VST := -fPIC -fvisibility=hidden
JUCE_LDFLAGS_VST := -shared -Wl,--no-undefined
JUCE_TARGET_VST := juicysfplugin.so
JUCE_CPPFLAGS_STANDALONE_PLUGIN := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1
JUCE_TARGET_STANDALONE_PLUGIN := juicysfplugin JUCE_TARGET_STANDALONE_PLUGIN := juicysfplugin
JUCE_CPPFLAGS_SHARED_CODE := -DJucePlugin_Build_VST=1 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJUCE_SHARED_CODE=1 JUCE_CPPFLAGS_SHARED_CODE := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0 -DJUCE_SHARED_CODE=1
JUCE_TARGET_SHARED_CODE := juicysfplugin.a JUCE_TARGET_SHARED_CODE := juicysfplugin.a
JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -fPIC -g -ggdb -O0 $(CFLAGS) JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 $(CFLAGS)
JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++14 $(CXXFLAGS) JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++17 $(CXXFLAGS)
JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -lGL -ldl -lpthread -lrt -lfluidsynth $(LDFLAGS) JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -ldl -lpthread -lrt -lfluidsynth $(LDFLAGS)
CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR) CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR)
endif endif
@ -65,31 +60,23 @@ ifeq ($(CONFIG),Release)
TARGET_ARCH := -march=native TARGET_ARCH := -march=native
endif endif
JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DNDEBUG=1 -DJUCER_LINUX_MAKE_7346DA2A=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 $(shell pkg-config --cflags alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -pthread -I../../JuceLibraryCode -I/opt/JUCE/modules -I../../include -I../../modules $(CPPFLAGS) JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DNDEBUG=1 -DJUCER_LINUX_MAKE_7346DA2A=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 $(shell pkg-config --cflags alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -pthread -I../../JuceLibraryCode -I$(HOME)/JUCE/modules -I../../include -I../../modules $(CPPFLAGS)
JUCE_CPPFLAGS_VST := -DJucePlugin_Build_VST=1 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 JUCE_CPPFLAGS_STANDALONE_PLUGIN := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0
JUCE_CFLAGS_VST := -fPIC -fvisibility=hidden
JUCE_LDFLAGS_VST := -shared -Wl,--no-undefined
JUCE_TARGET_VST := juicysfplugin.so
JUCE_CPPFLAGS_STANDALONE_PLUGIN := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1
JUCE_TARGET_STANDALONE_PLUGIN := juicysfplugin JUCE_TARGET_STANDALONE_PLUGIN := juicysfplugin
JUCE_CPPFLAGS_SHARED_CODE := -DJucePlugin_Build_VST=1 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJUCE_SHARED_CODE=1 JUCE_CPPFLAGS_SHARED_CODE := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0 -DJUCE_SHARED_CODE=1
JUCE_TARGET_SHARED_CODE := juicysfplugin.a JUCE_TARGET_SHARED_CODE := juicysfplugin.a
JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -fPIC -O3 $(CFLAGS) JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -O3 $(CFLAGS)
JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++14 $(CXXFLAGS) JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++17 $(CXXFLAGS)
JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -fvisibility=hidden -lGL -ldl -lpthread -lrt -lfluidsynth $(LDFLAGS) JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -fvisibility=hidden -ldl -lpthread -lrt -lfluidsynth $(LDFLAGS)
CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR) CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR)
endif endif
OBJECTS_ALL := \ OBJECTS_ALL := \
OBJECTS_VST := \
$(JUCE_OBJDIR)/include_juce_audio_plugin_client_VST2_dd551e08.o \
OBJECTS_STANDALONE_PLUGIN := \ OBJECTS_STANDALONE_PLUGIN := \
$(JUCE_OBJDIR)/include_juce_audio_plugin_client_Standalone_1a871192.o \ $(JUCE_OBJDIR)/include_juce_audio_plugin_client_Standalone_1a871192.o \
@ -114,49 +101,37 @@ OBJECTS_SHARED_CODE := \
$(JUCE_OBJDIR)/include_juce_audio_processors_10c03666.o \ $(JUCE_OBJDIR)/include_juce_audio_processors_10c03666.o \
$(JUCE_OBJDIR)/include_juce_audio_utils_9f9fb2d6.o \ $(JUCE_OBJDIR)/include_juce_audio_utils_9f9fb2d6.o \
$(JUCE_OBJDIR)/include_juce_core_f26d17db.o \ $(JUCE_OBJDIR)/include_juce_core_f26d17db.o \
$(JUCE_OBJDIR)/include_juce_cryptography_8cb807a8.o \
$(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o \ $(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o \
$(JUCE_OBJDIR)/include_juce_events_fd7d695.o \ $(JUCE_OBJDIR)/include_juce_events_fd7d695.o \
$(JUCE_OBJDIR)/include_juce_graphics_f817e147.o \ $(JUCE_OBJDIR)/include_juce_graphics_f817e147.o \
$(JUCE_OBJDIR)/include_juce_gui_basics_e3f79785.o \ $(JUCE_OBJDIR)/include_juce_gui_basics_e3f79785.o \
$(JUCE_OBJDIR)/include_juce_gui_extra_6dee1c1a.o \ $(JUCE_OBJDIR)/include_juce_gui_extra_6dee1c1a.o \
$(JUCE_OBJDIR)/include_juce_opengl_a8a032b.o \
$(JUCE_OBJDIR)/include_juce_video_be78589.o \
.PHONY: clean all VST Standalone .PHONY: clean all strip Standalone
all : VST Standalone all : Standalone
VST : $(JUCE_OUTDIR)/$(JUCE_TARGET_VST)
Standalone : $(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN) Standalone : $(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN)
$(JUCE_OUTDIR)/$(JUCE_TARGET_VST) : check-pkg-config $(OBJECTS_VST) $(RESOURCES) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN) : $(OBJECTS_STANDALONE_PLUGIN) $(RESOURCES) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE)
@echo Linking "juicysfplugin - VST" @command -v pkg-config >/dev/null 2>&1 || { echo >&2 "pkg-config not installed. Please, install it."; exit 1; }
-$(V_AT)mkdir -p $(JUCE_BINDIR) @pkg-config --print-errors alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl
-$(V_AT)mkdir -p $(JUCE_LIBDIR)
-$(V_AT)mkdir -p $(JUCE_OUTDIR)
$(V_AT)$(CXX) -o $(JUCE_OUTDIR)/$(JUCE_TARGET_VST) $(OBJECTS_VST) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(JUCE_LDFLAGS) $(JUCE_LDFLAGS_VST) $(RESOURCES) $(TARGET_ARCH)
$(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN) : check-pkg-config $(OBJECTS_STANDALONE_PLUGIN) $(RESOURCES) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE)
@echo Linking "juicysfplugin - Standalone Plugin" @echo Linking "juicysfplugin - Standalone Plugin"
-$(V_AT)mkdir -p $(JUCE_BINDIR) -$(V_AT)mkdir -p $(JUCE_BINDIR)
-$(V_AT)mkdir -p $(JUCE_LIBDIR) -$(V_AT)mkdir -p $(JUCE_LIBDIR)
-$(V_AT)mkdir -p $(JUCE_OUTDIR) -$(V_AT)mkdir -p $(JUCE_OUTDIR)
$(V_AT)$(CXX) -o $(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN) $(OBJECTS_STANDALONE_PLUGIN) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(JUCE_LDFLAGS) $(JUCE_LDFLAGS_STANDALONE_PLUGIN) $(RESOURCES) $(TARGET_ARCH) $(V_AT)$(CXX) -o $(JUCE_OUTDIR)/$(JUCE_TARGET_STANDALONE_PLUGIN) $(OBJECTS_STANDALONE_PLUGIN) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(JUCE_LDFLAGS) $(JUCE_LDFLAGS_STANDALONE_PLUGIN) $(RESOURCES) $(TARGET_ARCH)
$(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) : check-pkg-config $(OBJECTS_SHARED_CODE) $(RESOURCES) $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) : $(OBJECTS_SHARED_CODE) $(RESOURCES)
@command -v pkg-config >/dev/null 2>&1 || { echo >&2 "pkg-config not installed. Please, install it."; exit 1; }
@pkg-config --print-errors alsa freetype2 x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 libcurl
@echo Linking "juicysfplugin - Shared Code" @echo Linking "juicysfplugin - Shared Code"
-$(V_AT)mkdir -p $(JUCE_BINDIR) -$(V_AT)mkdir -p $(JUCE_BINDIR)
-$(V_AT)mkdir -p $(JUCE_LIBDIR) -$(V_AT)mkdir -p $(JUCE_LIBDIR)
-$(V_AT)mkdir -p $(JUCE_OUTDIR) -$(V_AT)mkdir -p $(JUCE_OUTDIR)
$(V_AT)$(AR) -rcs $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(OBJECTS_SHARED_CODE) $(V_AT)$(AR) -rcs $(JUCE_OUTDIR)/$(JUCE_TARGET_SHARED_CODE) $(OBJECTS_SHARED_CODE)
$(JUCE_OBJDIR)/include_juce_audio_plugin_client_VST2_dd551e08.o: ../../JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_audio_plugin_client_VST2.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_VST) $(JUCE_CFLAGS_VST) -o "$@" -c "$<"
$(JUCE_OBJDIR)/include_juce_audio_plugin_client_Standalone_1a871192.o: ../../JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp $(JUCE_OBJDIR)/include_juce_audio_plugin_client_Standalone_1a871192.o: ../../JuceLibraryCode/include_juce_audio_plugin_client_Standalone.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR) -$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_audio_plugin_client_Standalone.cpp" @echo "Compiling include_juce_audio_plugin_client_Standalone.cpp"
@ -262,11 +237,6 @@ $(JUCE_OBJDIR)/include_juce_core_f26d17db.o: ../../JuceLibraryCode/include_juce_
@echo "Compiling include_juce_core.cpp" @echo "Compiling include_juce_core.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<" $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<"
$(JUCE_OBJDIR)/include_juce_cryptography_8cb807a8.o: ../../JuceLibraryCode/include_juce_cryptography.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_cryptography.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<"
$(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o: ../../JuceLibraryCode/include_juce_data_structures.cpp $(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o: ../../JuceLibraryCode/include_juce_data_structures.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR) -$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_data_structures.cpp" @echo "Compiling include_juce_data_structures.cpp"
@ -292,20 +262,6 @@ $(JUCE_OBJDIR)/include_juce_gui_extra_6dee1c1a.o: ../../JuceLibraryCode/include_
@echo "Compiling include_juce_gui_extra.cpp" @echo "Compiling include_juce_gui_extra.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<" $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<"
$(JUCE_OBJDIR)/include_juce_opengl_a8a032b.o: ../../JuceLibraryCode/include_juce_opengl.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_opengl.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<"
$(JUCE_OBJDIR)/include_juce_video_be78589.o: ../../JuceLibraryCode/include_juce_video.cpp
-$(V_AT)mkdir -p $(JUCE_OBJDIR)
@echo "Compiling include_juce_video.cpp"
$(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_SHARED_CODE) $(JUCE_CFLAGS_SHARED_CODE) -o "$@" -c "$<"
check-pkg-config:
@command -v pkg-config >/dev/null 2>&1 || { echo >&2 "pkg-config not installed. Please, install it."; exit 1; }
@pkg-config --print-errors alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0
clean: clean:
@echo Cleaning juicysfplugin @echo Cleaning juicysfplugin
$(V_AT)$(CLEANCMD) $(V_AT)$(CLEANCMD)
@ -314,6 +270,5 @@ strip:
@echo Stripping juicysfplugin @echo Stripping juicysfplugin
-$(V_AT)$(STRIP) --strip-unneeded $(JUCE_OUTDIR)/$(TARGET) -$(V_AT)$(STRIP) --strip-unneeded $(JUCE_OUTDIR)/$(TARGET)
-include $(OBJECTS_VST:%.o=%.d)
-include $(OBJECTS_STANDALONE_PLUGIN:%.o=%.d) -include $(OBJECTS_STANDALONE_PLUGIN:%.o=%.d)
-include $(OBJECTS_SHARED_CODE:%.o=%.d) -include $(OBJECTS_SHARED_CODE:%.o=%.d)

View File

@ -33,7 +33,7 @@
<key>description</key> <key>description</key>
<string>Audio plugin to play soundfonts</string> <string>Audio plugin to play soundfonts</string>
<key>factoryFunction</key> <key>factoryFunction</key>
<string>JUCEProjectAUFactory</string> <string>juicysfpluginAUFactory</string>
<key>manufacturer</key> <key>manufacturer</key>
<string>Blbs</string> <string>Blbs</string>
<key>type</key> <key>type</key>
@ -42,6 +42,13 @@
<string>Jspf</string> <string>Jspf</string>
<key>version</key> <key>version</key>
<integer>65536</integer> <integer>65536</integer>
<key>resourceUsage</key>
<dict>
<key>network.client</key>
<true/>
<key>temporary-exception.files.all.read-write</key>
<true/>
</dict>
</dict> </dict>
</array> </array>
</dict> </dict>

File diff suppressed because it is too large Load Diff

View File

@ -1,69 +1,38 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 15 # Visual Studio 2017
VisualStudioVersion = 15.0.27703.2026
MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin - Standalone Plugin", "juicysfplugin_StandalonePlugin.vcxproj", "{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin_StandalonePlugin", "juicysfplugin_StandalonePlugin.vcxproj", "{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{81231CE9-96E4-09DA-53C7-714106FA6BD5} = {81231CE9-96E4-09DA-53C7-714106FA6BD5} {81231CE9-96E4-09DA-53C7-714106FA6BD5} = {81231CE9-96E4-09DA-53C7-714106FA6BD5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin_VST", "juicysfplugin_VST.vcxproj", "{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin - VST3", "juicysfplugin_VST3.vcxproj", "{70A2C49A-5DF9-60C9-981B-D030ADE816BF}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{81231CE9-96E4-09DA-53C7-714106FA6BD5} = {81231CE9-96E4-09DA-53C7-714106FA6BD5} {81231CE9-96E4-09DA-53C7-714106FA6BD5} = {81231CE9-96E4-09DA-53C7-714106FA6BD5}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin_VST3", "juicysfplugin_VST3.vcxproj", "{70A2C49A-5DF9-60C9-981B-D030ADE816BF}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin - Shared Code", "juicysfplugin_SharedCode.vcxproj", "{81231CE9-96E4-09DA-53C7-714106FA6BD5}"
ProjectSection(ProjectDependencies) = postProject
{81231CE9-96E4-09DA-53C7-714106FA6BD5} = {81231CE9-96E4-09DA-53C7-714106FA6BD5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "juicysfplugin_SharedCode", "juicysfplugin_SharedCode.vcxproj", "{81231CE9-96E4-09DA-53C7-714106FA6BD5}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "..\Setup\Setup.vdproj", "{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Debug|x64.ActiveCfg = Debug|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Debug|x64.Build.0 = Debug|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Debug|x86.ActiveCfg = Debug|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Release|x64.ActiveCfg = Release|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Release|x64.Build.0 = Release|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Release|x86.ActiveCfg = Release|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Debug|x64.ActiveCfg = Debug|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Debug|x64.Build.0 = Debug|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Debug|x86.ActiveCfg = Debug|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Release|x64.ActiveCfg = Release|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Release|x64.Build.0 = Release|x64
{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}.Release|x86.ActiveCfg = Release|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Debug|x64.ActiveCfg = Debug|x64 {70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Debug|x64.ActiveCfg = Debug|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Debug|x64.Build.0 = Debug|x64 {70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Debug|x64.Build.0 = Debug|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Debug|x86.ActiveCfg = Debug|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Release|x64.ActiveCfg = Release|x64 {70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Release|x64.ActiveCfg = Release|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Release|x64.Build.0 = Release|x64 {70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Release|x64.Build.0 = Release|x64
{70A2C49A-5DF9-60C9-981B-D030ADE816BF}.Release|x86.ActiveCfg = Release|x64 {7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Debug|x64.ActiveCfg = Debug|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Debug|x64.Build.0 = Debug|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Release|x64.ActiveCfg = Release|x64
{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}.Release|x64.Build.0 = Release|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Debug|x64.ActiveCfg = Debug|x64 {81231CE9-96E4-09DA-53C7-714106FA6BD5}.Debug|x64.ActiveCfg = Debug|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Debug|x64.Build.0 = Debug|x64 {81231CE9-96E4-09DA-53C7-714106FA6BD5}.Debug|x64.Build.0 = Debug|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Debug|x86.ActiveCfg = Debug|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Release|x64.ActiveCfg = Release|x64 {81231CE9-96E4-09DA-53C7-714106FA6BD5}.Release|x64.ActiveCfg = Release|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Release|x64.Build.0 = Release|x64 {81231CE9-96E4-09DA-53C7-714106FA6BD5}.Release|x64.Build.0 = Release|x64
{81231CE9-96E4-09DA-53C7-714106FA6BD5}.Release|x86.ActiveCfg = Release|x64
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Debug|x64.ActiveCfg = Debug
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Debug|x86.ActiveCfg = Debug
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Debug|x86.Build.0 = Debug
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Release|x64.ActiveCfg = Release
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Release|x86.ActiveCfg = Release
{1D3DFF82-3C97-4736-BB8D-2B4B0D36B48F}.Release|x86.Build.0 = Release
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E715E8C3-CBEF-440A-BE03-3B61083ABE6B}
EndGlobalSection
EndGlobal EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build"
ToolsVersion="15.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
@ -12,35 +15,31 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}</ProjectGuid> <ProjectGuid>{7C3AB9BE-365A-0EF7-AA2A-5B044FE497E5}</ProjectGuid>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
<ImportGroup Label="ExtensionSettings" /> <ImportGroup Label="ExtensionSettings"/>
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform"/>
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros">
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<TargetExt>.exe</TargetExt> <TargetExt>.exe</TargetExt>
@ -54,8 +53,6 @@
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath> <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl> <Midl>
@ -63,23 +60,23 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=1;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -110,22 +107,22 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Full</Optimization> <Optimization>Full</Optimization>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=1;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -153,17 +150,12 @@
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_Standalone.cpp" /> <ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_Standalone.cpp"/>
</ItemGroup> </ItemGroup>
<ItemGroup/>
<ItemGroup> <ItemGroup>
<Content Include="lib\*.dll"> <ResourceCompile Include=".\resources.rc"/>
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ResourceCompile Include=".\resources.rc" /> <ImportGroup Label="ExtensionTargets"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="JUCE Library Code"> <Filter Include="JUCE Library Code">
@ -10,23 +11,7 @@
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup/>
<None Include="lib\libFLAC-8.dll" />
<None Include="lib\libfluidsynth-1.dll" />
<None Include="lib\libglib-2.0-0.dll" />
<None Include="lib\libiconv-2.dll" />
<None Include="lib\libintl-8.dll" />
<None Include="lib\libogg-0.dll" />
<None Include="lib\libpcre-1.dll" />
<None Include="lib\libportaudio-2.dll" />
<None Include="lib\libreadline7.dll" />
<None Include="lib\libsndfile-1.dll" />
<None Include="lib\libspeex-1.dll" />
<None Include="lib\libtermcap-0.dll" />
<None Include="lib\libvorbis-0.dll" />
<None Include="lib\libvorbisenc-2.dll" />
<None Include="lib\libwinpthread-1.dll" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include=".\resources.rc"> <ResourceCompile Include=".\resources.rc">
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build"
ToolsVersion="15.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
@ -12,35 +15,31 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}</ProjectGuid> <ProjectGuid>{F47A6C45-0C65-BB36-F74E-BCCDF23F5ECA}</ProjectGuid>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
<ImportGroup Label="ExtensionSettings" /> <ImportGroup Label="ExtensionSettings"/>
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform"/>
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros">
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<TargetExt>.dll</TargetExt> <TargetExt>.dll</TargetExt>
@ -54,8 +53,6 @@
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath> <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl> <Midl>
@ -63,23 +60,23 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=1;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=1;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -110,22 +107,22 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Full</Optimization> <Optimization>Full</Optimization>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=1;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=1;JucePlugin_Build_VST3=0;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -153,17 +150,12 @@
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_VST2.cpp" /> <ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_VST2.cpp"/>
</ItemGroup> </ItemGroup>
<ItemGroup/>
<ItemGroup> <ItemGroup>
<Content Include="lib\*.dll"> <ResourceCompile Include=".\resources.rc"/>
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ResourceCompile Include=".\resources.rc" /> <ImportGroup Label="ExtensionTargets"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="JUCE Library Code"> <Filter Include="JUCE Library Code">
@ -10,23 +11,7 @@
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup/>
<None Include="lib\libFLAC-8.dll" />
<None Include="lib\libfluidsynth-1.dll" />
<None Include="lib\libglib-2.0-0.dll" />
<None Include="lib\libiconv-2.dll" />
<None Include="lib\libintl-8.dll" />
<None Include="lib\libogg-0.dll" />
<None Include="lib\libpcre-1.dll" />
<None Include="lib\libportaudio-2.dll" />
<None Include="lib\libreadline7.dll" />
<None Include="lib\libsndfile-1.dll" />
<None Include="lib\libspeex-1.dll" />
<None Include="lib\libtermcap-0.dll" />
<None Include="lib\libvorbis-0.dll" />
<None Include="lib\libvorbisenc-2.dll" />
<None Include="lib\libwinpthread-1.dll" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include=".\resources.rc"> <ResourceCompile Include=".\resources.rc">
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build"
ToolsVersion="15.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
@ -12,35 +15,31 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{70A2C49A-5DF9-60C9-981B-D030ADE816BF}</ProjectGuid> <ProjectGuid>{70A2C49A-5DF9-60C9-981B-D030ADE816BF}</ProjectGuid>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
<ImportGroup Label="ExtensionSettings" /> <ImportGroup Label="ExtensionSettings"/>
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label="LocalAppDataPlatform"/>
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros">
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<TargetExt>.vst3</TargetExt> <TargetExt>.vst3</TargetExt>
@ -54,8 +53,6 @@
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">juicysfplugin</TargetName>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath> <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);import_lib;$(SolutionDir)$(Platform)\$(Configuration)\Shared Code</LibraryPath>
<PlatformToolset>v141</PlatformToolset>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl> <Midl>
@ -63,23 +60,23 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=1;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;DEBUG;_DEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=1;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -110,22 +107,22 @@
<MkTypLibCompatible>true</MkTypLibCompatible> <MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment> <TargetEnvironment>Win32</TargetEnvironment>
<HeaderFileName /> <HeaderFileName/>
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Full</Optimization> <Optimization>Full</Optimization>
<AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\SDKs\VST_SDK\VST3_SDK;..\..\JuceLibraryCode;C:\JUCE\modules;..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=1;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;JUCER_VS2017_78A5024=1;JUCE_APP_VERSION=1.0.0;JUCE_APP_VERSION_HEX=0x10000;JucePlugin_Build_VST=0;JucePlugin_Build_VST3=1;JucePlugin_Build_AU=0;JucePlugin_Build_AUv3=0;JucePlugin_Build_RTAS=0;JucePlugin_Build_AAX=0;JucePlugin_Build_Standalone=0;JucePlugin_Build_Unity=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader /> <PrecompiledHeader/>
<AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)\</AssemblerListingLocation>
<ObjectFileName>$(IntDir)\</ObjectFileName> <ObjectFileName>$(IntDir)\</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName> <ProgramDataBaseFileName>$(IntDir)\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard> <LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -153,17 +150,12 @@
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_VST3.cpp" /> <ClCompile Include="..\..\JuceLibraryCode\include_juce_audio_plugin_client_VST3.cpp"/>
</ItemGroup> </ItemGroup>
<ItemGroup/>
<ItemGroup> <ItemGroup>
<Content Include="lib\*.dll"> <ResourceCompile Include=".\resources.rc"/>
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ResourceCompile Include=".\resources.rc" /> <ImportGroup Label="ExtensionTargets"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="JUCE Library Code"> <Filter Include="JUCE Library Code">
@ -10,23 +11,7 @@
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup/>
<None Include="lib\libFLAC-8.dll" />
<None Include="lib\libfluidsynth-1.dll" />
<None Include="lib\libglib-2.0-0.dll" />
<None Include="lib\libiconv-2.dll" />
<None Include="lib\libintl-8.dll" />
<None Include="lib\libogg-0.dll" />
<None Include="lib\libpcre-1.dll" />
<None Include="lib\libportaudio-2.dll" />
<None Include="lib\libreadline7.dll" />
<None Include="lib\libsndfile-1.dll" />
<None Include="lib\libspeex-1.dll" />
<None Include="lib\libtermcap-0.dll" />
<None Include="lib\libvorbis-0.dll" />
<None Include="lib\libvorbisenc-2.dll" />
<None Include="lib\libwinpthread-1.dll" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include=".\resources.rc"> <ResourceCompile Include=".\resources.rc">
<Filter>JUCE Library Code</Filter> <Filter>JUCE Library Code</Filter>

View File

@ -55,20 +55,21 @@
#define JUCE_MODULE_AVAILABLE_juce_audio_processors 1 #define JUCE_MODULE_AVAILABLE_juce_audio_processors 1
#define JUCE_MODULE_AVAILABLE_juce_audio_utils 1 #define JUCE_MODULE_AVAILABLE_juce_audio_utils 1
#define JUCE_MODULE_AVAILABLE_juce_core 1 #define JUCE_MODULE_AVAILABLE_juce_core 1
#define JUCE_MODULE_AVAILABLE_juce_cryptography 1
#define JUCE_MODULE_AVAILABLE_juce_data_structures 1 #define JUCE_MODULE_AVAILABLE_juce_data_structures 1
#define JUCE_MODULE_AVAILABLE_juce_events 1 #define JUCE_MODULE_AVAILABLE_juce_events 1
#define JUCE_MODULE_AVAILABLE_juce_graphics 1 #define JUCE_MODULE_AVAILABLE_juce_graphics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_basics 1 #define JUCE_MODULE_AVAILABLE_juce_gui_basics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1 #define JUCE_MODULE_AVAILABLE_juce_gui_extra 1
#define JUCE_MODULE_AVAILABLE_juce_opengl 1
#define JUCE_MODULE_AVAILABLE_juce_video 1
#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1 #define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1
//============================================================================== //==============================================================================
// juce_audio_devices flags: // juce_audio_devices flags:
#ifndef JUCE_USE_WINRT_MIDI
//#define JUCE_USE_WINRT_MIDI 0
#endif
#ifndef JUCE_ASIO #ifndef JUCE_ASIO
//#define JUCE_ASIO 0 //#define JUCE_ASIO 0
#endif #endif
@ -105,10 +106,6 @@
//#define JUCE_USE_ANDROID_OPENSLES 0 //#define JUCE_USE_ANDROID_OPENSLES 0
#endif #endif
#ifndef JUCE_USE_WINRT_MIDI
//#define JUCE_USE_WINRT_MIDI 0
#endif
#ifndef JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS #ifndef JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS
//#define JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 0 //#define JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 0
#endif #endif
@ -139,6 +136,10 @@
//============================================================================== //==============================================================================
// juce_audio_plugin_client flags: // juce_audio_plugin_client flags:
#ifndef JUCE_VST3_CAN_REPLACE_VST2
//#define JUCE_VST3_CAN_REPLACE_VST2 1
#endif
#ifndef JUCE_FORCE_USE_LEGACY_PARAM_IDS #ifndef JUCE_FORCE_USE_LEGACY_PARAM_IDS
//#define JUCE_FORCE_USE_LEGACY_PARAM_IDS 0 //#define JUCE_FORCE_USE_LEGACY_PARAM_IDS 0
#endif #endif
@ -212,6 +213,10 @@
//#define JUCE_USE_CURL 0 //#define JUCE_USE_CURL 0
#endif #endif
#ifndef JUCE_LOAD_CURL_SYMBOLS_LAZILY
//#define JUCE_LOAD_CURL_SYMBOLS_LAZILY 0
#endif
#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS
//#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1
#endif #endif
@ -220,6 +225,10 @@
//#define JUCE_ALLOW_STATIC_NULL_VARIABLES 1 //#define JUCE_ALLOW_STATIC_NULL_VARIABLES 1
#endif #endif
#ifndef JUCE_STRICT_REFCOUNTEDPOINTER
//#define JUCE_STRICT_REFCOUNTEDPOINTER 0
#endif
//============================================================================== //==============================================================================
// juce_events flags: // juce_events flags:
@ -238,6 +247,10 @@
//#define JUCE_USE_DIRECTWRITE 1 //#define JUCE_USE_DIRECTWRITE 1
#endif #endif
#ifndef JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING
//#define JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 0
#endif
//============================================================================== //==============================================================================
// juce_gui_basics flags: // juce_gui_basics flags:
@ -265,6 +278,10 @@
//#define JUCE_USE_XCURSOR 1 //#define JUCE_USE_XCURSOR 1
#endif #endif
#ifndef JUCE_WIN_PER_MONITOR_DPI_AWARE
//#define JUCE_WIN_PER_MONITOR_DPI_AWARE 1
#endif
//============================================================================== //==============================================================================
// juce_gui_extra flags: // juce_gui_extra flags:
@ -276,32 +293,17 @@
//#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0 //#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0
#endif #endif
//==============================================================================
// juce_video flags:
#ifndef JUCE_USE_CAMERA
//#define JUCE_USE_CAMERA 0
#endif
//==============================================================================
#ifndef JUCE_STANDALONE_APPLICATION
#if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone)
#define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone
#else
#define JUCE_STANDALONE_APPLICATION 0
#endif
#endif
//============================================================================== //==============================================================================
// Audio plugin settings.. // Audio plugin settings..
#ifndef JucePlugin_Build_VST #ifndef JucePlugin_Build_VST
#define JucePlugin_Build_VST 1 #define JucePlugin_Build_VST 0
#endif #endif
#ifndef JucePlugin_Build_VST3 #ifndef JucePlugin_Build_VST3
#define JucePlugin_Build_VST3 1 #define JucePlugin_Build_VST3 1
#endif #endif
#ifndef JucePlugin_Build_AU #ifndef JucePlugin_Build_AU
#define JucePlugin_Build_AU 0 #define JucePlugin_Build_AU 1
#endif #endif
#ifndef JucePlugin_Build_AUv3 #ifndef JucePlugin_Build_AUv3
#define JucePlugin_Build_AUv3 0 #define JucePlugin_Build_AUv3 0
@ -315,6 +317,9 @@
#ifndef JucePlugin_Build_Standalone #ifndef JucePlugin_Build_Standalone
#define JucePlugin_Build_Standalone 1 #define JucePlugin_Build_Standalone 1
#endif #endif
#ifndef JucePlugin_Build_Unity
#define JucePlugin_Build_Unity 0
#endif
#ifndef JucePlugin_Enable_IAA #ifndef JucePlugin_Enable_IAA
#define JucePlugin_Enable_IAA 0 #define JucePlugin_Enable_IAA 0
#endif #endif
@ -406,7 +411,7 @@
#define JucePlugin_RTASDisableMultiMono 0 #define JucePlugin_RTASDisableMultiMono 0
#endif #endif
#ifndef JucePlugin_AAXIdentifier #ifndef JucePlugin_AAXIdentifier
#define JucePlugin_AAXIdentifier com.yourcompany.juicysfplugin #define JucePlugin_AAXIdentifier com.Birchlabs.juicysfplugin
#endif #endif
#ifndef JucePlugin_AAXManufacturerCode #ifndef JucePlugin_AAXManufacturerCode
#define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode #define JucePlugin_AAXManufacturerCode JucePlugin_ManufacturerCode
@ -432,3 +437,18 @@
#ifndef JucePlugin_IAAName #ifndef JucePlugin_IAAName
#define JucePlugin_IAAName "birchlabs: Juicy SF" #define JucePlugin_IAAName "birchlabs: Juicy SF"
#endif #endif
#ifndef JucePlugin_VSTNumMidiInputs
#define JucePlugin_VSTNumMidiInputs 16
#endif
#ifndef JucePlugin_VSTNumMidiOutputs
#define JucePlugin_VSTNumMidiOutputs 16
#endif
//==============================================================================
#ifndef JUCE_STANDALONE_APPLICATION
#if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone)
#define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone
#else
#define JUCE_STANDALONE_APPLICATION 0
#endif
#endif

View File

@ -21,14 +21,11 @@
#include <juce_audio_processors/juce_audio_processors.h> #include <juce_audio_processors/juce_audio_processors.h>
#include <juce_audio_utils/juce_audio_utils.h> #include <juce_audio_utils/juce_audio_utils.h>
#include <juce_core/juce_core.h> #include <juce_core/juce_core.h>
#include <juce_cryptography/juce_cryptography.h>
#include <juce_data_structures/juce_data_structures.h> #include <juce_data_structures/juce_data_structures.h>
#include <juce_events/juce_events.h> #include <juce_events/juce_events.h>
#include <juce_graphics/juce_graphics.h> #include <juce_graphics/juce_graphics.h>
#include <juce_gui_basics/juce_gui_basics.h> #include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h> #include <juce_gui_extra/juce_gui_extra.h>
#include <juce_opengl/juce_opengl.h>
#include <juce_video/juce_video.h>
#if ! DONT_SET_USING_JUCE_NAMESPACE #if ! DONT_SET_USING_JUCE_NAMESPACE
@ -41,6 +38,7 @@
namespace ProjectInfo namespace ProjectInfo
{ {
const char* const projectName = "juicysfplugin"; const char* const projectName = "juicysfplugin";
const char* const companyName = "Birchlabs";
const char* const versionString = "1.0.0"; const char* const versionString = "1.0.0";
const int versionNumber = 0x10000; const int versionNumber = 0x10000;
} }

View File

@ -6,4 +6,4 @@
*/ */
#include "AppConfig.h" #include "AppConfig.h"
#include <juce_cryptography/juce_cryptography.cpp> #include <juce_audio_plugin_client/juce_audio_plugin_client_Unity.cpp>

View File

@ -1,9 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_cryptography/juce_cryptography.mm>

View File

@ -1,9 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_opengl/juce_opengl.cpp>

View File

@ -1,9 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_opengl/juce_opengl.mm>

View File

@ -1,9 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_video/juce_video.cpp>

View File

@ -1,9 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_video/juce_video.mm>

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT name="juicysfplugin" projectType="audioplug" buildStandalone="1" <JUCERPROJECT name="juicysfplugin" projectType="audioplug" buildStandalone="1"
jucerVersion="5.3.2" buildAUv3="0" buildVST3="1" pluginIsSynth="1" jucerVersion="5.4.3" buildAUv3="0" buildVST3="1" pluginIsSynth="1"
pluginWantsMidiIn="1" pluginEditorRequiresKeys="1" companyName="Birchlabs" pluginWantsMidiIn="1" pluginEditorRequiresKeys="1" companyName="Birchlabs"
companyWebsite="https://birchlabs.co.uk" bundleIdentifier="uk.co.birchlabs.juicysfplugin" companyWebsite="https://birchlabs.co.uk" bundleIdentifier="uk.co.birchlabs.juicysfplugin"
pluginManufacturer="birchlabs" pluginCode="Jspf" pluginManufacturerCode="Blbs" pluginManufacturer="birchlabs" pluginCode="Jspf" pluginManufacturerCode="Blbs"
pluginName="Juicy SF" pluginDesc="Audio plugin to play soundfonts" pluginName="Juicy SF" pluginDesc="Audio plugin to play soundfonts"
id="ptvVfg" pluginFormats="buildVST,buildVST3,buildStandalone" id="ptvVfg" pluginFormats="buildAU,buildStandalone,buildVST3"
pluginCharacteristicsValue="pluginIsSynth,pluginWantsMidiIn,pluginEditorRequiresKeys" pluginCharacteristicsValue="pluginIsSynth,pluginWantsMidiIn,pluginEditorRequiresKeys"
buildVST="1" buildAU="0" buildRTAS="0" buildAAX="0" enableIAA="0"> buildVST="0" buildAU="1" buildRTAS="0" buildAAX="0" enableIAA="0"
projectLineFeed="&#10;" cppLanguageStandard="17">
<MAINGROUP id="rCqBG3" name="juicysfplugin"> <MAINGROUP id="rCqBG3" name="juicysfplugin">
<GROUP id="{ED7E27E3-B67D-383C-F819-F05289E08A33}" name="Source"> <GROUP id="{ED7E27E3-B67D-383C-F819-F05289E08A33}" name="Source">
<FILE id="EiukEj" name="BankAndPreset.cpp" compile="1" resource="0" <FILE id="EiukEj" name="BankAndPreset.cpp" compile="1" resource="0"
@ -62,8 +63,7 @@
</GROUP> </GROUP>
</MAINGROUP> </MAINGROUP>
<EXPORTFORMATS> <EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vst3Folder="" externalLibraries="fluidsynth" <XCODE_MAC targetFolder="Builds/MacOSX" externalLibraries="fluidsynth" extraLinkerFlags="-Llib">
extraLinkerFlags="-Llib">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" headerPath="../../include&#10;../../modules"/> <CONFIGURATION isDebug="1" name="Debug" headerPath="../../include&#10;../../modules"/>
<CONFIGURATION isDebug="0" name="Release" headerPath="../../include&#10;../../modules"/> <CONFIGURATION isDebug="0" name="Release" headerPath="../../include&#10;../../modules"/>
@ -74,16 +74,13 @@
<MODULEPATH id="juce_graphics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_graphics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_data_structures" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_gui_basics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_video" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_basics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_basics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_devices" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_processors" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_plugin_client" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_utils" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_utils" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
</MODULEPATHS> </MODULEPATHS>
</XCODE_MAC> </XCODE_MAC>
<LINUX_MAKE targetFolder="Builds/Linux" externalLibraries="fluidsynth"> <LINUX_MAKE targetFolder="Builds/Linux" externalLibraries="fluidsynth">
@ -92,64 +89,55 @@
<CONFIGURATION isDebug="0" name="Release" headerPath="../../include&#10;../../modules"/> <CONFIGURATION isDebug="0" name="Release" headerPath="../../include&#10;../../modules"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_video" path="../../juce"/>
<MODULEPATH id="juce_opengl" path="../../juce"/>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/> <MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/> <MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/> <MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/> <MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_cryptography" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/> <MODULEPATH id="juce_core" path="../../juce"/>
<MODULEPATH id="juce_audio_utils" path="../../juce"/> <MODULEPATH id="juce_audio_utils" path="../../juce"/>
<MODULEPATH id="juce_audio_processors" path="../../juce"/> <MODULEPATH id="juce_audio_processors" path="../../juce"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../juce"/> <MODULEPATH id="juce_audio_plugin_client" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../juce"/>
<MODULEPATH id="juce_audio_devices" path="../../juce"/> <MODULEPATH id="juce_audio_devices" path="../../juce"/>
<MODULEPATH id="juce_audio_basics" path="../../juce"/> <MODULEPATH id="juce_audio_basics" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
</MODULEPATHS> </MODULEPATHS>
</LINUX_MAKE> </LINUX_MAKE>
<CLION targetFolder="Builds/CLion" clionXcodeEnabled="1"> <CLION targetFolder="Builds/CLion" clionXcodeEnabled="1" clionMakefileEnabled="1">
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_core" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_core" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_events" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_graphics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_data_structures" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_gui_basics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_video" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_basics" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_basics" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_devices" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_processors" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_plugin_client" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_utils" path="../../../../Applications/JUCE/modules"/> <MODULEPATH id="juce_audio_utils" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
</MODULEPATHS> </MODULEPATHS>
</CLION> </CLION>
<VS2017 targetFolder="Builds/VisualStudio2017" vst3Folder="" windowsTargetPlatformVersion="10.0.17134.0" <VS2017 targetFolder="Builds/VisualStudio2017" windowsTargetPlatformVersion="10.0.17134.0"
externalLibraries="libfluidsynth.dll.a"> externalLibraries="libfluidsynth.dll.a">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" libraryPath="import_lib" headerPath="..\..\include"/> <CONFIGURATION isDebug="1" name="Debug" libraryPath="import_lib" headerPath="..\..\include"/>
<CONFIGURATION isDebug="0" name="Release" libraryPath="import_lib" headerPath="..\..\include"/> <CONFIGURATION isDebug="0" name="Release" libraryPath="import_lib" headerPath="..\..\include"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_video" path="../../juce"/>
<MODULEPATH id="juce_opengl" path="../../juce"/>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/> <MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/> <MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/> <MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/> <MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_cryptography" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/> <MODULEPATH id="juce_core" path="../../juce"/>
<MODULEPATH id="juce_audio_utils" path="../../juce"/> <MODULEPATH id="juce_audio_utils" path="../../juce"/>
<MODULEPATH id="juce_audio_processors" path="../../juce"/> <MODULEPATH id="juce_audio_processors" path="../../juce"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../juce"/> <MODULEPATH id="juce_audio_plugin_client" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../juce"/>
<MODULEPATH id="juce_audio_devices" path="../../juce"/> <MODULEPATH id="juce_audio_devices" path="../../juce"/>
<MODULEPATH id="juce_audio_basics" path="../../juce"/> <MODULEPATH id="juce_audio_basics" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../../../Applications/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../Applications/JUCE/modules"/>
</MODULEPATHS> </MODULEPATHS>
</VS2017> </VS2017>
</EXPORTFORMATS> </EXPORTFORMATS>
@ -162,14 +150,11 @@
<MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_cryptography" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/> <MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_video" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
</MODULES> </MODULES>
<JUCEOPTIONS/> <JUCEOPTIONS/>
<LIVE_SETTINGS> <LIVE_SETTINGS>

View File

@ -1,78 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
void Analytics::addDestination (AnalyticsDestination* destination)
{
destinations.add (destination);
}
OwnedArray<AnalyticsDestination>& Analytics::getDestinations()
{
return destinations;
}
void Analytics::setUserId (String newUserId)
{
userId = newUserId;
}
void Analytics::setUserProperties (StringPairArray properties)
{
userProperties = properties;
}
void Analytics::logEvent (const String& eventName,
const StringPairArray& parameters,
int eventType)
{
if (! isSuspended)
{
AnalyticsDestination::AnalyticsEvent event
{
eventName,
eventType,
Time::getMillisecondCounter(),
parameters,
userId,
userProperties
};
for (auto* destination : destinations)
destination->logEvent (event);
}
}
void Analytics::setSuspended (bool shouldBeSuspended)
{
isSuspended = shouldBeSuspended;
}
JUCE_IMPLEMENT_SINGLETON (Analytics)
}

View File

@ -1,117 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
A singleton class to manage analytics data.
Use an Analytics object to manage sending analytics data to one or more
AnalyticsDestinations.
@see AnalyticsDestination, ThreadedAnalyticsDestination,
AnalyticsDestination::AnalyticsEvent
@tags{Analytics}
*/
class JUCE_API Analytics : public DeletedAtShutdown
{
public:
//==============================================================================
/** Adds an AnalyticsDestination to the list of AnalyticsDestinations
managed by this Analytics object.
The Analytics class will take ownership of the AnalyticsDestination
passed to this function.
@param destination the AnalyticsDestination to manage
*/
void addDestination (AnalyticsDestination* destination);
/** Returns the array of AnalyticsDestinations managed by this class.
If you have added any subclasses of ThreadedAnalyticsDestination to
this class then you can remove them from this list to force them to
flush any pending events.
*/
OwnedArray<AnalyticsDestination>& getDestinations();
/** Sets a user ID that will be added to all AnalyticsEvents sent to
AnalyticsDestinations.
@param newUserId the userId to add to AnalyticsEvents
*/
void setUserId (String newUserId);
/** Sets some user properties that will be added to all AnalyticsEvents sent
to AnalyticsDestinations.
@param properties the userProperties to add to AnalyticsEvents
*/
void setUserProperties (StringPairArray properties);
/** Sends an AnalyticsEvent to all AnalyticsDestinations.
The AnalyticsEvent will be timestamped, and will have the userId and
userProperties populated by values previously set by calls to
setUserId and setUserProperties. The name, parameters and type will be
populated by the arguments supplied to this function.
@param eventName the event name
@param parameters the event parameters
@param eventType (optional) an integer to indicate the event
type, which will be set to 0 if not supplied.
*/
void logEvent (const String& eventName, const StringPairArray& parameters, int eventType = 0);
/** Suspends analytics submissions to AnalyticsDestinations.
@param shouldBeSuspended if event submission should be suspended
*/
void setSuspended (bool shouldBeSuspended);
#ifndef DOXYGEN
JUCE_DECLARE_SINGLETON (Analytics, false)
#endif
private:
//==============================================================================
Analytics() = default;
~Analytics() { clearSingletonInstance(); }
String userId;
StringPairArray userProperties;
bool isSuspended = false;
OwnedArray<AnalyticsDestination> destinations;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Analytics)
};
} // namespace juce

View File

@ -1,61 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
ButtonTracker::ButtonTracker (Button& buttonToTrack,
const String& triggeredEventName,
const StringPairArray& triggeredEventParameters,
int triggeredEventType)
: button (buttonToTrack),
eventName (triggeredEventName),
eventParameters (triggeredEventParameters),
eventType (triggeredEventType)
{
button.addListener (this);
}
ButtonTracker::~ButtonTracker()
{
button.removeListener (this);
}
void ButtonTracker::buttonClicked (Button* b)
{
if (b == &button)
{
auto params = eventParameters;
if (button.getClickingTogglesState())
params.set ("ButtonState", button.getToggleState() ? "On" : "Off");
Analytics::getInstance()->logEvent (eventName, params, eventType);
}
}
} // namespace juce

View File

@ -1,80 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
A class that automatically sends analytics events to the Analytics singleton
when a button is clicked.
@see Analytics, AnalyticsDestination::AnalyticsEvent
@tags{Analytics}
*/
class JUCE_API ButtonTracker : private Button::Listener
{
public:
//==============================================================================
/**
Creating one of these automatically sends analytics events to the Analytics
singeton when the corresponding button is clicked.
The name and parameters of the analytics event will be populated from the
variables supplied here. If clicking changes the button's state then the
parameters will have a {"ButtonState", "On"/"Off"} entry added.
@param buttonToTrack the button to track
@param triggeredEventName the name of the generated event
@param triggeredEventParameters the parameters to add to the generated
event
@param triggeredEventType (optional) an integer to indicate the event
type, which will be set to 0 if not supplied.
@see Analytics, AnalyticsDestination::AnalyticsEvent
*/
ButtonTracker (Button& buttonToTrack,
const String& triggeredEventName,
const StringPairArray& triggeredEventParameters = {},
int triggeredEventType = 0);
/** Destructor. */
~ButtonTracker();
private:
/** @internal */
void buttonClicked (Button*) override;
Button& button;
const String eventName;
const StringPairArray eventParameters;
const int eventType;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ButtonTracker)
};
} // namespace juce

View File

@ -1,98 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
An interface for handling analytics events collected by an Analytics object.
For basic analytics logging you can implement this interface and add your
class to an Analytics object.
For more advanced logging you may want to subclass
ThreadedAnalyticsDestination instead, which is more suitable for interacting
with web servers and other time consuming destinations.
@see Analytics, ThreadedAnalyticsDestination
@tags{Analytics}
*/
struct JUCE_API AnalyticsDestination
{
/** Contains information about an event to be logged. */
struct AnalyticsEvent
{
/** The name of the event. */
String name;
/** An optional integer representing the type of the event. You can use
this to indicate if the event was a screenview, session start,
exception, etc.
*/
int eventType;
/**
The timestamp of the event.
Timestamps are automatically applied by an Analytics object and are
derived from Time::getMillisecondCounter(). As such these timestamps
do not represent absolute times, but relative timings of events for
each user in each session will be accurate.
*/
uint32 timestamp;
/** The parameters of the event. */
StringPairArray parameters;
/** The user ID associated with the event. */
String userID;
/** Properties associated with the user. */
StringPairArray userProperties;
};
/** Constructor. */
AnalyticsDestination() = default;
/** Destructor. */
virtual ~AnalyticsDestination() {}
/**
When an AnalyticsDestination is added to an Analytics object this method
is called when an analytics event is triggered from the Analytics
object.
Override this method to log the event information somewhere useful.
*/
virtual void logEvent (const AnalyticsEvent& event) = 0;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AnalyticsDestination)
};
} // namespace juce

View File

@ -1,290 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
ThreadedAnalyticsDestination::ThreadedAnalyticsDestination (const String& threadName)
: dispatcher (threadName, *this)
{}
ThreadedAnalyticsDestination::~ThreadedAnalyticsDestination()
{
// If you hit this assertion then the analytics thread has not been shut down
// before this class is destroyed. Call stopAnalyticsThread() in your destructor!
jassert (! dispatcher.isThreadRunning());
}
void ThreadedAnalyticsDestination::setBatchPeriod (int newBatchPeriodMilliseconds)
{
dispatcher.batchPeriodMilliseconds = newBatchPeriodMilliseconds;
}
void ThreadedAnalyticsDestination::logEvent (const AnalyticsEvent& event)
{
dispatcher.addToQueue (event);
}
void ThreadedAnalyticsDestination::startAnalyticsThread (int initialBatchPeriodMilliseconds)
{
setBatchPeriod (initialBatchPeriodMilliseconds);
dispatcher.startThread();
}
void ThreadedAnalyticsDestination::stopAnalyticsThread (int timeout)
{
dispatcher.signalThreadShouldExit();
stopLoggingEvents();
dispatcher.stopThread (timeout);
if (dispatcher.eventQueue.size() > 0)
saveUnloggedEvents (dispatcher.eventQueue);
}
ThreadedAnalyticsDestination::EventDispatcher::EventDispatcher (const String& threadName,
ThreadedAnalyticsDestination& destination)
: Thread (threadName),
parent (destination)
{}
void ThreadedAnalyticsDestination::EventDispatcher::run()
{
// We may have inserted some events into the queue (on the message thread)
// before this thread has started, so make sure the old events are at the
// front of the queue.
{
std::deque<AnalyticsEvent> restoredEventQueue;
parent.restoreUnloggedEvents (restoredEventQueue);
const ScopedLock lock (queueAccess);
for (auto rit = restoredEventQueue.rbegin(); rit != restoredEventQueue.rend(); ++rit)
eventQueue.push_front (*rit);
}
const int maxBatchSize = parent.getMaximumBatchSize();
while (! threadShouldExit())
{
{
const auto numEventsInBatch = eventsToSend.size();
const auto freeBatchCapacity = maxBatchSize - numEventsInBatch;
if (freeBatchCapacity > 0)
{
const auto numNewEvents = (int) eventQueue.size() - numEventsInBatch;
if (numNewEvents > 0)
{
const ScopedLock lock (queueAccess);
const auto numEventsToAdd = jmin (numNewEvents, freeBatchCapacity);
const auto newBatchSize = numEventsInBatch + numEventsToAdd;
for (auto i = numEventsInBatch; i < newBatchSize; ++i)
eventsToSend.add (eventQueue[(size_t) i]);
}
}
}
const auto submissionTime = Time::getMillisecondCounter();
if (! eventsToSend.isEmpty())
{
if (parent.logBatchedEvents (eventsToSend))
{
const ScopedLock lock (queueAccess);
for (auto i = 0; i < eventsToSend.size(); ++i)
eventQueue.pop_front();
eventsToSend.clearQuick();
}
}
while (Time::getMillisecondCounter() - submissionTime < (uint32) batchPeriodMilliseconds.get())
{
if (threadShouldExit())
return;
Thread::sleep (100);
}
}
}
void ThreadedAnalyticsDestination::EventDispatcher::addToQueue (const AnalyticsEvent& event)
{
const ScopedLock lock (queueAccess);
eventQueue.push_back (event);
}
//==============================================================================
#if JUCE_UNIT_TESTS
namespace DestinationTestHelpers
{
//==============================================================================
struct BasicDestination : public ThreadedAnalyticsDestination
{
BasicDestination (std::deque<AnalyticsEvent>& loggedEvents,
std::deque<AnalyticsEvent>& unloggedEvents)
: ThreadedAnalyticsDestination ("ThreadedAnalyticsDestinationTest"),
loggedEventQueue (loggedEvents),
unloggedEventStore (unloggedEvents)
{
startAnalyticsThread (20);
}
~BasicDestination()
{
stopAnalyticsThread (1000);
}
int getMaximumBatchSize() override
{
return 5;
}
void saveUnloggedEvents (const std::deque<AnalyticsEvent>& eventsToSave) override
{
unloggedEventStore = eventsToSave;
}
void restoreUnloggedEvents (std::deque<AnalyticsEvent>& restoredEventQueue) override
{
restoredEventQueue = unloggedEventStore;
}
bool logBatchedEvents (const Array<AnalyticsEvent>& events) override
{
jassert (events.size() <= getMaximumBatchSize());
if (loggingIsEnabled)
{
const ScopedLock lock (eventQueueChanging);
for (auto& event : events)
loggedEventQueue.push_back (event);
return true;
}
return false;
}
void stopLoggingEvents() override {}
void setLoggingEnabled (bool shouldLogEvents)
{
loggingIsEnabled = shouldLogEvents;
}
std::deque<AnalyticsEvent>& loggedEventQueue;
std::deque<AnalyticsEvent>& unloggedEventStore;
bool loggingIsEnabled = true;
CriticalSection eventQueueChanging;
};
}
//==============================================================================
struct ThreadedAnalyticsDestinationTests : public UnitTest
{
ThreadedAnalyticsDestinationTests()
: UnitTest ("ThreadedAnalyticsDestination")
{}
void compareEventQueues (const std::deque<AnalyticsDestination::AnalyticsEvent>& a,
const std::deque<AnalyticsDestination::AnalyticsEvent>& b)
{
const auto numEntries = a.size();
expectEquals ((int) b.size(), (int) numEntries);
for (size_t i = 0; i < numEntries; ++i)
{
expectEquals (a[i].name, b[i].name);
expect (a[i].timestamp == b[i].timestamp);
}
}
void runTest() override
{
std::deque<AnalyticsDestination::AnalyticsEvent> testEvents;
for (int i = 0; i < 7; ++i)
testEvents.push_back ({ String (i), 0, Time::getMillisecondCounter(), {}, "TestUser", {} });
std::deque<AnalyticsDestination::AnalyticsEvent> loggedEvents, unloggedEvents;
beginTest ("New events");
{
DestinationTestHelpers::BasicDestination destination (loggedEvents, unloggedEvents);
for (auto& event : testEvents)
destination.logEvent (event);
size_t waitTime = 0, numLoggedEvents = 0;
while (numLoggedEvents < testEvents.size())
{
if (waitTime > 4000)
{
expect (waitTime < 4000);
break;
}
Thread::sleep (40);
waitTime += 40;
const ScopedLock lock (destination.eventQueueChanging);
numLoggedEvents = loggedEvents.size();
}
}
compareEventQueues (loggedEvents, testEvents);
expect (unloggedEvents.size() == 0);
loggedEvents.clear();
beginTest ("Unlogged events");
{
DestinationTestHelpers::BasicDestination destination (loggedEvents, unloggedEvents);
destination.setLoggingEnabled (false);
for (auto& event : testEvents)
destination.logEvent (event);
}
compareEventQueues (unloggedEvents, testEvents);
expect (loggedEvents.size() == 0);
}
};
static ThreadedAnalyticsDestinationTests threadedAnalyticsDestinationTests;
#endif
} // namespace juce

View File

@ -1,218 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
A base class for dispatching analytics events on a dedicated thread.
This class is particularly useful for sending analytics events to a web
server without blocking the message thread. It can also save (and restore)
events that were not dispatched so no information is lost when an internet
connection is absent or something else prevents successful logging.
Once startAnalyticsThread is called the logBatchedEvents method is
periodically invoked on an analytics thread, with the period determined by
calls to setBatchPeriod. Here events are grouped together into batches, with
the maximum batch size set by the implementation of getMaximumBatchSize.
It's important to call stopAnalyticsThread in the destructor of your
subclass (or before then) to give the analytics thread time to shut down.
Calling stopAnalyticsThread will, in turn, call stopLoggingEvents, which
you should use to terminate the currently running logBatchedEvents call.
@see Analytics, AnalyticsDestination, AnalyticsDestination::AnalyticsEvent
@tags{Analytics}
*/
class JUCE_API ThreadedAnalyticsDestination : public AnalyticsDestination
{
public:
//==============================================================================
/**
Creates a ThreadedAnalyticsDestination.
@param threadName used to identify the analytics
thread in debug builds
*/
ThreadedAnalyticsDestination (const String& threadName = "Analytics thread");
/** Destructor. */
virtual ~ThreadedAnalyticsDestination();
//==============================================================================
/**
Override this method to provide the maximum batch size you can handle in
your subclass.
Calls to logBatchedEvents will contain no more than this number of events.
*/
virtual int getMaximumBatchSize() = 0;
/**
This method will be called periodically on the analytics thread.
If this method returns false then the subsequent call of this function will
contain the same events as previous call, plus any new events that have been
generated in the period between calls. The order of events will not be
changed. This allows you to retry logging events until they are logged
successfully.
@param events a list of events to be logged
@returns if the events were successfully logged
*/
virtual bool logBatchedEvents (const Array<AnalyticsEvent>& events) = 0;
/**
You must always call stopAnalyticsThread in the destructor of your subclass
(or before then) to give the analytics thread time to shut down.
Calling stopAnalyticsThread triggers a call to this method. At this point
you are guaranteed that logBatchedEvents has been called for the last time
and you should make sure that the current call to logBatchedEvents finishes
as quickly as possible. This method and a subsequent call to
saveUnloggedEvents must both complete before the timeout supplied to
stopAnalyticsThread.
In a normal use case stopLoggingEvents will be called on the message thread
from the destructor of your ThreadedAnalyticsDestination subclass, and must
stop the logBatchedEvents method which is running on the analytics thread.
@see stopAnalyticsThread
*/
virtual void stopLoggingEvents() = 0;
//==============================================================================
/**
Call this to set the period between logBatchedEvents invocations.
This method is thread safe and can be used to implements things like
exponential backoff in logBatchedEvents calls.
@param newSubmissionPeriodMilliseconds the new submission period to
use in milliseconds
*/
void setBatchPeriod (int newSubmissionPeriodMilliseconds);
/**
Adds an event to the queue, which will ultimately be submitted to
logBatchedEvents.
This method is thread safe.
@param event the analytics event to add to the queue
*/
void logEvent (const AnalyticsEvent& event) override final;
protected:
//==============================================================================
/**
Starts the analytics thread, with an initial event batching period.
@param initialBatchPeriodMilliseconds the initial event batching period
in milliseconds
*/
void startAnalyticsThread (int initialBatchPeriodMilliseconds);
//==============================================================================
/**
Triggers the shutdown of the analytics thread.
You must call this method in the destructor of your subclass (or before
then) to give the analytics thread time to shut down.
This method invokes stopLoggingEvents and you should ensure that both the
analytics thread and a call to saveUnloggedEvents are able to finish before
the supplied timeout. This timeout is important because on platforms like
iOS an app is killed if it takes too long to shut down.
@param timeoutMilliseconds the number of milliseconds before
the analytics thread is forcibly
terminated
*/
void stopAnalyticsThread (int timeoutMilliseconds);
private:
//==============================================================================
/**
This method will be called when the analytics thread is shut down,
giving you the chance to save any analytics events that could not be
logged. Once saved these events can be put back into the queue of events
when the ThreadedAnalyticsDestination is recreated via
restoreUnloggedEvents.
This method should return as quickly as possible, as both
stopLoggingEvents and this method need to complete inside the timeout
set in stopAnalyticsThread.
@param eventsToSave the events that could not be logged
@see stopAnalyticsThread, stopLoggingEvents, restoreUnloggedEvents
*/
virtual void saveUnloggedEvents (const std::deque<AnalyticsEvent>& eventsToSave) = 0;
/**
The counterpart to saveUnloggedEvents.
Events added to the event queue provided by this method will be the
first events supplied to logBatchedEvents calls. Use this method to
restore any unlogged events previously stored in a call to
saveUnloggedEvents.
This method is called on the analytics thread.
@param restoredEventQueue place restored events into this queue
@see saveUnloggedEvents
*/
virtual void restoreUnloggedEvents (std::deque<AnalyticsEvent>& restoredEventQueue) = 0;
struct EventDispatcher : public Thread
{
EventDispatcher (const String& threadName, ThreadedAnalyticsDestination&);
void run() override;
void addToQueue (const AnalyticsEvent&);
ThreadedAnalyticsDestination& parent;
std::deque<AnalyticsEvent> eventQueue;
CriticalSection queueAccess;
Atomic<int> batchPeriodMilliseconds { 1000 };
Array<AnalyticsEvent> eventsToSend;
};
const String destinationName;
EventDispatcher dispatcher;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadedAnalyticsDestination)
};
} // namespace juce

View File

@ -1,40 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#ifdef JUCE_ANALYTICS_H_INCLUDED
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included any other headers - just put it inside a file on its own, possibly with your config
flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
header files that the compiler may be using.
*/
#error "Incorrect use of JUCE cpp file"
#endif
#include "juce_analytics.h"
#include "destinations/juce_ThreadedAnalyticsDestination.cpp"
#include "analytics/juce_Analytics.cpp"
#include "analytics/juce_ButtonTracker.cpp"

View File

@ -1,60 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
/*******************************************************************************
The block below describes the properties of this module, and is read by
the Projucer to automatically generate project code that uses it.
For details about the syntax and how to create or use a module, see the
JUCE Module Format.txt file.
BEGIN_JUCE_MODULE_DECLARATION
ID: juce_analytics
vendor: juce
version: 5.3.2
name: JUCE analytics classes
description: Classes to collect analytics and send to destinations
website: http://www.juce.com/juce
license: GPL/Commercial
dependencies: juce_gui_basics
END_JUCE_MODULE_DECLARATION
*******************************************************************************/
#pragma once
#define JUCE_ANALYTICS_H_INCLUDED
#include <queue>
#include <juce_gui_basics/juce_gui_basics.h>
#include "destinations/juce_AnalyticsDestination.h"
#include "destinations/juce_ThreadedAnalyticsDestination.h"
#include "analytics/juce_Analytics.h"
#include "analytics/juce_ButtonTracker.h"

View File

@ -39,10 +39,10 @@ class JUCE_API AudioPlayHead
{ {
protected: protected:
//============================================================================== //==============================================================================
AudioPlayHead() {} AudioPlayHead() = default;
public: public:
virtual ~AudioPlayHead() {} virtual ~AudioPlayHead() = default;
//============================================================================== //==============================================================================
/** Frame rate types. */ /** Frame rate types. */

View File

@ -75,6 +75,27 @@ String AudioChannelSet::getChannelTypeName (AudioChannelSet::ChannelType type)
case ambisonicZ: return NEEDS_TRANS("Ambisonic Z"); case ambisonicZ: return NEEDS_TRANS("Ambisonic Z");
case topSideLeft: return NEEDS_TRANS("Top Side Left"); case topSideLeft: return NEEDS_TRANS("Top Side Left");
case topSideRight: return NEEDS_TRANS("Top Side Right"); case topSideRight: return NEEDS_TRANS("Top Side Right");
case ambisonicACN4: return NEEDS_TRANS("Ambisonic 4");
case ambisonicACN5: return NEEDS_TRANS("Ambisonic 5");
case ambisonicACN6: return NEEDS_TRANS("Ambisonic 6");
case ambisonicACN7: return NEEDS_TRANS("Ambisonic 7");
case ambisonicACN8: return NEEDS_TRANS("Ambisonic 8");
case ambisonicACN9: return NEEDS_TRANS("Ambisonic 9");
case ambisonicACN10: return NEEDS_TRANS("Ambisonic 10");
case ambisonicACN11: return NEEDS_TRANS("Ambisonic 11");
case ambisonicACN12: return NEEDS_TRANS("Ambisonic 12");
case ambisonicACN13: return NEEDS_TRANS("Ambisonic 13");
case ambisonicACN14: return NEEDS_TRANS("Ambisonic 14");
case ambisonicACN15: return NEEDS_TRANS("Ambisonic 15");
case bottomFrontLeft: return NEEDS_TRANS("Bottom Front Left");
case bottomFrontCentre: return NEEDS_TRANS("Bottom Front Centre");
case bottomFrontRight: return NEEDS_TRANS("Bottom Front Right");
case bottomSideLeft: return NEEDS_TRANS("Bottom Side Left");
case bottomSideRight: return NEEDS_TRANS("Bottom Side Right");
case bottomRearLeft: return NEEDS_TRANS("Bottom Rear Left");
case bottomRearCentre: return NEEDS_TRANS("Bottom Rear Centre");
case bottomRearRight: return NEEDS_TRANS("Bottom Rear Right");
case discreteChannel0: return NEEDS_TRANS("Discrete channel");
default: break; default: break;
} }
@ -115,8 +136,28 @@ String AudioChannelSet::getAbbreviatedChannelTypeName (AudioChannelSet::ChannelT
case ambisonicACN1: return "ACN1"; case ambisonicACN1: return "ACN1";
case ambisonicACN2: return "ACN2"; case ambisonicACN2: return "ACN2";
case ambisonicACN3: return "ACN3"; case ambisonicACN3: return "ACN3";
case ambisonicACN4: return "ACN4";
case ambisonicACN5: return "ACN5";
case ambisonicACN6: return "ACN6";
case ambisonicACN7: return "ACN7";
case ambisonicACN8: return "ACN8";
case ambisonicACN9: return "ACN9";
case ambisonicACN10: return "ACN10";
case ambisonicACN11: return "ACN11";
case ambisonicACN12: return "ACN12";
case ambisonicACN13: return "ACN13";
case ambisonicACN14: return "ACN14";
case ambisonicACN15: return "ACN15";
case topSideLeft: return "Tsl"; case topSideLeft: return "Tsl";
case topSideRight: return "Tsr"; case topSideRight: return "Tsr";
case bottomFrontLeft: return "Bfl";
case bottomFrontCentre: return "Bfc";
case bottomFrontRight: return "Bfr";
case bottomSideLeft: return "Bsl";
case bottomSideRight: return "Bsr";
case bottomRearLeft: return "Brl";
case bottomRearCentre: return "Brc";
case bottomRearRight: return "Brr";
default: break; default: break;
} }
@ -130,38 +171,61 @@ AudioChannelSet::ChannelType AudioChannelSet::getChannelTypeFromAbbreviation (co
{ {
if (abbr.length() > 0 && (abbr[0] >= '0' && abbr[0] <= '9')) if (abbr.length() > 0 && (abbr[0] >= '0' && abbr[0] <= '9'))
return static_cast<AudioChannelSet::ChannelType> (static_cast<int> (discreteChannel0) return static_cast<AudioChannelSet::ChannelType> (static_cast<int> (discreteChannel0)
+ abbr.getIntValue() + 1); + abbr.getIntValue() - 1);
if (abbr == "L") return left;
if (abbr == "R") return right;
if (abbr == "C") return centre;
if (abbr == "Lfe") return LFE;
if (abbr == "Ls") return leftSurround;
if (abbr == "Rs") return rightSurround;
if (abbr == "Lc") return leftCentre;
if (abbr == "Rc") return rightCentre;
if (abbr == "Cs") return centreSurround;
if (abbr == "Lrs") return leftSurroundRear;
if (abbr == "Rrs") return rightSurroundRear;
if (abbr == "Tm") return topMiddle;
if (abbr == "Tfl") return topFrontLeft;
if (abbr == "Tfc") return topFrontCentre;
if (abbr == "Tfr") return topFrontRight;
if (abbr == "Trl") return topRearLeft;
if (abbr == "Trc") return topRearCentre;
if (abbr == "Trr") return topRearRight;
if (abbr == "Wl") return wideLeft;
if (abbr == "Wr") return wideRight;
if (abbr == "Lfe2") return LFE2;
if (abbr == "Lss") return leftSurroundSide;
if (abbr == "Rss") return rightSurroundSide;
if (abbr == "W") return ambisonicW;
if (abbr == "X") return ambisonicX;
if (abbr == "Y") return ambisonicY;
if (abbr == "Z") return ambisonicZ;
if (abbr == "Tsl") return topSideLeft;
if (abbr == "Tsr") return topSideRight;
if (abbr == "L") return left;
if (abbr == "R") return right;
if (abbr == "C") return centre;
if (abbr == "Lfe") return LFE;
if (abbr == "Ls") return leftSurround;
if (abbr == "Rs") return rightSurround;
if (abbr == "Lc") return leftCentre;
if (abbr == "Rc") return rightCentre;
if (abbr == "Cs") return centreSurround;
if (abbr == "Lrs") return leftSurroundRear;
if (abbr == "Rrs") return rightSurroundRear;
if (abbr == "Tm") return topMiddle;
if (abbr == "Tfl") return topFrontLeft;
if (abbr == "Tfc") return topFrontCentre;
if (abbr == "Tfr") return topFrontRight;
if (abbr == "Trl") return topRearLeft;
if (abbr == "Trc") return topRearCentre;
if (abbr == "Trr") return topRearRight;
if (abbr == "Wl") return wideLeft;
if (abbr == "Wr") return wideRight;
if (abbr == "Lfe2") return LFE2;
if (abbr == "Lss") return leftSurroundSide;
if (abbr == "Rss") return rightSurroundSide;
if (abbr == "W") return ambisonicW;
if (abbr == "X") return ambisonicX;
if (abbr == "Y") return ambisonicY;
if (abbr == "Z") return ambisonicZ;
if (abbr == "ACN0") return ambisonicACN0;
if (abbr == "ACN1") return ambisonicACN1;
if (abbr == "ACN2") return ambisonicACN2;
if (abbr == "ACN3") return ambisonicACN3;
if (abbr == "ACN4") return ambisonicACN4;
if (abbr == "ACN5") return ambisonicACN5;
if (abbr == "ACN6") return ambisonicACN6;
if (abbr == "ACN7") return ambisonicACN7;
if (abbr == "ACN8") return ambisonicACN8;
if (abbr == "ACN9") return ambisonicACN9;
if (abbr == "ACN10") return ambisonicACN10;
if (abbr == "ACN11") return ambisonicACN11;
if (abbr == "ACN12") return ambisonicACN12;
if (abbr == "ACN13") return ambisonicACN13;
if (abbr == "ACN14") return ambisonicACN14;
if (abbr == "ACN15") return ambisonicACN15;
if (abbr == "Tsl") return topSideLeft;
if (abbr == "Tsr") return topSideRight;
if (abbr == "Bfl") return bottomFrontLeft;
if (abbr == "Bfc") return bottomFrontCentre;
if (abbr == "Bfr") return bottomFrontRight;
if (abbr == "Bsl") return bottomSideLeft;
if (abbr == "Bsr") return bottomSideRight;
if (abbr == "Brl") return bottomRearLeft;
if (abbr == "Brc") return bottomRearCentre;
if (abbr == "Brr") return bottomRearRight;
return unknown; return unknown;
} }

View File

@ -49,7 +49,7 @@ public:
/** Creates an empty channel set. /** Creates an empty channel set.
You can call addChannel to add channels to the set. You can call addChannel to add channels to the set.
*/ */
AudioChannelSet() noexcept {} AudioChannelSet() = default;
/** Creates a zero-channel set which can be used to indicate that a /** Creates a zero-channel set which can be used to indicate that a
bus is disabled. */ bus is disabled. */
@ -365,7 +365,21 @@ public:
ambisonicZ = ambisonicACN2, /**< Same as first-order ambisonic channel number 2. */ ambisonicZ = ambisonicACN2, /**< Same as first-order ambisonic channel number 2. */
//============================================================================== //==============================================================================
discreteChannel0 = 64 /**< Non-typed individual channels are indexed upwards from this value. */ bottomFrontLeft = 62, /**< Bottom Front Left (Bfl) */
bottomFrontCentre = 63, /**< Bottom Front Centre (Bfc) */
bottomFrontRight = 64, /**< Bottom Front Right (Bfr) */
proxymityLeft = 65, /**< Proximity Left (Pl) */
proximityRight = 66, /**< Proximity Right (Pr) */
bottomSideLeft = 67, /**< Bottom Side Left (Bsl) */
bottomSideRight = 68, /**< Bottom Side Right (Bsr) */
bottomRearLeft = 69, /**< Bottom Rear Left (Brl) */
bottomRearCentre = 70, /**< Bottom Rear Center (Brc) */
bottomRearRight = 71, /**< Bottom Rear Right (Brr) */
//==============================================================================
discreteChannel0 = 128 /**< Non-typed individual channels are indexed upwards from this value. */
}; };
/** Returns the name of a given channel type. For example, this method may return "Surround Left". */ /** Returns the name of a given channel type. For example, this method may return "Surround Left". */

View File

@ -23,16 +23,16 @@
namespace juce namespace juce
{ {
void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fff; auto maxVal = (double) 0x7fff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(uint16*) intData = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
intData += destBytesPerSample; intData += destBytesPerSample;
} }
} }
@ -43,21 +43,21 @@ void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= destBytesPerSample; intData -= destBytesPerSample;
*(uint16*) intData = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
} }
} }
} }
void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fff; auto maxVal = (double) 0x7fff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(uint16*) intData = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
intData += destBytesPerSample; intData += destBytesPerSample;
} }
} }
@ -68,15 +68,15 @@ void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= destBytesPerSample; intData -= destBytesPerSample;
*(uint16*) intData = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
} }
} }
} }
void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fffff; auto maxVal = (double) 0x7fffff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
@ -98,10 +98,10 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest
} }
} }
void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fffff; auto maxVal = (double) 0x7fffff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
@ -123,16 +123,16 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest
} }
} }
void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fffffff; auto maxVal = (double) 0x7fffffff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(uint32*)intData = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
intData += destBytesPerSample; intData += destBytesPerSample;
} }
} }
@ -143,21 +143,21 @@ void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= destBytesPerSample; intData -= destBytesPerSample;
*(uint32*)intData = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
} }
} }
} }
void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
const double maxVal = (double) 0x7fffffff; auto maxVal = (double) 0x7fffffff;
char* intData = static_cast<char*> (dest); auto intData = static_cast<char*> (dest);
if (dest != (void*) source || destBytesPerSample <= 4) if (dest != (void*) source || destBytesPerSample <= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(uint32*)intData = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
intData += destBytesPerSample; intData += destBytesPerSample;
} }
} }
@ -168,12 +168,12 @@ void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= destBytesPerSample; intData -= destBytesPerSample;
*(uint32*)intData = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i])));
} }
} }
} }
void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data!
@ -181,28 +181,28 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(float*) d = source[i]; *reinterpret_cast<float*> (d) = source[i];
#if JUCE_BIG_ENDIAN #if JUCE_BIG_ENDIAN
*(uint32*) d = ByteOrder::swap (*(uint32*) d); *reinterpret_cast<uint32*> (d) = ByteOrder::swap (*reinterpret_cast<uint32*> (d));
#endif #endif
d += destBytesPerSample; d += destBytesPerSample;
} }
} }
void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{ {
jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data!
char* d = static_cast<char*> (dest); auto d = static_cast<char*> (dest);
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
*(float*) d = source[i]; *reinterpret_cast<float*> (d) = source[i];
#if JUCE_LITTLE_ENDIAN #if JUCE_LITTLE_ENDIAN
*(uint32*) d = ByteOrder::swap (*(uint32*) d); *reinterpret_cast<uint32*> (d) = ByteOrder::swap (*reinterpret_cast<uint32*> (d));
#endif #endif
d += destBytesPerSample; d += destBytesPerSample;
@ -210,16 +210,16 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de
} }
//============================================================================== //==============================================================================
void AudioDataConverters::convertInt16LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt16LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const float scale = 1.0f / 0x7fff; const float scale = 1.0f / 0x7fff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*(uint16*)intData); dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint16*> (intData));
intData += srcBytesPerSample; intData += srcBytesPerSample;
} }
} }
@ -230,21 +230,21 @@ void AudioDataConverters::convertInt16LEToFloat (const void* const source, float
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= srcBytesPerSample; intData -= srcBytesPerSample;
dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*(uint16*)intData); dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint16*> (intData));
} }
} }
} }
void AudioDataConverters::convertInt16BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt16BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const float scale = 1.0f / 0x7fff; const float scale = 1.0f / 0x7fff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*(uint16*)intData); dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint16*> (intData));
intData += srcBytesPerSample; intData += srcBytesPerSample;
} }
} }
@ -255,15 +255,15 @@ void AudioDataConverters::convertInt16BEToFloat (const void* const source, float
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= srcBytesPerSample; intData -= srcBytesPerSample;
dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*(uint16*)intData); dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint16*> (intData));
} }
} }
} }
void AudioDataConverters::convertInt24LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt24LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const float scale = 1.0f / 0x7fffff; const float scale = 1.0f / 0x7fffff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
@ -285,10 +285,10 @@ void AudioDataConverters::convertInt24LEToFloat (const void* const source, float
} }
} }
void AudioDataConverters::convertInt24BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt24BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const float scale = 1.0f / 0x7fffff; const float scale = 1.0f / 0x7fffff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
@ -310,16 +310,16 @@ void AudioDataConverters::convertInt24BEToFloat (const void* const source, float
} }
} }
void AudioDataConverters::convertInt32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const auto scale = 1.0f / (float) 0x7fffffff; const float scale = 1.0f / (float) 0x7fffffff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*(uint32*) intData); dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint32*> (intData));
intData += srcBytesPerSample; intData += srcBytesPerSample;
} }
} }
@ -330,21 +330,21 @@ void AudioDataConverters::convertInt32LEToFloat (const void* const source, float
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= srcBytesPerSample; intData -= srcBytesPerSample;
dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*(uint32*) intData); dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint32*> (intData));
} }
} }
} }
void AudioDataConverters::convertInt32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertInt32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const auto scale = 1.0f / (float) 0x7fffffff; const float scale = 1.0f / (float) 0x7fffffff;
const char* intData = static_cast<const char*> (source); auto intData = static_cast<const char*> (source);
if (source != (void*) dest || srcBytesPerSample >= 4) if (source != (void*) dest || srcBytesPerSample >= 4)
{ {
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*(uint32*) intData); dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint32*> (intData));
intData += srcBytesPerSample; intData += srcBytesPerSample;
} }
} }
@ -355,21 +355,21 @@ void AudioDataConverters::convertInt32BEToFloat (const void* const source, float
for (int i = numSamples; --i >= 0;) for (int i = numSamples; --i >= 0;)
{ {
intData -= srcBytesPerSample; intData -= srcBytesPerSample;
dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*(uint32*) intData); dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint32*> (intData));
} }
} }
} }
void AudioDataConverters::convertFloat32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertFloat32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const char* s = static_cast<const char*> (source); auto s = static_cast<const char*> (source);
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = *(float*)s; dest[i] = *reinterpret_cast<const float*> (s);
#if JUCE_BIG_ENDIAN #if JUCE_BIG_ENDIAN
uint32* const d = (uint32*) (dest + i); auto d = reinterpret_cast<uint32*> (dest + i);
*d = ByteOrder::swap (*d); *d = ByteOrder::swap (*d);
#endif #endif
@ -377,16 +377,16 @@ void AudioDataConverters::convertFloat32LEToFloat (const void* const source, flo
} }
} }
void AudioDataConverters::convertFloat32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) void AudioDataConverters::convertFloat32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample)
{ {
const char* s = static_cast<const char*> (source); auto s = static_cast<const char*> (source);
for (int i = 0; i < numSamples; ++i) for (int i = 0; i < numSamples; ++i)
{ {
dest[i] = *(float*)s; dest[i] = *reinterpret_cast<const float*> (s);
#if JUCE_LITTLE_ENDIAN #if JUCE_LITTLE_ENDIAN
uint32* const d = (uint32*) (dest + i); auto d = reinterpret_cast<uint32*> (dest + i);
*d = ByteOrder::swap (*d); *d = ByteOrder::swap (*d);
#endif #endif
@ -396,10 +396,7 @@ void AudioDataConverters::convertFloat32BEToFloat (const void* const source, flo
//============================================================================== //==============================================================================
void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat, void AudioDataConverters::convertFloatToFormat (DataFormat destFormat, const float* source, void* dest, int numSamples)
const float* const source,
void* const dest,
const int numSamples)
{ {
switch (destFormat) switch (destFormat)
{ {
@ -415,10 +412,7 @@ void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat,
} }
} }
void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat, void AudioDataConverters::convertFormatToFloat (DataFormat sourceFormat, const void* source, float* dest, int numSamples)
const void* const source,
float* const dest,
const int numSamples)
{ {
switch (sourceFormat) switch (sourceFormat)
{ {
@ -435,15 +429,12 @@ void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat,
} }
//============================================================================== //==============================================================================
void AudioDataConverters::interleaveSamples (const float** const source, void AudioDataConverters::interleaveSamples (const float** source, float* dest, int numSamples, int numChannels)
float* const dest,
const int numSamples,
const int numChannels)
{ {
for (int chan = 0; chan < numChannels; ++chan) for (int chan = 0; chan < numChannels; ++chan)
{ {
int i = chan; auto i = chan;
const float* src = source [chan]; auto src = source [chan];
for (int j = 0; j < numSamples; ++j) for (int j = 0; j < numSamples; ++j)
{ {
@ -453,15 +444,12 @@ void AudioDataConverters::interleaveSamples (const float** const source,
} }
} }
void AudioDataConverters::deinterleaveSamples (const float* const source, void AudioDataConverters::deinterleaveSamples (const float* source, float** dest, int numSamples, int numChannels)
float** const dest,
const int numSamples,
const int numChannels)
{ {
for (int chan = 0; chan < numChannels; ++chan) for (int chan = 0; chan < numChannels; ++chan)
{ {
int i = chan; auto i = chan;
float* dst = dest [chan]; auto dst = dest [chan];
for (int j = 0; j < numSamples; ++j) for (int j = 0; j < numSamples; ++j)
{ {
@ -492,7 +480,7 @@ public:
static void test (UnitTest& unitTest, bool inPlace, Random& r) static void test (UnitTest& unitTest, bool inPlace, Random& r)
{ {
const int numSamples = 2048; const int numSamples = 2048;
int32 original [numSamples], converted [numSamples], reversed [numSamples]; int32 original[numSamples], converted[numSamples], reversed[numSamples];
{ {
AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original); AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original);
@ -514,13 +502,13 @@ public:
} }
// convert data from the source to dest format.. // convert data from the source to dest format..
std::unique_ptr<AudioData::Converter> conv (new AudioData::ConverterInstance <AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::Const>, std::unique_ptr<AudioData::Converter> conv (new AudioData::ConverterInstance<AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::Const>,
AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::NonConst>>()); AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::NonConst>>());
conv->convertSamples (inPlace ? reversed : converted, original, numSamples); conv->convertSamples (inPlace ? reversed : converted, original, numSamples);
// ..and back again.. // ..and back again..
conv.reset (new AudioData::ConverterInstance <AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::Const>, conv.reset (new AudioData::ConverterInstance<AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::Const>,
AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst>>()); AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst>>());
if (! inPlace) if (! inPlace)
zeromem (reversed, sizeof (reversed)); zeromem (reversed, sizeof (reversed));
@ -582,7 +570,7 @@ public:
void runTest() override void runTest() override
{ {
Random r = getRandom(); auto r = getRandom();
beginTest ("Round-trip conversion: Int8"); beginTest ("Round-trip conversion: Int8");
Test1 <AudioData::Int8>::test (*this, r); Test1 <AudioData::Int8>::test (*this, r);
beginTest ("Round-trip conversion: Int16"); beginTest ("Round-trip conversion: Int16");

View File

@ -277,8 +277,8 @@ public:
class NonInterleaved class NonInterleaved
{ {
public: public:
inline NonInterleaved() noexcept {} inline NonInterleaved() = default;
inline NonInterleaved (const NonInterleaved&) noexcept {} inline NonInterleaved (const NonInterleaved&) = default;
inline NonInterleaved (const int) noexcept {} inline NonInterleaved (const int) noexcept {}
inline void copyFrom (const NonInterleaved&) noexcept {} inline void copyFrom (const NonInterleaved&) noexcept {}
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.advance(); } template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.advance(); }
@ -292,15 +292,15 @@ public:
class Interleaved class Interleaved
{ {
public: public:
inline Interleaved() noexcept : numInterleavedChannels (1) {} inline Interleaved() noexcept {}
inline Interleaved (const Interleaved& other) noexcept : numInterleavedChannels (other.numInterleavedChannels) {} inline Interleaved (const Interleaved& other) = default;
inline Interleaved (const int numInterleavedChans) noexcept : numInterleavedChannels (numInterleavedChans) {} inline Interleaved (const int numInterleavedChans) noexcept : numInterleavedChannels (numInterleavedChans) {}
inline void copyFrom (const Interleaved& other) noexcept { numInterleavedChannels = other.numInterleavedChannels; } inline void copyFrom (const Interleaved& other) noexcept { numInterleavedChannels = other.numInterleavedChannels; }
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.skip (numInterleavedChannels); } template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.skip (numInterleavedChannels); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numInterleavedChannels * numSamples); } template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numInterleavedChannels * numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } } template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } }
template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType&) const noexcept { return numInterleavedChannels * SampleFormatType::bytesPerSample; } template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType&) const noexcept { return numInterleavedChannels * SampleFormatType::bytesPerSample; }
int numInterleavedChannels; int numInterleavedChannels = 1;
enum { isInterleavedType = 1 }; enum { isInterleavedType = 1 };
}; };
@ -587,7 +587,7 @@ public:
class Converter class Converter
{ {
public: public:
virtual ~Converter() {} virtual ~Converter() = default;
/** Converts a sequence of samples from the converter's source format into the dest format. */ /** Converts a sequence of samples from the converter's source format into the dest format. */
virtual void convertSamples (void* destSamples, const void* sourceSamples, int numSamples) const = 0; virtual void convertSamples (void* destSamples, const void* sourceSamples, int numSamples) const = 0;

View File

@ -0,0 +1,79 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
AudioProcessLoadMeasurer::AudioProcessLoadMeasurer() {}
AudioProcessLoadMeasurer::~AudioProcessLoadMeasurer() {}
void AudioProcessLoadMeasurer::reset()
{
reset (0, 0);
}
void AudioProcessLoadMeasurer::reset (double sampleRate, int blockSize)
{
cpuUsageMs = 0;
xruns = 0;
if (sampleRate > 0.0 && blockSize > 0)
{
msPerBlock = 1000.0 * blockSize / sampleRate;
timeToCpuScale = (msPerBlock > 0.0) ? (1.0 / msPerBlock) : 0.0;
}
else
{
msPerBlock = 0;
timeToCpuScale = 0;
}
}
void AudioProcessLoadMeasurer::registerBlockRenderTime (double milliseconds)
{
const double filterAmount = 0.2;
cpuUsageMs += filterAmount * (milliseconds - cpuUsageMs);
if (milliseconds > msPerBlock)
++xruns;
}
double AudioProcessLoadMeasurer::getLoadAsProportion() const { return jlimit (0.0, 1.0, timeToCpuScale * cpuUsageMs); }
double AudioProcessLoadMeasurer::getLoadAsPercentage() const { return 100.0 * getLoadAsProportion(); }
int AudioProcessLoadMeasurer::getXRunCount() const { return xruns; }
AudioProcessLoadMeasurer::ScopedTimer::ScopedTimer (AudioProcessLoadMeasurer& p)
: owner (p), startTime (Time::getMillisecondCounterHiRes())
{
}
AudioProcessLoadMeasurer::ScopedTimer::~ScopedTimer()
{
owner.registerBlockRenderTime (Time::getMillisecondCounterHiRes() - startTime);
}
} // namespace juce

View File

@ -0,0 +1,96 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
Maintains an ongoing measurement of the proportion of time which is being
spent inside an audio callback.
*/
class JUCE_API AudioProcessLoadMeasurer
{
public:
/** */
AudioProcessLoadMeasurer();
/** Destructor. */
~AudioProcessLoadMeasurer();
//==============================================================================
/** Resets the state. */
void reset();
/** Resets the counter, in preparation for use with the given sample rate and block size. */
void reset (double sampleRate, int blockSize);
/** Returns the current load as a proportion 0 to 1.0 */
double getLoadAsProportion() const;
/** Returns the current load as a percentage 0 to 100.0 */
double getLoadAsPercentage() const;
/** Returns the number of over- (or under-) runs recorded since the state was reset. */
int getXRunCount() const;
//==============================================================================
/** This class measures the time between its construction and destruction and
adds it to an AudioProcessLoadMeasurer.
e.g.
@code
{
AudioProcessLoadMeasurer::ScopedTimer timer (myProcessLoadMeasurer);
myCallback->doTheCallback();
}
@endcode
*/
struct JUCE_API ScopedTimer
{
ScopedTimer (AudioProcessLoadMeasurer&);
~ScopedTimer();
private:
AudioProcessLoadMeasurer& owner;
double startTime;
JUCE_DECLARE_NON_COPYABLE (ScopedTimer)
};
/** Can be called manually to add the time of a callback to the stats.
Normally you probably would never call this - it's simpler and more robust to
use a ScopedTimer to measure the time using an RAII pattern.
*/
void registerBlockRenderTime (double millisecondsTaken);
private:
double cpuUsageMs = 0, timeToCpuScale = 0, msPerBlock = 0;
int xruns = 0;
};
} // namespace juce

View File

@ -172,14 +172,14 @@ public:
/** Destructor. /** Destructor.
This will free any memory allocated by the buffer. This will free any memory allocated by the buffer.
*/ */
~AudioBuffer() noexcept {} ~AudioBuffer() = default;
/** Move constructor */ /** Move constructor */
AudioBuffer (AudioBuffer&& other) noexcept AudioBuffer (AudioBuffer&& other) noexcept
: numChannels (other.numChannels), : numChannels (other.numChannels),
size (other.size), size (other.size),
allocatedBytes (other.allocatedBytes), allocatedBytes (other.allocatedBytes),
allocatedData (static_cast<HeapBlock<char, true>&&> (other.allocatedData)), allocatedData (std::move (other.allocatedData)),
isClear (other.isClear) isClear (other.isClear)
{ {
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))
@ -205,7 +205,7 @@ public:
numChannels = other.numChannels; numChannels = other.numChannels;
size = other.size; size = other.size;
allocatedBytes = other.allocatedBytes; allocatedBytes = other.allocatedBytes;
allocatedData = static_cast<HeapBlock<char, true>&&> (other.allocatedData); allocatedData = std::move (other.allocatedData);
isClear = other.isClear; isClear = other.isClear;
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))
@ -1080,7 +1080,7 @@ private:
allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32; allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32;
allocatedData.malloc (allocatedBytes); allocatedData.malloc (allocatedBytes);
channels = reinterpret_cast<Type**> (allocatedData.get()); channels = reinterpret_cast<Type**> (allocatedData.get());
auto* chan = (Type*) (allocatedData + channelListSize); auto chan = reinterpret_cast<Type*> (allocatedData + channelListSize);
for (int i = 0; i < numChannels; ++i) for (int i = 0; i < numChannels; ++i)
{ {

View File

@ -878,7 +878,7 @@ void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, cons
JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, ) JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, )
#else #else
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = (float) src[i] * multiplier, JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = (float) src[i] * multiplier,
Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 ((const __m128i*) src))), Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 (reinterpret_cast<const __m128i*> (src)))),
JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST,
const Mode::ParallelType mult = Mode::load1 (multiplier);) const Mode::ParallelType mult = Mode::load1 (multiplier);)
#endif #endif

View File

@ -1,215 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
Utility class for linearly smoothed values like volume etc. that should
not change abruptly but as a linear ramp, to avoid audio glitches.
@tags{Audio}
*/
template <typename FloatType>
class LinearSmoothedValue
{
public:
/** Constructor. */
LinearSmoothedValue() noexcept
{
}
/** Constructor. */
LinearSmoothedValue (FloatType initialValue) noexcept
: currentValue (initialValue), target (initialValue)
{
}
//==============================================================================
/** Reset to a new sample rate and ramp length.
@param sampleRate The sampling rate
@param rampLengthInSeconds The duration of the ramp in seconds
*/
void reset (double sampleRate, double rampLengthInSeconds) noexcept
{
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
stepsToTarget = (int) std::floor (rampLengthInSeconds * sampleRate);
currentValue = target;
countdown = 0;
}
//==============================================================================
/** Set a new target value.
@param newValue The new target value
@param force If true, the value will be set immediately, bypassing the ramp
*/
void setValue (FloatType newValue, bool force = false) noexcept
{
if (force)
{
target = currentValue = newValue;
countdown = 0;
return;
}
if (target != newValue)
{
target = newValue;
countdown = stepsToTarget;
if (countdown <= 0)
currentValue = target;
else
step = (target - currentValue) / (FloatType) countdown;
}
}
//==============================================================================
/** Compute the next value.
@returns Smoothed value
*/
FloatType getNextValue() noexcept
{
if (countdown <= 0)
return target;
--countdown;
currentValue += step;
return currentValue;
}
/** Returns true if the current value is currently being interpolated. */
bool isSmoothing() const noexcept
{
return countdown > 0;
}
/** Returns the target value towards which the smoothed value is currently moving. */
FloatType getTargetValue() const noexcept
{
return target;
}
//==============================================================================
/** Applies a linear smoothed gain to a stream of samples
S[i] *= gain
@param samples Pointer to a raw array of samples
@param numSamples Length of array of samples
*/
void applyGain (FloatType* samples, int numSamples) noexcept
{
jassert(numSamples >= 0);
if (isSmoothing())
{
for (int i = 0; i < numSamples; i++)
samples[i] *= getNextValue();
}
else
{
FloatVectorOperations::multiply (samples, target, numSamples);
}
}
//==============================================================================
/** Computes output as linear smoothed gain applied to a stream of samples.
Sout[i] = Sin[i] * gain
@param samplesOut A pointer to a raw array of output samples
@param samplesIn A pointer to a raw array of input samples
@param numSamples The length of the array of samples
*/
void applyGain (FloatType* samplesOut, const FloatType* samplesIn, int numSamples) noexcept
{
jassert (numSamples >= 0);
if (isSmoothing())
{
for (int i = 0; i < numSamples; i++)
samplesOut[i] = samplesIn[i] * getNextValue();
}
else
{
FloatVectorOperations::multiply (samplesOut, samplesIn, target, numSamples);
}
}
//==============================================================================
/** Applies a linear smoothed gain to a buffer */
void applyGain (AudioBuffer<FloatType>& buffer, int numSamples) noexcept
{
jassert (numSamples >= 0);
if (isSmoothing())
{
if (buffer.getNumChannels() == 1)
{
FloatType* samples = buffer.getWritePointer(0);
for (int i = 0; i < numSamples; i++)
samples[i] *= getNextValue();
}
else
{
for (int i = 0; i < numSamples; i++)
{
const FloatType gain = getNextValue();
for (int channel = 0; channel < buffer.getNumChannels(); channel++)
buffer.setSample (channel, i, buffer.getSample (channel, i) * gain);
}
}
}
else
{
buffer.applyGain (0, numSamples, target);
}
}
//==============================================================================
/** Skip the next numSamples samples.
This is identical to calling getNextValue numSamples times.
@see getNextValue
*/
void skip (int numSamples) noexcept
{
if (numSamples >= countdown)
{
currentValue = target;
countdown = 0;
}
else
{
currentValue += (step * static_cast<FloatType> (numSamples));
countdown -= numSamples;
}
}
private:
//==============================================================================
FloatType currentValue = 0, target = 0, step = 0;
int countdown = 0, stepsToTarget = 0;
};
} // namespace juce

View File

@ -56,9 +56,11 @@
#include "buffers/juce_AudioDataConverters.cpp" #include "buffers/juce_AudioDataConverters.cpp"
#include "buffers/juce_FloatVectorOperations.cpp" #include "buffers/juce_FloatVectorOperations.cpp"
#include "buffers/juce_AudioChannelSet.cpp" #include "buffers/juce_AudioChannelSet.cpp"
#include "effects/juce_IIRFilter.cpp" #include "buffers/juce_AudioProcessLoadMeasurer.cpp"
#include "effects/juce_LagrangeInterpolator.cpp" #include "utilities/juce_IIRFilter.cpp"
#include "effects/juce_CatmullRomInterpolator.cpp" #include "utilities/juce_LagrangeInterpolator.cpp"
#include "utilities/juce_CatmullRomInterpolator.cpp"
#include "utilities/juce_SmoothedValue.cpp"
#include "midi/juce_MidiBuffer.cpp" #include "midi/juce_MidiBuffer.cpp"
#include "midi/juce_MidiFile.cpp" #include "midi/juce_MidiFile.cpp"
#include "midi/juce_MidiKeyboardState.cpp" #include "midi/juce_MidiKeyboardState.cpp"

View File

@ -31,7 +31,7 @@
ID: juce_audio_basics ID: juce_audio_basics
vendor: juce vendor: juce
version: 5.3.2 version: 5.4.3
name: JUCE audio and MIDI data classes name: JUCE audio and MIDI data classes
description: Classes for audio buffer manipulation, midi message handling, synthesis, etc. description: Classes for audio buffer manipulation, midi message handling, synthesis, etc.
website: http://www.juce.com/juce website: http://www.juce.com/juce
@ -84,12 +84,14 @@
#include "buffers/juce_FloatVectorOperations.h" #include "buffers/juce_FloatVectorOperations.h"
#include "buffers/juce_AudioSampleBuffer.h" #include "buffers/juce_AudioSampleBuffer.h"
#include "buffers/juce_AudioChannelSet.h" #include "buffers/juce_AudioChannelSet.h"
#include "effects/juce_Decibels.h" #include "buffers/juce_AudioProcessLoadMeasurer.h"
#include "effects/juce_IIRFilter.h" #include "utilities/juce_Decibels.h"
#include "effects/juce_LagrangeInterpolator.h" #include "utilities/juce_IIRFilter.h"
#include "effects/juce_CatmullRomInterpolator.h" #include "utilities/juce_LagrangeInterpolator.h"
#include "effects/juce_LinearSmoothedValue.h" #include "utilities/juce_CatmullRomInterpolator.h"
#include "effects/juce_Reverb.h" #include "utilities/juce_SmoothedValue.h"
#include "utilities/juce_Reverb.h"
#include "utilities/juce_ADSR.h"
#include "midi/juce_MidiMessage.h" #include "midi/juce_MidiMessage.h"
#include "midi/juce_MidiBuffer.h" #include "midi/juce_MidiBuffer.h"
#include "midi/juce_MidiMessageSequence.h" #include "midi/juce_MidiMessageSequence.h"

View File

@ -57,9 +57,16 @@ namespace MidiBufferHelpers
} }
else if (byte == 0xff) else if (byte == 0xff)
{ {
int n; if (maxBytes == 1)
const int bytesLeft = MidiMessage::readVariableLengthVal (data + 1, n); {
size = jmin (maxBytes, n + 2 + bytesLeft); size = 1;
}
else
{
int n;
const int bytesLeft = MidiMessage::readVariableLengthVal (data + 1, n);
size = jmin (maxBytes, n + 2 + bytesLeft);
}
} }
else if (byte >= 0x80) else if (byte >= 0x80)
{ {

View File

@ -169,14 +169,14 @@ MidiFile& MidiFile::operator= (const MidiFile& other)
} }
MidiFile::MidiFile (MidiFile&& other) MidiFile::MidiFile (MidiFile&& other)
: tracks (static_cast<OwnedArray<MidiMessageSequence>&&> (other.tracks)), : tracks (std::move (other.tracks)),
timeFormat (other.timeFormat) timeFormat (other.timeFormat)
{ {
} }
MidiFile& MidiFile::operator= (MidiFile&& other) MidiFile& MidiFile::operator= (MidiFile&& other)
{ {
tracks = static_cast<OwnedArray<MidiMessageSequence>&&> (other.tracks); tracks = std::move (other.tracks);
timeFormat = other.timeFormat; timeFormat = other.timeFormat;
return *this; return *this;
} }
@ -245,7 +245,7 @@ double MidiFile::getLastTimestamp() const
} }
//============================================================================== //==============================================================================
bool MidiFile::readFrom (InputStream& sourceStream) bool MidiFile::readFrom (InputStream& sourceStream, bool createMatchingNoteOffs)
{ {
clear(); clear();
MemoryBlock data; MemoryBlock data;
@ -276,7 +276,7 @@ bool MidiFile::readFrom (InputStream& sourceStream)
break; break;
if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk")) if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk"))
readNextTrack (d, chunkSize); readNextTrack (d, chunkSize, createMatchingNoteOffs);
size -= (size_t) chunkSize + 8; size -= (size_t) chunkSize + 8;
d += chunkSize; d += chunkSize;
@ -290,7 +290,7 @@ bool MidiFile::readFrom (InputStream& sourceStream)
return false; return false;
} }
void MidiFile::readNextTrack (const uint8* data, int size) void MidiFile::readNextTrack (const uint8* data, int size, bool createMatchingNoteOffs)
{ {
double time = 0; double time = 0;
uint8 lastStatusByte = 0; uint8 lastStatusByte = 0;
@ -337,7 +337,9 @@ void MidiFile::readNextTrack (const uint8* data, int size)
}); });
addTrack (result); addTrack (result);
tracks.getLast()->updateMatchedPairs();
if (createMatchingNoteOffs)
tracks.getLast()->updateMatchedPairs();
} }
//============================================================================== //==============================================================================
@ -361,7 +363,7 @@ void MidiFile::convertTimestampTicksToSeconds()
} }
//============================================================================== //==============================================================================
bool MidiFile::writeTo (OutputStream& out, int midiFileType) bool MidiFile::writeTo (OutputStream& out, int midiFileType) const
{ {
jassert (midiFileType >= 0 && midiFileType <= 2); jassert (midiFileType >= 0 && midiFileType <= 2);
@ -379,7 +381,7 @@ bool MidiFile::writeTo (OutputStream& out, int midiFileType)
return true; return true;
} }
bool MidiFile::writeTrack (OutputStream& mainOut, const MidiMessageSequence& ms) bool MidiFile::writeTrack (OutputStream& mainOut, const MidiMessageSequence& ms) const
{ {
MemoryOutputStream out; MemoryOutputStream out;

View File

@ -156,16 +156,25 @@ public:
terms of midi ticks. To convert them to seconds, use the convertTimestampTicksToSeconds() terms of midi ticks. To convert them to seconds, use the convertTimestampTicksToSeconds()
method. method.
@param sourceStream the source stream
@param createMatchingNoteOffs if true, any missing note-offs for previous note-ons will
be automatically added at the end of the file by calling
MidiMessageSequence::updateMatchedPairs on each track.
@returns true if the stream was read successfully @returns true if the stream was read successfully
*/ */
bool readFrom (InputStream& sourceStream); bool readFrom (InputStream& sourceStream, bool createMatchingNoteOffs = true);
/** Writes the midi tracks as a standard midi file. /** Writes the midi tracks as a standard midi file.
The midiFileType value is written as the file's format type, which can be 0, 1 The midiFileType value is written as the file's format type, which can be 0, 1
or 2 - see the midi file spec for more info about that. or 2 - see the midi file spec for more info about that.
@param destStream the destination stream
@param midiFileType the type of midi file
@returns true if the operation succeeded. @returns true if the operation succeeded.
*/ */
bool writeTo (OutputStream& destStream, int midiFileType = 1); bool writeTo (OutputStream& destStream, int midiFileType = 1) const;
/** Converts the timestamp of all the midi events from midi ticks to seconds. /** Converts the timestamp of all the midi events from midi ticks to seconds.
@ -174,14 +183,13 @@ public:
*/ */
void convertTimestampTicksToSeconds(); void convertTimestampTicksToSeconds();
private: private:
//============================================================================== //==============================================================================
OwnedArray<MidiMessageSequence> tracks; OwnedArray<MidiMessageSequence> tracks;
short timeFormat; short timeFormat;
void readNextTrack (const uint8*, int size); void readNextTrack (const uint8*, int, bool);
bool writeTrack (OutputStream&, const MidiMessageSequence&); bool writeTrack (OutputStream&, const MidiMessageSequence&) const;
JUCE_LEAK_DETECTOR (MidiFile) JUCE_LEAK_DETECTOR (MidiFile)
}; };

View File

@ -38,8 +38,8 @@ class JUCE_API MidiKeyboardStateListener
{ {
public: public:
//============================================================================== //==============================================================================
MidiKeyboardStateListener() noexcept {} MidiKeyboardStateListener() = default;
virtual ~MidiKeyboardStateListener() {} virtual ~MidiKeyboardStateListener() = default;
//============================================================================== //==============================================================================
/** Called when one of the MidiKeyboardState's keys is pressed. /** Called when one of the MidiKeyboardState's keys is pressed.

View File

@ -224,9 +224,16 @@ MidiMessage::MidiMessage (const void* srcData, int sz, int& numBytesUsed, const
} }
else if (byte == 0xff) else if (byte == 0xff)
{ {
int n; if (sz == 1)
const int bytesLeft = readVariableLengthVal (src + 1, n); {
size = jmin (sz + 1, n + 2 + bytesLeft); size = 1;
}
else
{
int n;
const int bytesLeft = readVariableLengthVal (src + 1, n);
size = jmin (sz + 1, n + 2 + bytesLeft);
}
auto dest = allocateSpace (size); auto dest = allocateSpace (size);
*dest = (uint8) byte; *dest = (uint8) byte;

View File

@ -83,19 +83,19 @@ public:
complete message, and will return the number of bytes it used. This lets complete message, and will return the number of bytes it used. This lets
you read a sequence of midi messages from a file or stream. you read a sequence of midi messages from a file or stream.
@param data the data to read from @param data the data to read from
@param maxBytesToUse the maximum number of bytes it's allowed to read @param maxBytesToUse the maximum number of bytes it's allowed to read
@param numBytesUsed returns the number of bytes that were actually needed @param numBytesUsed returns the number of bytes that were actually needed
@param lastStatusByte in a sequence of midi messages, the initial byte @param lastStatusByte in a sequence of midi messages, the initial byte
can be dropped from a message if it's the same as the can be dropped from a message if it's the same as the
first byte of the previous message, so this lets you first byte of the previous message, so this lets you
supply the byte to use if the first byte of the message supply the byte to use if the first byte of the message
has in fact been dropped. has in fact been dropped.
@param timeStamp the time to give the midi message - this value doesn't @param timeStamp the time to give the midi message - this value doesn't
use any particular units, so will be application-specific use any particular units, so will be application-specific
@param sysexHasEmbeddedLength when reading sysexes, this flag indicates whether @param sysexHasEmbeddedLength when reading sysexes, this flag indicates whether
to expect the data to begin with a variable-length field to expect the data to begin with a variable-length
indicating its size field indicating its size
*/ */
MidiMessage (const void* data, int maxBytesToUse, MidiMessage (const void* data, int maxBytesToUse,
int& numBytesUsed, uint8 lastStatusByte, int& numBytesUsed, uint8 lastStatusByte,

View File

@ -24,7 +24,7 @@ namespace juce
{ {
MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {} MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {}
MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (static_cast<MidiMessage&&> (mm)) {} MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (std::move (mm)) {}
MidiMessageSequence::MidiEventHolder::~MidiEventHolder() {} MidiMessageSequence::MidiEventHolder::~MidiEventHolder() {}
//============================================================================== //==============================================================================
@ -53,13 +53,13 @@ MidiMessageSequence& MidiMessageSequence::operator= (const MidiMessageSequence&
} }
MidiMessageSequence::MidiMessageSequence (MidiMessageSequence&& other) noexcept MidiMessageSequence::MidiMessageSequence (MidiMessageSequence&& other) noexcept
: list (static_cast<OwnedArray<MidiEventHolder>&&> (other.list)) : list (std::move (other.list))
{ {
} }
MidiMessageSequence& MidiMessageSequence::operator= (MidiMessageSequence&& other) noexcept MidiMessageSequence& MidiMessageSequence::operator= (MidiMessageSequence&& other) noexcept
{ {
list = static_cast<OwnedArray<MidiEventHolder>&&> (other.list); list = std::move (other.list);
return *this; return *this;
} }
@ -174,7 +174,7 @@ MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (const MidiM
MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (MidiMessage&& newMessage, double timeAdjustment) MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (MidiMessage&& newMessage, double timeAdjustment)
{ {
return addEvent (new MidiEventHolder (static_cast<MidiMessage&&> (newMessage)), timeAdjustment); return addEvent (new MidiEventHolder (std::move (newMessage)), timeAdjustment);
} }
void MidiMessageSequence::deleteEvent (int index, bool deleteMatchingNoteUp) void MidiMessageSequence::deleteEvent (int index, bool deleteMatchingNoteUp)

View File

@ -129,12 +129,12 @@ void MPEInstrument::setTimbreTrackingMode (TrackingMode modeToUse)
} }
//============================================================================== //==============================================================================
void MPEInstrument::addListener (Listener* const listenerToAdd) noexcept void MPEInstrument::addListener (Listener* listenerToAdd)
{ {
listeners.add (listenerToAdd); listeners.add (listenerToAdd);
} }
void MPEInstrument::removeListener (Listener* const listenerToRemove) noexcept void MPEInstrument::removeListener (Listener* listenerToRemove)
{ {
listeners.remove (listenerToRemove); listeners.remove (listenerToRemove);
} }
@ -156,7 +156,7 @@ void MPEInstrument::processNextMidiEvent (const MidiMessage& message)
//============================================================================== //==============================================================================
void MPEInstrument::processMidiNoteOnMessage (const MidiMessage& message) void MPEInstrument::processMidiNoteOnMessage (const MidiMessage& message)
{ {
// Note: if a note-on with velocity = 0 is used to convey a note-off, // Note: If a note-on with velocity = 0 is used to convey a note-off,
// then the actual note-off velocity is not known. In this case, // then the actual note-off velocity is not known. In this case,
// the MPE convention is to use note-off velocity = 64. // the MPE convention is to use note-off velocity = 64.

View File

@ -241,7 +241,7 @@ public:
{ {
public: public:
/** Destructor. */ /** Destructor. */
virtual ~Listener() {} virtual ~Listener() = default;
/** Implement this callback to be informed whenever a new expressive MIDI /** Implement this callback to be informed whenever a new expressive MIDI
note is triggered. note is triggered.
@ -271,7 +271,7 @@ public:
MPE note's key state (whether the key is down and/or the note is MPE note's key state (whether the key is down and/or the note is
sustained) has changed. sustained) has changed.
Note: if the key state changes to MPENote::off, noteReleased is Note: If the key state changes to MPENote::off, noteReleased is
called instead. called instead.
*/ */
virtual void noteKeyStateChanged (MPENote changedNote) = 0; virtual void noteKeyStateChanged (MPENote changedNote) = 0;
@ -286,10 +286,10 @@ public:
//============================================================================== //==============================================================================
/** Adds a listener. */ /** Adds a listener. */
void addListener (Listener* listenerToAdd) noexcept; void addListener (Listener* listenerToAdd);
/** Removes a listener. */ /** Removes a listener. */
void removeListener (Listener* listenerToRemove) noexcept; void removeListener (Listener* listenerToRemove);
//============================================================================== //==============================================================================
/** Puts the instrument into legacy mode. /** Puts the instrument into legacy mode.
@ -352,8 +352,7 @@ private:
struct MPEDimension struct MPEDimension
{ {
MPEDimension() noexcept : trackingMode (lastNotePlayedOnChannel) {} TrackingMode trackingMode = lastNotePlayedOnChannel;
TrackingMode trackingMode;
MPEValue lastValueReceivedOnChannel[16]; MPEValue lastValueReceivedOnChannel[16];
MPEValue MPENote::* value; MPEValue MPENote::* value;
MPEValue& getValue (MPENote& note) noexcept { return note.*(value); } MPEValue& getValue (MPENote& note) noexcept { return note.*(value); }

View File

@ -215,7 +215,7 @@ private:
std::size_t pos = 0; std::size_t pos = 0;
MidiBuffer::Iterator iter (midiBuffer); MidiBuffer::Iterator iter (midiBuffer);
MidiMessage midiMessage; MidiMessage midiMessage;
int samplePosition; // Note: not actually used, so no need to initialise. int samplePosition; // Note: Not actually used, so no need to initialise.
while (iter.getNextEvent (midiMessage, samplePosition)) while (iter.getNextEvent (midiMessage, samplePosition))
{ {

View File

@ -35,7 +35,7 @@ namespace juce
class instead. You just need to take care to send them to the appropriate class instead. You just need to take care to send them to the appropriate
per-note MIDI channel. per-note MIDI channel.
Note: if you are working with an MPEZoneLayout object inside your app, Note: If you are working with an MPEZoneLayout object inside your app,
you should not use the message sequences provided here. Instead, you should you should not use the message sequences provided here. Instead, you should
change the zone layout programmatically with the member functions provided in the change the zone layout programmatically with the member functions provided in the
MPEZoneLayout class itself. You should also make sure that the Expressive MPEZoneLayout class itself. You should also make sure that the Expressive

View File

@ -132,7 +132,7 @@ struct JUCE_API MPENote
*/ */
MPEValue pressure { MPEValue::centreValue() }; MPEValue pressure { MPEValue::centreValue() };
/** Inital value of timbre when the note was triggered. /** Initial value of timbre when the note was triggered.
This should never change during the lifetime of an MPENote object. This should never change during the lifetime of an MPENote object.
*/ */
MPEValue initialTimbre { MPEValue::centreValue() }; MPEValue initialTimbre { MPEValue::centreValue() };

View File

@ -42,13 +42,16 @@ MPESynthesiser::~MPESynthesiser()
void MPESynthesiser::startVoice (MPESynthesiserVoice* voice, MPENote noteToStart) void MPESynthesiser::startVoice (MPESynthesiserVoice* voice, MPENote noteToStart)
{ {
jassert (voice != nullptr); jassert (voice != nullptr);
voice->currentlyPlayingNote = noteToStart; voice->currentlyPlayingNote = noteToStart;
voice->noteOnTime = lastNoteOnCounter++;
voice->noteStarted(); voice->noteStarted();
} }
void MPESynthesiser::stopVoice (MPESynthesiserVoice* voice, MPENote noteToStop, bool allowTailOff) void MPESynthesiser::stopVoice (MPESynthesiserVoice* voice, MPENote noteToStop, bool allowTailOff)
{ {
jassert (voice != nullptr); jassert (voice != nullptr);
voice->currentlyPlayingNote = noteToStop; voice->currentlyPlayingNote = noteToStop;
voice->noteStopped (allowTailOff); voice->noteStopped (allowTailOff);
} }
@ -197,7 +200,7 @@ MPESynthesiserVoice* MPESynthesiser::findVoiceToSteal (MPENote noteToStealVoiceF
// compilers generating code containing heap allocations.. // compilers generating code containing heap allocations..
struct Sorter struct Sorter
{ {
bool operator() (const MPESynthesiserVoice* a, const MPESynthesiserVoice* b) const noexcept { return a->wasStartedBefore (*b); } bool operator() (const MPESynthesiserVoice* a, const MPESynthesiserVoice* b) const noexcept { return a->noteOnTime < b->noteOnTime; }
}; };
std::sort (usableVoices.begin(), usableVoices.end(), Sorter()); std::sort (usableVoices.begin(), usableVoices.end(), Sorter());

View File

@ -72,7 +72,7 @@ public:
MPESynthesiser (MPEInstrument* instrument); MPESynthesiser (MPEInstrument* instrument);
/** Destructor. */ /** Destructor. */
~MPESynthesiser(); ~MPESynthesiser() override;
//============================================================================== //==============================================================================
/** Deletes all voices. */ /** Deletes all voices. */
@ -188,7 +188,7 @@ protected:
renderNextBlock(). Do not call it yourself, otherwise the internal MPE note state renderNextBlock(). Do not call it yourself, otherwise the internal MPE note state
will become inconsistent. will become inconsistent.
*/ */
virtual void noteAdded (MPENote newNote) override; void noteAdded (MPENote newNote) override;
/** Stops playing a note. /** Stops playing a note.
@ -203,7 +203,7 @@ protected:
renderNextBlock(). Do not call it yourself, otherwise the internal MPE note state renderNextBlock(). Do not call it yourself, otherwise the internal MPE note state
will become inconsistent. will become inconsistent.
*/ */
virtual void noteReleased (MPENote finishedNote) override; void noteReleased (MPENote finishedNote) override;
/** Will find any voice that is currently playing changedNote, update its /** Will find any voice that is currently playing changedNote, update its
currently playing note, and call its notePressureChanged method. currently playing note, and call its notePressureChanged method.
@ -211,7 +211,7 @@ protected:
This method will be called automatically according to the midi data passed into This method will be called automatically according to the midi data passed into
renderNextBlock(). Do not call it yourself. renderNextBlock(). Do not call it yourself.
*/ */
virtual void notePressureChanged (MPENote changedNote) override; void notePressureChanged (MPENote changedNote) override;
/** Will find any voice that is currently playing changedNote, update its /** Will find any voice that is currently playing changedNote, update its
currently playing note, and call its notePitchbendChanged method. currently playing note, and call its notePitchbendChanged method.
@ -219,7 +219,7 @@ protected:
This method will be called automatically according to the midi data passed into This method will be called automatically according to the midi data passed into
renderNextBlock(). Do not call it yourself. renderNextBlock(). Do not call it yourself.
*/ */
virtual void notePitchbendChanged (MPENote changedNote) override; void notePitchbendChanged (MPENote changedNote) override;
/** Will find any voice that is currently playing changedNote, update its /** Will find any voice that is currently playing changedNote, update its
currently playing note, and call its noteTimbreChanged method. currently playing note, and call its noteTimbreChanged method.
@ -227,7 +227,7 @@ protected:
This method will be called automatically according to the midi data passed into This method will be called automatically according to the midi data passed into
renderNextBlock(). Do not call it yourself. renderNextBlock(). Do not call it yourself.
*/ */
virtual void noteTimbreChanged (MPENote changedNote) override; void noteTimbreChanged (MPENote changedNote) override;
/** Will find any voice that is currently playing changedNote, update its /** Will find any voice that is currently playing changedNote, update its
currently playing note, and call its noteKeyStateChanged method. currently playing note, and call its noteKeyStateChanged method.
@ -235,24 +235,24 @@ protected:
This method will be called automatically according to the midi data passed into This method will be called automatically according to the midi data passed into
renderNextBlock(). Do not call it yourself. renderNextBlock(). Do not call it yourself.
*/ */
virtual void noteKeyStateChanged (MPENote changedNote) override; void noteKeyStateChanged (MPENote changedNote) override;
//============================================================================== //==============================================================================
/** This will simply call renderNextBlock for each currently active /** This will simply call renderNextBlock for each currently active
voice and fill the buffer with the sum. voice and fill the buffer with the sum.
Override this method if you need to do more work to render your audio. Override this method if you need to do more work to render your audio.
*/ */
virtual void renderNextSubBlock (AudioBuffer<float>& outputAudio, void renderNextSubBlock (AudioBuffer<float>& outputAudio,
int startSample, int startSample,
int numSamples) override; int numSamples) override;
/** This will simply call renderNextBlock for each currently active /** This will simply call renderNextBlock for each currently active
voice and fill the buffer with the sum. (souble-precision version) voice and fill the buffer with the sum. (souble-precision version)
Override this method if you need to do more work to render your audio. Override this method if you need to do more work to render your audio.
*/ */
virtual void renderNextSubBlock (AudioBuffer<double>& outputAudio, void renderNextSubBlock (AudioBuffer<double>& outputAudio,
int startSample, int startSample,
int numSamples) override; int numSamples) override;
//============================================================================== //==============================================================================
/** Searches through the voices to find one that's not currently playing, and /** Searches through the voices to find one that's not currently playing, and
@ -304,6 +304,7 @@ protected:
private: private:
//============================================================================== //==============================================================================
bool shouldStealVoices = false; bool shouldStealVoices = false;
uint32 lastNoteOnCounter = 0;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiser) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiser)
}; };

View File

@ -42,11 +42,6 @@ bool MPESynthesiserVoice::isPlayingButReleased() const noexcept
return isActive() && currentlyPlayingNote.keyState == MPENote::off; return isActive() && currentlyPlayingNote.keyState == MPENote::off;
} }
bool MPESynthesiserVoice::wasStartedBefore (const MPESynthesiserVoice& other) const noexcept
{
return noteStartTime < other.noteStartTime;
}
void MPESynthesiserVoice::clearCurrentNote() noexcept void MPESynthesiserVoice::clearCurrentNote() noexcept
{ {
currentlyPlayingNote = MPENote(); currentlyPlayingNote = MPENote();

View File

@ -156,8 +156,10 @@ public:
*/ */
double getSampleRate() const noexcept { return currentSampleRate; } double getSampleRate() const noexcept { return currentSampleRate; }
/** Returns true if this voice started playing its current note before the other voice did. */ /** This will be set to an incrementing counter value in MPESynthesiser::startVoice()
bool wasStartedBefore (const MPESynthesiserVoice& other) const noexcept; and can be used to determine the order in which voices started.
*/
uint32 noteOnTime = 0;
protected: protected:
//============================================================================== //==============================================================================
@ -182,7 +184,6 @@ protected:
private: private:
//============================================================================== //==============================================================================
friend class MPESynthesiser; friend class MPESynthesiser;
uint32 noteStartTime = 0;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserVoice) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserVoice)
}; };

View File

@ -80,13 +80,7 @@ public:
*/ */
struct Zone struct Zone
{ {
Zone (const Zone& other) noexcept Zone (const Zone& other) = default;
: numMemberChannels (other.numMemberChannels),
perNotePitchbendRange (other.perNotePitchbendRange),
masterPitchbendRange (other.masterPitchbendRange),
lowerZone (other.lowerZone)
{
}
bool isLowerZone() const noexcept { return lowerZone; } bool isLowerZone() const noexcept { return lowerZone; }
bool isUpperZone() const noexcept { return ! lowerZone; } bool isUpperZone() const noexcept { return ! lowerZone; }
@ -185,7 +179,7 @@ public:
{ {
public: public:
/** Destructor. */ /** Destructor. */
virtual ~Listener() {} virtual ~Listener() = default;
/** Implement this callback to be notified about any changes to this /** Implement this callback to be notified about any changes to this
MPEZoneLayout. Will be called whenever a zone is added, zones are MPEZoneLayout. Will be called whenever a zone is added, zones are

View File

@ -32,9 +32,7 @@ namespace juce
struct JUCE_API AudioSourceChannelInfo struct JUCE_API AudioSourceChannelInfo
{ {
/** Creates an uninitialised AudioSourceChannelInfo. */ /** Creates an uninitialised AudioSourceChannelInfo. */
AudioSourceChannelInfo() noexcept AudioSourceChannelInfo() = default;
{
}
/** Creates an AudioSourceChannelInfo. */ /** Creates an AudioSourceChannelInfo. */
AudioSourceChannelInfo (AudioBuffer<float>* bufferToUse, AudioSourceChannelInfo (AudioBuffer<float>* bufferToUse,
@ -113,11 +111,11 @@ class JUCE_API AudioSource
protected: protected:
//============================================================================== //==============================================================================
/** Creates an AudioSource. */ /** Creates an AudioSource. */
AudioSource() noexcept {} AudioSource() = default;
public: public:
/** Destructor. */ /** Destructor. */
virtual ~AudioSource() {} virtual ~AudioSource() = default;
//============================================================================== //==============================================================================
/** Tells the source to prepare for playing. /** Tells the source to prepare for playing.

View File

@ -66,7 +66,7 @@ public:
The input source may be deleted depending on whether the deleteSourceWhenDeleted The input source may be deleted depending on whether the deleteSourceWhenDeleted
flag was set in the constructor. flag was set in the constructor.
*/ */
~BufferingAudioSource(); ~BufferingAudioSource() override;
//============================================================================== //==============================================================================
/** Implementation of the AudioSource method. */ /** Implementation of the AudioSource method. */

View File

@ -56,7 +56,7 @@ public:
bool deleteSourceWhenDeleted); bool deleteSourceWhenDeleted);
/** Destructor. */ /** Destructor. */
~ChannelRemappingAudioSource(); ~ChannelRemappingAudioSource() override;
//============================================================================== //==============================================================================
/** Specifies a number of channels that this audio source must produce from its /** Specifies a number of channels that this audio source must produce from its

View File

@ -43,7 +43,7 @@ public:
bool deleteInputWhenDeleted); bool deleteInputWhenDeleted);
/** Destructor. */ /** Destructor. */
~IIRFilterAudioSource(); ~IIRFilterAudioSource() override;
//============================================================================== //==============================================================================
/** Changes the filter to use the same parameters as the one being passed in. */ /** Changes the filter to use the same parameters as the one being passed in. */

View File

@ -49,7 +49,8 @@ void MemoryAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& bufferT
auto max = 0, pos = 0; auto max = 0, pos = 0;
auto n = buffer.getNumSamples(), m = bufferToFill.numSamples; auto n = buffer.getNumSamples(), m = bufferToFill.numSamples;
for (auto i = position; (i < n || isLooping) && (pos < m); i += max) int i;
for (i = position; (i < n || isLooping) && (pos < m); i += max)
{ {
max = jmin (m - pos, n - (i % n)); max = jmin (m - pos, n - (i % n));
@ -65,6 +66,8 @@ void MemoryAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& bufferT
if (pos < m) if (pos < m)
dst.clear (bufferToFill.startSample + pos, m - pos); dst.clear (bufferToFill.startSample + pos, m - pos);
position = (i % n);
} }
} // namespace juce } // namespace juce

View File

@ -41,7 +41,7 @@ public:
MixerAudioSource(); MixerAudioSource();
/** Destructor. */ /** Destructor. */
~MixerAudioSource(); ~MixerAudioSource() override;
//============================================================================== //==============================================================================
/** Adds an input source to the mixer. /** Adds an input source to the mixer.

View File

@ -40,11 +40,11 @@ class JUCE_API PositionableAudioSource : public AudioSource
protected: protected:
//============================================================================== //==============================================================================
/** Creates the PositionableAudioSource. */ /** Creates the PositionableAudioSource. */
PositionableAudioSource() noexcept {} PositionableAudioSource() = default;
public: public:
/** Destructor */ /** Destructor */
~PositionableAudioSource() {} ~PositionableAudioSource() override = default;
//============================================================================== //==============================================================================
/** Tells the stream to move to a new position. /** Tells the stream to move to a new position.

View File

@ -47,7 +47,7 @@ public:
int numChannels = 2); int numChannels = 2);
/** Destructor. */ /** Destructor. */
~ResamplingAudioSource(); ~ResamplingAudioSource() override;
/** Changes the resampling ratio. /** Changes the resampling ratio.

View File

@ -44,7 +44,7 @@ public:
bool deleteInputWhenDeleted); bool deleteInputWhenDeleted);
/** Destructor. */ /** Destructor. */
~ReverbAudioSource(); ~ReverbAudioSource() override;
//============================================================================== //==============================================================================
/** Returns the parameters from the reverb. */ /** Returns the parameters from the reverb. */

View File

@ -38,7 +38,7 @@ public:
ToneGeneratorAudioSource(); ToneGeneratorAudioSource();
/** Destructor. */ /** Destructor. */
~ToneGeneratorAudioSource(); ~ToneGeneratorAudioSource() override;
//============================================================================== //==============================================================================
/** Sets the signal's amplitude. */ /** Sets the signal's amplitude. */

View File

@ -217,6 +217,18 @@ void Synthesiser::processNextBlock (AudioBuffer<floatType>& outputAudio,
template void Synthesiser::processNextBlock<float> (AudioBuffer<float>&, const MidiBuffer&, int, int); template void Synthesiser::processNextBlock<float> (AudioBuffer<float>&, const MidiBuffer&, int, int);
template void Synthesiser::processNextBlock<double> (AudioBuffer<double>&, const MidiBuffer&, int, int); template void Synthesiser::processNextBlock<double> (AudioBuffer<double>&, const MidiBuffer&, int, int);
void Synthesiser::renderNextBlock (AudioBuffer<float>& outputAudio, const MidiBuffer& inputMidi,
int startSample, int numSamples)
{
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
}
void Synthesiser::renderNextBlock (AudioBuffer<double>& outputAudio, const MidiBuffer& inputMidi,
int startSample, int numSamples)
{
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
}
void Synthesiser::renderVoices (AudioBuffer<float>& buffer, int startSample, int numSamples) void Synthesiser::renderVoices (AudioBuffer<float>& buffer, int startSample, int numSamples)
{ {
for (auto* voice : voices) for (auto* voice : voices)
@ -323,7 +335,7 @@ void Synthesiser::stopVoice (SynthesiserVoice* voice, float velocity, const bool
voice->stopNote (velocity, allowTailOff); voice->stopNote (velocity, allowTailOff);
// the subclass MUST call clearCurrentNote() if it's not tailing off! RTFM for stopNote()! // the subclass MUST call clearCurrentNote() if it's not tailing off! RTFM for stopNote()!
jassert (allowTailOff || (voice->getCurrentlyPlayingNote() < 0 && voice->getCurrentlyPlayingSound() == 0)); jassert (allowTailOff || (voice->getCurrentlyPlayingNote() < 0 && voice->getCurrentlyPlayingSound() == nullptr));
} }
void Synthesiser::noteOff (const int midiChannel, void Synthesiser::noteOff (const int midiChannel,
@ -338,7 +350,7 @@ void Synthesiser::noteOff (const int midiChannel,
if (voice->getCurrentlyPlayingNote() == midiNoteNumber if (voice->getCurrentlyPlayingNote() == midiNoteNumber
&& voice->isPlayingChannel (midiChannel)) && voice->isPlayingChannel (midiChannel))
{ {
if (SynthesiserSound* const sound = voice->getCurrentlyPlayingSound()) if (auto sound = voice->getCurrentlyPlayingSound())
{ {
if (sound->appliesToNote (midiNoteNumber) if (sound->appliesToNote (midiNoteNumber)
&& sound->appliesToChannel (midiChannel)) && sound->appliesToChannel (midiChannel))

View File

@ -46,7 +46,7 @@ protected:
public: public:
/** Destructor. */ /** Destructor. */
virtual ~SynthesiserSound(); ~SynthesiserSound() override;
//============================================================================== //==============================================================================
/** Returns true if this sound should be played when a given midi note is pressed. /** Returns true if this sound should be played when a given midi note is pressed.
@ -352,7 +352,7 @@ public:
int getNumSounds() const noexcept { return sounds.size(); } int getNumSounds() const noexcept { return sounds.size(); }
/** Returns one of the sounds. */ /** Returns one of the sounds. */
SynthesiserSound* getSound (int index) const noexcept { return sounds [index]; } SynthesiserSound::Ptr getSound (int index) const noexcept { return sounds[index]; }
/** Adds a new sound to the synthesiser. /** Adds a new sound to the synthesiser.
@ -525,21 +525,15 @@ public:
both to the audio output buffer and the midi input buffer, so any midi events both to the audio output buffer and the midi input buffer, so any midi events
with timestamps outside the specified region will be ignored. with timestamps outside the specified region will be ignored.
*/ */
inline void renderNextBlock (AudioBuffer<float>& outputAudio, void renderNextBlock (AudioBuffer<float>& outputAudio,
const MidiBuffer& inputMidi, const MidiBuffer& inputMidi,
int startSample, int startSample,
int numSamples) int numSamples);
{
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
}
inline void renderNextBlock (AudioBuffer<double>& outputAudio, void renderNextBlock (AudioBuffer<double>& outputAudio,
const MidiBuffer& inputMidi, const MidiBuffer& inputMidi,
int startSample, int startSample,
int numSamples) int numSamples);
{
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
}
/** Returns the current target sample rate at which rendering is being done. /** Returns the current target sample rate at which rendering is being done.
Subclasses may need to know this so that they can pitch things correctly. Subclasses may need to know this so that they can pitch things correctly.
@ -632,12 +626,6 @@ protected:
private: private:
//============================================================================== //==============================================================================
template <typename floatType>
void processNextBlock (AudioBuffer<floatType>& outputAudio,
const MidiBuffer& inputMidi,
int startSample,
int numSamples);
//==============================================================================
double sampleRate = 0; double sampleRate = 0;
uint32 lastNoteOnCounter = 0; uint32 lastNoteOnCounter = 0;
int minimumSubBlockSize = 32; int minimumSubBlockSize = 32;
@ -645,6 +633,9 @@ private:
bool shouldStealNotes = true; bool shouldStealNotes = true;
BigInteger sustainPedalsDown; BigInteger sustainPedalsDown;
template <typename floatType>
void processNextBlock (AudioBuffer<floatType>&, const MidiBuffer&, int startSample, int numSamples);
#if JUCE_CATCH_DEPRECATED_CODE_MISUSE #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
// Note the new parameters for these methods. // Note the new parameters for these methods.
virtual int findFreeVoice (const bool) const { return 0; } virtual int findFreeVoice (const bool) const { return 0; }

View File

@ -0,0 +1,255 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
A very simple ADSR envelope class.
To use it, call setSampleRate() with the current sample rate and give it some parameters
with setParameters() then call getNextSample() to get the envelope value to be applied
to each audio sample or applyEnvelopeToBuffer() to apply the envelope to a whole buffer.
*/
class ADSR
{
public:
//==============================================================================
ADSR()
{
setSampleRate (44100.0);
setParameters ({});
}
//==============================================================================
/** Holds the parameters being used by an ADSR object. */
struct Parameters
{
/** Attack time in seconds. */
float attack = 0.1f;
/** Decay time in seconds. */
float decay = 0.1f;
/** Sustain level. */
float sustain = 1.0f;
/** Release time in seconds. */
float release = 0.1f;
};
/** Sets the parameters that will be used by an ADSR object.
You must have called setSampleRate() with the correct sample rate before
this otherwise the values may be incorrect!
@see getParameters
*/
void setParameters (const Parameters& newParameters)
{
currentParameters = newParameters;
sustainLevel = newParameters.sustain;
calculateRates (newParameters);
if (currentState != State::idle)
checkCurrentState();
}
/** Returns the parameters currently being used by an ADSR object.
@see setParameters
*/
const Parameters& getParameters() const { return currentParameters; }
/** Returns true if the envelope is in its attack, decay, sustain or release stage. */
bool isActive() const noexcept { return currentState != State::idle; }
//==============================================================================
/** Sets the sample rate that will be used for the envelope.
This must be called before the getNextSample() or setParameters() methods.
*/
void setSampleRate (double sampleRate)
{
jassert (sampleRate > 0.0);
sr = sampleRate;
}
//==============================================================================
/** Resets the envelope to an idle state. */
void reset()
{
envelopeVal = 0.0f;
currentState = State::idle;
if (resetReleaseRate)
{
releaseRate = static_cast<float> (sustainLevel / (currentParameters.release * sr));
resetReleaseRate = false;
}
}
/** Starts the attack phase of the envelope. */
void noteOn()
{
if (attackRate > 0.0f)
{
currentState = State::attack;
}
else if (decayRate > 0.0f)
{
envelopeVal = 1.0f;
currentState = State::decay;
}
else
{
currentState = State::sustain;
}
}
/** Starts the release phase of the envelope. */
void noteOff()
{
if (currentState != State::idle)
{
if (releaseRate > 0.0f)
{
if (currentState != State::sustain)
{
releaseRate = static_cast<float> (envelopeVal / (currentParameters.release * sr));
resetReleaseRate = true;
}
currentState = State::release;
}
else
{
reset();
}
}
}
//==============================================================================
/** Returns the next sample value for an ADSR object.
@see applyEnvelopeToBuffer
*/
float getNextSample()
{
if (currentState == State::idle)
return 0.0f;
if (currentState == State::attack)
{
envelopeVal += attackRate;
if (envelopeVal >= 1.0f)
{
envelopeVal = 1.0f;
if (decayRate > 0.0f)
currentState = State::decay;
else
currentState = State::sustain;
}
}
else if (currentState == State::decay)
{
envelopeVal -= decayRate;
if (envelopeVal <= sustainLevel)
{
envelopeVal = sustainLevel;
currentState = State::sustain;
}
}
else if (currentState == State::sustain)
{
envelopeVal = sustainLevel;
}
else if (currentState == State::release)
{
envelopeVal -= releaseRate;
if (envelopeVal <= 0.0f)
reset();
}
return envelopeVal;
}
/** This method will conveniently apply the next numSamples number of envelope values
to an AudioBuffer.
@see getNextSample
*/
template<typename FloatType>
void applyEnvelopeToBuffer (AudioBuffer<FloatType>& buffer, int startSample, int numSamples)
{
jassert (startSample + numSamples <= buffer.getNumSamples());
auto numChannels = buffer.getNumChannels();
while (--numSamples >= 0)
{
auto env = getNextSample();
for (int i = 0; i < numChannels; ++i)
buffer.getWritePointer (i)[startSample] *= env;
++startSample;
}
}
private:
//==============================================================================
void calculateRates (const Parameters& parameters)
{
// need to call setSampleRate() first!
jassert (sr > 0.0);
attackRate = (parameters.attack > 0.0f ? static_cast<float> (1.0f / (parameters.attack * sr)) : -1.0f);
decayRate = (parameters.decay > 0.0f ? static_cast<float> ((1.0f - sustainLevel) / (parameters.decay * sr)) : -1.0f);
releaseRate = (parameters.release > 0.0f ? static_cast<float> (sustainLevel / (parameters.release * sr)) : -1.0f);
}
void checkCurrentState()
{
if (currentState == State::attack && attackRate <= 0.0f) currentState = decayRate > 0.0f ? State::decay : State::sustain;
else if (currentState == State::decay && decayRate <= 0.0f) currentState = State::sustain;
else if (currentState == State::release && releaseRate <= 0.0f) reset();
}
//==============================================================================
enum class State { idle, attack, decay, sustain, release };
State currentState = State::idle;
Parameters currentParameters;
double sr = 0.0;
float envelopeVal = 0.0f, sustainLevel = 0.0f, attackRate = 0.0f, decayRate = 0.0f, releaseRate = 0.0f;
bool resetReleaseRate = false;
};
} // namespace juce

View File

@ -242,6 +242,10 @@ namespace
} }
subSamplePos = pos; subSamplePos = pos;
if (wrap == 0)
return (int) (in - originalIn);
return ((int) (in - originalIn) + wrap) % wrap; return ((int) (in - originalIn) + wrap) % wrap;
} }
@ -353,6 +357,10 @@ namespace
} }
subSamplePos = pos; subSamplePos = pos;
if (wrap == 0)
return (int) (in - originalIn);
return ((int) (in - originalIn) + wrap) % wrap; return ((int) (in - originalIn) + wrap) % wrap;
} }

View File

@ -49,22 +49,13 @@ public:
/** Holds the parameters being used by a Reverb object. */ /** Holds the parameters being used by a Reverb object. */
struct Parameters struct Parameters
{ {
Parameters() noexcept float roomSize = 0.5f; /**< Room size, 0 to 1.0, where 1.0 is big, 0 is small. */
: roomSize (0.5f), float damping = 0.5f; /**< Damping, 0 to 1.0, where 0 is not damped, 1.0 is fully damped. */
damping (0.5f), float wetLevel = 0.33f; /**< Wet level, 0 to 1.0 */
wetLevel (0.33f), float dryLevel = 0.4f; /**< Dry level, 0 to 1.0 */
dryLevel (0.4f), float width = 1.0f; /**< Reverb width, 0 to 1.0, where 1.0 is very wide. */
width (1.0f), float freezeMode = 0.0f; /**< Freeze mode - values < 0.5 are "normal" mode, values > 0.5
freezeMode (0) put the reverb into a continuous feedback loop. */
{}
float roomSize; /**< Room size, 0 to 1.0, where 1.0 is big, 0 is small. */
float damping; /**< Damping, 0 to 1.0, where 0 is not damped, 1.0 is fully damped. */
float wetLevel; /**< Wet level, 0 to 1.0 */
float dryLevel; /**< Dry level, 0 to 1.0 */
float width; /**< Reverb width, 0 to 1.0, where 1.0 is very wide. */
float freezeMode; /**< Freeze mode - values < 0.5 are "normal" mode, values > 0.5
put the reverb into a continuous feedback loop. */
}; };
//============================================================================== //==============================================================================
@ -81,9 +72,9 @@ public:
const float dryScaleFactor = 2.0f; const float dryScaleFactor = 2.0f;
const float wet = newParams.wetLevel * wetScaleFactor; const float wet = newParams.wetLevel * wetScaleFactor;
dryGain.setValue (newParams.dryLevel * dryScaleFactor); dryGain.setTargetValue (newParams.dryLevel * dryScaleFactor);
wetGain1.setValue (0.5f * wet * (1.0f + newParams.width)); wetGain1.setTargetValue (0.5f * wet * (1.0f + newParams.width));
wetGain2.setValue (0.5f * wet * (1.0f - newParams.width)); wetGain2.setTargetValue (0.5f * wet * (1.0f - newParams.width));
gain = isFrozen (newParams.freezeMode) ? 0.0f : 0.015f; gain = isFrozen (newParams.freezeMode) ? 0.0f : 0.015f;
parameters = newParams; parameters = newParams;
@ -216,15 +207,15 @@ private:
void setDamping (const float dampingToUse, const float roomSizeToUse) noexcept void setDamping (const float dampingToUse, const float roomSizeToUse) noexcept
{ {
damping.setValue (dampingToUse); damping.setTargetValue (dampingToUse);
feedback.setValue (roomSizeToUse); feedback.setTargetValue (roomSizeToUse);
} }
//============================================================================== //==============================================================================
class CombFilter class CombFilter
{ {
public: public:
CombFilter() noexcept : bufferSize (0), bufferIndex (0), last (0) {} CombFilter() noexcept {}
void setSize (const int size) void setSize (const int size)
{ {
@ -259,8 +250,8 @@ private:
private: private:
HeapBlock<float> buffer; HeapBlock<float> buffer;
int bufferSize, bufferIndex; int bufferSize = 0, bufferIndex = 0;
float last; float last = 0.0f;
JUCE_DECLARE_NON_COPYABLE (CombFilter) JUCE_DECLARE_NON_COPYABLE (CombFilter)
}; };
@ -269,7 +260,7 @@ private:
class AllPassFilter class AllPassFilter
{ {
public: public:
AllPassFilter() noexcept : bufferSize (0), bufferIndex (0) {} AllPassFilter() noexcept {}
void setSize (const int size) void setSize (const int size)
{ {
@ -300,7 +291,7 @@ private:
private: private:
HeapBlock<float> buffer; HeapBlock<float> buffer;
int bufferSize, bufferIndex; int bufferSize = 0, bufferIndex = 0;
JUCE_DECLARE_NON_COPYABLE (AllPassFilter) JUCE_DECLARE_NON_COPYABLE (AllPassFilter)
}; };
@ -314,7 +305,7 @@ private:
CombFilter comb [numChannels][numCombs]; CombFilter comb [numChannels][numCombs];
AllPassFilter allPass [numChannels][numAllPasses]; AllPassFilter allPass [numChannels][numAllPasses];
LinearSmoothedValue<float> damping, feedback, dryGain, wetGain1, wetGain2; SmoothedValue<float> damping, feedback, dryGain, wetGain1, wetGain2;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Reverb) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Reverb)
}; };

View File

@ -0,0 +1,92 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2018 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
#if JUCE_UNIT_TESTS
static CommonSmoothedValueTests <SmoothedValue<float, ValueSmoothingTypes::Linear>> commonLinearSmoothedValueTests;
static CommonSmoothedValueTests <SmoothedValue<float, ValueSmoothingTypes::Multiplicative>> commonMultiplicativeSmoothedValueTests;
class SmoothedValueTests : public UnitTest
{
public:
SmoothedValueTests()
: UnitTest ("SmoothedValueTests", "SmoothedValues")
{}
void runTest() override
{
beginTest ("Linear moving target");
{
SmoothedValue<float, ValueSmoothingTypes::Linear> sv;
sv.reset (12);
float initialValue = 0.0f;
sv.setCurrentAndTargetValue (initialValue);
sv.setTargetValue (1.0f);
auto delta = sv.getNextValue() - initialValue;
sv.skip (6);
auto newInitialValue = sv.getCurrentValue();
sv.setTargetValue (newInitialValue + 2.0f);
auto doubleDelta = sv.getNextValue() - newInitialValue;
expectWithinAbsoluteError (doubleDelta, delta * 2.0f, 1.0e-7f);
}
beginTest ("Multiplicative curve");
{
SmoothedValue<double, ValueSmoothingTypes::Multiplicative> sv;
auto numSamples = 12;
AudioBuffer<double> values (2, numSamples + 1);
sv.reset (numSamples);
sv.setCurrentAndTargetValue (1.0);
sv.setTargetValue (2.0f);
values.setSample (0, 0, sv.getCurrentValue());
for (int i = 1; i < values.getNumSamples(); ++i)
values.setSample (0, i, sv.getNextValue());
sv.setTargetValue (1.0f);
values.setSample (1, values.getNumSamples() - 1, sv.getCurrentValue());
for (int i = values.getNumSamples() - 2; i >= 0 ; --i)
values.setSample (1, i, sv.getNextValue());
for (int i = 0; i < values.getNumSamples(); ++i)
expectWithinAbsoluteError (values.getSample (0, i), values.getSample (1, i), 1.0e-9);
}
}
};
static SmoothedValueTests smoothedValueTests;
#endif
} // namespace juce

View File

@ -0,0 +1,622 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
A base class for the smoothed value classes.
This class is used to provide common functionality to the SmoothedValue and
dsp::LogRampedValue classes.
@tags{Audio}
*/
template <typename SmoothedValueType>
class SmoothedValueBase
{
private:
//==============================================================================
template <typename T> struct FloatTypeHelper;
template <template <typename> class SmoothedValueClass, typename FloatType>
struct FloatTypeHelper <SmoothedValueClass <FloatType>>
{
using Type = FloatType;
};
template <template <typename, typename> class SmoothedValueClass, typename FloatType, typename SmoothingType>
struct FloatTypeHelper <SmoothedValueClass <FloatType, SmoothingType>>
{
using Type = FloatType;
};
public:
using FloatType = typename FloatTypeHelper<SmoothedValueType>::Type;
//==============================================================================
/** Constructor. */
SmoothedValueBase() = default;
virtual ~SmoothedValueBase() {}
//==============================================================================
/** Returns true if the current value is currently being interpolated. */
bool isSmoothing() const noexcept { return countdown > 0; }
/** Returns the current value of the ramp. */
FloatType getCurrentValue() const noexcept { return currentValue; }
//==============================================================================
/** Returns the target value towards which the smoothed value is currently moving. */
FloatType getTargetValue() const noexcept { return target; }
/** Sets the current value and the target value.
@param newValue the new value to take
*/
void setCurrentAndTargetValue (FloatType newValue)
{
target = currentValue = newValue;
countdown = 0;
}
//==============================================================================
/** Applies a smoothed gain to a stream of samples
S[i] *= gain
@param samples Pointer to a raw array of samples
@param numSamples Length of array of samples
*/
void applyGain (FloatType* samples, int numSamples) noexcept
{
jassert (numSamples >= 0);
if (isSmoothing())
{
for (int i = 0; i < numSamples; ++i)
samples[i] *= getNextSmoothedValue();
}
else
{
FloatVectorOperations::multiply (samples, target, numSamples);
}
}
/** Computes output as a smoothed gain applied to a stream of samples.
Sout[i] = Sin[i] * gain
@param samplesOut A pointer to a raw array of output samples
@param samplesIn A pointer to a raw array of input samples
@param numSamples The length of the array of samples
*/
void applyGain (FloatType* samplesOut, const FloatType* samplesIn, int numSamples) noexcept
{
jassert (numSamples >= 0);
if (isSmoothing())
{
for (int i = 0; i < numSamples; ++i)
samplesOut[i] = samplesIn[i] * getNextSmoothedValue();
}
else
{
FloatVectorOperations::multiply (samplesOut, samplesIn, target, numSamples);
}
}
/** Applies a smoothed gain to a buffer */
void applyGain (AudioBuffer<FloatType>& buffer, int numSamples) noexcept
{
jassert (numSamples >= 0);
if (isSmoothing())
{
if (buffer.getNumChannels() == 1)
{
auto* samples = buffer.getWritePointer (0);
for (int i = 0; i < numSamples; ++i)
samples[i] *= getNextSmoothedValue();
}
else
{
for (auto i = 0; i < numSamples; ++i)
{
auto gain = getNextSmoothedValue();
for (int channel = 0; channel < buffer.getNumChannels(); channel++)
buffer.setSample (channel, i, buffer.getSample (channel, i) * gain);
}
}
}
else
{
buffer.applyGain (0, numSamples, target);
}
}
private:
//==============================================================================
FloatType getNextSmoothedValue() noexcept
{
return static_cast <SmoothedValueType*> (this)->getNextValue();
}
protected:
//==============================================================================
FloatType currentValue = 0;
FloatType target = currentValue;
int countdown = 0;
};
//==============================================================================
/**
A namespace containing a set of types used for specifying the smoothing
behaviour of the SmoothedValue class.
For example:
@code
SmoothedValue<float, ValueSmoothingTypes::Multiplicative> frequency (1.0f);
@endcode
*/
namespace ValueSmoothingTypes
{
/** Used to indicate a linear smoothing between values. */
struct Linear {};
/** Used to indicate a smoothing between multiplicative values. */
struct Multiplicative {};
}
//==============================================================================
/**
A utility class for values that need smoothing to avoid audio glitches.
A ValueSmoothingTypes::Linear template parameter selects linear smoothing,
which increments the SmoothedValue linearly towards its target value.
@code
SmoothedValue<float, ValueSmoothingTypes::Linear> yourSmoothedValue;
@endcode
A ValueSmoothingTypes::Multiplicative template parameter selects
multiplicative smoothing increments towards the target value.
@code
SmoothedValue<float, ValueSmoothingTypes::Multiplicative> yourSmoothedValue;
@endcode
Multiplicative smoothing is useful when you are dealing with
exponential/logarithmic values like volume in dB or frequency in Hz. For
example a 12 step ramp from 440.0 Hz (A4) to 880.0 Hz (A5) will increase the
frequency with an equal temperament tuning across the octave. A 10 step
smoothing from 1.0 (0 dB) to 3.16228 (10 dB) will increase the value in
increments of 1 dB.
Note that when you are using multiplicative smoothing you cannot ever reach a
target value of zero!
@tags{Audio}
*/
template <typename FloatType, typename SmoothingType = ValueSmoothingTypes::Linear>
class SmoothedValue : public SmoothedValueBase <SmoothedValue <FloatType, SmoothingType>>
{
public:
//==============================================================================
/** Constructor. */
SmoothedValue() noexcept
: SmoothedValue ((FloatType) (std::is_same<SmoothingType, ValueSmoothingTypes::Linear>::value ? 0 : 1))
{
}
/** Constructor. */
SmoothedValue (FloatType initialValue) noexcept
{
// Multiplicative smoothed values cannot ever reach 0!
jassert (! (std::is_same<SmoothingType, ValueSmoothingTypes::Multiplicative>::value && initialValue == 0));
// Visual Studio can't handle base class initialisation with CRTP
this->currentValue = initialValue;
this->target = this->currentValue;
}
//==============================================================================
/** Reset to a new sample rate and ramp length.
@param sampleRate The sample rate
@param rampLengthInSeconds The duration of the ramp in seconds
*/
void reset (double sampleRate, double rampLengthInSeconds) noexcept
{
jassert (sampleRate > 0 && rampLengthInSeconds >= 0);
reset ((int) std::floor (rampLengthInSeconds * sampleRate));
}
/** Set a new ramp length directly in samples.
@param numSteps The number of samples over which the ramp should be active
*/
void reset (int numSteps) noexcept
{
stepsToTarget = numSteps;
this->setCurrentAndTargetValue (this->target);
}
//==============================================================================
/** Set the next value to ramp towards.
@param newValue The new target value
*/
void setTargetValue (FloatType newValue) noexcept
{
if (newValue == this->target)
return;
if (stepsToTarget <= 0)
{
this->setCurrentAndTargetValue (newValue);
return;
}
// Multiplicative smoothed values cannot ever reach 0!
jassert (! (std::is_same<SmoothingType, ValueSmoothingTypes::Multiplicative>::value && newValue == 0));
this->target = newValue;
this->countdown = stepsToTarget;
setStepSize();
}
//==============================================================================
/** Compute the next value.
@returns Smoothed value
*/
FloatType getNextValue() noexcept
{
if (! this->isSmoothing())
return this->target;
--(this->countdown);
if (this->isSmoothing())
setNextValue();
else
this->currentValue = this->target;
return this->currentValue;
}
//==============================================================================
/** Skip the next numSamples samples.
This is identical to calling getNextValue numSamples times. It returns
the new current value.
@see getNextValue
*/
FloatType skip (int numSamples) noexcept
{
if (numSamples >= this->countdown)
{
this->setCurrentAndTargetValue (this->target);
return this->target;
}
skipCurrentValue (numSamples);
this->countdown -= numSamples;
return this->currentValue;
}
//==============================================================================
/** THIS FUNCTION IS DEPRECATED.
Use `setTargetValue (float)` and `setCurrentAndTargetValue()` instead:
lsv.setValue (x, false); -> lsv.setTargetValue (x);
lsv.setValue (x, true); -> lsv.setCurrentAndTargetValue (x);
@param newValue The new target value
@param force If true, the value will be set immediately, bypassing the ramp
*/
JUCE_DEPRECATED_WITH_BODY (void setValue (FloatType newValue, bool force = false) noexcept,
{
if (force)
{
this->setCurrentAndTargetValue (newValue);
return;
}
setTargetValue (newValue);
})
private:
//==============================================================================
template <typename T>
using LinearVoid = typename std::enable_if <std::is_same <T, ValueSmoothingTypes::Linear>::value, void>::type;
template <typename T>
using MultiplicativeVoid = typename std::enable_if <std::is_same <T, ValueSmoothingTypes::Multiplicative>::value, void>::type;
//==============================================================================
template <typename T = SmoothingType>
LinearVoid<T> setStepSize() noexcept
{
step = (this->target - this->currentValue) / (FloatType) this->countdown;
}
template <typename T = SmoothingType>
MultiplicativeVoid<T> setStepSize()
{
step = std::exp ((std::log (std::abs (this->target)) - std::log (std::abs (this->currentValue))) / this->countdown);
}
//==============================================================================
template <typename T = SmoothingType>
LinearVoid<T> setNextValue() noexcept
{
this->currentValue += step;
}
template <typename T = SmoothingType>
MultiplicativeVoid<T> setNextValue() noexcept
{
this->currentValue *= step;
}
//==============================================================================
template <typename T = SmoothingType>
LinearVoid<T> skipCurrentValue (int numSamples) noexcept
{
this->currentValue += step * (FloatType) numSamples;
}
template <typename T = SmoothingType>
MultiplicativeVoid<T> skipCurrentValue (int numSamples)
{
this->currentValue *= (FloatType) std::pow (step, numSamples);
}
//==============================================================================
FloatType step = FloatType();
int stepsToTarget = 0;
};
template <typename FloatType>
using LinearSmoothedValue = SmoothedValue <FloatType, ValueSmoothingTypes::Linear>;
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
template <class SmoothedValueType>
class CommonSmoothedValueTests : public UnitTest
{
public:
CommonSmoothedValueTests()
: UnitTest ("CommonSmoothedValueTests", "SmoothedValues")
{}
void runTest() override
{
beginTest ("Initial state");
{
SmoothedValueType sv;
auto value = sv.getCurrentValue();
expectEquals (sv.getTargetValue(), value);
sv.getNextValue();
expectEquals (sv.getCurrentValue(), value);
expect (! sv.isSmoothing());
}
beginTest ("Resetting");
{
auto initialValue = 15.0f;
SmoothedValueType sv (initialValue);
sv.reset (3);
expectEquals (sv.getCurrentValue(), initialValue);
auto targetValue = initialValue + 1.0f;
sv.setTargetValue (targetValue);
expectEquals (sv.getTargetValue(), targetValue);
expectEquals (sv.getCurrentValue(), initialValue);
expect (sv.isSmoothing());
auto currentValue = sv.getNextValue();
expect (currentValue > initialValue);
expectEquals (sv.getCurrentValue(), currentValue);
expectEquals (sv.getTargetValue(), targetValue);
expect (sv.isSmoothing());
sv.reset (5);
expectEquals (sv.getCurrentValue(), targetValue);
expectEquals (sv.getTargetValue(), targetValue);
expect (! sv.isSmoothing());
sv.getNextValue();
expectEquals (sv.getCurrentValue(), targetValue);
sv.setTargetValue (1.5f);
sv.getNextValue();
float newStart = 0.2f;
sv.setCurrentAndTargetValue (newStart);
expectEquals (sv.getNextValue(), newStart);
expectEquals (sv.getTargetValue(), newStart);
expectEquals (sv.getCurrentValue(), newStart);
expect (! sv.isSmoothing());
}
beginTest ("Sample rate");
{
SmoothedValueType svSamples { 3.0f };
auto svTime = svSamples;
auto numSamples = 12;
svSamples.reset (numSamples);
svTime.reset (numSamples * 2, 1.0);
for (int i = 0; i < numSamples; ++i)
{
svTime.skip (1);
expectWithinAbsoluteError (svSamples.getNextValue(),
svTime.getNextValue(),
1.0e-7f);
}
}
beginTest ("Block processing");
{
SmoothedValueType sv (1.0f);
sv.reset (12);
sv.setTargetValue (2.0f);
const auto numSamples = 15;
AudioBuffer<float> referenceData (1, numSamples);
for (int i = 0; i < numSamples; ++i)
referenceData.setSample (0, i, sv.getNextValue());
expect (referenceData.getSample (0, 0) > 0);
expect (referenceData.getSample (0, 10) < sv.getTargetValue());
expectWithinAbsoluteError (referenceData.getSample (0, 11),
sv.getTargetValue(),
1.0e-7f);
auto getUnitData = [] (int numSamplesToGenerate)
{
AudioBuffer<float> result (1, numSamplesToGenerate);
for (int i = 0; i < numSamplesToGenerate; ++i)
result.setSample (0, i, 1.0f);
return result;
};
auto compareData = [this](const AudioBuffer<float>& test,
const AudioBuffer<float>& reference)
{
for (int i = 0; i < test.getNumSamples(); ++i)
expectWithinAbsoluteError (test.getSample (0, i),
reference.getSample (0, i),
1.0e-7f);
};
auto testData = getUnitData (numSamples);
sv.setCurrentAndTargetValue (1.0f);
sv.setTargetValue (2.0f);
sv.applyGain (testData.getWritePointer (0), numSamples);
compareData (testData, referenceData);
testData = getUnitData (numSamples);
AudioBuffer<float> destData (1, numSamples);
sv.setCurrentAndTargetValue (1.0f);
sv.setTargetValue (2.0f);
sv.applyGain (destData.getWritePointer (0),
testData.getReadPointer (0),
numSamples);
compareData (destData, referenceData);
compareData (testData, getUnitData (numSamples));
testData = getUnitData (numSamples);
sv.setCurrentAndTargetValue (1.0f);
sv.setTargetValue (2.0f);
sv.applyGain (testData, numSamples);
compareData (testData, referenceData);
}
beginTest ("Skip");
{
SmoothedValueType sv;
sv.reset (12);
sv.setCurrentAndTargetValue (1.0f);
sv.setTargetValue (2.0f);
Array<float> reference;
for (int i = 0; i < 15; ++i)
reference.add (sv.getNextValue());
sv.setCurrentAndTargetValue (1.0f);
sv.setTargetValue (2.0f);
expectWithinAbsoluteError (sv.skip (1), reference[0], 1.0e-6f);
expectWithinAbsoluteError (sv.skip (1), reference[1], 1.0e-6f);
expectWithinAbsoluteError (sv.skip (2), reference[3], 1.0e-6f);
sv.skip (3);
expectWithinAbsoluteError (sv.getCurrentValue(), reference[6], 1.0e-6f);
expectEquals (sv.skip (300), sv.getTargetValue());
expectEquals (sv.getCurrentValue(), sv.getTargetValue());
}
beginTest ("Negative");
{
SmoothedValueType sv;
auto numValues = 12;
sv.reset (numValues);
std::vector<std::pair<float, float>> ranges = { { -1.0f, -2.0f },
{ -100.0f, -3.0f } };
for (auto range : ranges)
{
auto start = range.first, end = range.second;
sv.setCurrentAndTargetValue (start);
sv.setTargetValue (end);
auto val = sv.skip (numValues / 2);
if (end > start)
expect (val > start && val < end);
else
expect (val < start && val > end);
auto nextVal = sv.getNextValue();
expect (end > start ? (nextVal > val) : (nextVal < val));
auto endVal = sv.skip (500);
expectEquals (endVal, end);
expectEquals (sv.getNextValue(), end);
expectEquals (sv.getCurrentValue(), end);
sv.setCurrentAndTargetValue (start);
sv.setTargetValue (end);
SmoothedValueType positiveSv { -start };
positiveSv.reset (numValues);
positiveSv.setTargetValue (-end);
for (int i = 0; i < numValues + 2; ++i)
expectEquals (sv.getNextValue(), -positiveSv.getNextValue());
}
}
}
};
#endif
} // namespace juce

View File

@ -23,14 +23,6 @@
namespace juce namespace juce
{ {
AudioDeviceManager::AudioDeviceSetup::AudioDeviceSetup()
: sampleRate (0),
bufferSize (0),
useDefaultInputChannels (true),
useDefaultOutputChannels (true)
{
}
bool AudioDeviceManager::AudioDeviceSetup::operator== (const AudioDeviceManager::AudioDeviceSetup& other) const bool AudioDeviceManager::AudioDeviceSetup::operator== (const AudioDeviceManager::AudioDeviceSetup& other) const
{ {
return outputDeviceName == other.outputDeviceName return outputDeviceName == other.outputDeviceName
@ -132,10 +124,36 @@ void AudioDeviceManager::audioDeviceListChanged()
{ {
if (currentAudioDevice != nullptr) if (currentAudioDevice != nullptr)
{ {
currentSetup.sampleRate = currentAudioDevice->getCurrentSampleRate(); auto isCurrentDeviceStillAvailable = [&]
currentSetup.bufferSize = currentAudioDevice->getCurrentBufferSizeSamples(); {
currentSetup.inputChannels = currentAudioDevice->getActiveInputChannels(); for (auto* dt : availableDeviceTypes)
currentSetup.outputChannels = currentAudioDevice->getActiveOutputChannels(); if (currentAudioDevice->getTypeName() == dt->getTypeName())
for (auto& dn : dt->getDeviceNames())
if (currentAudioDevice->getName() == dn)
return true;
return false;
};
if (! isCurrentDeviceStillAvailable())
{
closeAudioDevice();
std::unique_ptr<XmlElement> e (createStateXml());
if (e == nullptr)
initialiseDefault (preferredDeviceName, &currentSetup);
else
initialiseFromXML (*e, true, preferredDeviceName, &currentSetup);
}
if (currentAudioDevice != nullptr)
{
currentSetup.sampleRate = currentAudioDevice->getCurrentSampleRate();
currentSetup.bufferSize = currentAudioDevice->getCurrentBufferSizeSamples();
currentSetup.inputChannels = currentAudioDevice->getActiveInputChannels();
currentSetup.outputChannels = currentAudioDevice->getActiveOutputChannels();
}
} }
sendChangeMessage(); sendChangeMessage();
@ -197,12 +215,13 @@ String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
numInputChansNeeded = numInputChannelsNeeded; numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded; numOutputChansNeeded = numOutputChannelsNeeded;
preferredDeviceName = preferredDefaultDeviceName;
if (xml != nullptr && xml->hasTagName ("DEVICESETUP")) if (xml != nullptr && xml->hasTagName ("DEVICESETUP"))
return initialiseFromXML (*xml, selectDefaultDeviceOnFailure, return initialiseFromXML (*xml, selectDefaultDeviceOnFailure,
preferredDefaultDeviceName, preferredSetupOptions); preferredDeviceName, preferredSetupOptions);
return initialiseDefault (preferredDefaultDeviceName, preferredSetupOptions); return initialiseDefault (preferredDeviceName, preferredSetupOptions);
} }
String AudioDeviceManager::initialiseDefault (const String& preferredDefaultDeviceName, String AudioDeviceManager::initialiseDefault (const String& preferredDefaultDeviceName,
@ -367,6 +386,11 @@ AudioIODeviceType* AudioDeviceManager::findType (const String& inputName, const
return {}; return {};
} }
AudioDeviceManager::AudioDeviceSetup AudioDeviceManager::getAudioDeviceSetup() const
{
return currentSetup;
}
void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup) const void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup) const
{ {
setup = currentSetup; setup = currentSetup;
@ -428,16 +452,15 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
stopDevice(); stopDevice();
if (! newSetup.useDefaultInputChannels) numInputChansNeeded = newSetup.inputChannels.countNumberOfSetBits(); if (! newSetup.useDefaultInputChannels)
if (! newSetup.useDefaultOutputChannels) numOutputChansNeeded = newSetup.outputChannels.countNumberOfSetBits(); numInputChansNeeded = newSetup.inputChannels.countNumberOfSetBits();
auto newInputDeviceName (numInputChansNeeded == 0 ? String() : newSetup.inputDeviceName); if (! newSetup.useDefaultOutputChannels)
auto newOutputDeviceName (numOutputChansNeeded == 0 ? String() : newSetup.outputDeviceName); numOutputChansNeeded = newSetup.outputChannels.countNumberOfSetBits();
String error;
auto* type = getCurrentDeviceTypeObject(); auto* type = getCurrentDeviceTypeObject();
if (type == nullptr || (newInputDeviceName.isEmpty() && newOutputDeviceName.isEmpty())) if (type == nullptr)
{ {
deleteCurrentDevice(); deleteCurrentDevice();
@ -447,20 +470,22 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
return {}; return {};
} }
if (currentSetup.inputDeviceName != newInputDeviceName String error;
|| currentSetup.outputDeviceName != newOutputDeviceName
|| currentAudioDevice == nullptr) if (currentSetup.inputDeviceName != newSetup.inputDeviceName
|| currentSetup.outputDeviceName != newSetup.outputDeviceName
|| currentAudioDevice == nullptr)
{ {
deleteCurrentDevice(); deleteCurrentDevice();
scanDevicesIfNeeded(); scanDevicesIfNeeded();
if (newOutputDeviceName.isNotEmpty() && ! deviceListContains (type, false, newOutputDeviceName)) if (newSetup.outputDeviceName.isNotEmpty() && ! deviceListContains (type, false, newSetup.outputDeviceName))
return "No such device: " + newOutputDeviceName; return "No such device: " + newSetup.outputDeviceName;
if (newInputDeviceName.isNotEmpty() && ! deviceListContains (type, true, newInputDeviceName)) if (newSetup.inputDeviceName.isNotEmpty() && ! deviceListContains (type, true, newSetup.inputDeviceName))
return "No such device: " + newInputDeviceName; return "No such device: " + newSetup.inputDeviceName;
currentAudioDevice.reset (type->createDevice (newOutputDeviceName, newInputDeviceName)); currentAudioDevice.reset (type->createDevice (newSetup.outputDeviceName, newSetup.inputDeviceName));
if (currentAudioDevice == nullptr) if (currentAudioDevice == nullptr)
error = "Can't open the audio device!\n\n" error = "Can't open the audio device!\n\n"
@ -487,15 +512,26 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
outputChannels.setRange (0, numOutputChansNeeded, true); outputChannels.setRange (0, numOutputChansNeeded, true);
} }
if (newInputDeviceName.isEmpty()) inputChannels.clear(); if (newSetup.inputDeviceName.isEmpty()) inputChannels.clear();
if (newOutputDeviceName.isEmpty()) outputChannels.clear(); if (newSetup.outputDeviceName.isEmpty()) outputChannels.clear();
} }
if (! newSetup.useDefaultInputChannels) inputChannels = newSetup.inputChannels; if (! newSetup.useDefaultInputChannels)
if (! newSetup.useDefaultOutputChannels) outputChannels = newSetup.outputChannels; inputChannels = newSetup.inputChannels;
if (! newSetup.useDefaultOutputChannels)
outputChannels = newSetup.outputChannels;
currentSetup = newSetup; currentSetup = newSetup;
if (inputChannels.isZero() && outputChannels.isZero())
{
if (treatAsChosenDevice)
updateXml();
return {};
}
currentSetup.sampleRate = chooseBestSampleRate (newSetup.sampleRate); currentSetup.sampleRate = chooseBestSampleRate (newSetup.sampleRate);
currentSetup.bufferSize = chooseBestBufferSize (newSetup.bufferSize); currentSetup.bufferSize = chooseBestBufferSize (newSetup.bufferSize);
@ -582,7 +618,7 @@ void AudioDeviceManager::closeAudioDevice()
{ {
stopDevice(); stopDevice();
currentAudioDevice.reset(); currentAudioDevice.reset();
cpuUsageMs = 0; loadMeasurer.reset();
} }
void AudioDeviceManager::restartLastAudioDevice() void AudioDeviceManager::restartLastAudioDevice()
@ -694,7 +730,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
if (callbacks.size() > 0) if (callbacks.size() > 0)
{ {
auto callbackStartTime = Time::getMillisecondCounterHiRes(); AudioProcessLoadMeasurer::ScopedTimer timer (loadMeasurer);
tempBuffer.setSize (jmax (1, numOutputChannels), jmax (1, numSamples), false, false, true); tempBuffer.setSize (jmax (1, numOutputChannels), jmax (1, numSamples), false, false, true);
@ -716,13 +752,6 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
dst[j] += src[j]; dst[j] += src[j];
} }
} }
auto msTaken = Time::getMillisecondCounterHiRes() - callbackStartTime;
const double filterAmount = 0.2;
cpuUsageMs += filterAmount * (msTaken - cpuUsageMs);
if (msTaken > msPerBlock)
++xruns;
} }
else else
{ {
@ -748,17 +777,8 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device) void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device)
{ {
cpuUsageMs = 0; loadMeasurer.reset (device->getCurrentSampleRate(),
xruns = 0; device->getCurrentBufferSizeSamples());
auto sampleRate = device->getCurrentSampleRate();
auto blockSize = device->getCurrentBufferSizeSamples();
if (sampleRate > 0.0 && blockSize > 0)
{
msPerBlock = 1000.0 * blockSize / sampleRate;
timeToCpuScale = (msPerBlock > 0.0) ? (1.0 / msPerBlock) : 0.0;
}
{ {
const ScopedLock sl (audioCallbackLock); const ScopedLock sl (audioCallbackLock);
@ -772,13 +792,12 @@ void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device
void AudioDeviceManager::audioDeviceStoppedInt() void AudioDeviceManager::audioDeviceStoppedInt()
{ {
cpuUsageMs = 0;
timeToCpuScale = 0;
xruns = 0;
sendChangeMessage(); sendChangeMessage();
const ScopedLock sl (audioCallbackLock); const ScopedLock sl (audioCallbackLock);
loadMeasurer.reset();
for (int i = callbacks.size(); --i >= 0;) for (int i = callbacks.size(); --i >= 0;)
callbacks.getUnchecked(i)->audioDeviceStopped(); callbacks.getUnchecked(i)->audioDeviceStopped();
} }
@ -793,7 +812,7 @@ void AudioDeviceManager::audioDeviceErrorInt (const String& message)
double AudioDeviceManager::getCpuUsage() const double AudioDeviceManager::getCpuUsage() const
{ {
return jlimit (0.0, 1.0, timeToCpuScale * cpuUsageMs); return loadMeasurer.getLoadAsProportion();
} }
//============================================================================== //==============================================================================
@ -980,7 +999,7 @@ void AudioDeviceManager::playTestSound()
auto phasePerSample = MathConstants<double>::twoPi / (sampleRate / frequency); auto phasePerSample = MathConstants<double>::twoPi / (sampleRate / frequency);
auto* newSound = new AudioBuffer<float> (1, soundLength); std::unique_ptr<AudioBuffer<float>> newSound (new AudioBuffer<float> (1, soundLength));
for (int i = 0; i < soundLength; ++i) for (int i = 0; i < soundLength; ++i)
newSound->setSample (0, i, amplitude * (float) std::sin (i * phasePerSample)); newSound->setSample (0, i, amplitude * (float) std::sin (i * phasePerSample));
@ -988,15 +1007,17 @@ void AudioDeviceManager::playTestSound()
newSound->applyGainRamp (0, 0, soundLength / 10, 0.0f, 1.0f); newSound->applyGainRamp (0, 0, soundLength / 10, 0.0f, 1.0f);
newSound->applyGainRamp (0, soundLength - soundLength / 4, soundLength / 4, 1.0f, 0.0f); newSound->applyGainRamp (0, soundLength - soundLength / 4, soundLength / 4, 1.0f, 0.0f);
const ScopedLock sl (audioCallbackLock); {
testSound.reset (newSound); const ScopedLock sl (audioCallbackLock);
std::swap (testSound, newSound);
}
} }
} }
int AudioDeviceManager::getXRunCount() const noexcept int AudioDeviceManager::getXRunCount() const noexcept
{ {
auto deviceXRuns = (currentAudioDevice != nullptr ? currentAudioDevice->getXRunCount() : -1); auto deviceXRuns = (currentAudioDevice != nullptr ? currentAudioDevice->getXRunCount() : -1);
return jmax (0, deviceXRuns) + xruns; return jmax (0, deviceXRuns) + loadMeasurer.getXRunCount();
} }
} // namespace juce } // namespace juce

View File

@ -76,7 +76,7 @@ public:
AudioDeviceManager(); AudioDeviceManager();
/** Destructor. */ /** Destructor. */
~AudioDeviceManager(); ~AudioDeviceManager() override;
//============================================================================== //==============================================================================
/** /**
@ -89,17 +89,6 @@ public:
*/ */
struct JUCE_API AudioDeviceSetup struct JUCE_API AudioDeviceSetup
{ {
/** Creates an AudioDeviceSetup object.
The default constructor sets all the member variables to indicate default values.
You can then fill-in any values you want to before passing the object to
AudioDeviceManager::initialise().
*/
AudioDeviceSetup();
bool operator== (const AudioDeviceSetup& other) const;
bool operator!= (const AudioDeviceSetup& other) const;
/** The name of the audio device used for output. /** The name of the audio device used for output.
The name has to be one of the ones listed by the AudioDeviceManager's currently The name has to be one of the ones listed by the AudioDeviceManager's currently
selected device type. selected device type.
@ -119,13 +108,13 @@ public:
A value of 0 indicates that you don't care what rate is used, and the A value of 0 indicates that you don't care what rate is used, and the
device will choose a sensible rate for you. device will choose a sensible rate for you.
*/ */
double sampleRate; double sampleRate = 0;
/** The buffer size, in samples. /** The buffer size, in samples.
This buffer size is used for both the input and output devices. This buffer size is used for both the input and output devices.
A value of 0 indicates the default buffer size. A value of 0 indicates the default buffer size.
*/ */
int bufferSize; int bufferSize = 0;
/** The set of active input channels. /** The set of active input channels.
The bits that are set in this array indicate the channels of the The bits that are set in this array indicate the channels of the
@ -138,7 +127,7 @@ public:
should be ignored, and instead, the device's default channels should be ignored, and instead, the device's default channels
should be used. should be used.
*/ */
bool useDefaultInputChannels; bool useDefaultInputChannels = true;
/** The set of active output channels. /** The set of active output channels.
The bits that are set in this array indicate the channels of the The bits that are set in this array indicate the channels of the
@ -151,7 +140,10 @@ public:
should be ignored, and instead, the device's default channels should be ignored, and instead, the device's default channels
should be used. should be used.
*/ */
bool useDefaultOutputChannels; bool useDefaultOutputChannels = true;
bool operator== (const AudioDeviceSetup&) const;
bool operator!= (const AudioDeviceSetup&) const;
}; };
@ -211,6 +203,13 @@ public:
/** Returns the current device properties that are in use. /** Returns the current device properties that are in use.
@see setAudioDeviceSetup @see setAudioDeviceSetup
*/ */
AudioDeviceSetup getAudioDeviceSetup() const;
/** Returns the current device properties that are in use.
This is an old method, kept around for compatibility, but you should prefer the new
version which returns the result rather than taking an out-parameter.
@see getAudioDeviceSetup()
*/
void getAudioDeviceSetup (AudioDeviceSetup& result) const; void getAudioDeviceSetup (AudioDeviceSetup& result) const;
/** Changes the current device or its settings. /** Changes the current device or its settings.
@ -232,8 +231,7 @@ public:
@see getAudioDeviceSetup @see getAudioDeviceSetup
*/ */
String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, String setAudioDeviceSetup (const AudioDeviceSetup& newSetup, bool treatAsChosenDevice);
bool treatAsChosenDevice);
/** Returns the currently-active audio device. */ /** Returns the currently-active audio device. */
@ -257,8 +255,7 @@ public:
For a list of types, see getAvailableDeviceTypes(). For a list of types, see getAvailableDeviceTypes().
*/ */
void setCurrentAudioDeviceType (const String& type, void setCurrentAudioDeviceType (const String& type, bool treatAsChosenDevice);
bool treatAsChosenDevice);
/** Closes the currently-open device. /** Closes the currently-open device.
You can call restartLastAudioDevice() later to reopen it in the same state You can call restartLastAudioDevice() later to reopen it in the same state
@ -435,10 +432,10 @@ public:
*/ */
LevelMeter::Ptr getInputLevelGetter() noexcept { return inputLevelGetter; } LevelMeter::Ptr getInputLevelGetter() noexcept { return inputLevelGetter; }
/** Returns a reference-counted object that can be used to get the current input level. /** Returns a reference-counted object that can be used to get the current output level.
You need to store this object locally to ensure that the reference count is incremented You need to store this object locally to ensure that the reference count is incremented
and decremented properly. The current input level value can be read using getCurrentLevel(). and decremented properly. The current output level value can be read using getCurrentLevel().
*/ */
LevelMeter::Ptr getOutputLevelGetter() noexcept { return outputLevelGetter; } LevelMeter::Ptr getOutputLevelGetter() noexcept { return outputLevelGetter; }
@ -473,7 +470,7 @@ private:
std::unique_ptr<AudioIODevice> currentAudioDevice; std::unique_ptr<AudioIODevice> currentAudioDevice;
Array<AudioIODeviceCallback*> callbacks; Array<AudioIODeviceCallback*> callbacks;
int numInputChansNeeded = 0, numOutputChansNeeded = 2; int numInputChansNeeded = 0, numOutputChansNeeded = 2;
String currentDeviceType; String preferredDeviceName, currentDeviceType;
BigInteger inputChannels, outputChannels; BigInteger inputChannels, outputChannels;
std::unique_ptr<XmlElement> lastExplicitSettings; std::unique_ptr<XmlElement> lastExplicitSettings;
mutable bool listNeedsScanning = true; mutable bool listNeedsScanning = true;
@ -496,16 +493,13 @@ private:
std::unique_ptr<AudioBuffer<float>> testSound; std::unique_ptr<AudioBuffer<float>> testSound;
int testSoundPosition = 0; int testSoundPosition = 0;
double cpuUsageMs = 0, timeToCpuScale = 0, msPerBlock = 0; AudioProcessLoadMeasurer loadMeasurer;
int xruns = 0;
LevelMeter::Ptr inputLevelGetter { new LevelMeter() }, LevelMeter::Ptr inputLevelGetter { new LevelMeter() },
outputLevelGetter { new LevelMeter() }; outputLevelGetter { new LevelMeter() };
//============================================================================== //==============================================================================
class CallbackHandler; class CallbackHandler;
friend class CallbackHandler;
friend struct ContainerDeletePolicy<CallbackHandler>;
std::unique_ptr<CallbackHandler> callbackHandler; std::unique_ptr<CallbackHandler> callbackHandler;
void audioDeviceIOCallbackInt (const float** inputChannelData, int totalNumInputChannels, void audioDeviceIOCallbackInt (const float** inputChannelData, int totalNumInputChannels,

View File

@ -43,7 +43,7 @@ class JUCE_API AudioIODeviceCallback
{ {
public: public:
/** Destructor. */ /** Destructor. */
virtual ~AudioIODeviceCallback() {} virtual ~AudioIODeviceCallback() = default;
/** Processes a block of incoming and outgoing audio data. /** Processes a block of incoming and outgoing audio data.

View File

@ -126,7 +126,7 @@ public:
class Listener class Listener
{ {
public: public:
virtual ~Listener() {} virtual ~Listener() = default;
/** Called when the list of available audio devices changes. */ /** Called when the list of available audio devices changes. */
virtual void audioDeviceListChanged() = 0; virtual void audioDeviceListChanged() = 0;

View File

@ -70,12 +70,12 @@
#include <mmreg.h> #include <mmreg.h>
#endif #endif
#if JUCE_USE_WINRT_MIDI #if JUCE_USE_WINRT_MIDI && JUCE_MSVC
/* If you cannot find any of the header files below then you are probably /* If you cannot find any of the header files below then you are probably
attempting to use the Windows 10 Bluetooth Low Energy API. For this to work you attempting to use the Windows 10 Bluetooth Low Energy API. For this to work you
need to install version 10.0.14393.0 of the Windows Standalone SDK and add the need to install version 10.0.14393.0 of the Windows Standalone SDK and you may
path to the WinRT headers to your build system. This path should have the form need to add the path to the WinRT headers to your build system. This path should
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt". have the form "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt".
Also please note that Microsoft's Bluetooth MIDI stack has multiple issues, so Also please note that Microsoft's Bluetooth MIDI stack has multiple issues, so
this API is EXPERIMENTAL - use at your own risk! this API is EXPERIMENTAL - use at your own risk!
@ -83,15 +83,16 @@
#include <windows.devices.h> #include <windows.devices.h>
#include <windows.devices.midi.h> #include <windows.devices.midi.h>
#include <windows.devices.enumeration.h> #include <windows.devices.enumeration.h>
#pragma warning (push)
#pragma warning (disable: 4265)
#include <wrl/event.h> #include <wrl/event.h>
#if JUCE_MSVC #pragma warning (pop)
#pragma warning (push)
#pragma warning (disable: 4467) #pragma warning (push)
#endif #pragma warning (disable: 4467)
#include <robuffer.h> #include <robuffer.h>
#if JUCE_MSVC #pragma warning (pop)
#pragma warning (pop)
#endif
#endif #endif
#if JUCE_ASIO #if JUCE_ASIO
@ -148,7 +149,9 @@
installed, or you've not got your paths set up correctly to find its header installed, or you've not got your paths set up correctly to find its header
files. files.
*/ */
#include <rtdk.h>
#include <Bela.h> #include <Bela.h>
#include <Midi.h>
#endif #endif
#undef SIZEOF #undef SIZEOF
@ -163,6 +166,10 @@
#endif #endif
#if JUCE_USE_ANDROID_OBOE #if JUCE_USE_ANDROID_OBOE
#if JUCE_USE_ANDROID_OPENSLES
#error "Oboe cannot be enabled at the same time as openSL! Please disable JUCE_USE_ANDROID_OPENSLES"
#endif
#include <oboe/Oboe.h> #include <oboe/Oboe.h>
#endif #endif
@ -210,14 +217,14 @@
#include "native/juce_linux_ALSA.cpp" #include "native/juce_linux_ALSA.cpp"
#endif #endif
#include "native/juce_linux_Midi.cpp"
#if JUCE_JACK #if JUCE_JACK
#include "native/juce_linux_JackAudio.cpp" #include "native/juce_linux_JackAudio.cpp"
#endif #endif
#if JUCE_BELA #if JUCE_BELA
#include "native/juce_linux_Bela.cpp" #include "native/juce_linux_Bela.cpp"
#else
#include "native/juce_linux_Midi.cpp"
#endif #endif
//============================================================================== //==============================================================================

View File

@ -31,7 +31,7 @@
ID: juce_audio_devices ID: juce_audio_devices
vendor: juce vendor: juce
version: 5.3.2 version: 5.4.3
name: JUCE audio and MIDI I/O device classes name: JUCE audio and MIDI I/O device classes
description: Classes to play and record from audio and MIDI I/O devices description: Classes to play and record from audio and MIDI I/O devices
website: http://www.juce.com/juce website: http://www.juce.com/juce
@ -59,6 +59,22 @@
#endif #endif
//============================================================================== //==============================================================================
/** Config: JUCE_USE_WINRT_MIDI
Enables the use of the Windows Runtime API for MIDI, allowing connections
to Bluetooth Low Energy devices on Windows 10 version 1809 (October 2018
Update) and later. If you enable this flag then older, unsupported,
versions of Windows will automatically fall back to using the regualar
Win32 MIDI API.
You will need version 10.0.14393.0 of the Windows Standalone SDK to compile
and you may need to add the path to the WinRT headers. The path to the
headers will be something similar to
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt".
*/
#ifndef JUCE_USE_WINRT_MIDI
#define JUCE_USE_WINRT_MIDI 0
#endif
/** Config: JUCE_ASIO /** Config: JUCE_ASIO
Enables ASIO audio devices (MS Windows only). Enables ASIO audio devices (MS Windows only).
Turning this on means that you'll need to have the Steinberg ASIO SDK installed Turning this on means that you'll need to have the Steinberg ASIO SDK installed
@ -146,25 +162,6 @@
#endif #endif
#endif #endif
/** Config: JUCE_USE_WINRT_MIDI
***
EXPERIMENTAL - Microsoft's Bluetooth MIDI stack has multiple issues,
use at your own risk!
***
Enables the use of the Windows Runtime API for MIDI, which supports
Bluetooth Low Energy connections on computers with the Anniversary Update
of Windows 10.
To compile with this flag requires version 10.0.14393.0 of the Windows
Standalone SDK and you must add the path to the WinRT headers. This path
should be something similar to
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt".
*/
#ifndef JUCE_USE_WINRT_MIDI
#define JUCE_USE_WINRT_MIDI 0
#endif
/** Config: JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS /** Config: JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS
Turning this on gives your app exclusive access to the system's audio Turning this on gives your app exclusive access to the system's audio
on platforms which support it (currently iOS only). on platforms which support it (currently iOS only).

View File

@ -41,7 +41,7 @@ class JUCE_API MidiInputCallback
{ {
public: public:
/** Destructor. */ /** Destructor. */
virtual ~MidiInputCallback() {} virtual ~MidiInputCallback() = default;
/** Receives an incoming message. /** Receives an incoming message.
@ -89,7 +89,7 @@ public:
@tags{Audio} @tags{Audio}
*/ */
class JUCE_API MidiInput class JUCE_API MidiInput final
{ {
public: public:
//============================================================================== //==============================================================================

View File

@ -44,7 +44,7 @@ public:
MidiMessageCollector(); MidiMessageCollector();
/** Destructor. */ /** Destructor. */
~MidiMessageCollector(); ~MidiMessageCollector() override;
//============================================================================== //==============================================================================
/** Clears any messages from the queue. /** Clears any messages from the queue.

View File

@ -42,7 +42,7 @@ void MidiOutput::sendBlockOfMessagesNow (const MidiBuffer& buffer)
{ {
MidiBuffer::Iterator i (buffer); MidiBuffer::Iterator i (buffer);
MidiMessage message; MidiMessage message;
int samplePosition; // Note: not actually used, so no need to initialise. int samplePosition; // Note: Not actually used, so no need to initialise.
while (i.getNextEvent (message, samplePosition)) while (i.getNextEvent (message, samplePosition))
sendMessageNow (message); sendMessageNow (message);

View File

@ -34,7 +34,7 @@ namespace juce
@tags{Audio} @tags{Audio}
*/ */
class JUCE_API MidiOutput : private Thread class JUCE_API MidiOutput final : private Thread
{ {
public: public:
//============================================================================== //==============================================================================
@ -81,7 +81,7 @@ public:
//============================================================================== //==============================================================================
/** Destructor. */ /** Destructor. */
~MidiOutput(); ~MidiOutput() override;
/** Returns the name of this device. */ /** Returns the name of this device. */
const String& getName() const noexcept { return name; } const String& getName() const noexcept { return name; }

View File

@ -33,79 +33,68 @@ namespace juce
class MidiDataConcatenator class MidiDataConcatenator
{ {
public: public:
//==============================================================================
MidiDataConcatenator (int initialBufferSize) MidiDataConcatenator (int initialBufferSize)
: pendingData ((size_t) initialBufferSize) : pendingSysexData ((size_t) initialBufferSize)
{ {
} }
void reset() void reset()
{ {
pendingBytes = 0; currentMessageLen = 0;
runningStatus = 0; pendingSysexSize = 0;
pendingDataTime = 0; pendingSysexTime = 0;
} }
template <typename UserDataType, typename CallbackType> template <typename UserDataType, typename CallbackType>
void pushMidiData (const void* inputData, int numBytes, double time, void pushMidiData (const void* inputData, int numBytes, double time,
UserDataType* input, CallbackType& callback) UserDataType* input, CallbackType& callback)
{ {
const uint8* d = static_cast<const uint8*> (inputData); auto d = static_cast<const uint8*> (inputData);
while (numBytes > 0) while (numBytes > 0)
{ {
if (pendingBytes > 0 || d[0] == 0xf0) auto nextByte = *d;
if (pendingSysexSize != 0 || nextByte == 0xf0)
{ {
processSysex (d, numBytes, time, input, callback); processSysex (d, numBytes, time, input, callback);
runningStatus = 0; currentMessageLen = 0;
continue;
}
++d;
--numBytes;
if (isRealtimeMessage (nextByte))
{
callback.handleIncomingMidiMessage (input, MidiMessage (nextByte, time));
// These can be embedded in the middle of a normal message, so we won't
// reset the currentMessageLen here.
continue;
}
if (isInitialByte (nextByte))
{
currentMessage[0] = nextByte;
currentMessageLen = 1;
}
else if (currentMessageLen > 0 && currentMessageLen < 3)
{
currentMessage[currentMessageLen++] = nextByte;
} }
else else
{ {
int len = 0; // message is too long or invalid MIDI - abandon it and start again with the next byte
uint8 data[3]; currentMessageLen = 0;
continue;
}
while (numBytes > 0) auto expectedLength = MidiMessage::getMessageLengthFromFirstByte (currentMessage[0]);
{
// If there's a realtime message embedded in the middle of
// the normal message, handle it now..
if (*d >= 0xf8 && *d <= 0xfe)
{
callback.handleIncomingMidiMessage (input, MidiMessage (*d++, time));
--numBytes;
}
else
{
if (len == 0 && *d < 0x80 && runningStatus >= 0x80)
data[len++] = runningStatus;
data[len++] = *d++; if (expectedLength == currentMessageLen)
--numBytes; {
callback.handleIncomingMidiMessage (input, MidiMessage (currentMessage, expectedLength, time));
const uint8 firstByte = data[0]; currentMessageLen = 1; // reset, but leave the first byte to use as the running status byte
if (firstByte < 0x80 || firstByte == 0xf7)
{
len = 0;
break; // ignore this malformed MIDI message..
}
if (len >= MidiMessage::getMessageLengthFromFirstByte (firstByte))
break;
}
}
if (len > 0)
{
int used = 0;
const MidiMessage m (data, len, used, 0, time);
if (used <= 0)
break; // malformed message..
jassert (used == len);
callback.handleIncomingMidiMessage (input, m);
runningStatus = data[0];
}
} }
} }
} }
@ -117,22 +106,22 @@ private:
{ {
if (*d == 0xf0) if (*d == 0xf0)
{ {
pendingBytes = 0; pendingSysexSize = 0;
pendingDataTime = time; pendingSysexTime = time;
} }
pendingData.ensureSize ((size_t) (pendingBytes + numBytes), false); pendingSysexData.ensureSize ((size_t) (pendingSysexSize + numBytes), false);
uint8* totalMessage = static_cast<uint8*> (pendingData.getData()); auto totalMessage = static_cast<uint8*> (pendingSysexData.getData());
uint8* dest = totalMessage + pendingBytes; auto dest = totalMessage + pendingSysexSize;
do do
{ {
if (pendingBytes > 0 && *d >= 0x80) if (pendingSysexSize > 0 && isInitialByte (*d))
{ {
if (*d == 0xf7) if (*d == 0xf7)
{ {
*dest++ = *d++; *dest++ = *d++;
++pendingBytes; ++pendingSysexSize;
--numBytes; --numBytes;
break; break;
} }
@ -145,7 +134,7 @@ private:
} }
else else
{ {
pendingBytes = 0; pendingSysexSize = 0;
int used = 0; int used = 0;
const MidiMessage m (d, numBytes, used, 0, time); const MidiMessage m (d, numBytes, used, 0, time);
@ -162,30 +151,35 @@ private:
else else
{ {
*dest++ = *d++; *dest++ = *d++;
++pendingBytes; ++pendingSysexSize;
--numBytes; --numBytes;
} }
} }
while (numBytes > 0); while (numBytes > 0);
if (pendingBytes > 0) if (pendingSysexSize > 0)
{ {
if (totalMessage [pendingBytes - 1] == 0xf7) if (totalMessage [pendingSysexSize - 1] == 0xf7)
{ {
callback.handleIncomingMidiMessage (input, MidiMessage (totalMessage, pendingBytes, pendingDataTime)); callback.handleIncomingMidiMessage (input, MidiMessage (totalMessage, pendingSysexSize, pendingSysexTime));
pendingBytes = 0; pendingSysexSize = 0;
} }
else else
{ {
callback.handlePartialSysexMessage (input, totalMessage, pendingBytes, pendingDataTime); callback.handlePartialSysexMessage (input, totalMessage, pendingSysexSize, pendingSysexTime);
} }
} }
} }
MemoryBlock pendingData; static bool isRealtimeMessage (uint8 byte) { return byte >= 0xf8 && byte <= 0xfe; }
double pendingDataTime = 0; static bool isInitialByte (uint8 byte) { return byte >= 0x80 && byte != 0xf7; }
int pendingBytes = 0;
uint8 runningStatus = 0; uint8 currentMessage[3];
int currentMessageLen = 0;
MemoryBlock pendingSysexData;
double pendingSysexTime = 0;
int pendingSysexSize = 0;
JUCE_DECLARE_NON_COPYABLE (MidiDataConcatenator) JUCE_DECLARE_NON_COPYABLE (MidiDataConcatenator)
}; };

View File

@ -23,7 +23,7 @@
namespace juce namespace juce
{ {
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
STATICMETHOD (getMinBufferSize, "getMinBufferSize", "(III)I") \ STATICMETHOD (getMinBufferSize, "getMinBufferSize", "(III)I") \
STATICMETHOD (getNativeOutputSampleRate, "getNativeOutputSampleRate", "(I)I") \ STATICMETHOD (getNativeOutputSampleRate, "getNativeOutputSampleRate", "(I)I") \
METHOD (constructor, "<init>", "(IIIIII)V") \ METHOD (constructor, "<init>", "(IIIIII)V") \
@ -34,11 +34,11 @@ namespace juce
METHOD (flush, "flush", "()V") \ METHOD (flush, "flush", "()V") \
METHOD (write, "write", "([SII)I") \ METHOD (write, "write", "([SII)I") \
DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack"); DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack")
#undef JNI_CLASS_MEMBERS #undef JNI_CLASS_MEMBERS
//============================================================================== //==============================================================================
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
STATICMETHOD (getMinBufferSize, "getMinBufferSize", "(III)I") \ STATICMETHOD (getMinBufferSize, "getMinBufferSize", "(III)I") \
METHOD (constructor, "<init>", "(IIIII)V") \ METHOD (constructor, "<init>", "(IIIII)V") \
METHOD (getState, "getState", "()I") \ METHOD (getState, "getState", "()I") \
@ -47,14 +47,7 @@ DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack");
METHOD (read, "read", "([SII)I") \ METHOD (read, "read", "([SII)I") \
METHOD (release, "release", "()V") \ METHOD (release, "release", "()V") \
DECLARE_JNI_CLASS (AudioRecord, "android/media/AudioRecord"); DECLARE_JNI_CLASS (AudioRecord, "android/media/AudioRecord")
#undef JNI_CLASS_MEMBERS
//==============================================================================
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \
STATICFIELD (SDK_INT, "SDK_INT", "I") \
DECLARE_JNI_CLASS (AndroidBuildVersion, "android/os/Build$VERSION");
#undef JNI_CLASS_MEMBERS #undef JNI_CLASS_MEMBERS
//============================================================================== //==============================================================================
@ -198,11 +191,11 @@ public:
if (numClientOutputChannels > 0) if (numClientOutputChannels > 0)
{ {
numDeviceOutputChannels = 2; numDeviceOutputChannels = 2;
outputDevice = GlobalRef (env->NewObject (AudioTrack, AudioTrack.constructor, outputDevice = GlobalRef (LocalRef<jobject>(env->NewObject (AudioTrack, AudioTrack.constructor,
STREAM_MUSIC, sampleRate, CHANNEL_OUT_STEREO, ENCODING_PCM_16BIT, STREAM_MUSIC, sampleRate, CHANNEL_OUT_STEREO, ENCODING_PCM_16BIT,
(jint) (minBufferSizeOut * numDeviceOutputChannels * static_cast<int> (sizeof (int16))), MODE_STREAM)); (jint) (minBufferSizeOut * numDeviceOutputChannels * static_cast<int> (sizeof (int16))), MODE_STREAM)));
const bool supportsUnderrunCount = (getEnv()->GetStaticIntField (AndroidBuildVersion, AndroidBuildVersion.SDK_INT) >= 24); const bool supportsUnderrunCount = (getAndroidSDKVersion() >= 24);
getUnderrunCount = supportsUnderrunCount ? env->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : 0; getUnderrunCount = supportsUnderrunCount ? env->GetMethodID (AudioTrack, "getUnderrunCount", "()I") : 0;
int outputDeviceState = env->CallIntMethod (outputDevice, AudioTrack.getState); int outputDeviceState = env->CallIntMethod (outputDevice, AudioTrack.getState);
@ -232,11 +225,11 @@ public:
else else
{ {
numDeviceInputChannels = jmin (numClientInputChannels, numDeviceInputChannelsAvailable); numDeviceInputChannels = jmin (numClientInputChannels, numDeviceInputChannelsAvailable);
inputDevice = GlobalRef (env->NewObject (AudioRecord, AudioRecord.constructor, inputDevice = GlobalRef (LocalRef<jobject>(env->NewObject (AudioRecord, AudioRecord.constructor,
0 /* (default audio source) */, sampleRate, 0 /* (default audio source) */, sampleRate,
numDeviceInputChannelsAvailable > 1 ? CHANNEL_IN_STEREO : CHANNEL_IN_MONO, numDeviceInputChannelsAvailable > 1 ? CHANNEL_IN_STEREO : CHANNEL_IN_MONO,
ENCODING_PCM_16BIT, ENCODING_PCM_16BIT,
(jint) (minBufferSizeIn * numDeviceInputChannels * static_cast<int> (sizeof (int16))))); (jint) (minBufferSizeIn * numDeviceInputChannels * static_cast<int> (sizeof (int16))))));
int inputDeviceState = env->CallIntMethod (inputDevice, AudioRecord.getState); int inputDeviceState = env->CallIntMethod (inputDevice, AudioRecord.getState);
if (inputDeviceState > 0) if (inputDeviceState > 0)

View File

@ -23,24 +23,346 @@
namespace juce namespace juce
{ {
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ //==============================================================================
METHOD (getJuceAndroidMidiInputDevices, "getJuceAndroidMidiInputDevices", "()[Ljava/lang/String;") \ // This byte-code is generated from native/java/com/roli/juce/JuceMidiSupport.java with min sdk version 23
METHOD (getJuceAndroidMidiOutputDevices, "getJuceAndroidMidiOutputDevices", "()[Ljava/lang/String;") \ // See juce_core/native/java/README.txt on how to generate this byte-code.
METHOD (openMidiInputPortWithJuceIndex, "openMidiInputPortWithJuceIndex", "(IJ)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceMidiPort;") \ static const uint8 javaMidiByteCode[] =
METHOD (openMidiOutputPortWithJuceIndex, "openMidiOutputPortWithJuceIndex", "(I)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceMidiPort;") \ {31,139,8,8,173,175,226,91,0,3,106,117,99,101,95,97,117,100,105,111,95,100,101,118,105,99,101,115,46,100,101,120,0,149,
METHOD (getInputPortNameForJuceIndex, "getInputPortNameForJuceIndex", "(I)Ljava/lang/String;") \ 124,11,124,220,69,181,255,153,223,99,119,179,217,164,155,77,218,164,105,178,217,164,73,179,133,60,155,182,164,77,26,154,
METHOD (getOutputPortNameForJuceIndex, "getOutputPortNameForJuceIndex", "(I)Ljava/lang/String;") 164,105,155,118,251,160,217,22,105,144,186,77,182,237,150,100,55,236,110,250,0,175,148,135,180,32,42,42,143,42,92,254,40,
DECLARE_JNI_CLASS (MidiDeviceManager, JUCE_ANDROID_ACTIVITY_CLASSPATH "$MidiDeviceManager") 175,130,168,232,5,46,34,42,8,87,20,69,184,92,212,122,125,1,194,223,130,200,67,65,68,196,222,239,153,153,125,164,45,84,
203,231,187,103,126,103,206,156,153,57,115,230,204,153,223,46,25,141,238,113,183,117,44,160,7,183,254,71,91,73,96,244,
225,231,218,251,238,107,108,49,191,55,239,138,244,25,191,14,80,247,85,235,137,38,136,104,207,166,249,62,210,255,30,90,71,
116,150,80,252,1,224,25,155,104,19,232,17,7,81,0,244,117,55,209,93,76,11,137,10,64,215,151,128,223,3,121,104,216,209,76,
180,19,24,7,146,192,36,112,61,112,35,112,8,184,27,184,7,120,0,120,8,120,26,40,110,33,90,7,156,11,196,129,36,176,27,56,8,
124,23,248,30,240,3,224,151,192,107,192,123,64,105,43,209,12,160,18,168,1,234,129,83,128,22,160,3,88,4,108,1,46,5,110,7,
158,6,204,54,162,54,96,24,216,7,124,25,248,9,240,6,224,111,39,234,7,206,1,46,4,190,2,60,13,188,3,84,207,35,90,11,236,7,
238,0,126,2,188,1,56,58,136,170,128,5,192,32,240,97,32,9,252,16,120,23,104,153,79,180,21,184,10,248,13,80,191,128,232,76,
224,227,192,109,192,227,192,203,64,209,66,162,38,96,37,176,5,72,2,251,129,235,129,175,1,223,7,94,0,204,211,136,102,2,109,
192,48,144,0,46,1,14,2,119,1,15,3,63,7,142,0,127,3,90,59,137,150,2,67,192,78,224,223,128,135,128,103,128,231,129,130,69,
68,30,192,11,76,7,102,1,179,129,70,160,9,152,7,44,2,122,128,126,96,16,88,7,108,2,62,12,68,128,81,96,7,48,6,76,0,87,3,143,
0,47,1,255,0,74,23,195,55,128,38,96,1,176,24,232,7,206,0,206,1,118,2,73,224,82,224,38,224,30,224,251,192,175,128,87,129,
119,0,179,11,227,3,170,129,122,96,30,176,24,88,5,156,1,124,8,136,0,113,96,15,240,113,224,83,192,13,192,205,192,109,192,
55,128,7,128,71,129,159,0,191,6,94,6,222,1,236,110,216,0,168,2,234,129,86,96,49,176,19,72,3,215,1,247,3,223,5,158,0,126,
1,252,22,120,25,120,13,120,23,40,95,66,52,31,88,13,124,4,56,31,248,12,112,61,240,85,224,155,192,15,129,159,2,191,1,10,
176,95,188,64,121,143,218,59,61,192,89,192,94,224,11,192,189,192,19,192,207,128,183,0,227,116,162,18,224,20,96,62,208,15,
132,129,109,64,2,248,24,176,31,248,12,112,29,240,37,224,86,224,78,224,235,192,127,2,223,1,126,8,252,12,248,29,240,10,240,
22,96,44,133,31,0,51,128,90,160,21,152,15,116,3,43,129,51,128,51,129,17,96,23,112,25,240,57,224,58,224,6,224,139,192,237,
192,87,129,251,129,239,0,143,0,63,2,126,11,252,21,40,238,37,106,0,122,128,245,192,8,144,4,46,6,62,15,220,9,60,12,60,14,
28,6,94,6,172,62,34,31,16,0,130,64,15,48,4,108,1,226,192,167,128,175,1,143,3,255,11,188,8,188,6,252,13,16,253,216,87,64,
25,48,23,24,0,206,1,70,129,113,96,15,112,49,112,37,112,29,240,69,224,110,224,1,224,113,224,73,224,247,192,107,192,187,
128,107,25,246,6,112,42,48,31,232,6,250,128,21,192,102,32,1,236,1,46,6,174,0,174,2,238,2,238,3,30,3,158,1,94,0,222,0,222,
6,254,1,20,32,184,86,0,1,96,14,208,6,116,1,189,192,32,16,6,62,12,164,129,79,3,119,0,119,3,211,16,115,203,128,58,96,54,80,
15,52,0,115,128,70,32,8,204,5,78,1,78,5,154,0,132,89,66,216,36,132,65,66,184,35,132,53,66,8,35,132,41,66,104,34,132,33,
66,136,33,132,13,66,104,32,108,93,194,214,35,108,15,130,123,19,92,150,224,42,132,101,33,152,151,96,18,90,166,207,135,229,
192,10,96,37,48,8,172,2,86,3,33,96,13,176,22,88,199,231,4,112,6,176,1,24,2,194,164,206,149,15,1,155,129,179,129,115,128,
45,64,4,24,1,70,129,40,112,46,112,1,240,49,224,66,96,31,112,17,112,49,112,9,41,155,100,254,121,53,125,22,147,47,209,229,
35,40,87,130,26,250,153,203,166,46,215,232,242,179,90,198,210,252,90,93,126,93,243,93,121,242,56,2,233,239,154,95,168,
249,179,128,34,110,211,164,248,197,121,125,77,203,43,251,242,228,203,180,60,151,43,242,218,86,230,245,85,165,199,198,50,
126,45,83,163,203,204,175,209,114,30,173,167,78,203,84,235,114,89,147,146,229,114,149,110,91,159,215,182,65,183,229,126,
216,135,130,122,12,45,121,227,108,205,27,91,91,222,216,184,220,214,164,242,2,46,119,54,229,248,25,123,182,231,233,105,
207,27,63,151,151,230,149,51,242,157,121,250,217,15,87,234,126,23,107,62,251,194,18,93,30,211,101,214,57,174,203,235,81,
142,235,242,135,80,78,232,242,104,147,202,105,184,156,70,121,183,46,127,20,229,243,116,249,0,202,73,93,190,10,229,73,93,
190,1,229,93,186,124,75,94,249,238,60,157,15,230,149,61,121,229,71,243,202,63,206,235,247,153,60,254,179,121,229,35,121,
253,190,158,199,255,107,94,91,222,208,123,50,125,53,231,228,43,80,222,171,203,129,230,92,219,165,121,122,218,242,244,119,
230,143,225,212,92,185,169,57,215,215,124,148,211,25,61,40,159,175,203,43,155,115,182,90,143,114,74,151,207,110,86,123,
181,71,175,209,71,117,153,215,232,223,116,57,157,87,110,203,43,103,124,160,87,183,229,114,95,158,63,244,231,249,195,50,
205,159,165,203,150,244,243,54,186,143,20,93,42,184,205,52,250,132,108,219,78,159,146,244,52,250,140,164,46,234,17,236,
183,21,116,5,219,10,189,191,36,169,160,87,37,109,160,217,178,126,14,53,11,142,5,101,82,174,86,243,107,53,127,182,126,102,
122,134,224,125,101,209,181,196,212,75,127,145,84,213,215,235,250,6,61,158,6,68,219,107,36,237,163,59,37,45,167,55,37,
157,79,239,232,122,191,80,52,32,212,190,60,68,76,123,232,15,164,158,231,10,142,247,53,116,21,49,109,160,183,137,227,155,
139,190,39,169,73,143,74,106,211,255,18,199,55,39,221,40,105,29,61,168,233,255,176,205,112,82,220,160,233,87,37,181,232,
191,36,93,67,11,161,223,6,223,73,28,251,86,208,42,193,116,1,173,21,156,247,43,190,59,75,221,116,157,164,5,180,28,245,30,
173,167,72,215,23,129,115,157,164,133,180,76,40,58,32,56,46,22,209,119,137,105,45,253,146,56,118,171,241,120,17,61,127,
44,233,52,154,41,152,122,169,90,112,60,87,227,230,184,254,51,77,127,69,42,166,254,72,210,51,232,176,164,37,244,11,205,
231,250,50,173,183,12,167,83,47,244,76,215,227,42,199,105,244,152,164,173,84,46,152,46,162,10,73,187,105,158,164,93,180,
73,112,108,86,237,43,224,225,255,174,41,219,107,166,214,83,137,241,127,139,56,134,250,232,126,226,216,107,208,45,210,15,
151,201,250,26,172,163,162,130,30,150,180,129,126,40,105,152,254,91,210,229,100,74,127,61,133,74,37,61,149,202,36,93,79,
115,36,29,164,213,146,14,208,70,233,151,167,75,125,1,61,46,166,255,33,105,51,253,90,210,16,189,162,249,211,164,252,106,
154,46,233,42,234,23,138,63,168,233,26,233,207,61,82,95,173,214,87,171,245,213,106,61,181,186,93,173,110,87,171,219,213,
105,249,58,45,87,167,229,234,180,92,157,150,155,77,75,165,254,217,200,58,44,249,220,65,182,166,14,73,219,201,41,233,124,
114,105,90,160,249,94,77,75,36,109,35,159,166,51,228,190,234,149,122,235,209,255,231,37,173,163,135,36,117,208,15,72,157,
115,143,75,58,151,186,244,126,114,202,253,165,230,215,0,143,184,71,210,153,116,175,164,106,125,26,224,23,223,151,116,54,
61,33,233,70,250,137,164,97,122,82,211,167,36,45,165,167,181,220,51,146,214,211,79,37,157,69,63,151,180,147,220,178,223,
211,168,80,83,143,80,252,34,73,23,83,177,80,251,191,82,210,25,52,75,210,10,170,146,116,45,213,75,218,66,13,66,197,139,
249,146,14,80,88,198,133,38,57,159,57,200,176,190,166,227,194,111,101,60,152,11,11,40,234,148,116,58,125,91,210,74,250,
14,241,121,126,138,228,183,106,249,86,120,236,135,4,159,219,74,190,77,219,167,13,30,253,8,241,249,172,244,183,195,206,47,
19,231,141,253,82,174,3,30,206,126,63,95,183,155,15,185,253,250,249,122,253,252,255,36,157,67,127,212,207,29,66,229,156,
43,37,29,162,33,193,249,103,35,93,73,156,131,42,61,11,117,251,133,144,191,73,210,26,217,207,66,100,183,127,146,52,64,237,
66,241,89,223,105,186,221,105,186,255,211,116,63,167,233,126,78,211,253,116,98,252,191,33,166,200,136,4,231,23,106,92,
139,53,237,210,122,186,144,205,158,46,56,247,85,207,221,218,191,248,12,2,91,190,247,32,185,255,113,94,115,162,141,36,247,
189,53,42,199,18,142,92,142,196,245,46,156,105,11,215,170,231,128,110,207,252,167,78,85,180,2,116,173,174,175,213,245,
109,121,245,109,160,151,233,250,217,90,175,157,167,127,37,234,191,170,235,235,53,191,59,175,254,67,168,127,81,215,55,104,
253,211,129,195,90,255,14,80,207,58,85,63,71,183,203,31,255,221,168,63,160,235,27,243,198,151,169,127,8,245,55,233,122,
206,175,127,129,196,255,217,144,146,251,131,166,127,11,229,234,10,215,228,202,229,107,84,125,93,30,239,84,93,94,8,186,36,
175,188,114,141,202,211,89,102,8,229,115,116,219,152,166,231,107,250,9,77,111,210,244,94,77,127,156,215,199,111,53,239,
101,169,211,144,229,111,14,168,187,195,132,183,8,207,117,240,153,9,47,251,238,176,215,66,84,31,246,26,52,236,51,112,46,
177,60,235,121,124,64,229,254,97,212,156,231,189,148,248,212,139,7,118,96,141,221,50,223,183,180,220,127,15,168,123,193,
121,178,23,143,136,7,12,236,35,200,122,109,249,204,113,205,68,29,203,254,102,64,157,105,225,128,69,225,90,11,50,95,66,
141,91,204,46,89,6,221,55,99,124,30,248,224,50,41,99,203,83,30,119,121,180,153,1,154,244,222,134,62,61,34,233,189,133,
219,24,157,70,17,120,183,162,204,109,60,228,243,197,219,22,193,131,130,175,23,235,145,17,189,51,160,236,192,119,21,135,
156,25,158,151,171,187,160,175,100,94,153,77,190,218,142,178,18,140,163,4,253,121,176,111,10,41,220,206,227,226,155,145,
199,136,7,110,130,207,250,122,59,202,106,16,191,166,83,165,177,147,206,11,180,131,151,107,225,59,166,197,23,101,173,165,
109,209,141,8,90,44,231,194,125,7,150,171,187,74,190,173,122,161,101,17,250,85,250,191,161,245,251,196,52,17,110,87,150,
23,82,242,124,105,169,224,91,110,104,98,237,109,208,117,38,207,163,220,231,208,250,160,199,77,149,22,244,216,69,82,79,24,
125,199,229,133,209,35,22,137,76,157,71,215,5,255,212,89,176,128,234,12,55,60,129,109,86,105,89,232,175,141,173,108,197,
3,94,196,226,58,179,8,117,62,88,46,30,40,67,6,204,252,233,184,181,122,44,95,3,151,194,52,59,189,20,61,76,67,107,143,189,
198,182,28,231,121,175,83,237,189,165,104,229,177,227,75,11,169,247,227,193,111,199,3,30,220,104,131,223,164,172,127,141,
46,87,247,204,169,254,245,111,240,175,98,228,97,14,57,163,241,229,234,110,57,225,109,65,155,225,217,5,52,92,239,160,225,
6,55,109,158,227,130,229,207,14,56,229,218,218,210,191,4,93,180,92,197,16,159,25,238,117,80,167,112,18,211,184,247,84,
212,133,123,11,192,41,144,52,220,231,70,95,31,133,157,135,251,161,179,223,1,45,69,122,5,124,122,5,130,71,84,28,98,221,66,
52,227,248,18,114,76,215,162,15,142,153,113,126,193,69,9,239,229,218,191,212,46,35,186,113,185,218,135,62,88,69,104,222,
45,203,115,126,88,140,185,241,93,251,206,229,106,223,44,41,244,208,208,69,46,114,238,115,126,78,220,34,238,181,190,191,
203,181,84,203,90,250,182,254,64,94,123,67,239,165,239,47,87,113,46,236,45,80,94,232,197,140,33,177,209,235,148,126,192,
207,241,64,19,246,148,207,123,182,215,57,165,237,147,31,208,182,51,219,182,153,219,82,166,45,143,133,199,112,88,175,219,
132,247,0,71,15,225,161,97,163,144,134,225,41,197,217,117,56,146,183,14,133,122,29,10,97,177,217,114,29,60,122,29,60,88,
135,162,236,58,64,79,127,225,191,176,14,239,101,215,97,229,9,215,193,94,161,215,1,30,228,212,163,47,4,175,148,231,221,
174,71,5,26,95,138,44,43,154,235,183,79,232,126,223,86,239,71,116,191,238,204,90,214,173,200,173,69,134,23,204,227,153,
50,218,17,181,172,80,239,84,134,197,52,216,138,45,54,108,20,203,248,170,222,204,44,206,107,147,89,231,101,39,224,173,95,
145,31,195,44,57,167,179,87,168,56,234,11,116,216,211,176,190,241,64,1,180,134,3,188,219,93,188,239,16,47,46,144,183,140,
156,158,115,79,160,123,247,9,120,151,156,128,247,233,99,230,199,255,174,63,1,239,214,60,158,45,45,71,244,181,21,188,179,
217,14,165,176,195,157,210,14,56,111,204,18,26,182,120,132,150,180,162,73,15,173,80,239,100,170,140,122,170,54,124,98,
184,221,135,85,253,50,106,224,143,237,94,172,215,52,73,227,240,71,161,75,28,37,88,210,139,231,18,72,184,37,141,123,43,52,
191,132,252,6,238,96,194,111,52,138,34,17,124,155,103,51,19,117,53,114,124,166,204,23,28,210,103,231,94,216,220,52,87,
151,13,250,245,10,149,59,86,153,24,139,25,222,0,221,198,108,98,26,247,206,228,88,39,226,222,58,121,10,249,230,119,244,
205,0,183,150,163,180,81,105,125,22,254,220,138,200,201,103,146,137,189,228,202,158,12,126,179,4,168,196,242,5,255,94,
132,82,163,161,206,251,57,104,217,172,125,73,32,223,205,248,239,187,43,84,125,216,235,149,107,109,104,111,19,43,51,231,
178,26,141,140,155,94,245,214,78,157,203,106,15,58,87,242,253,14,115,16,152,131,8,183,249,56,39,167,112,27,230,130,252,
142,159,195,243,160,33,144,70,196,245,11,246,127,191,104,36,213,103,169,236,171,12,251,70,157,193,190,149,234,125,166,
207,154,240,54,192,114,195,225,50,26,222,84,6,139,148,81,165,249,22,180,148,227,230,227,49,106,140,114,26,222,80,14,62,
110,154,56,87,42,13,236,40,115,187,220,201,243,176,214,117,198,66,248,192,65,142,229,27,102,226,105,62,158,62,45,159,42,
166,212,85,78,121,154,46,245,197,189,115,216,242,84,107,250,140,5,243,220,124,15,199,105,155,68,28,59,108,24,88,91,41,
211,54,151,54,88,193,31,187,244,25,115,250,74,149,43,134,71,42,208,254,115,188,51,44,206,31,44,114,155,157,102,155,204,
31,44,57,110,63,133,17,176,106,76,175,180,169,153,91,97,211,183,160,99,232,247,71,245,10,155,149,182,90,225,161,236,10,
255,226,168,94,97,51,30,248,4,206,72,214,252,228,209,18,195,103,4,255,225,200,156,117,43,213,187,234,112,95,37,244,223,
192,243,48,146,222,219,53,189,5,148,91,205,146,227,49,164,230,86,10,247,67,54,112,189,28,75,13,214,48,238,253,136,28,1,
247,50,36,229,95,56,90,34,124,34,248,15,142,51,202,123,46,92,169,222,123,87,217,13,84,109,135,211,60,235,107,120,182,214,
236,190,62,142,243,105,101,7,204,217,33,100,38,229,64,93,167,53,67,246,236,128,246,26,211,79,135,17,239,194,184,194,212,
88,202,26,124,158,175,177,12,33,68,240,247,126,187,196,40,178,252,118,163,197,126,209,34,123,109,37,151,244,19,131,238,
91,169,238,62,170,255,9,111,140,117,90,195,163,51,200,111,215,153,106,181,77,140,35,222,118,30,237,194,220,59,141,82,204,
113,2,123,128,51,139,171,112,235,58,12,7,207,212,6,223,80,61,241,28,76,158,67,47,103,137,215,194,59,61,86,141,133,44,81,
142,129,163,65,67,118,255,240,205,88,237,148,63,106,155,87,25,24,139,17,238,85,51,103,11,242,188,161,79,116,138,10,57,
111,83,90,220,47,111,156,53,66,205,89,230,92,222,26,153,115,117,156,113,228,168,223,224,88,226,163,224,123,42,154,168,
125,210,40,123,10,18,231,130,220,175,99,16,209,141,251,116,163,79,119,167,183,140,124,115,121,54,55,20,121,176,94,107,41,
252,240,76,204,224,11,200,143,185,119,39,44,225,119,151,144,111,102,240,213,13,237,179,104,34,16,199,125,212,227,236,116,
46,162,240,46,140,197,129,168,231,232,128,84,39,124,113,67,123,53,218,206,66,46,204,118,43,64,6,31,32,231,195,214,11,187,
28,242,77,39,191,107,129,246,58,171,3,122,62,137,53,139,183,253,59,181,91,126,119,240,41,140,216,221,40,84,251,74,110,
239,234,116,189,116,180,14,103,220,196,210,21,244,80,103,240,121,191,27,51,123,144,228,157,186,31,51,226,239,56,84,246,
178,66,250,22,123,241,126,204,141,223,253,249,28,225,20,118,90,224,20,248,122,149,133,121,90,225,212,116,216,236,243,124,
2,165,148,127,155,210,202,183,203,12,144,173,109,75,127,45,151,214,182,165,63,183,42,89,248,119,169,244,58,246,239,45,
144,15,190,84,100,250,173,70,211,103,14,163,222,15,221,51,143,213,152,183,131,43,243,118,240,28,146,178,208,56,91,106,
236,64,187,79,201,118,53,102,29,228,214,178,246,223,13,239,154,9,185,19,69,131,186,140,46,229,11,166,160,78,68,3,166,53,
166,37,79,29,51,239,201,33,159,50,17,163,130,117,255,82,233,253,12,202,156,141,112,214,196,247,232,185,176,223,124,82,
119,32,129,155,165,186,11,24,244,237,65,229,159,190,64,149,128,21,225,109,87,242,72,140,69,70,0,43,184,13,235,192,235,
140,27,138,215,207,39,223,188,233,210,115,250,228,205,199,137,88,29,252,139,138,216,19,129,237,90,214,98,238,31,252,194,
39,115,38,142,73,179,208,99,128,248,62,207,125,87,203,236,129,253,246,233,65,149,87,251,106,217,59,125,38,223,99,156,114,
39,26,242,198,198,239,106,130,239,229,242,197,231,7,149,111,248,2,19,129,115,229,141,171,36,91,119,36,83,231,205,213,101,
250,121,53,211,79,201,7,247,227,211,54,249,7,228,183,18,199,179,18,218,232,170,162,78,215,90,220,111,212,110,114,33,159,
9,23,206,160,218,7,125,46,113,249,130,31,174,194,9,80,88,224,51,244,46,117,113,155,13,69,179,168,227,240,34,172,2,191,
233,246,20,213,254,198,231,90,112,164,157,150,91,69,174,184,215,207,246,117,116,236,154,131,250,106,185,234,178,205,180,
106,234,248,115,21,120,85,188,250,54,175,3,252,21,123,164,56,115,174,187,42,11,222,147,81,255,32,234,107,236,118,222,181,
182,175,49,120,207,97,151,75,4,159,58,236,42,16,226,242,224,127,250,221,149,72,84,131,127,46,114,97,191,185,56,227,219,
128,214,31,201,198,166,45,176,133,41,215,37,182,74,125,247,232,43,245,89,62,17,126,12,179,218,35,150,47,184,108,30,45,39,
167,131,71,143,243,164,160,246,11,98,96,193,173,245,180,220,40,176,121,244,56,37,10,59,126,57,147,58,158,155,78,117,246,
156,204,169,239,232,88,82,40,103,132,122,107,98,233,199,40,218,239,28,42,49,69,127,240,47,135,17,179,15,219,182,8,254,
250,176,141,128,191,41,248,164,207,12,254,89,221,221,121,28,95,90,165,214,135,207,58,206,179,124,237,29,94,19,126,27,198,
121,238,19,241,165,65,106,243,5,223,225,247,202,134,204,151,238,130,252,77,28,223,138,176,34,69,105,49,147,119,175,139,
199,225,194,56,124,78,95,1,223,202,194,158,74,220,232,246,115,236,47,102,159,125,133,220,158,69,158,115,100,47,144,243,
248,122,58,94,105,67,212,99,235,186,200,227,169,44,86,103,234,43,210,186,56,83,109,117,131,70,164,176,148,62,229,251,33,
180,237,244,116,83,142,119,61,120,30,103,141,211,202,227,221,8,94,93,97,189,228,184,176,23,92,56,99,38,206,60,135,10,107,
143,27,27,34,228,43,133,117,197,93,56,151,14,97,214,157,5,109,84,234,121,202,121,209,67,182,151,243,67,236,236,165,119,
208,119,188,254,162,226,204,120,60,172,131,119,231,67,228,113,119,186,225,145,119,33,211,122,168,6,214,116,34,110,187,
100,156,112,202,248,224,164,52,206,151,82,242,23,5,159,43,242,248,139,26,61,165,158,81,10,62,93,228,9,190,205,123,99,18,
30,193,223,101,85,235,239,84,84,222,118,80,92,216,124,163,56,40,56,199,51,100,94,221,182,90,125,231,85,229,132,205,157,
124,54,185,113,122,179,205,113,118,27,225,107,213,124,12,94,7,216,232,50,172,67,167,3,209,245,90,196,162,192,103,233,54,
60,47,114,52,208,84,185,235,33,231,113,212,56,56,234,70,228,185,63,181,254,70,212,179,134,58,151,159,38,218,230,209,33,
147,79,231,203,200,239,44,38,61,2,139,87,143,243,136,74,151,90,189,203,100,92,199,234,137,42,105,45,33,243,82,73,29,108,
177,24,86,183,211,134,111,13,169,24,218,105,186,116,84,85,209,148,163,168,155,130,79,22,57,130,79,20,57,252,206,70,135,
58,99,199,97,247,9,29,63,119,203,189,132,8,122,97,115,122,23,114,132,66,25,53,4,237,131,141,62,204,54,194,76,171,165,109,
220,228,182,249,60,61,75,190,163,89,147,141,213,97,129,222,133,69,190,50,223,244,14,36,57,62,43,124,141,58,97,108,121,86,
221,174,169,60,179,176,162,175,30,213,103,150,60,97,54,52,206,34,173,221,213,177,255,213,163,178,45,172,217,32,61,87,157,
56,182,44,171,19,7,209,187,44,248,227,78,225,210,183,22,117,99,9,95,195,107,115,53,106,253,14,228,221,182,223,209,104,
171,185,158,37,227,196,230,236,251,171,71,86,79,189,251,241,61,248,71,171,179,241,118,253,94,154,23,246,200,236,195,144,
117,63,93,173,238,156,252,190,204,103,76,108,216,75,253,94,174,47,144,251,29,247,154,213,234,183,12,136,59,6,175,141,75,
174,17,191,153,230,44,208,164,105,134,58,209,249,61,159,19,22,236,180,113,210,88,193,183,112,95,177,26,141,112,114,58,
233,86,182,207,193,187,103,131,35,156,44,3,111,134,204,100,125,211,235,28,179,225,47,67,180,203,25,95,138,19,49,234,65,
150,131,21,207,107,39,91,9,191,37,230,5,31,231,59,234,126,10,254,77,189,151,116,99,166,252,93,231,169,210,6,21,217,24,
229,8,169,123,126,38,38,53,34,38,169,59,167,178,210,180,144,178,71,216,59,83,238,126,126,127,164,252,194,162,138,144,250,
189,5,207,209,45,119,6,71,55,181,147,194,215,170,168,114,155,228,227,206,114,173,138,40,183,201,181,134,127,26,106,213,
12,185,106,134,174,191,17,245,124,226,222,33,189,25,153,172,119,43,123,138,204,94,236,236,46,163,236,46,98,207,135,44,
172,11,223,235,159,114,195,112,196,3,147,216,21,42,123,240,59,131,247,40,175,47,18,149,14,220,154,92,165,242,214,116,25,
113,188,230,179,100,25,172,178,86,223,181,207,208,241,226,76,157,255,26,52,116,97,243,166,161,236,59,154,177,80,254,59,
154,179,196,44,58,219,168,162,179,204,106,249,246,73,221,48,63,26,82,239,203,125,98,17,98,238,52,228,31,87,200,76,138,41,
124,216,236,152,247,246,81,231,250,26,228,230,27,250,170,105,3,218,118,204,123,245,232,198,190,42,218,104,86,161,124,228,
232,134,190,89,224,227,196,157,247,252,81,95,73,240,183,153,247,112,68,159,12,169,239,10,234,112,55,216,208,59,139,158,
246,237,3,173,166,82,115,31,45,104,47,149,229,187,107,39,2,31,231,24,235,189,140,87,223,216,216,139,243,30,59,197,247,
198,55,106,167,137,82,113,33,5,95,131,214,191,169,219,48,209,23,245,58,251,96,179,26,192,143,185,100,222,5,29,10,169,124,
71,205,183,88,199,82,131,190,18,210,239,161,68,238,13,169,73,37,66,191,19,69,206,244,238,209,42,163,17,247,131,173,194,
79,139,4,178,106,81,131,53,235,64,134,30,3,199,47,249,193,35,153,156,191,68,234,16,250,123,12,33,179,43,83,247,245,88,72,
125,127,82,73,234,62,108,200,222,44,249,93,109,21,242,180,106,177,21,245,139,136,51,247,6,244,49,138,182,60,19,191,228,7,
95,205,220,191,139,116,31,213,217,62,170,228,111,79,229,221,95,219,130,231,250,81,159,250,254,231,82,208,43,179,191,110,
85,255,14,234,231,140,60,255,182,233,22,240,238,58,134,63,168,249,247,31,211,254,209,99,158,159,242,169,62,51,191,41,226,
119,135,207,250,212,111,122,94,247,169,239,73,254,234,83,191,91,56,226,83,191,105,98,189,219,88,184,84,253,94,5,14,77,
222,210,169,122,171,142,121,150,223,149,104,58,67,83,254,237,140,33,105,187,236,127,26,245,200,88,199,117,85,121,115,17,
164,114,25,67,63,153,154,246,80,238,119,81,153,239,118,12,73,219,228,243,28,205,239,207,202,121,116,91,245,11,15,213,215,
233,217,246,66,219,65,97,134,140,89,220,46,99,159,204,239,171,20,207,161,121,14,201,83,101,103,86,87,129,166,94,77,125,
90,198,167,245,10,101,62,202,124,167,101,72,58,139,50,223,177,177,44,127,199,59,71,247,203,223,171,206,209,123,176,1,255,
89,154,122,117,92,88,164,219,44,210,119,19,150,235,214,123,168,71,215,157,174,199,111,101,203,114,214,65,50,131,131,184,
203,204,165,250,182,142,190,206,182,129,5,189,205,3,203,6,58,155,231,247,117,116,52,247,158,182,160,189,121,97,255,64,
199,252,129,254,249,253,167,181,193,180,200,211,186,71,198,98,241,88,186,135,28,221,138,26,61,93,100,245,116,205,221,196,
159,40,123,251,198,38,163,233,68,34,189,99,77,36,30,217,30,77,210,226,99,57,129,104,50,153,72,46,14,140,36,38,199,70,3,
241,68,58,176,61,154,14,100,165,2,161,129,64,106,36,18,143,163,237,233,255,92,219,209,232,182,200,228,88,190,142,200,104,
100,34,13,5,149,203,38,199,199,247,102,249,43,34,233,116,127,100,108,108,107,100,4,23,155,65,50,6,67,100,14,134,66,84,51,
184,46,48,176,103,36,58,145,142,37,226,129,221,59,98,99,209,192,200,88,34,21,139,111,15,76,36,146,105,106,24,92,247,126,
245,227,177,209,24,134,176,43,54,18,37,177,138,172,85,27,251,7,168,100,213,228,72,116,13,106,6,227,19,147,233,245,172,
194,151,97,173,155,76,103,120,158,12,79,62,149,101,158,134,38,39,184,215,150,157,145,93,17,18,33,50,66,131,100,134,6,229,
7,122,192,7,50,10,12,219,12,225,195,10,133,54,135,168,62,20,137,143,38,19,177,209,214,173,153,217,182,102,231,221,171,
204,209,69,179,63,72,106,153,156,67,23,213,126,144,16,155,176,139,230,158,76,36,99,229,46,106,61,169,232,142,72,50,50,
130,225,197,82,233,216,72,23,157,122,178,6,203,162,169,145,100,108,34,157,72,158,120,32,99,209,156,124,40,58,164,124,233,
196,115,135,40,215,231,70,251,62,250,88,104,121,108,12,131,172,239,155,140,141,141,178,190,19,153,105,138,232,7,138,108,
136,166,224,178,39,158,173,22,25,138,166,211,112,176,84,174,203,15,152,66,70,184,139,102,102,133,70,18,241,116,52,158,
110,237,103,186,7,157,213,100,171,198,163,163,177,72,43,187,110,43,59,92,102,233,155,62,88,96,48,190,45,81,207,174,202,
133,252,225,188,175,116,23,53,124,176,208,80,58,146,158,196,168,235,222,79,44,187,129,242,93,233,24,25,29,29,234,149,202,
220,106,158,118,178,6,235,226,170,201,186,137,104,60,58,26,130,7,70,165,175,4,78,210,240,3,230,158,219,221,249,235,127,
140,208,134,232,72,52,182,139,245,148,102,69,18,169,214,190,201,248,232,24,150,161,44,159,185,50,194,76,136,150,231,115,
215,71,146,35,209,177,141,147,177,209,46,242,101,43,38,211,177,177,214,80,98,251,113,188,245,145,88,50,175,175,44,175,
139,54,30,207,236,62,137,155,156,52,62,224,32,104,11,141,36,198,91,147,137,177,88,235,78,68,181,214,99,66,91,253,177,145,
189,139,218,79,210,226,184,136,218,69,243,254,201,38,249,107,210,244,79,182,81,210,161,147,72,231,172,146,245,193,247,61,
113,186,104,217,191,172,45,199,97,23,13,71,82,231,158,220,80,199,105,57,249,164,51,19,94,31,73,239,224,48,241,129,210,
188,89,71,35,99,187,98,231,182,34,180,38,176,129,113,40,182,14,196,245,129,216,63,22,73,97,67,251,79,32,51,200,145,88,
215,215,158,160,126,77,116,124,171,22,136,66,164,250,4,34,67,177,237,113,68,140,36,118,73,229,9,170,195,59,146,137,221,
104,58,61,196,103,103,107,44,209,154,119,112,119,81,137,98,143,69,226,219,91,245,56,74,243,88,131,136,147,210,94,190,60,
230,186,173,59,163,35,233,169,188,161,116,18,51,205,118,35,121,178,235,200,86,222,191,85,121,236,100,116,91,235,153,209,
200,185,27,162,219,162,201,104,28,73,66,245,7,213,242,230,151,213,114,55,246,38,147,145,189,28,150,50,61,77,229,242,121,
117,2,118,247,241,35,237,201,142,63,39,154,154,202,91,25,73,97,51,78,100,12,146,207,59,94,16,199,205,113,130,224,77,29,
253,32,14,193,136,60,166,167,229,113,229,116,188,199,48,186,168,227,24,78,247,73,207,206,158,169,122,101,247,37,121,140,
112,108,156,215,114,250,177,44,181,139,74,142,219,38,212,123,28,235,196,249,102,222,65,16,72,237,197,153,49,30,72,69,147,
50,1,244,29,191,97,201,147,191,187,168,33,255,180,110,233,239,13,133,250,122,251,87,111,9,159,181,126,96,203,154,222,112,
255,202,45,161,117,67,97,18,155,200,216,132,132,111,19,82,84,107,211,224,230,65,114,108,90,133,20,112,21,216,72,252,54,
33,35,180,54,113,74,104,111,146,92,112,228,7,75,135,84,37,202,54,127,174,82,4,105,228,166,205,36,144,57,66,153,129,148,
209,24,238,163,186,225,147,103,49,205,195,255,82,86,80,255,79,136,99,219,13,159,96,139,77,97,102,246,88,97,100,100,36,
154,74,45,31,139,108,79,145,27,153,226,100,100,76,166,203,206,76,150,111,70,70,71,249,105,52,9,57,242,232,222,7,227,163,
209,61,104,173,158,100,11,119,100,98,66,39,67,228,136,164,148,39,110,61,38,75,166,202,44,39,52,32,195,158,90,219,141,27,
7,151,145,111,235,113,153,101,158,134,140,35,149,229,56,217,105,167,242,228,182,232,235,66,193,214,116,175,30,181,107,
107,90,201,65,76,151,82,124,22,195,4,228,216,154,230,115,132,236,173,156,8,146,103,68,31,40,225,189,19,81,114,96,20,200,
4,168,120,100,74,30,77,246,200,88,52,146,100,146,72,69,201,137,92,48,14,27,83,161,46,72,133,46,206,16,35,177,120,74,178,
101,105,117,116,175,20,150,54,242,232,66,56,177,17,58,108,236,130,120,154,196,40,185,71,179,41,56,57,244,92,92,138,194,
70,153,210,40,21,101,74,74,65,225,104,214,1,82,153,186,140,201,220,234,81,230,41,5,163,177,36,134,136,136,13,118,44,149,
25,186,35,122,30,150,62,69,5,114,83,246,39,70,97,192,104,38,182,83,203,182,8,110,101,163,129,116,34,48,146,140,70,210,
209,192,214,201,49,125,29,84,186,3,219,146,137,241,64,198,77,92,219,98,241,200,88,236,252,40,213,162,52,154,91,168,229,
137,100,222,197,73,9,215,176,72,102,67,159,72,192,222,22,75,194,153,60,219,96,162,209,204,130,187,185,67,229,198,100,109,
103,131,23,240,167,50,134,137,72,66,110,124,100,84,84,114,89,57,235,113,151,232,89,185,186,227,195,214,116,174,156,152,
24,139,141,200,51,48,227,224,165,96,31,55,206,138,124,102,126,6,46,181,28,127,109,34,23,216,242,164,164,18,148,150,169,
155,118,102,167,20,72,150,92,254,226,108,81,45,175,59,251,156,34,39,202,210,223,230,162,176,114,114,156,35,56,246,46,142,
74,101,156,19,26,20,162,240,37,73,70,165,6,214,75,85,178,160,147,185,181,145,113,94,45,78,79,212,102,159,137,90,126,58,
206,84,41,242,31,95,37,245,100,234,107,142,175,87,89,99,70,128,117,51,247,216,145,162,106,134,174,90,150,117,97,140,74,
143,154,199,72,213,40,228,114,208,227,134,93,136,234,76,5,21,101,30,38,57,23,162,114,253,200,103,199,148,70,46,93,145,82,
45,146,137,137,104,50,29,195,104,166,225,113,67,116,60,145,142,102,2,10,24,67,242,152,210,145,76,14,76,6,143,162,29,242,
114,161,175,35,228,220,17,73,173,101,223,113,161,176,67,238,48,107,71,2,126,93,192,159,202,111,69,140,204,216,232,30,178,
99,114,24,86,140,151,197,142,201,69,47,136,101,223,118,20,198,82,89,75,241,67,191,218,196,81,88,37,150,26,24,159,72,239,
229,130,92,2,174,206,189,38,113,197,116,214,64,46,78,62,87,202,238,119,102,167,237,217,153,255,198,196,60,23,225,202,129,
15,206,71,220,99,9,68,70,37,230,28,215,155,195,226,211,135,220,227,217,229,161,146,241,227,118,80,241,248,148,213,163,
194,241,60,207,49,198,199,201,28,79,109,199,71,122,146,172,56,47,146,205,159,136,33,241,232,110,222,62,48,83,156,205,102,
38,182,238,36,71,98,219,182,20,134,227,75,196,251,34,233,145,29,185,140,37,69,229,216,158,83,194,52,158,226,219,97,148,
178,99,43,120,135,208,244,99,185,103,38,97,29,169,69,153,19,219,93,246,175,212,144,55,17,207,189,28,145,26,74,242,57,170,
117,81,66,95,122,225,192,232,185,56,49,229,14,204,125,230,63,47,139,142,69,246,130,61,45,195,102,215,218,149,47,167,226,
71,102,34,206,68,124,249,216,100,106,7,121,18,241,53,233,201,12,27,35,227,241,40,191,220,144,74,197,168,130,57,99,49,142,
2,114,92,253,137,241,9,196,107,200,162,165,76,63,100,60,207,60,41,11,194,184,200,157,226,210,94,218,153,83,203,248,132,
192,93,26,178,165,216,4,241,99,194,27,185,153,169,203,69,92,206,249,154,159,31,167,220,41,207,140,165,119,228,246,88,77,
166,62,183,121,167,10,204,204,8,28,95,85,204,85,121,175,250,10,248,89,109,88,87,34,147,26,22,100,74,8,120,24,49,159,131,
137,92,19,59,177,155,67,112,233,4,124,242,216,89,85,158,128,57,148,142,78,132,119,39,168,124,74,93,46,50,145,53,193,25,
168,147,47,113,131,216,194,5,178,160,162,201,132,206,223,84,73,70,162,130,76,41,165,152,50,125,45,202,148,84,52,144,21,
50,148,20,103,74,225,196,114,132,6,50,121,103,207,72,70,183,243,75,149,228,212,55,51,228,72,74,47,34,183,162,42,98,168,
178,202,212,102,38,113,216,71,83,233,156,159,175,79,198,18,240,147,189,220,86,186,130,51,169,55,21,24,233,93,145,49,178,
146,236,87,102,114,50,78,37,169,108,254,170,95,158,81,105,42,47,239,206,48,157,153,55,205,174,212,200,142,232,40,18,6,
114,164,162,72,56,70,201,74,177,159,85,242,167,122,197,187,35,50,26,24,92,23,200,101,28,46,174,99,235,210,52,236,247,254,
252,164,172,16,12,246,218,53,28,66,139,249,65,231,144,147,177,81,84,238,224,235,4,246,13,38,106,165,56,5,177,83,242,161,
64,18,110,72,69,170,152,78,76,200,71,71,74,157,210,86,10,28,244,156,225,23,192,105,50,139,155,222,17,131,49,248,179,190,
13,21,184,234,160,209,248,4,57,211,9,121,223,163,233,147,241,19,185,210,204,99,216,121,14,83,49,25,127,159,21,180,97,241,
73,156,24,146,172,219,70,93,226,102,225,44,54,222,160,174,61,198,167,47,236,106,166,144,184,28,12,90,46,201,126,147,174,
17,22,255,191,111,197,116,171,16,100,89,223,52,22,143,56,139,143,154,116,191,81,180,217,38,186,92,136,175,179,252,39,133,
241,121,113,191,225,44,62,55,100,210,237,194,106,62,104,211,146,61,33,7,181,92,123,62,196,118,75,117,7,164,186,150,61,1,
58,67,252,192,112,54,65,244,83,194,108,49,252,187,141,109,213,33,83,92,37,10,90,174,104,217,108,26,223,54,10,175,219,108,
154,223,49,138,87,111,94,242,200,224,122,219,176,77,186,84,72,37,215,210,189,194,122,87,92,38,190,102,60,143,199,238,102,
252,235,166,223,10,114,86,135,182,172,222,219,220,108,236,170,246,155,244,13,209,66,15,129,89,220,221,77,143,49,165,183,
229,231,27,194,250,187,184,196,184,69,252,15,6,219,124,43,253,93,152,234,25,117,79,176,196,35,155,151,208,207,50,133,3,
134,169,186,82,29,209,125,198,9,186,249,140,161,186,57,200,148,14,25,89,133,107,182,24,23,84,215,40,161,27,101,229,205,
242,243,77,195,160,119,81,223,220,221,76,151,154,198,3,226,122,238,253,98,211,228,210,19,232,139,46,201,43,191,107,160,
252,132,177,15,229,37,171,175,163,143,115,213,109,170,234,178,188,242,229,92,126,79,149,15,112,249,91,134,44,239,231,14,
100,233,162,108,233,179,166,69,119,137,219,197,183,208,239,102,158,215,245,38,198,181,164,27,11,242,128,113,122,104,243,
112,207,218,115,122,154,109,50,246,118,57,136,30,144,149,161,152,41,254,191,40,221,251,136,92,196,230,115,108,178,197,
172,154,69,244,35,174,165,39,229,231,79,165,228,254,61,254,42,250,157,201,158,85,109,220,96,117,25,47,94,208,212,252,104,
200,40,222,13,155,237,217,179,103,111,12,238,35,250,149,190,197,61,182,160,95,216,114,105,133,207,107,25,111,139,154,222,
253,249,93,61,198,61,217,6,189,164,133,102,120,77,58,36,218,32,115,147,209,112,136,43,233,57,39,247,123,192,52,126,47,
250,177,40,47,8,33,156,54,153,2,133,71,44,147,53,10,195,22,14,18,133,54,57,68,141,109,54,75,141,119,88,226,110,182,106,
172,102,216,50,191,98,44,216,140,182,47,162,173,101,26,95,54,26,155,119,25,23,236,134,122,248,94,191,131,28,134,195,196,
136,143,138,1,122,205,41,238,192,64,150,8,223,52,139,88,249,115,1,155,102,213,156,66,15,88,230,139,226,57,241,10,87,118,
155,5,95,55,68,200,52,161,169,117,191,209,208,100,132,171,109,211,46,88,224,48,29,5,59,45,231,87,208,174,101,181,233,184,
93,148,180,192,69,222,16,179,91,118,154,198,205,198,204,102,12,149,70,108,3,91,231,182,118,116,111,218,14,219,105,156,
135,133,64,75,135,195,185,211,116,29,17,211,165,148,48,29,100,120,170,33,4,17,219,85,67,239,194,254,213,195,75,134,197,
140,105,166,128,141,254,203,22,139,187,107,248,201,248,147,104,132,121,109,163,133,141,140,29,90,211,27,218,115,254,229,
54,13,119,211,95,45,54,108,245,146,157,177,133,198,158,234,253,237,157,177,150,26,250,155,45,94,100,239,48,137,77,17,162,
27,45,233,191,242,243,18,199,212,186,59,156,226,16,236,184,215,116,98,202,75,238,149,139,231,55,141,55,133,184,237,54,
211,250,178,225,195,60,239,54,4,166,107,222,105,136,157,171,77,251,46,99,94,76,184,109,187,197,97,55,240,82,96,150,150,
109,219,14,99,164,218,118,46,112,8,88,219,226,201,26,23,116,161,194,97,148,175,98,41,246,54,167,113,183,241,186,112,54,
249,77,113,135,33,16,81,208,215,109,188,94,190,157,205,7,62,201,203,37,4,175,150,177,187,186,214,216,221,180,200,54,12,
239,42,68,160,79,58,48,42,103,241,5,85,244,176,67,60,37,247,146,233,66,91,12,237,144,16,126,211,249,128,176,107,204,130,
151,196,233,207,239,245,63,98,218,28,168,86,155,214,213,98,222,109,194,101,59,155,49,150,234,221,60,200,123,204,66,248,
221,189,162,196,107,23,250,141,209,106,12,212,190,213,114,191,195,235,185,179,165,251,244,165,182,123,161,154,12,175,137,
93,176,136,231,225,112,57,10,28,133,198,100,151,93,200,242,244,174,30,3,92,22,189,63,122,224,40,111,88,251,90,163,230,22,
219,244,35,24,162,103,140,237,17,83,168,97,16,134,177,223,178,101,31,33,135,217,210,221,39,29,195,14,181,74,227,89,116,
141,154,221,146,3,22,105,199,130,215,151,172,49,133,156,149,117,159,113,250,18,63,111,28,118,131,3,162,100,154,191,14,
158,208,221,51,140,230,176,188,191,10,6,122,208,161,98,195,31,45,131,157,24,165,63,89,114,153,233,74,27,195,112,54,169,
97,24,51,118,24,227,213,75,98,70,113,19,166,115,171,240,122,101,39,45,215,183,204,164,67,82,176,56,70,111,217,210,33,54,
211,87,212,158,53,130,59,140,225,234,37,7,100,44,178,209,241,217,182,1,47,128,29,121,114,176,64,55,142,139,213,150,245,
78,110,236,231,247,217,38,124,28,134,132,15,192,243,97,181,26,83,112,36,125,194,48,239,20,95,21,87,168,224,223,66,207,27,
226,98,195,89,221,49,243,190,102,147,190,100,52,210,47,57,200,98,115,154,244,59,209,246,13,155,186,17,195,110,118,97,103,
52,211,28,118,223,207,186,196,151,224,239,8,118,251,133,105,120,154,224,42,231,46,89,189,7,222,117,169,172,41,222,223,96,
156,95,173,56,70,80,252,220,168,104,52,230,26,151,10,171,224,61,81,94,104,156,10,78,149,85,254,225,114,187,124,168,220,
165,30,237,114,81,254,17,48,154,202,11,164,104,125,129,3,178,21,185,102,51,140,38,150,19,21,243,114,188,114,165,188,65,
113,12,112,138,115,197,29,57,185,109,198,41,220,214,168,168,175,152,157,233,110,88,246,94,159,235,159,25,103,148,47,207,
48,156,229,103,130,209,3,180,65,202,157,97,178,212,202,242,141,248,92,150,97,186,48,244,161,114,51,43,171,21,56,202,141,
60,150,28,139,27,99,137,169,177,56,42,26,42,230,84,212,86,4,42,106,42,234,68,185,37,76,81,96,86,26,248,39,140,142,125,
251,172,91,230,204,23,207,204,17,226,239,192,161,70,33,126,5,28,12,10,113,23,112,104,174,16,111,2,247,240,143,174,237,
181,23,185,72,28,3,108,98,151,67,255,230,70,208,146,139,246,89,135,79,53,47,54,168,71,28,104,18,214,43,77,134,184,178,89,
136,155,128,123,128,103,129,55,129,187,91,16,241,29,133,234,215,242,104,243,74,203,74,113,85,171,176,222,108,21,226,234,
54,244,11,188,2,236,107,39,67,184,139,13,113,85,96,8,98,87,183,135,197,61,237,66,252,0,248,21,240,58,112,203,60,33,238,7,
126,12,60,11,188,9,28,232,32,75,216,94,76,80,112,211,115,208,244,134,142,45,226,209,14,33,158,154,47,196,51,11,160,29,
184,122,33,57,157,165,101,74,76,255,55,10,217,103,23,26,198,193,78,97,220,180,200,48,14,44,6,186,76,227,234,238,66,227,
192,146,168,245,66,143,41,238,233,53,196,221,125,134,120,182,15,86,3,61,216,143,33,1,119,15,96,40,203,133,56,2,252,106,
16,163,15,9,113,120,13,250,2,14,172,53,196,161,181,224,175,67,27,224,224,122,88,192,152,37,248,223,199,208,231,85,27,46,
20,247,108,16,226,170,33,254,13,158,223,45,220,23,137,3,251,172,23,134,4,42,247,133,69,193,65,224,210,141,148,251,251,69,
249,191,225,201,252,109,62,254,109,74,230,239,243,241,239,82,50,127,163,143,127,151,18,32,245,119,250,248,183,57,153,191,
213,231,160,220,223,235,51,189,234,183,52,242,119,83,1,245,183,154,234,75,33,19,80,50,252,255,180,11,175,250,253,61,255,
127,232,70,64,245,203,127,223,207,212,242,252,255,75,91,1,245,187,27,254,127,170,237,128,26,31,255,127,240,164,245,200,
31,228,121,21,159,255,174,224,255,1,51,160,178,16,144,80,0,0};
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
STATICMETHOD (getAndroidMidiDeviceManager, "getAndroidMidiDeviceManager", "(Landroid/content/Context;)Lcom/roli/juce/JuceMidiSupport$MidiDeviceManager;") \
STATICMETHOD (getAndroidBluetoothManager, "getAndroidBluetoothManager", "(Landroid/content/Context;)Lcom/roli/juce/JuceMidiSupport$BluetoothManager;")
DECLARE_JNI_CLASS_WITH_BYTECODE (JuceMidiSupport, "com/roli/juce/JuceMidiSupport", 23, javaMidiByteCode, sizeof (javaMidiByteCode))
#undef JNI_CLASS_MEMBERS #undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (getJuceAndroidMidiInputDevices, "getJuceAndroidMidiInputDevices", "()[Ljava/lang/String;") \
METHOD (getJuceAndroidMidiOutputDevices, "getJuceAndroidMidiOutputDevices", "()[Ljava/lang/String;") \
METHOD (openMidiInputPortWithJuceIndex, "openMidiInputPortWithJuceIndex", "(IJ)Lcom/roli/juce/JuceMidiSupport$JuceMidiPort;") \
METHOD (openMidiOutputPortWithJuceIndex, "openMidiOutputPortWithJuceIndex", "(I)Lcom/roli/juce/JuceMidiSupport$JuceMidiPort;") \
METHOD (getInputPortNameForJuceIndex, "getInputPortNameForJuceIndex", "(I)Ljava/lang/String;") \
METHOD (getOutputPortNameForJuceIndex, "getOutputPortNameForJuceIndex", "(I)Ljava/lang/String;")
DECLARE_JNI_CLASS_WITH_MIN_SDK (MidiDeviceManager, "com/roli/juce/JuceMidiSupport$MidiDeviceManager", 23)
#undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (start, "start", "()V" )\ METHOD (start, "start", "()V" )\
METHOD (stop, "stop", "()V") \ METHOD (stop, "stop", "()V") \
METHOD (close, "close", "()V") \ METHOD (close, "close", "()V") \
METHOD (sendMidi, "sendMidi", "([BII)V") METHOD (sendMidi, "sendMidi", "([BII)V")
DECLARE_JNI_CLASS (JuceMidiPort, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceMidiPort")
#undef JNI_CLASS_MEMBERS
DECLARE_JNI_CLASS_WITH_MIN_SDK (JuceMidiPort, "com/roli/juce/JuceMidiSupport$JuceMidiPort", 23)
#undef JNI_CLASS_MEMBERS
//============================================================================== //==============================================================================
class AndroidMidiInput class AndroidMidiInput
@ -51,10 +373,10 @@ public:
: juceMidiInput (midiInput), : juceMidiInput (midiInput),
callback (midiInputCallback), callback (midiInputCallback),
midiConcatenator (2048), midiConcatenator (2048),
javaMidiDevice (getEnv()->CallObjectMethod (deviceManager, javaMidiDevice (LocalRef<jobject>(getEnv()->CallObjectMethod (deviceManager,
MidiDeviceManager.openMidiInputPortWithJuceIndex, MidiDeviceManager.openMidiInputPortWithJuceIndex,
(jint) portIdx, (jint) portIdx,
(jlong) this)) (jlong) this)))
{ {
} }
@ -86,10 +408,12 @@ public:
callback = nullptr; callback = nullptr;
} }
void receive (jbyteArray byteArray, jlong offset, jint len, jlong timestamp) void handleMidi (jbyteArray byteArray, jlong offset, jint len, jlong timestamp)
{ {
auto* env = getEnv();
jassert (byteArray != nullptr); jassert (byteArray != nullptr);
jbyte* data = getEnv()->GetByteArrayElements (byteArray, nullptr); jbyte* data = env->GetByteArrayElements (byteArray, nullptr);
HeapBlock<uint8> buffer (static_cast<size_t> (len)); HeapBlock<uint8> buffer (static_cast<size_t> (len));
std::memcpy (buffer.get(), data + offset, static_cast<size_t> (len)); std::memcpy (buffer.get(), data + offset, static_cast<size_t> (len));
@ -98,7 +422,15 @@ public:
len, static_cast<double> (timestamp) * 1.0e-9, len, static_cast<double> (timestamp) * 1.0e-9,
juceMidiInput, *callback); juceMidiInput, *callback);
getEnv()->ReleaseByteArrayElements (byteArray, data, 0); env->ReleaseByteArrayElements (byteArray, data, 0);
}
static void handleReceive (JNIEnv*, jobject, jlong host, jbyteArray byteArray,
jint offset, jint len, jlong timestamp)
{
auto* myself = reinterpret_cast<AndroidMidiInput*> (host);
myself->handleMidi (byteArray, offset, len, timestamp);
} }
private: private:
@ -112,7 +444,7 @@ private:
class AndroidMidiOutput class AndroidMidiOutput
{ {
public: public:
AndroidMidiOutput (jobject midiDevice) AndroidMidiOutput (const LocalRef<jobject>& midiDevice)
: javaMidiDevice (midiDevice) : javaMidiDevice (midiDevice)
{ {
} }
@ -138,24 +470,19 @@ private:
GlobalRef javaMidiDevice; GlobalRef javaMidiDevice;
}; };
JUCE_JNI_CALLBACK (JUCE_JOIN_MACRO (JUCE_ANDROID_ACTIVITY_CLASSNAME, _00024JuceMidiInputPort), handleReceive, //==============================================================================
void, (JNIEnv* env, jobject, jlong host, jbyteArray byteArray, #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
jint offset, jint count, jlong timestamp)) CALLBACK (AndroidMidiInput::handleReceive, "handleReceive", "(J[BIIJ)V" )
{
// Java may create a Midi thread which JUCE doesn't know about and this callback may be
// received on this thread. Java will have already created a JNI Env for this new thread,
// which we need to tell JUCE about
setEnv (env);
reinterpret_cast<AndroidMidiInput*> (host)->receive (byteArray, offset, count, timestamp); DECLARE_JNI_CLASS_WITH_MIN_SDK (JuceMidiInputPort, "com/roli/juce/JuceMidiSupport$JuceMidiInputPort", 23)
} #undef JNI_CLASS_MEMBERS
//============================================================================== //==============================================================================
class AndroidMidiDeviceManager class AndroidMidiDeviceManager
{ {
public: public:
AndroidMidiDeviceManager() AndroidMidiDeviceManager()
: deviceManager (android.activity.callObjectMethod (JuceAppActivity.getAndroidMidiDeviceManager)) : deviceManager (LocalRef<jobject>(getEnv()->CallStaticObjectMethod (JuceMidiSupport, JuceMidiSupport.getAndroidMidiDeviceManager, getAppContext().get())))
{ {
} }
@ -187,7 +514,7 @@ public:
{ {
jobjectArray jDevices jobjectArray jDevices
= (jobjectArray) getEnv()->CallObjectMethod (dm, input ? MidiDeviceManager.getJuceAndroidMidiInputDevices = (jobjectArray) getEnv()->CallObjectMethod (dm, input ? MidiDeviceManager.getJuceAndroidMidiInputDevices
: MidiDeviceManager.getJuceAndroidMidiOutputDevices); : MidiDeviceManager.getJuceAndroidMidiOutputDevices);
// Create a local reference as converting this // Create a local reference as converting this
// to a JUCE string will call into JNI // to a JUCE string will call into JNI
@ -215,7 +542,7 @@ public:
{ {
if (jobject dm = deviceManager.get()) if (jobject dm = deviceManager.get())
if (jobject javaMidiPort = getEnv()->CallObjectMethod (dm, MidiDeviceManager.openMidiOutputPortWithJuceIndex, (jint) idx)) if (jobject javaMidiPort = getEnv()->CallObjectMethod (dm, MidiDeviceManager.openMidiOutputPortWithJuceIndex, (jint) idx))
return new AndroidMidiOutput (javaMidiPort); return new AndroidMidiOutput (LocalRef<jobject>(javaMidiPort));
return nullptr; return nullptr;
} }
@ -227,18 +554,23 @@ private:
//============================================================================== //==============================================================================
StringArray MidiOutput::getDevices() StringArray MidiOutput::getDevices()
{ {
AndroidMidiDeviceManager manager; if (getAndroidSDKVersion() >= 23)
return manager.getDevices (false); {
AndroidMidiDeviceManager manager;
return manager.getDevices (false);
}
return {};
} }
int MidiOutput::getDefaultDeviceIndex() int MidiOutput::getDefaultDeviceIndex()
{ {
return 0; return (getAndroidSDKVersion() >= 23 ? 0 : -1);
} }
MidiOutput* MidiOutput::openDevice (int index) MidiOutput* MidiOutput::openDevice (int index)
{ {
if (index < 0) if (index < 0 || getAndroidSDKVersion() < 23)
return nullptr; return nullptr;
AndroidMidiDeviceManager manager; AndroidMidiDeviceManager manager;
@ -295,18 +627,23 @@ MidiInput::MidiInput (const String& nm) : name (nm)
StringArray MidiInput::getDevices() StringArray MidiInput::getDevices()
{ {
AndroidMidiDeviceManager manager; if (getAndroidSDKVersion() >= 23)
return manager.getDevices (true); {
AndroidMidiDeviceManager manager;
return manager.getDevices (true);
}
return {};
} }
int MidiInput::getDefaultDeviceIndex() int MidiInput::getDefaultDeviceIndex()
{ {
return 0; return (getAndroidSDKVersion() >= 23 ? 0 : -1);
} }
MidiInput* MidiInput::openDevice (int index, juce::MidiInputCallback* callback) MidiInput* MidiInput::openDevice (int index, juce::MidiInputCallback* callback)
{ {
if (index < 0) if (getAndroidSDKVersion() < 23 || index < 0)
return nullptr; return nullptr;
AndroidMidiDeviceManager manager; AndroidMidiDeviceManager manager;

Some files were not shown because too many files have changed in this diff Show More