diff --git a/examples/MPETest/Builds/LinuxMakefile/Makefile b/examples/MPEDemo/Builds/LinuxMakefile/Makefile similarity index 96% rename from examples/MPETest/Builds/LinuxMakefile/Makefile rename to examples/MPEDemo/Builds/LinuxMakefile/Makefile index d030648855..2f58234ca5 100644 --- a/examples/MPETest/Builds/LinuxMakefile/Makefile +++ b/examples/MPEDemo/Builds/LinuxMakefile/Makefile @@ -37,7 +37,7 @@ ifeq ($(CONFIG),Debug) JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DDEBUG=1 -D_DEBUG=1 -DJUCER_LINUX_MAKE_6D53C8B4=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../../../../modules $(CPPFLAGS) JUCE_CPPFLAGS_APP := -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=0 - JUCE_TARGET_APP := MPETest + JUCE_TARGET_APP := MPEDemo JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 $(CFLAGS) JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++14 $(CXXFLAGS) @@ -58,7 +58,7 @@ ifeq ($(CONFIG),Release) JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DNDEBUG=1 -DJUCER_LINUX_MAKE_6D53C8B4=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../../../../modules $(CPPFLAGS) JUCE_CPPFLAGS_APP := -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=0 - JUCE_TARGET_APP := MPETest + JUCE_TARGET_APP := MPEDemo JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -O3 $(CFLAGS) JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++14 $(CXXFLAGS) @@ -89,7 +89,7 @@ OBJECTS_APP := \ all : $(JUCE_OUTDIR)/$(JUCE_TARGET_APP) $(JUCE_OUTDIR)/$(JUCE_TARGET_APP) : check-pkg-config $(OBJECTS_APP) $(RESOURCES) - @echo Linking "MPETest - App" + @echo Linking "MPEDemo - App" -$(V_AT)mkdir -p $(JUCE_BINDIR) -$(V_AT)mkdir -p $(JUCE_LIBDIR) -$(V_AT)mkdir -p $(JUCE_OUTDIR) @@ -175,11 +175,11 @@ check-pkg-config: @pkg-config --print-errors alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0 clean: - @echo Cleaning MPETest + @echo Cleaning MPEDemo $(V_AT)$(CLEANCMD) strip: - @echo Stripping MPETest + @echo Stripping MPEDemo -$(V_AT)$(STRIP) --strip-unneeded $(JUCE_OUTDIR)/$(TARGET) -include $(OBJECTS_APP:%.o=%.d) diff --git a/examples/MPETest/Builds/MacOSX/Info-App.plist b/examples/MPEDemo/Builds/MacOSX/Info-App.plist similarity index 90% rename from examples/MPETest/Builds/MacOSX/Info-App.plist rename to examples/MPEDemo/Builds/MacOSX/Info-App.plist index a07c9aeabd..d331ba22ca 100644 --- a/examples/MPETest/Builds/MacOSX/Info-App.plist +++ b/examples/MPEDemo/Builds/MacOSX/Info-App.plist @@ -10,9 +10,9 @@ CFBundleIdentifier com.roli.MPETest CFBundleName - MPETest + MPEDemo CFBundleDisplayName - MPETest + MPEDemo CFBundlePackageType APPL CFBundleSignature diff --git a/examples/MPETest/Builds/MacOSX/MPETest.xcodeproj/project.pbxproj b/examples/MPEDemo/Builds/MacOSX/MPEDemo.xcodeproj/project.pbxproj similarity index 98% rename from examples/MPETest/Builds/MacOSX/MPETest.xcodeproj/project.pbxproj rename to examples/MPEDemo/Builds/MacOSX/MPEDemo.xcodeproj/project.pbxproj index 8bda674f26..917b78a9a8 100644 --- a/examples/MPETest/Builds/MacOSX/MPETest.xcodeproj/project.pbxproj +++ b/examples/MPEDemo/Builds/MacOSX/MPEDemo.xcodeproj/project.pbxproj @@ -75,7 +75,7 @@ B238642BCD1B9A2C199F4DBF = {isa = PBXFileReference; lastKnownFileType = file; name = "juce_audio_devices"; path = "../../../../modules/juce_audio_devices"; sourceTree = "SOURCE_ROOT"; }; B28DF2C453E72E37695C06FE = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "include_juce_audio_processors.mm"; path = "../../JuceLibraryCode/include_juce_audio_processors.mm"; sourceTree = "SOURCE_ROOT"; }; B9D41F779C018E18CEDD66B8 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "include_juce_core.mm"; path = "../../JuceLibraryCode/include_juce_core.mm"; sourceTree = "SOURCE_ROOT"; }; - BCC50B48B1A4B967949B2DB2 = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MPETest.app; sourceTree = "BUILT_PRODUCTS_DIR"; }; + BCC50B48B1A4B967949B2DB2 = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MPEDemo.app; sourceTree = "BUILT_PRODUCTS_DIR"; }; BDEC3EEA7DFFC78C00075A2A = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "include_juce_audio_devices.mm"; path = "../../JuceLibraryCode/include_juce_audio_devices.mm"; sourceTree = "SOURCE_ROOT"; }; C64527E74752ECF0B056A9F5 = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; CCC23D1BCFBE5FFC700F8608 = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -100,7 +100,7 @@ 8A339D25116C57AC5F0FFBCD, AB1DE39BFBA22179B919703B, ); name = Source; sourceTree = ""; }; C69BCE512948465235B05858 = {isa = PBXGroup; children = ( - 47DF0B5F0B14AE411808F7CE, ); name = MPETest; sourceTree = ""; }; + 47DF0B5F0B14AE411808F7CE, ); name = MPEDemo; sourceTree = ""; }; 38592324982B511EF7CF4FE1 = {isa = PBXGroup; children = ( 947FE6943BE8210665728E5A, B238642BCD1B9A2C199F4DBF, @@ -259,7 +259,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "MPETest"; + PRODUCT_NAME = "MPEDemo"; WARNING_CFLAGS = -Wreorder; ZERO_LINK = NO; }; name = Debug; }; 40FE0A8C9EA53BF7A25086B3 = {isa = XCBuildConfiguration; buildSettings = { @@ -295,7 +295,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "MPETest"; + PRODUCT_NAME = "MPEDemo"; WARNING_CFLAGS = -Wreorder; ZERO_LINK = NO; }; name = Release; }; 33F09A62C3878F91E38BA7B3 = {isa = PBXTargetDependency; target = 0DF05A38ED8E8BF6EB7D9C5C; }; @@ -341,7 +341,7 @@ 0DF05A38ED8E8BF6EB7D9C5C = {isa = PBXNativeTarget; buildConfigurationList = 20A88B838659B5B766A08F56; buildPhases = ( 518008B4BCAC2EDE2921458A, EF758DF42F97B8D22FD35F80, - AF94D754542EEF998EE0EF72, ); buildRules = ( ); dependencies = ( ); name = "MPETest - App"; productName = MPETest; productReference = BCC50B48B1A4B967949B2DB2; productType = "com.apple.product-type.application"; }; + AF94D754542EEF998EE0EF72, ); buildRules = ( ); dependencies = ( ); name = "MPEDemo - App"; productName = MPEDemo; productReference = BCC50B48B1A4B967949B2DB2; productType = "com.apple.product-type.application"; }; 9606743A47FFF871B775B1AB = {isa = PBXProject; buildConfigurationList = CC7502C8943D2FC599DFC557; attributes = { LastUpgradeCheck = 0830; ORGANIZATIONNAME = "ROLI Ltd."; TargetAttributes = { 0DF05A38ED8E8BF6EB7D9C5C = { SystemCapabilities = {com.apple.ApplicationGroups.iOS = { enabled = 0; }; com.apple.InAppPurchase = { enabled = 0; }; com.apple.InterAppAudio = { enabled = 0; }; com.apple.Push = { enabled = 0; }; com.apple.Sandbox = { enabled = 0; }; }; }; }; }; compatibilityVersion = "Xcode 3.2"; hasScannedForEncodings = 0; mainGroup = 9F958921F12E7C784E909D34; projectDirPath = ""; projectRoot = ""; targets = (0DF05A38ED8E8BF6EB7D9C5C); }; }; rootObject = 9606743A47FFF871B775B1AB; diff --git a/examples/MPETest/Builds/MacOSX/RecentFilesMenuTemplate.nib b/examples/MPEDemo/Builds/MacOSX/RecentFilesMenuTemplate.nib similarity index 100% rename from examples/MPETest/Builds/MacOSX/RecentFilesMenuTemplate.nib rename to examples/MPEDemo/Builds/MacOSX/RecentFilesMenuTemplate.nib diff --git a/examples/MPETest/Builds/VisualStudio2015/MPETest.sln b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo.sln similarity index 83% rename from examples/MPETest/Builds/VisualStudio2015/MPETest.sln rename to examples/MPEDemo/Builds/VisualStudio2015/MPEDemo.sln index 275c79a67c..057a764ecc 100644 --- a/examples/MPETest/Builds/VisualStudio2015/MPETest.sln +++ b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2015 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPETest - App", "MPETest_App.vcxproj", "{D4B09FE5-F7C6-3530-7AA4-725B57317169}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPEDemo - App", "MPEDemo_App.vcxproj", "{D4B09FE5-F7C6-3530-7AA4-725B57317169}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj similarity index 98% rename from examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj rename to examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj index 1fadec8958..cdc295db30 100644 --- a/examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj +++ b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj @@ -51,11 +51,11 @@ .exe $(SolutionDir)$(Platform)\$(Configuration)\App\ $(Platform)\$(Configuration)\App\ - MPETest + MPEDemo true $(SolutionDir)$(Platform)\$(Configuration)\App\ $(Platform)\$(Configuration)\App\ - MPETest + MPEDemo true v140 8.1 @@ -88,18 +88,18 @@ _DEBUG;%(PreprocessorDefinitions) - $(OutDir)\MPETest.exe + $(OutDir)\MPEDemo.exe true libcmt.lib; msvcrt.lib;;%(IgnoreSpecificDefaultLibraries) true - $(IntDir)\MPETest.pdb + $(IntDir)\MPEDemo.pdb Windows MachineX86 true true - $(IntDir)\MPETest.bsc + $(IntDir)\MPEDemo.bsc @@ -130,11 +130,11 @@ NDEBUG;%(PreprocessorDefinitions) - $(OutDir)\MPETest.exe + $(OutDir)\MPEDemo.exe true %(IgnoreSpecificDefaultLibraries) false - $(IntDir)\MPETest.pdb + $(IntDir)\MPEDemo.pdb Windows MachineX86 true @@ -143,7 +143,7 @@ true - $(IntDir)\MPETest.bsc + $(IntDir)\MPEDemo.bsc @@ -203,10 +203,10 @@ true - + true - + true @@ -1820,8 +1820,8 @@ + - diff --git a/examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj.filters b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj.filters similarity index 98% rename from examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj.filters rename to examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj.filters index f68fe1a1db..0bf8b1b448 100644 --- a/examples/MPETest/Builds/VisualStudio2015/MPETest_App.vcxproj.filters +++ b/examples/MPEDemo/Builds/VisualStudio2015/MPEDemo_App.vcxproj.filters @@ -2,11 +2,11 @@ - - {4C619D3B-22E1-04C0-C5D0-079B9D4033C5} + + {A5DDD243-6BE8-6763-3B38-381FFC66A24B} - - {B247D4B4-6F9D-8C96-A514-D55062B9D9F8} + + {9C29808E-4A1F-7792-BC99-39E90332240C} {EB58F05A-A968-CEBE-40C4-107CDD8F240F} @@ -374,7 +374,7 @@ - MPETest\Source + MPEDemo\Source JUCE Modules\juce_audio_basics\buffers @@ -430,10 +430,10 @@ JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe @@ -2167,22 +2167,22 @@ - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source JUCE Modules\juce_audio_basics\audio_play_head @@ -2253,10 +2253,10 @@ JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe diff --git a/examples/MPETest/Builds/VisualStudio2017/resources.rc b/examples/MPEDemo/Builds/VisualStudio2015/resources.rc similarity index 82% rename from examples/MPETest/Builds/VisualStudio2017/resources.rc rename to examples/MPEDemo/Builds/VisualStudio2015/resources.rc index cc2b828fbd..cc60ddb73a 100644 --- a/examples/MPETest/Builds/VisualStudio2017/resources.rc +++ b/examples/MPEDemo/Builds/VisualStudio2015/resources.rc @@ -15,9 +15,9 @@ BEGIN BEGIN VALUE "CompanyName", "ROLI Ltd.\0" VALUE "LegalCopyright", "ROLI Ltd.\0" - VALUE "FileDescription", "MPETest\0" + VALUE "FileDescription", "MPEDemo\0" VALUE "FileVersion", "1.0.0\0" - VALUE "ProductName", "MPETest\0" + VALUE "ProductName", "MPEDemo\0" VALUE "ProductVersion", "1.0.0\0" END END diff --git a/examples/MPETest/Builds/VisualStudio2017/MPETest.sln b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo.sln similarity index 82% rename from examples/MPETest/Builds/VisualStudio2017/MPETest.sln rename to examples/MPEDemo/Builds/VisualStudio2017/MPEDemo.sln index 0f017c4854..4095f00d42 100644 --- a/examples/MPETest/Builds/VisualStudio2017/MPETest.sln +++ b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2017 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPETest - App", "MPETest_App.vcxproj", "{D4B09FE5-F7C6-3530-7AA4-725B57317169}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPEDemo - App", "MPEDemo_App.vcxproj", "{D4B09FE5-F7C6-3530-7AA4-725B57317169}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj similarity index 98% rename from examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj rename to examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj index 73c2ead897..6bcce7e453 100644 --- a/examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj +++ b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj @@ -53,11 +53,11 @@ .exe $(SolutionDir)$(Platform)\$(Configuration)\App\ $(Platform)\$(Configuration)\App\ - MPETest + MPEDemo true $(SolutionDir)$(Platform)\$(Configuration)\App\ $(Platform)\$(Configuration)\App\ - MPETest + MPEDemo true v141 10.0.16299.0 @@ -90,17 +90,17 @@ _DEBUG;%(PreprocessorDefinitions) - $(OutDir)\MPETest.exe + $(OutDir)\MPEDemo.exe true libcmt.lib; msvcrt.lib;;%(IgnoreSpecificDefaultLibraries) true - $(IntDir)\MPETest.pdb + $(IntDir)\MPEDemo.pdb Windows true true - $(IntDir)\MPETest.bsc + $(IntDir)\MPEDemo.bsc @@ -131,11 +131,11 @@ NDEBUG;%(PreprocessorDefinitions) - $(OutDir)\MPETest.exe + $(OutDir)\MPEDemo.exe true %(IgnoreSpecificDefaultLibraries) false - $(IntDir)\MPETest.pdb + $(IntDir)\MPEDemo.pdb Windows true true @@ -143,7 +143,7 @@ true - $(IntDir)\MPETest.bsc + $(IntDir)\MPEDemo.bsc @@ -203,10 +203,10 @@ true - + true - + true @@ -1820,8 +1820,8 @@ + - diff --git a/examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj.filters b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj.filters similarity index 98% rename from examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj.filters rename to examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj.filters index 79c56a8d91..72d9343ee4 100644 --- a/examples/MPETest/Builds/VisualStudio2017/MPETest_App.vcxproj.filters +++ b/examples/MPEDemo/Builds/VisualStudio2017/MPEDemo_App.vcxproj.filters @@ -2,11 +2,11 @@ - - {4C619D3B-22E1-04C0-C5D0-079B9D4033C5} + + {A5DDD243-6BE8-6763-3B38-381FFC66A24B} - - {B247D4B4-6F9D-8C96-A514-D55062B9D9F8} + + {9C29808E-4A1F-7792-BC99-39E90332240C} {EB58F05A-A968-CEBE-40C4-107CDD8F240F} @@ -374,7 +374,7 @@ - MPETest\Source + MPEDemo\Source JUCE Modules\juce_audio_basics\buffers @@ -430,10 +430,10 @@ JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe @@ -2167,22 +2167,22 @@ - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source - MPETest\Source + MPEDemo\Source JUCE Modules\juce_audio_basics\audio_play_head @@ -2253,10 +2253,10 @@ JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe - + JUCE Modules\juce_audio_basics\mpe diff --git a/examples/MPETest/Builds/VisualStudio2015/resources.rc b/examples/MPEDemo/Builds/VisualStudio2017/resources.rc similarity index 82% rename from examples/MPETest/Builds/VisualStudio2015/resources.rc rename to examples/MPEDemo/Builds/VisualStudio2017/resources.rc index cc2b828fbd..cc60ddb73a 100644 --- a/examples/MPETest/Builds/VisualStudio2015/resources.rc +++ b/examples/MPEDemo/Builds/VisualStudio2017/resources.rc @@ -15,9 +15,9 @@ BEGIN BEGIN VALUE "CompanyName", "ROLI Ltd.\0" VALUE "LegalCopyright", "ROLI Ltd.\0" - VALUE "FileDescription", "MPETest\0" + VALUE "FileDescription", "MPEDemo\0" VALUE "FileVersion", "1.0.0\0" - VALUE "ProductName", "MPETest\0" + VALUE "ProductName", "MPEDemo\0" VALUE "ProductVersion", "1.0.0\0" END END diff --git a/examples/MPETest/JuceLibraryCode/AppConfig.h b/examples/MPEDemo/JuceLibraryCode/AppConfig.h similarity index 100% rename from examples/MPETest/JuceLibraryCode/AppConfig.h rename to examples/MPEDemo/JuceLibraryCode/AppConfig.h diff --git a/examples/MPETest/JuceLibraryCode/JuceHeader.h b/examples/MPEDemo/JuceLibraryCode/JuceHeader.h similarity index 93% rename from examples/MPETest/JuceLibraryCode/JuceHeader.h rename to examples/MPEDemo/JuceLibraryCode/JuceHeader.h index 6a95e72f6f..8aefab50df 100644 --- a/examples/MPETest/JuceLibraryCode/JuceHeader.h +++ b/examples/MPEDemo/JuceLibraryCode/JuceHeader.h @@ -39,7 +39,7 @@ #if ! JUCE_DONT_DECLARE_PROJECTINFO namespace ProjectInfo { - const char* const projectName = "MPETest"; + const char* const projectName = "MPEDemo"; const char* const versionString = "1.0.0"; const int versionNumber = 0x10000; } diff --git a/examples/MPETest/JuceLibraryCode/ReadMe.txt b/examples/MPEDemo/JuceLibraryCode/ReadMe.txt similarity index 100% rename from examples/MPETest/JuceLibraryCode/ReadMe.txt rename to examples/MPEDemo/JuceLibraryCode/ReadMe.txt diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_basics.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_basics.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_basics.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_basics.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_basics.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_basics.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_basics.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_basics.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_devices.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_devices.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_devices.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_devices.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_devices.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_devices.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_devices.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_devices.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_formats.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_formats.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_formats.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_formats.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_formats.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_formats.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_formats.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_formats.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_processors.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_processors.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_processors.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_processors.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_processors.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_processors.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_processors.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_processors.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_utils.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_utils.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_utils.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_utils.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_audio_utils.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_audio_utils.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_audio_utils.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_audio_utils.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_core.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_core.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_core.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_core.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_core.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_core.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_core.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_core.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_cryptography.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_cryptography.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_cryptography.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_cryptography.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_cryptography.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_cryptography.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_cryptography.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_cryptography.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_data_structures.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_data_structures.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_data_structures.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_data_structures.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_data_structures.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_data_structures.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_data_structures.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_data_structures.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_events.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_events.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_events.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_events.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_events.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_events.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_events.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_events.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_graphics.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_graphics.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_graphics.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_graphics.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_graphics.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_graphics.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_graphics.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_graphics.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_gui_basics.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_gui_basics.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_gui_basics.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_gui_basics.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_gui_basics.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_gui_basics.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_gui_basics.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_gui_basics.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_gui_extra.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_gui_extra.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_gui_extra.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_gui_extra.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_gui_extra.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_gui_extra.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_gui_extra.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_gui_extra.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_opengl.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_opengl.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_opengl.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_opengl.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_opengl.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_opengl.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_opengl.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_opengl.mm diff --git a/examples/MPETest/JuceLibraryCode/include_juce_video.cpp b/examples/MPEDemo/JuceLibraryCode/include_juce_video.cpp similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_video.cpp rename to examples/MPEDemo/JuceLibraryCode/include_juce_video.cpp diff --git a/examples/MPETest/JuceLibraryCode/include_juce_video.mm b/examples/MPEDemo/JuceLibraryCode/include_juce_video.mm similarity index 100% rename from examples/MPETest/JuceLibraryCode/include_juce_video.mm rename to examples/MPEDemo/JuceLibraryCode/include_juce_video.mm diff --git a/examples/MPETest/MPETest.jucer b/examples/MPEDemo/MPEDemo.jucer similarity index 92% rename from examples/MPETest/MPETest.jucer rename to examples/MPEDemo/MPEDemo.jucer index 50c8d91711..f205fd8c28 100644 --- a/examples/MPETest/MPETest.jucer +++ b/examples/MPEDemo/MPEDemo.jucer @@ -1,9 +1,9 @@ - - + @@ -21,8 +21,8 @@ - - + + @@ -43,8 +43,8 @@ - - + + @@ -66,8 +66,8 @@ - + targetName="MPEDemo"/> + @@ -88,8 +88,8 @@ - - + + diff --git a/examples/MPETest/Source/MPEDemoSynthVoice.h b/examples/MPEDemo/Source/MPEDemoSynthVoice.h similarity index 79% rename from examples/MPETest/Source/MPEDemoSynthVoice.h rename to examples/MPEDemo/Source/MPEDemoSynthVoice.h index 0c358ba9f3..8e43f97782 100644 --- a/examples/MPETest/Source/MPEDemoSynthVoice.h +++ b/examples/MPEDemo/Source/MPEDemoSynthVoice.h @@ -32,10 +32,7 @@ class MPEDemoSynthVoice : public MPESynthesiserVoice { public: //============================================================================== - MPEDemoSynthVoice() - : phase (0.0), phaseDelta (0.0), tailOff (0.0) - { - } + MPEDemoSynthVoice() {} //============================================================================== void noteStarted() override @@ -49,7 +46,7 @@ public: timbre.setValue (currentlyPlayingNote.timbre.asUnsignedFloat()); phase = 0.0; - const double cyclesPerSample = frequency.getNextValue() / currentSampleRate; + auto cyclesPerSample = frequency.getNextValue() / currentSampleRate; phaseDelta = MathConstants::twoPi * cyclesPerSample; tailOff = 0.0; @@ -65,8 +62,7 @@ public: // this and do a fade out, calling clearCurrentNote() when it's finished. if (tailOff == 0.0) // we only need to begin a tail-off if it's not already doing so - the - // stopNote method could be called more than once. - tailOff = 1.0; + tailOff = 1.0; // stopNote method could be called more than once. } else { @@ -119,9 +115,9 @@ public: { while (--numSamples >= 0) { - const float currentSample = getNextSample() * (float) tailOff; + auto currentSample = getNextSample() * (float) tailOff; - for (int i = outputBuffer.getNumChannels(); --i >= 0;) + for (auto i = outputBuffer.getNumChannels(); --i >= 0;) outputBuffer.addSample (i, startSample, currentSample); ++startSample; @@ -141,9 +137,9 @@ public: { while (--numSamples >= 0) { - const float currentSample = getNextSample(); + auto currentSample = getNextSample(); - for (int i = outputBuffer.getNumChannels(); --i >= 0;) + for (auto i = outputBuffer.getNumChannels(); --i >= 0;) outputBuffer.addSample (i, startSample, currentSample); ++startSample; @@ -156,18 +152,18 @@ private: //============================================================================== float getNextSample() noexcept { - const double levelDb = (level.getNextValue() - 1.0) * maxLevelDb; - const double amplitude = std::pow (10.0f, 0.05f * levelDb) * maxLevel; + auto levelDb = (level.getNextValue() - 1.0) * maxLevelDb; + auto amplitude = std::pow (10.0f, 0.05f * levelDb) * maxLevel; // timbre is used to blend between a sine and a square. - const double f1 = std::sin (phase); - const double f2 = std::copysign (1.0, f1); - const double a2 = timbre.getNextValue(); - const double a1 = 1.0 - a2; + auto f1 = std::sin (phase); + auto f2 = std::copysign (1.0, f1); + auto a2 = timbre.getNextValue(); + auto a1 = 1.0 - a2; - const float nextSample = float (amplitude * ((a1 * f1) + (a2 * f2))); + auto nextSample = float (amplitude * ((a1 * f1) + (a2 * f2))); - const double cyclesPerSample = frequency.getNextValue() / currentSampleRate; + auto cyclesPerSample = frequency.getNextValue() / currentSampleRate; phaseDelta = MathConstants::twoPi * cyclesPerSample; phase = std::fmod (phase + phaseDelta, MathConstants::twoPi); @@ -176,7 +172,10 @@ private: //============================================================================== LinearSmoothedValue level, timbre, frequency; - double phase, phaseDelta, tailOff; + + double phase = 0.0; + double phaseDelta = 0.0; + double tailOff = 0.0; const double maxLevel = 0.05f; const double maxLevelDb = 31.0f; diff --git a/examples/MPETest/Source/MPESetupComponent.h b/examples/MPEDemo/Source/MPESetupComponent.h similarity index 67% rename from examples/MPETest/Source/MPESetupComponent.h rename to examples/MPEDemo/Source/MPESetupComponent.h index ed26c2f1c3..4ccd322fdb 100644 --- a/examples/MPETest/Source/MPESetupComponent.h +++ b/examples/MPEDemo/Source/MPESetupComponent.h @@ -39,7 +39,7 @@ public: { public: virtual ~Listener() {} - virtual void zoneAdded (MPEZone newZone) = 0; + virtual void zoneChanged (bool isLower, int numMemberChans, int perNotePb, int masterPb) = 0; virtual void allZonesCleared() = 0; virtual void legacyModeChanged (bool legacyModeEnabled, int pitchbendRange, Range channelRange) = 0; virtual void voiceStealingEnabledChanged (bool voiceStealingEnabled) = 0; @@ -51,22 +51,11 @@ public: //============================================================================== MPESetupComponent() - : masterChannelLabel (String(), "Master channel:"), - noteChannelsLabel (String(), "Nr. of note channels:"), - masterPitchbendRangeLabel (String(), "Master pitchbend range (semitones):"), - notePitchbendRangeLabel (String(), "Note pitchbend range (semitones):"), - addZoneButton ("Add this zone"), - clearAllZonesButton ("Clear all zones"), - legacyStartChannelLabel (String(), "First channel:"), - legacyEndChannelLabel (String(), "Last channel:"), - legacyPitchbendRangeLabel (String(), "Pitchbend range (semitones):"), - legacyModeEnabledToggle ("Enable Legacy Mode"), - voiceStealingEnabledToggle ("Enable synth voice stealing"), - numberOfVoicesLabel (String(), "Number of synth voices") { + addAndMakeVisible (isLowerZoneButton); + isLowerZoneButton.setToggleState (true, NotificationType::dontSendNotification); - initialiseComboBoxWithConsecutiveIntegers (masterChannel, masterChannelLabel, 1, 15, defaultMasterChannel); - initialiseComboBoxWithConsecutiveIntegers (noteChannels, noteChannelsLabel, 1, 15, defaultNoteChannels); + initialiseComboBoxWithConsecutiveIntegers (memberChannels, memberChannelsLabel, 0, 16, defaultMemberChannels); initialiseComboBoxWithConsecutiveIntegers (masterPitchbendRange, masterPitchbendRangeLabel, 0, 96, defaultMasterPitchbendRange); initialiseComboBoxWithConsecutiveIntegers (notePitchbendRange, notePitchbendRangeLabel, 0, 96, defaultNotePitchbendRange); @@ -74,12 +63,13 @@ public: initialiseComboBoxWithConsecutiveIntegers (legacyEndChannel, legacyEndChannelLabel, 1, 16, 16, false); initialiseComboBoxWithConsecutiveIntegers (legacyPitchbendRange, legacyPitchbendRangeLabel, 0, 96, 2, false); - initialiseButton (addZoneButton); + initialiseButton (setZoneButton); initialiseButton (clearAllZonesButton); initialiseButton (legacyModeEnabledToggle); initialiseButton (voiceStealingEnabledToggle); initialiseComboBoxWithConsecutiveIntegers (numberOfVoices, numberOfVoicesLabel, 1, 20, 15); + numberOfVoices.addListener (this); } @@ -91,29 +81,29 @@ public: const int hspace = 6; const int hbigspace = 18; - masterChannel.setBounds (r.removeFromTop (h)); + isLowerZoneButton.setBounds (r.removeFromTop (h)); r.removeFromTop (hspace); - noteChannels.setBounds (r.removeFromTop (h)); + memberChannels.setBounds (r.removeFromTop (h)); r.removeFromTop (hspace); notePitchbendRange.setBounds (r.removeFromTop (h)); r.removeFromTop (hspace); masterPitchbendRange.setBounds (r.removeFromTop (h)); - legacyStartChannel.setBounds (masterChannel.getBounds()); - legacyEndChannel.setBounds (noteChannels.getBounds()); + legacyStartChannel.setBounds (isLowerZoneButton.getBounds()); + legacyEndChannel.setBounds (memberChannels.getBounds()); legacyPitchbendRange.setBounds (notePitchbendRange.getBounds()); r.removeFromTop (hbigspace); - int buttonLeft = proportionOfWidth (0.5f); + auto buttonLeft = proportionOfWidth (0.5f); - addZoneButton.setBounds (r.removeFromTop (h).withLeft (buttonLeft)); + setZoneButton.setBounds (r.removeFromTop (h).withLeft (buttonLeft)); r.removeFromTop (hspace); clearAllZonesButton.setBounds (r.removeFromTop (h).withLeft (buttonLeft)); r.removeFromTop (hbigspace); - int toggleLeft = proportionOfWidth (0.25f); + auto toggleLeft = proportionOfWidth (0.25f); legacyModeEnabledToggle.setBounds (r.removeFromTop (h).withLeft (toggleLeft)); r.removeFromTop (hspace); @@ -152,33 +142,26 @@ private: //============================================================================== void buttonClicked (Button* button) override { - if (button == &addZoneButton) - addZoneButtonClicked(); - else if (button == &clearAllZonesButton) - clearAllZonesButtonClicked(); - else if (button == &legacyModeEnabledToggle) - legacyModeEnabledToggleClicked(); - else if (button == &voiceStealingEnabledToggle) - voiceStealingEnabledToggleClicked(); + if (button == &setZoneButton) setZoneButtonClicked(); + else if (button == &clearAllZonesButton) clearAllZonesButtonClicked(); + else if (button == &legacyModeEnabledToggle) legacyModeEnabledToggleClicked(); + else if (button == &voiceStealingEnabledToggle) voiceStealingEnabledToggleClicked(); } //============================================================================== - void addZoneButtonClicked() + void setZoneButtonClicked() { - if (areMPEParametersValid()) - { - MPEZone newZone (masterChannel.getText().getIntValue(), - noteChannels.getText().getIntValue(), - notePitchbendRange.getText().getIntValue(), - masterPitchbendRange.getText().getIntValue()); + auto isLowerZone = isLowerZoneButton.getToggleState(); + auto numMemberChannels = memberChannels.getText().getIntValue(); + auto perNotePb = notePitchbendRange.getText().getIntValue(); + auto masterPb = masterPitchbendRange.getText().getIntValue(); - zoneLayout.addZone (newZone); - listeners.call ([&] (Listener& l) { l.zoneAdded (newZone); }); - } + if (isLowerZone) + zoneLayout.setLowerZone (numMemberChannels, perNotePb, masterPb); else - { - handleInvalidMPEParameters(); - } + zoneLayout.setUpperZone (numMemberChannels, perNotePb, masterPb); + + listeners.call ([&] (Listener& l) { l.zoneChanged (isLowerZone, numMemberChannels, perNotePb, masterPb); }); } //============================================================================== @@ -191,17 +174,17 @@ private: //============================================================================== void legacyModeEnabledToggleClicked() { - bool legacyModeEnabled = legacyModeEnabledToggle.getToggleState(); + auto legacyModeEnabled = legacyModeEnabledToggle.getToggleState(); - masterChannel.setVisible (! legacyModeEnabled); - noteChannels.setVisible (! legacyModeEnabled); - notePitchbendRange.setVisible (! legacyModeEnabled); + isLowerZoneButton.setVisible (! legacyModeEnabled); + memberChannels.setVisible (! legacyModeEnabled); + notePitchbendRange.setVisible (! legacyModeEnabled); masterPitchbendRange.setVisible (! legacyModeEnabled); - addZoneButton.setVisible (! legacyModeEnabled); - clearAllZonesButton.setVisible (! legacyModeEnabled); + setZoneButton.setVisible (! legacyModeEnabled); + clearAllZonesButton.setVisible (! legacyModeEnabled); - legacyStartChannel.setVisible (legacyModeEnabled); - legacyEndChannel.setVisible (legacyModeEnabled); + legacyStartChannel.setVisible (legacyModeEnabled); + legacyEndChannel.setVisible (legacyModeEnabled); legacyPitchbendRange.setVisible (legacyModeEnabled); if (areLegacyModeParametersValid()) @@ -219,7 +202,7 @@ private: //============================================================================== void voiceStealingEnabledToggleClicked() { - bool newState = voiceStealingEnabledToggle.getToggleState(); + auto newState = voiceStealingEnabledToggle.getToggleState(); listeners.call ([=] (Listener& l) { l.voiceStealingEnabledChanged (newState); }); } @@ -271,21 +254,6 @@ private: } //============================================================================== - bool areMPEParametersValid() const - { - int maxPossibleNumNoteChannels = 16 - masterChannel.getText().getIntValue(); - return noteChannels.getText().getIntValue() <= maxPossibleNumNoteChannels; - } - - void handleInvalidMPEParameters() const - { - AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, - "Invalid zone layout", - "Cannot create MPE zone:\n" - "Invalid zone parameters selected!", - "Got it"); - } - bool areLegacyModeParametersValid() const { return legacyStartChannel.getText().getIntValue() <= legacyEndChannel.getText().getIntValue(); @@ -303,27 +271,39 @@ private: //============================================================================== Range getLegacyModeChannelRange() const { - return Range (legacyStartChannel.getText().getIntValue(), - legacyEndChannel.getText().getIntValue() + 1); + return { legacyStartChannel.getText().getIntValue(), + legacyEndChannel.getText().getIntValue() + 1 }; } //============================================================================== MPEZoneLayout zoneLayout; - ComboBox masterChannel, noteChannels, masterPitchbendRange, notePitchbendRange; - Label masterChannelLabel, noteChannelsLabel, masterPitchbendRangeLabel, notePitchbendRangeLabel; - TextButton addZoneButton, clearAllZonesButton; + ComboBox memberChannels, masterPitchbendRange, notePitchbendRange; + + ToggleButton isLowerZoneButton { "Lower zone" }; + + Label memberChannelsLabel { {}, "Nr. of member channels:" }; + Label masterPitchbendRangeLabel { {}, "Master pitchbend range (semitones):" }; + Label notePitchbendRangeLabel { {}, "Note pitchbend range (semitones):" }; + + TextButton setZoneButton { "Set zone" }; + TextButton clearAllZonesButton { "Clear all zones" }; ComboBox legacyStartChannel, legacyEndChannel, legacyPitchbendRange; - Label legacyStartChannelLabel, legacyEndChannelLabel, legacyPitchbendRangeLabel; - ToggleButton legacyModeEnabledToggle, voiceStealingEnabledToggle; + Label legacyStartChannelLabel { {}, "First channel:" }; + Label legacyEndChannelLabel { {}, "Last channel:" }; + Label legacyPitchbendRangeLabel { {}, "Pitchbend range (semitones):"}; + + ToggleButton legacyModeEnabledToggle { "Enable Legacy Mode" }; + ToggleButton voiceStealingEnabledToggle { "Enable synth voice stealing" }; + ComboBox numberOfVoices; - Label numberOfVoicesLabel; + Label numberOfVoicesLabel { {}, "Number of synth voices"}; ListenerList listeners; - const int defaultMasterChannel = 1, defaultNoteChannels = 15, + const int defaultMasterChannel = 1, defaultMemberChannels = 15, defaultMasterPitchbendRange = 2, defaultNotePitchbendRange = 48; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESetupComponent) diff --git a/examples/MPETest/Source/Main.cpp b/examples/MPEDemo/Source/Main.cpp similarity index 87% rename from examples/MPETest/Source/Main.cpp rename to examples/MPEDemo/Source/Main.cpp index 87bc2cc1b9..0eb319d543 100644 --- a/examples/MPETest/Source/Main.cpp +++ b/examples/MPEDemo/Source/Main.cpp @@ -29,7 +29,7 @@ #include -struct MPETestClasses +struct MPEDemoClasses { #include "MPESetupComponent.h" #include "ZoneColourPicker.h" @@ -41,11 +41,11 @@ struct MPETestClasses //============================================================================== -class MPETestApplication : public JUCEApplication +class MPEDemoApplication : public JUCEApplication { public: //============================================================================== - MPETestApplication() {} + MPEDemoApplication() {} const String getApplicationName() override { return ProjectInfo::projectName; } const String getApplicationVersion() override { return ProjectInfo::versionString; } @@ -74,11 +74,11 @@ public: MainWindow (String name) : DocumentWindow (name, LookAndFeel::getDefaultLookAndFeel() - .findColour (ResizableWindow::backgroundColourId), + .findColour (ResizableWindow::backgroundColourId), DocumentWindow::allButtons) { setUsingNativeTitleBar (true); - setContentOwned (new MPETestClasses::MainComponent(), true); + setContentOwned (new MPEDemoClasses::MainComponent(), true); centreWithSize (getWidth(), getHeight()); setVisible (true); @@ -98,4 +98,4 @@ private: }; //============================================================================== -START_JUCE_APPLICATION (MPETestApplication) +START_JUCE_APPLICATION (MPEDemoApplication) diff --git a/examples/MPETest/Source/MainComponent.h b/examples/MPEDemo/Source/MainComponent.h similarity index 77% rename from examples/MPETest/Source/MainComponent.h rename to examples/MPEDemo/Source/MainComponent.h index c924d3a778..9aed9ff8a8 100644 --- a/examples/MPETest/Source/MainComponent.h +++ b/examples/MPEDemo/Source/MainComponent.h @@ -41,8 +41,8 @@ public: visualiserComp (colourPicker) { setSize (880, 720); - audioDeviceManager.initialise (0, 2, 0, true, String(), 0); - audioDeviceManager.addMidiInputCallback (String(), this); + audioDeviceManager.initialise (0, 2, 0, true, {}, 0); + audioDeviceManager.addMidiInputCallback ({}, this); audioDeviceManager.addAudioCallback (this); addAndMakeVisible (audioSetupComp); @@ -60,7 +60,7 @@ public: synth.setVoiceStealingEnabled (false); for (int i = 0; i < 15; ++i) - synth.addVoice (new MPEDemoSynthVoice); + synth.addVoice (new MPEDemoSynthVoice()); } ~MainComponent() @@ -71,16 +71,16 @@ public: //============================================================================== void resized() override { - const int visualiserCompWidth = 2800; - const int visualiserCompHeight = 300; - const int zoneLayoutCompHeight = 60; - const float audioSetupCompRelativeWidth = 0.55f; + int visualiserCompWidth = 2800; + int visualiserCompHeight = 300; + int zoneLayoutCompHeight = 60; + float audioSetupCompRelativeWidth = 0.55f; - Rectangle r (getLocalBounds()); + auto r = getLocalBounds(); visualiserViewport.setBounds (r.removeFromBottom (visualiserCompHeight)); - visualiserComp.setBounds (Rectangle (visualiserCompWidth, - visualiserViewport.getHeight() - visualiserViewport.getScrollBarThickness())); + visualiserComp.setBounds ({ visualiserCompWidth, + visualiserViewport.getHeight() - visualiserViewport.getScrollBarThickness() }); zoneLayoutComp.setBounds (r.removeFromBottom (zoneLayoutCompHeight)); audioSetupComp.setBounds (r.removeFromLeft (proportionOfWidth (audioSetupCompRelativeWidth))); @@ -102,7 +102,8 @@ public: void audioDeviceAboutToStart (AudioIODevice* device) override { - const double sampleRate = device->getCurrentSampleRate(); + auto sampleRate = device->getCurrentSampleRate(); + midiCollector.reset (sampleRate); synth.setCurrentPlaybackSampleRate (sampleRate); } @@ -121,13 +122,23 @@ private: } //============================================================================== - void zoneAdded (MPEZone newZone) override + void zoneChanged (bool isLowerZone, int numMemberChannels, + int perNotePitchbendRange, int masterPitchbendRange) override { - MidiOutput* midiOutput = audioDeviceManager.getDefaultMidiOutput(); + auto* midiOutput = audioDeviceManager.getDefaultMidiOutput(); if (midiOutput != nullptr) - midiOutput->sendBlockOfMessagesNow (MPEMessages::addZone (newZone)); + { + if (isLowerZone) + midiOutput->sendBlockOfMessagesNow (MPEMessages::setLowerZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange)); + else + midiOutput->sendBlockOfMessagesNow (MPEMessages::setUpperZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange)); + } + + if (isLowerZone) + zoneLayout.setLowerZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange); + else + zoneLayout.setUpperZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange); - zoneLayout.addZone (newZone); visualiserInstrument.setZoneLayout (zoneLayout); synth.setZoneLayout (zoneLayout); colourPicker.setZoneLayout (zoneLayout); @@ -135,7 +146,7 @@ private: void allZonesCleared() override { - MidiOutput* midiOutput = audioDeviceManager.getDefaultMidiOutput(); + auto* midiOutput = audioDeviceManager.getDefaultMidiOutput(); if (midiOutput != nullptr) midiOutput->sendBlockOfMessagesNow (MPEMessages::clearAllZones()); @@ -172,7 +183,7 @@ private: synth.reduceNumVoices (numberOfVoices); else while (synth.getNumVoices() < numberOfVoices) - synth.addVoice (new MPEDemoSynthVoice); + synth.addVoice (new MPEDemoSynthVoice()); } //============================================================================== diff --git a/examples/MPETest/Source/Visualiser.h b/examples/MPEDemo/Source/Visualiser.h similarity index 88% rename from examples/MPETest/Source/Visualiser.h rename to examples/MPEDemo/Source/Visualiser.h index 1d25fe115b..960af10c7a 100644 --- a/examples/MPETest/Source/Visualiser.h +++ b/examples/MPEDemo/Source/Visualiser.h @@ -84,7 +84,7 @@ private: g.setColour (zoneColour); Path circle, dashedCircle; circle.addEllipse (translateToLocalBounds (getSquareAroundCentre (getNoteOffRadius()))); - const float dashLengths[] = { 3.0f, 3.0f }; + float dashLengths[] = { 3.0f, 3.0f }; PathStrokeType (2.0, PathStrokeType::mitered).createDashedStroke (dashedCircle, circle, dashLengths, 2); g.fillPath (dashedCircle); } @@ -92,7 +92,8 @@ private: //============================================================================== void drawNoteLabel (Graphics& g, Colour zoneColour) { - Rectangle textBounds = translateToLocalBounds (getTextRectangle()).getSmallestIntegerContainer(); + auto textBounds = translateToLocalBounds (getTextRectangle()).getSmallestIntegerContainer(); + g.drawText ("+", textBounds, Justification::centred); g.drawText (MidiMessage::getMidiNoteName (note.initialNote, true, true, 3), textBounds, Justification::centredBottom); g.setFont (Font (22.0f, Font::bold)); @@ -131,7 +132,7 @@ class Visualiser : public Component, { public: //============================================================================== - Visualiser (const ZoneColourPicker& zoneColourPicker) + Visualiser (ZoneColourPicker& zoneColourPicker) : colourPicker (zoneColourPicker) {} @@ -140,11 +141,12 @@ public: { g.fillAll (Colours::black); - float noteDistance = float (getWidth()) / 128; + auto noteDistance = float (getWidth()) / 128; for (int i = 0; i < 128; ++i) { - float x = noteDistance * i; - int noteHeight = int (MidiMessage::isMidiNoteBlack (i) ? 0.7 * getHeight() : getHeight()); + auto x = noteDistance * i; + auto noteHeight = int (MidiMessage::isMidiNoteBlack (i) ? 0.7 * getHeight() : getHeight()); + g.setColour (MidiMessage::isMidiNoteBlack (i) ? Colours::white : Colours::grey); g.drawLine (x, 0.0f, x, (float) noteHeight); @@ -185,7 +187,7 @@ public: { const ScopedLock sl (lock); - for (int i = activeNotes.size(); --i >= 0;) + for (auto i = activeNotes.size(); --i >= 0;) if (activeNotes.getReference(i).noteID == finishedNote.noteID) activeNotes.remove (i); @@ -218,7 +220,7 @@ private: { const ScopedLock sl (lock); - for (int i = noteComponents.size(); --i >= 0;) + for (auto i = noteComponents.size(); --i >= 0;) if (findActiveNote (noteComponents.getUnchecked(i)->note.noteID) == nullptr) noteComponents.remove (i); @@ -234,18 +236,18 @@ private: //============================================================================== Point getCentrePositionForNote (MPENote note) const { - float n = float (note.initialNote) + float (note.totalPitchbendInSemitones); - float x = getWidth() * n / 128; - float y = getHeight() * (1 - note.timbre.asUnsignedFloat()); + auto n = float (note.initialNote) + float (note.totalPitchbendInSemitones); + auto x = getWidth() * n / 128; + auto y = getHeight() * (1 - note.timbre.asUnsignedFloat()); - return Point (x, y); + return { x, y }; } //============================================================================== OwnedArray noteComponents; CriticalSection lock; Array activeNotes; - const ZoneColourPicker& colourPicker; + ZoneColourPicker& colourPicker; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Visualiser) }; diff --git a/examples/MPETest/Source/ZoneColourPicker.h b/examples/MPEDemo/Source/ZoneColourPicker.h similarity index 63% rename from examples/MPETest/Source/ZoneColourPicker.h rename to examples/MPEDemo/Source/ZoneColourPicker.h index 3382733edb..64791ba7d8 100644 --- a/examples/MPETest/Source/ZoneColourPicker.h +++ b/examples/MPEDemo/Source/ZoneColourPicker.h @@ -34,42 +34,29 @@ public: ZoneColourPicker() {} //============================================================================== - Colour getColourForMidiChannel (int midiChannel) const noexcept + Colour getColourForMidiChannel (int midiChannel) noexcept { if (legacyModeEnabled) return Colours::white; - if (zoneLayout.getNumZones() == 0) - return Colours::transparentBlack; + if (zoneLayout.getLowerZone().isUsingChannelAsMemberChannel (midiChannel)) + return getColourForZone (true); - if (auto* zone = zoneLayout.getZoneByChannel (midiChannel)) - return getColourForZoneIndex (std::distance (zoneLayout.getZoneByIndex (0), zone)); + if (zoneLayout.getUpperZone().isUsingChannelAsMemberChannel (midiChannel)) + return getColourForZone (false); return Colours::transparentBlack; } - //============================================================================== - Colour getColourForZoneIndex (int zoneIndex) const noexcept + Colour getColourForZone (bool isLowerZone) const noexcept { if (legacyModeEnabled) return Colours::white; - if (zoneIndex >= zoneLayout.getNumZones()) - return Colours::transparentBlack; - - static const std::array colours = - { - Colours::red, - Colours::yellow, - Colours::blue, - Colours::magenta, - Colours::limegreen, - Colours::cyan, - Colours::orange, - Colours::salmon - }; - - return colours[zoneIndex % colours.size()]; + if (isLowerZone) + return Colours::blue; + + return Colours::red; } //============================================================================== diff --git a/examples/MPETest/Source/ZoneLayoutComponent.h b/examples/MPEDemo/Source/ZoneLayoutComponent.h similarity index 68% rename from examples/MPETest/Source/ZoneLayoutComponent.h rename to examples/MPEDemo/Source/ZoneLayoutComponent.h index 932882698c..aaa8786faf 100644 --- a/examples/MPETest/Source/ZoneLayoutComponent.h +++ b/examples/MPEDemo/Source/ZoneLayoutComponent.h @@ -49,9 +49,14 @@ public: } //============================================================================== - void zoneAdded (MPEZone newZone) override + void zoneChanged (bool isLowerZone, int numMemberChannels, + int perNotePitchbendRange, int masterPitchbendRange) override { - zoneLayout.addZone (newZone); + if (isLowerZone) + zoneLayout.setLowerZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange); + else + zoneLayout.setUpperZone (numMemberChannels, perNotePitchbendRange, masterPitchbendRange); + repaint(); } @@ -66,6 +71,7 @@ public: legacyModeEnabled = legacyModeShouldBeEnabled; legacyModePitchbendRange = pitchbendRange; legacyModeChannelRange = channelRange; + repaint(); } @@ -81,11 +87,10 @@ private: for (int i = 0; i < numMidiChannels; ++i) { - float x = float (i) * channelWidth; + auto x = float (i) * channelWidth; Rectangle channelArea ((int) x, 0, (int) channelWidth, getHeight()); - Line line (x, 0.0f, x, float (getHeight())); - g.drawLine (line); + g.drawLine ({ x, 0.0f, x, float (getHeight()) }); g.drawText (String (i + 1), channelArea.reduced (4, 4), Justification::topLeft, false); } } @@ -93,35 +98,40 @@ private: //============================================================================== void paintZones (Graphics& g) { - float channelWidth = getChannelRectangleWidth(); + auto channelWidth = getChannelRectangleWidth(); + + Array activeZones; + if (zoneLayout.getLowerZone().isActive()) activeZones.add (zoneLayout.getLowerZone()); + if (zoneLayout.getUpperZone().isActive()) activeZones.add (zoneLayout.getUpperZone()); - for (int i = 0; i < zoneLayout.getNumZones(); ++i) + for (auto zone : activeZones) { - MPEZone zone = *zoneLayout.getZoneByIndex (i); - Colour zoneColour = colourPicker.getColourForZoneIndex (i); + auto zoneColour = colourPicker.getColourForZone (zone.isLowerZone()); - Rectangle zoneRect (int (getChannelRectangleWidth() * (zone.getMasterChannel() - 1)), 0, - int (getChannelRectangleWidth() * (zone.getNumNoteChannels() + 1)), getHeight()); - zoneRect.removeFromTop (20); + auto xPos = zone.isLowerZone() ? 0 : zone.getLastMemberChannel() - 1; - g.setColour (zoneColour.withAlpha (0.3f)); - g.fillRect (zoneRect.withWidth ((int) channelWidth)); + Rectangle zoneRect { int (channelWidth * (xPos)), 20, + int (channelWidth * (zone.numMemberChannels + 1)), getHeight() - 20 }; g.setColour (zoneColour); g.drawRect (zoneRect, 3); - g.drawText ("<>" + String (zone.getPerNotePitchbendRange()), zoneRect.withTrimmedLeft ((int) channelWidth).reduced (4, 4), Justification::bottomLeft, false); - g.setColour (Colours::black); - g.drawText ("ZONE " + String (i + 1), zoneRect.reduced (4, 4), Justification::topLeft, false); - g.drawText ("<>" + String (zone.getMasterPitchbendRange()), zoneRect.reduced (4, 4), Justification::bottomLeft, false); + auto masterRect = zone.isLowerZone() ? zoneRect.removeFromLeft (channelWidth) : zoneRect.removeFromRight (channelWidth); + + g.setColour (zoneColour.withAlpha (0.3f)); + g.fillRect (masterRect); + + g.setColour (zoneColour.contrasting()); + g.drawText ("<>" + String (zone.masterPitchbendRange), masterRect.reduced (4), Justification::top, false); + g.drawText ("<>" + String (zone.perNotePitchbendRange), masterRect.reduced (4), Justification::bottom, false); } } //============================================================================== void paintLegacyMode (Graphics& g) { - int startChannel = legacyModeChannelRange.getStart() - 1; - int numChannels = legacyModeChannelRange.getEnd() - startChannel - 1; + auto startChannel = legacyModeChannelRange.getStart() - 1; + auto numChannels = legacyModeChannelRange.getEnd() - startChannel - 1; Rectangle zoneRect (int (getChannelRectangleWidth() * startChannel), 0,