├── .gitignore ├── .gitmodules ├── BinaryData └── pMix.png ├── Builds └── MacOSX │ ├── Icon.icns │ ├── Info-App.plist │ ├── RecentFilesMenuTemplate.nib │ └── pMix.xcodeproj │ └── project.pbxproj ├── GPL.txt ├── JuceLibraryCode ├── AppConfig.h ├── JuceHeader.h ├── ReadMe.txt ├── include_juce_audio_basics.cpp ├── include_juce_audio_basics.mm ├── include_juce_audio_devices.cpp ├── include_juce_audio_devices.mm ├── include_juce_audio_formats.cpp ├── include_juce_audio_formats.mm ├── include_juce_audio_processors.cpp ├── include_juce_audio_processors.mm ├── include_juce_audio_utils.cpp ├── include_juce_audio_utils.mm ├── include_juce_core.cpp ├── include_juce_core.mm ├── include_juce_cryptography.cpp ├── include_juce_cryptography.mm ├── include_juce_data_structures.cpp ├── include_juce_data_structures.mm ├── include_juce_events.cpp ├── include_juce_events.mm ├── include_juce_faustllvm.cpp ├── include_juce_graphics.cpp ├── include_juce_graphics.mm ├── include_juce_gui_basics.cpp ├── include_juce_gui_basics.mm ├── include_juce_gui_extra.cpp ├── include_juce_gui_extra.mm ├── include_juce_opengl.cpp └── include_juce_opengl.mm ├── README.md ├── Resources ├── default.gif └── wait.html ├── Source ├── pMixAboutBox.h ├── pMixApp.cpp ├── pMixApp.h ├── pMixAudioEngine.cpp ├── pMixAudioEngine.h ├── pMixCodeEditor.cpp ├── pMixCodeEditor.h ├── pMixCommandIDs.h ├── pMixConsole.cpp ├── pMixConsole.h ├── pMixConstants.h ├── pMixDefaultColours.h ├── pMixDocument.cpp ├── pMixDocument.h ├── pMixFileBrowser.cpp ├── pMixFileBrowser.h ├── pMixFloatWindow.cpp ├── pMixFloatWindow.h ├── pMixGenericEditor.cpp ├── pMixGenericEditor.h ├── pMixGraphEditor.cpp ├── pMixGraphEditor.h ├── pMixGraphEditorActions.cpp ├── pMixGraphEditorActions.h ├── pMixGraphEditorParts.cpp ├── pMixGraphEditorParts.h ├── pMixInternalPluginFormat.cpp ├── pMixInternalPluginFormat.h ├── pMixInterpolationSpace.cpp ├── pMixInterpolationSpace.h ├── pMixInterpolationSpaceActions.cpp ├── pMixInterpolationSpaceActions.h ├── pMixInterpolationSpaceCrosshairs.cpp ├── pMixInterpolationSpaceCrosshairs.h ├── pMixInterpolationSpaceLayout.cpp ├── pMixInterpolationSpaceLayout.h ├── pMixLogger.h ├── pMixLookAndFeel.cpp ├── pMixLookAndFeel.h ├── pMixMainAppWindow.cpp ├── pMixMainAppWindow.h ├── pMixMainComponent.cpp ├── pMixMainComponent.h ├── pMixParamTreeView.cpp ├── pMixParamTreeView.h ├── pMixParamView.cpp ├── pMixParamView.h ├── pMixPluginWindow.cpp ├── pMixPluginWindow.h ├── pMixPrefsAudio.cpp ├── pMixPrefsAudio.h ├── pMixPrefsColours.cpp ├── pMixPrefsColours.h ├── pMixPrefsComponent.cpp ├── pMixPrefsComponent.h ├── pMixPrefsControllers.cpp ├── pMixPrefsControllers.h ├── pMixPrefsGeneral.cpp ├── pMixPrefsGeneral.h ├── pMixPrefsPlugins.cpp ├── pMixPrefsPlugins.h ├── pMixRHPTabContainer.cpp ├── pMixRHPTabContainer.h ├── pMixSVGDisplay.cpp └── pMixSVGDisplay.h ├── manual └── pMix-manual.tex ├── misc └── pMixVimeo.png ├── pMix.jucer └── pMixPlugin ├── Builds └── MacOSX │ ├── Info-AU.plist │ ├── Info-Shared_Code.plist │ ├── Info-VST.plist │ ├── Info-VST3.plist │ ├── RecentFilesMenuTemplate.nib │ ├── pMixPlugin.entitlements │ └── pMixPlugin.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ └── contents.xcworkspacedata ├── JUCE.patch ├── JuceLibraryCode ├── AppConfig.h ├── JuceHeader.h └── ReadMe.txt ├── README.md ├── Source ├── PluginEditor.cpp ├── PluginEditor.h ├── PluginProcessor.cpp └── PluginProcessor.h └── pMixPlugin.jucer /.gitignore: -------------------------------------------------------------------------------- 1 | /builds/MacOSX/build/* 2 | Builds/*/ipch 3 | *.sdf 4 | Builds/MacOSX/pMix.xcodeproj/xcuserdata 5 | Builds/MacOSX/pMix.xcodeproj/project.xcworkspace 6 | pMixPlugin/Builds/MacOSX/build 7 | *xcuserdata 8 | *.DS_Store 9 | Builds/VisualStudio2013/Debug/ 10 | Builds/VisualStudio2013/Release/ 11 | *.aux 12 | *.glo 13 | *.ist 14 | *.log 15 | *.out 16 | *.synctex.gz 17 | *.toc 18 | *.opensdf 19 | pMixPlugin/JuceLibraryCode/* 20 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "VST3_SDK/public.sdk"] 2 | path = VST3_SDK/public.sdk 3 | url = git@github.com:steinbergmedia/vst3_public_sdk.git 4 | [submodule "VST3_SDK/base"] 5 | path = VST3_SDK/base 6 | url = git@github.com:steinbergmedia/vst3_base.git 7 | [submodule "VST3_SDK/pluginterfaces"] 8 | path = VST3_SDK/pluginterfaces 9 | url = git@github.com:steinbergmedia/vst3_pluginterfaces.git 10 | -------------------------------------------------------------------------------- /BinaryData/pMix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/BinaryData/pMix.png -------------------------------------------------------------------------------- /Builds/MacOSX/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/Builds/MacOSX/Icon.icns -------------------------------------------------------------------------------- /Builds/MacOSX/Info-App.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${EXECUTABLE_NAME} 8 | CFBundleIconFile 9 | Icon.icns 10 | CFBundleIdentifier 11 | $(PRODUCT_BUNDLE_IDENTIFIER) 12 | CFBundleName 13 | pMix 14 | CFBundleDisplayName 15 | pMix 16 | CFBundlePackageType 17 | APPL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | 0.0.2 22 | CFBundleVersion 23 | 0.0.2 24 | NSHumanReadableCopyright 25 | OliLarkin 26 | NSHighResolutionCapable 27 | 28 | NSAppTransportSecurity 29 | 30 | NSAllowsArbitraryLoads 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Builds/MacOSX/RecentFilesMenuTemplate.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/Builds/MacOSX/RecentFilesMenuTemplate.nib -------------------------------------------------------------------------------- /JuceLibraryCode/AppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | There's a section below where you can add your own custom code safely, and the 7 | Projucer will preserve the contents of that block, but the best way to change 8 | any of these definitions is by using the Projucer's project settings. 9 | 10 | Any commented-out settings will assume their default values. 11 | 12 | */ 13 | 14 | #pragma once 15 | 16 | //============================================================================== 17 | // [BEGIN_USER_CODE_SECTION] 18 | 19 | // (You can add your own code in this section, and the Projucer will not overwrite it) 20 | 21 | // [END_USER_CODE_SECTION] 22 | 23 | /* 24 | ============================================================================== 25 | 26 | In accordance with the terms of the JUCE 5 End-Use License Agreement, the 27 | JUCE Code in SECTION A cannot be removed, changed or otherwise rendered 28 | ineffective unless you have a JUCE Indie or Pro license, or are using JUCE 29 | under the GPL v3 license. 30 | 31 | End User License Agreement: www.juce.com/juce-5-licence 32 | 33 | ============================================================================== 34 | */ 35 | 36 | // BEGIN SECTION A 37 | 38 | #ifndef JUCE_DISPLAY_SPLASH_SCREEN 39 | #define JUCE_DISPLAY_SPLASH_SCREEN 0 40 | #endif 41 | 42 | #ifndef JUCE_REPORT_APP_USAGE 43 | #define JUCE_REPORT_APP_USAGE 0 44 | #endif 45 | 46 | // END SECTION A 47 | 48 | #define JUCE_USE_DARK_SPLASH_SCREEN 1 49 | 50 | #define JUCE_PROJUCER_VERSION 0x50405 51 | 52 | //============================================================================== 53 | #define JUCE_MODULE_AVAILABLE_juce_audio_basics 1 54 | #define JUCE_MODULE_AVAILABLE_juce_audio_devices 1 55 | #define JUCE_MODULE_AVAILABLE_juce_audio_formats 1 56 | #define JUCE_MODULE_AVAILABLE_juce_audio_processors 1 57 | #define JUCE_MODULE_AVAILABLE_juce_audio_utils 1 58 | #define JUCE_MODULE_AVAILABLE_juce_core 1 59 | #define JUCE_MODULE_AVAILABLE_juce_cryptography 1 60 | #define JUCE_MODULE_AVAILABLE_juce_data_structures 1 61 | #define JUCE_MODULE_AVAILABLE_juce_events 1 62 | #define JUCE_MODULE_AVAILABLE_juce_faustllvm 1 63 | #define JUCE_MODULE_AVAILABLE_juce_graphics 1 64 | #define JUCE_MODULE_AVAILABLE_juce_gui_basics 1 65 | #define JUCE_MODULE_AVAILABLE_juce_gui_extra 1 66 | #define JUCE_MODULE_AVAILABLE_juce_opengl 1 67 | 68 | #define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1 69 | 70 | //============================================================================== 71 | // juce_audio_devices flags: 72 | 73 | #ifndef JUCE_USE_WINRT_MIDI 74 | //#define JUCE_USE_WINRT_MIDI 0 75 | #endif 76 | 77 | #ifndef JUCE_ASIO 78 | #define JUCE_ASIO 1 79 | #endif 80 | 81 | #ifndef JUCE_WASAPI 82 | //#define JUCE_WASAPI 1 83 | #endif 84 | 85 | #ifndef JUCE_WASAPI_EXCLUSIVE 86 | //#define JUCE_WASAPI_EXCLUSIVE 0 87 | #endif 88 | 89 | #ifndef JUCE_DIRECTSOUND 90 | //#define JUCE_DIRECTSOUND 1 91 | #endif 92 | 93 | #ifndef JUCE_ALSA 94 | #define JUCE_ALSA 0 95 | #endif 96 | 97 | #ifndef JUCE_JACK 98 | #define JUCE_JACK 1 99 | #endif 100 | 101 | #ifndef JUCE_BELA 102 | //#define JUCE_BELA 0 103 | #endif 104 | 105 | #ifndef JUCE_USE_ANDROID_OBOE 106 | //#define JUCE_USE_ANDROID_OBOE 0 107 | #endif 108 | 109 | #ifndef JUCE_USE_ANDROID_OPENSLES 110 | //#define JUCE_USE_ANDROID_OPENSLES 0 111 | #endif 112 | 113 | #ifndef JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 114 | //#define JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 0 115 | #endif 116 | 117 | //============================================================================== 118 | // juce_audio_formats flags: 119 | 120 | #ifndef JUCE_USE_FLAC 121 | //#define JUCE_USE_FLAC 1 122 | #endif 123 | 124 | #ifndef JUCE_USE_OGGVORBIS 125 | //#define JUCE_USE_OGGVORBIS 1 126 | #endif 127 | 128 | #ifndef JUCE_USE_MP3AUDIOFORMAT 129 | //#define JUCE_USE_MP3AUDIOFORMAT 0 130 | #endif 131 | 132 | #ifndef JUCE_USE_LAME_AUDIO_FORMAT 133 | //#define JUCE_USE_LAME_AUDIO_FORMAT 0 134 | #endif 135 | 136 | #ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT 137 | //#define JUCE_USE_WINDOWS_MEDIA_FORMAT 1 138 | #endif 139 | 140 | //============================================================================== 141 | // juce_audio_processors flags: 142 | 143 | #ifndef JUCE_PLUGINHOST_VST 144 | #define JUCE_PLUGINHOST_VST 0 145 | #endif 146 | 147 | #ifndef JUCE_PLUGINHOST_VST3 148 | #define JUCE_PLUGINHOST_VST3 0 149 | #endif 150 | 151 | #ifndef JUCE_PLUGINHOST_AU 152 | #define JUCE_PLUGINHOST_AU 0 153 | #endif 154 | 155 | #ifndef JUCE_PLUGINHOST_LADSPA 156 | //#define JUCE_PLUGINHOST_LADSPA 0 157 | #endif 158 | 159 | //============================================================================== 160 | // juce_audio_utils flags: 161 | 162 | #ifndef JUCE_USE_CDREADER 163 | #define JUCE_USE_CDREADER 0 164 | #endif 165 | 166 | #ifndef JUCE_USE_CDBURNER 167 | #define JUCE_USE_CDBURNER 0 168 | #endif 169 | 170 | //============================================================================== 171 | // juce_core flags: 172 | 173 | #ifndef JUCE_FORCE_DEBUG 174 | //#define JUCE_FORCE_DEBUG 0 175 | #endif 176 | 177 | #ifndef JUCE_LOG_ASSERTIONS 178 | //#define JUCE_LOG_ASSERTIONS 0 179 | #endif 180 | 181 | #ifndef JUCE_CHECK_MEMORY_LEAKS 182 | //#define JUCE_CHECK_MEMORY_LEAKS 1 183 | #endif 184 | 185 | #ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 186 | //#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0 187 | #endif 188 | 189 | #ifndef JUCE_INCLUDE_ZLIB_CODE 190 | //#define JUCE_INCLUDE_ZLIB_CODE 1 191 | #endif 192 | 193 | #ifndef JUCE_USE_CURL 194 | //#define JUCE_USE_CURL 1 195 | #endif 196 | 197 | #ifndef JUCE_LOAD_CURL_SYMBOLS_LAZILY 198 | //#define JUCE_LOAD_CURL_SYMBOLS_LAZILY 0 199 | #endif 200 | 201 | #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS 202 | //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 0 203 | #endif 204 | 205 | #ifndef JUCE_ALLOW_STATIC_NULL_VARIABLES 206 | //#define JUCE_ALLOW_STATIC_NULL_VARIABLES 0 207 | #endif 208 | 209 | #ifndef JUCE_STRICT_REFCOUNTEDPOINTER 210 | //#define JUCE_STRICT_REFCOUNTEDPOINTER 0 211 | #endif 212 | 213 | //============================================================================== 214 | // juce_events flags: 215 | 216 | #ifndef JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 217 | //#define JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 0 218 | #endif 219 | 220 | //============================================================================== 221 | // juce_graphics flags: 222 | 223 | #ifndef JUCE_USE_COREIMAGE_LOADER 224 | //#define JUCE_USE_COREIMAGE_LOADER 1 225 | #endif 226 | 227 | #ifndef JUCE_USE_DIRECTWRITE 228 | //#define JUCE_USE_DIRECTWRITE 1 229 | #endif 230 | 231 | #ifndef JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 232 | //#define JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 0 233 | #endif 234 | 235 | //============================================================================== 236 | // juce_gui_basics flags: 237 | 238 | #ifndef JUCE_ENABLE_REPAINT_DEBUGGING 239 | #define JUCE_ENABLE_REPAINT_DEBUGGING 0 240 | #endif 241 | 242 | #ifndef JUCE_USE_XRANDR 243 | //#define JUCE_USE_XRANDR 1 244 | #endif 245 | 246 | #ifndef JUCE_USE_XINERAMA 247 | //#define JUCE_USE_XINERAMA 1 248 | #endif 249 | 250 | #ifndef JUCE_USE_XSHM 251 | //#define JUCE_USE_XSHM 1 252 | #endif 253 | 254 | #ifndef JUCE_USE_XRENDER 255 | //#define JUCE_USE_XRENDER 0 256 | #endif 257 | 258 | #ifndef JUCE_USE_XCURSOR 259 | //#define JUCE_USE_XCURSOR 1 260 | #endif 261 | 262 | #ifndef JUCE_WIN_PER_MONITOR_DPI_AWARE 263 | //#define JUCE_WIN_PER_MONITOR_DPI_AWARE 1 264 | #endif 265 | 266 | //============================================================================== 267 | // juce_gui_extra flags: 268 | 269 | #ifndef JUCE_WEB_BROWSER 270 | //#define JUCE_WEB_BROWSER 1 271 | #endif 272 | 273 | #ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR 274 | //#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0 275 | #endif 276 | 277 | //============================================================================== 278 | #ifndef JUCE_STANDALONE_APPLICATION 279 | #if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone) 280 | #define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone 281 | #else 282 | #define JUCE_STANDALONE_APPLICATION 1 283 | #endif 284 | #endif 285 | -------------------------------------------------------------------------------- /JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | 33 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION 34 | /** If you've hit this error then the version of the Projucer that was used to generate this project is 35 | older than the version of the JUCE modules being included. To fix this error, re-save your project 36 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, 37 | remove the JUCE_PROJUCER_VERSION define from the AppConfig.h file. 38 | */ 39 | #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." 40 | #endif 41 | 42 | #if ! DONT_SET_USING_JUCE_NAMESPACE 43 | // If your code uses a lot of JUCE classes, then this will obviously save you 44 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 45 | using namespace juce; 46 | #endif 47 | 48 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 49 | namespace ProjectInfo 50 | { 51 | const char* const projectName = "pMix"; 52 | const char* const companyName = "OliLarkin"; 53 | const char* const versionString = "0.0.3"; 54 | const int versionNumber = 0x3; 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Important Note!! 3 | ================ 4 | 5 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 7 | the Projucer saves your project. 8 | 9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 10 | put any of your own files in here if you don't want to lose them. (Of course you may choose 11 | to add the folder's contents to your version-control system so that you can re-merge your own 12 | modifications after the Projucer has saved its changes). 13 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_processors.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_utils.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_cryptography.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_cryptography.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_faustllvm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_graphics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_extra.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_gui_extra.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_opengl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_opengl.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pMix - Preset Mixer (v2) 2 | 3 | pMix (short for preset mixer) is a sound design, composition and performance tool that facilitates the control of multiple parameters using an intuitive graphical interface. It includes a graphical patcher for creating a network of audio synthesis or processing nodes. A node could be a VST2, VST3, AU or LADSPA plug-in or it could a JIT compiled FAUST script. FAUST is a first class citizen in pMix and an integrated code editor and SVG display makes it a nice environment for FAUST development. 4 | 5 | Presets created for each node are represented by colour-coded balls that are positioned on a 2D plane. The size of each ball and its proximity to the node's cursor affects the weight of the associated preset in the interpolation. 6 | 7 | Morphing between presets can result in the discovery of interesting hybrid sounds. By constraining sound manipulations within a predesigned "interpolation space" complex transitions can be achieved that would otherwise be hard to manage. 8 | 9 | pMix version 2 will eventually work on Mac, Linux and Windows and can operate as a standalone application or as a plug-in. 10 | 11 | [![IMAGE ALT TEXT](/misc/pMixVimeo.png?raw=true)](https://vimeo.com/122268573 "pMix2 quick demo") 12 | 13 | 14 | ## Dependencies 15 | 16 | **libFaust** 17 | 18 | The Faust JIT compiler is linked dynamically. libfaust.dylib is copied into the application bundle. In order to to simplify building pMix2, a prebuilt libfaust.dylib can be downloaded. [This zip](https://github.com/iPlug2/iPlug2/releases/download/setup/IPLUG2_DEPS_MAC.zip) should be extracted to a directory "Faust" alongside the .jucer file. 19 | 20 | **JUCE** 21 | 22 | pMix v2 is built using JUCE and the .jucer project expects to find the JUCE source and the juce_faustllvm juce modules source in the global module directory, which you can set in the Projucer settings. 23 | 24 | 25 | ## Compiling 26 | 27 | Once you have built and installed the above in the correct locations you should be able to compile the standalone app version of pMix by opening the Xcode project: /Builds/MacOSX/pMix.xcodeproj 28 | 29 | If you need to change any paths etc, you should do so using the .jucer project rather than modifing the xcode project. 30 | 31 | ## Notes 32 | 33 | * pMix has been developed on macOS and there hasn't yet been time to get it working on the other intended platforms! Hopefully there should not be any platform dependencies that prevent it working on Linux and Windows. 34 | * JUCE's VST2 plug-in support is most mature, so VST2 plug-ins are preferable to VST3, however Steinberg no longer distribute the VST2.4 SDK so VST3 support must be enabled in order to find the VST2.4 headers in the VST3 SDK. 35 | * If you don't care about plugin hosting support, you can disable it on the juce_audio_processors module tab by opening the pMix.jucer. 36 | * AU plug-in hosting is currently disabled, you can turn it on via the .jucer project. 37 | 38 | **License:** 39 | 40 | pMix - Copyright Oliver Larkin 2008 - 2019 41 | GNU Public License 42 | www.olilarkin.co.uk 43 | -------------------------------------------------------------------------------- /Resources/default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/Resources/default.gif -------------------------------------------------------------------------------- /Resources/wait.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Please Wait 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/pMixAboutBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixAboutBox.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "../JuceLibraryCode/JuceHeader.h" 13 | 14 | class pMixAboutBox : public Component 15 | { 16 | public: 17 | pMixAboutBox() 18 | { 19 | setSize (400, 300); 20 | } 21 | 22 | ~pMixAboutBox() 23 | { 24 | } 25 | 26 | void paint (Graphics& g) 27 | { 28 | g.fillAll (Colours::white); 29 | g.setColour (Colours::black); 30 | g.setFont (24.0f); 31 | g.drawText ("pMix 2", getLocalBounds(), Justification::centred, true); 32 | } 33 | 34 | void resized() 35 | { 36 | } 37 | 38 | private: 39 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (pMixAboutBox) 40 | }; 41 | -------------------------------------------------------------------------------- /Source/pMixApp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixApp.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixApp.h" 11 | 12 | pMixApp::pMixApp() 13 | { 14 | } 15 | 16 | void pMixApp::initialise (const String& commandLine) 17 | { 18 | // splash = new SplashScreen ("pMix", 19 | // ImageCache::getFromMemory (BinaryData::pMix_about_png, BinaryData::pMix_about_pngSize), 20 | // true); 21 | // 22 | // splash->deleteAfterDelay (RelativeTime::seconds (4), false); 23 | 24 | 25 | 26 | mainWindow = std::make_unique(audioEngine); 27 | 28 | deviceManager.addAudioCallback (&graphPlayer); 29 | deviceManager.addMidiInputCallback (String(), &graphPlayer.getMidiMessageCollector()); 30 | 31 | // if (commandLine.isNotEmpty() && ! commandLine.trimStart().startsWith ("-") && mainWindow->getMainComponent() != nullptr) 32 | // { 33 | // mainWindow->getMainComponent()->getDoc().loadFrom (File::getCurrentWorkingDirectory().getChildFile (commandLine), true); 34 | // } 35 | 36 | std::unique_ptr savedAudioState (audioEngine.getAppProperties().getUserSettings()->getXmlValue ("audioDeviceState")); 37 | graphPlayer.setDoublePrecisionProcessing(true); 38 | graphPlayer.setProcessor(&audioEngine.getGraph()); 39 | audioEngine.getDoc().initialize(); 40 | deviceManager.initialise (256, 256, savedAudioState.get(), true); 41 | } 42 | 43 | void pMixApp::shutdown() 44 | { 45 | deviceManager.removeAudioCallback (&graphPlayer); 46 | deviceManager.removeMidiInputCallback (String(), &graphPlayer.getMidiMessageCollector()); 47 | graphPlayer.setProcessor (nullptr); 48 | 49 | mainWindow = nullptr; 50 | } 51 | 52 | void pMixApp::systemRequestedQuit() 53 | { 54 | if (mainWindow != nullptr) 55 | mainWindow->tryToQuitApplication(); 56 | else 57 | JUCEApplicationBase::quit(); 58 | } 59 | 60 | const String pMixApp::getApplicationName() { return "pMix"; } 61 | const String pMixApp::getApplicationVersion() { return ProjectInfo::versionString; } 62 | bool pMixApp::moreThanOneInstanceAllowed() { return false; } 63 | 64 | static pMixApp& getApp() { return *dynamic_cast(JUCEApplication::getInstance()); } 65 | ApplicationCommandManager& getCommandManager() { return getApp().commandManager; } 66 | AudioDeviceManager& getDeviceManager() { return getApp().deviceManager; } 67 | 68 | // This kicks the whole thing off.. 69 | START_JUCE_APPLICATION (pMixApp) 70 | -------------------------------------------------------------------------------- /Source/pMixApp.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixApp.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "../JuceLibraryCode/JuceHeader.h" 13 | #include "pMixMainAppWindow.h" 14 | 15 | class pMixApp : public JUCEApplication 16 | { 17 | public: 18 | pMixApp(); 19 | void initialise (const String& commandLine); 20 | void shutdown(); 21 | void systemRequestedQuit(); 22 | const String getApplicationName(); 23 | const String getApplicationVersion(); 24 | bool moreThanOneInstanceAllowed(); 25 | 26 | AudioDeviceManager deviceManager; 27 | ApplicationCommandManager commandManager; 28 | 29 | private: 30 | std::unique_ptr mainWindow; 31 | AudioProcessorPlayer graphPlayer; 32 | PMixAudioEngine audioEngine; 33 | // SplashScreen* splash; 34 | }; 35 | -------------------------------------------------------------------------------- /Source/pMixAudioEngine.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixAudioEngine.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixAudioEngine.h" 11 | #include "pMixCommandIDs.h" 12 | 13 | PMixAudioEngine::PMixAudioEngine() 14 | : doc(*this) 15 | { 16 | Logger::setCurrentLogger(&logger); 17 | 18 | LOG("pMix v 0.01"); 19 | 20 | // initialise our settings file.. 21 | 22 | PropertiesFile::Options options; 23 | options.applicationName = "pMix"; 24 | options.filenameSuffix = "settings"; 25 | options.osxLibrarySubFolder = "Application Support"; 26 | #ifdef JUCE_MAC 27 | options.folderName = "pMix2"; 28 | #endif 29 | appProperties = std::make_unique(); 30 | appProperties->setStorageParameters (options); 31 | 32 | formatManager.addDefaultFormats(); 33 | 34 | InternalPluginFormat* internalFormat = new InternalPluginFormat(); 35 | internalFormat->getAllTypes (internalTypes); 36 | formatManager.addFormat(internalFormat); 37 | 38 | FaustPluginFormat* faustPluginFormat = new FaustPluginFormat(doc.getLibraryPath(), File(FAUST_DRAW_PATH)); 39 | faustPluginFormat->getAllTypes(internalTypes); 40 | JITformatManager.addFormat(faustPluginFormat); 41 | 42 | std::unique_ptr savedPluginList (getAppProperties().getUserSettings()->getXmlValue ("pluginList")); 43 | 44 | if (savedPluginList != nullptr) 45 | knownPluginList.recreateFromXml (*savedPluginList); 46 | 47 | scanFaustDSPFiles(); 48 | 49 | String pluginBeingScanned; 50 | 51 | pluginSortMethod = (KnownPluginList::SortMethod) getAppProperties().getUserSettings()->getIntValue ("pluginSortMethod", KnownPluginList::sortByFileSystemLocation); 52 | setPluginSortMethod(pluginSortMethod); 53 | 54 | #if JUCE_MAC 55 | knownPluginList.addToBlacklist("/Library/Audio/Plug-Ins/VST/pMixPlugin.vst"); 56 | #endif 57 | knownPluginList.addChangeListener (this); 58 | } 59 | 60 | PMixAudioEngine::~PMixAudioEngine() 61 | { 62 | knownPluginList.removeChangeListener (this); 63 | doc.clear(); 64 | graph.clear(); 65 | appProperties = nullptr; 66 | } 67 | 68 | void PMixAudioEngine::changeListenerCallback (ChangeBroadcaster* broadcaster) 69 | { 70 | if (broadcaster == &knownPluginList) 71 | { 72 | // save the plugin list every time it gets chnaged, so that if we're scanning 73 | // and it crashes, we've still saved the previous ones 74 | std::unique_ptr savedPluginList (knownPluginList.createXml()); 75 | 76 | if (savedPluginList != nullptr) 77 | { 78 | getAppProperties().getUserSettings()->setValue ("pluginList", savedPluginList.get()); 79 | getAppProperties().saveIfNeeded(); 80 | } 81 | } 82 | } 83 | 84 | void PMixAudioEngine::setPluginSortMethod(KnownPluginList::SortMethod sortMethod) 85 | { 86 | pluginSortMethod = sortMethod; 87 | getAppProperties().getUserSettings()->setValue ("pluginSortMethod", (int) pluginSortMethod); 88 | } 89 | 90 | void PMixAudioEngine::createNodeMenu (PopupMenu& m) const 91 | { 92 | PopupMenu ioMenu; 93 | 94 | ioMenu.addItem (CommandIDs::newAudioInput, internalTypes.getUnchecked(0)->name); 95 | ioMenu.addItem (CommandIDs::newAudioOutput, internalTypes.getUnchecked(1)->name); 96 | ioMenu.addItem (CommandIDs::newMIDIInput, internalTypes.getUnchecked(2)->name); 97 | ioMenu.addItem (CommandIDs::newMIDIOutput, internalTypes.getUnchecked(3)->name); 98 | 99 | m.addSubMenu("I/O", ioMenu); 100 | 101 | PopupMenu faustMenu; 102 | faustMenu.addItem(CommandIDs::newFaustEffect, "Effect"); 103 | faustMenu.addItem(CommandIDs::newFaustEffect, "Synth"); 104 | faustMenu.addSeparator(); 105 | 106 | for(int i = 0; i< faustDSPFiles.size(); i++) 107 | { 108 | faustMenu.addItem(CommandIDs::faustDSPFiles + i, faustDSPFiles[i]->name); 109 | } 110 | 111 | m.addSubMenu("Faust", faustMenu); 112 | 113 | PopupMenu pluginsMenu; 114 | knownPluginList.addToMenu (pluginsMenu, pluginSortMethod); 115 | m.addSubMenu("Plugins", pluginsMenu); 116 | } 117 | 118 | const PluginDescription* PMixAudioEngine::getChosenType (int menuID) const 119 | { 120 | if(menuID >= CommandIDs::faustDSPFiles && menuID < CommandIDs::faustDSPFiles + faustDSPFiles.size()) 121 | { 122 | return faustDSPFiles[menuID - CommandIDs::faustDSPFiles]; 123 | } 124 | 125 | switch (menuID) 126 | { 127 | case CommandIDs::newAudioInput: return internalTypes[0]; 128 | case CommandIDs::newAudioOutput: return internalTypes[1]; 129 | case CommandIDs::newMIDIInput: return internalTypes[2]; 130 | case CommandIDs::newMIDIOutput: return internalTypes[3]; 131 | case CommandIDs::newFaustEffect: return internalTypes[4]; 132 | default: 133 | { 134 | return knownPluginList.getType (knownPluginList.getIndexChosenByMenu (menuID)); 135 | } 136 | } 137 | } 138 | 139 | std::unique_ptr PMixAudioEngine::createPluginInstance(const PluginDescription& desc, String& errorMessage) 140 | { 141 | std::unique_ptr result = nullptr; 142 | 143 | if(desc.pluginFormatName == "FAUST") 144 | { 145 | result = JITformatManager.createPluginInstance (desc, getGraph().getSampleRate(), getGraph().getBlockSize(), errorMessage); 146 | } 147 | else 148 | result = formatManager.createPluginInstance (desc, getGraph().getSampleRate(), getGraph().getBlockSize(), errorMessage); 149 | 150 | return result; 151 | } 152 | 153 | void PMixAudioEngine::scanFaustDSPFiles() 154 | { 155 | LOG("Scanning Faust .dsp files..."); 156 | 157 | faustDSPFiles.clear(); 158 | 159 | DirectoryIterator iter (File (DEFAULT_FAUST_DSP_SEARCHPATH), true, "*.dsp"); 160 | 161 | while (iter.next()) 162 | { 163 | File theFileItFound(iter.getFile()); 164 | 165 | LOG("Found " + theFileItFound.getFileName()); 166 | 167 | PluginDescription* desc = new PluginDescription(); 168 | FaustAudioPluginInstance::fillInitialInPluginDescription(*desc); 169 | desc->name = theFileItFound.getFileName(); 170 | desc->fileOrIdentifier = theFileItFound.getFullPathName(); 171 | faustDSPFiles.add(desc); 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /Source/pMixAudioEngine.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixAudioEngine.h 5 | Author: Oliver Larkin 6 | 7 | This class contains the main audio side of pMix and owns the document. It exists before the GUI and should be capable of playing a graph without GUI. 8 | 9 | ============================================================================== 10 | */ 11 | 12 | #pragma once 13 | 14 | #include "pMixDocument.h" 15 | #include "pMixInternalPluginFormat.h" 16 | #include "pMixLogger.h" 17 | 18 | ApplicationCommandManager& getCommandManager(); 19 | 20 | class PMixAudioEngine : public ChangeListener 21 | { 22 | public: 23 | PMixAudioEngine(); 24 | ~PMixAudioEngine(); 25 | 26 | AudioProcessorGraph& getGraph() noexcept { return graph; } 27 | //AudioProcessorPlayer& getGraphPlayer() noexcept { return graphPlayer; } 28 | AudioPluginFormatManager& getFormatManager() noexcept { return formatManager; } 29 | 30 | KnownPluginList& getKnownPluginList() { return knownPluginList; } 31 | KnownPluginList::SortMethod getSortMethod() noexcept { return pluginSortMethod; } 32 | const File getDMPFile() { return getAppProperties().getUserSettings()->getFile().getSiblingFile ("RecentlyCrashedPluginsList"); } 33 | 34 | PMixDocument &getDoc() noexcept { return doc; } 35 | PMixLogger &getLogger() noexcept { return logger; } 36 | 37 | ApplicationProperties& getAppProperties() { return *appProperties; } 38 | 39 | void setPluginSortMethod(KnownPluginList::SortMethod sortMethod); 40 | 41 | // called from GUI classes to populate menus 42 | void createNodeMenu (PopupMenu& m) const; 43 | const PluginDescription* getChosenType (int menuID) const; 44 | 45 | //ChangeListener 46 | void changeListenerCallback (ChangeBroadcaster* broadcaster); 47 | 48 | std::unique_ptr createPluginInstance(const PluginDescription& desc, String& errorMessage); 49 | 50 | void scanFaustDSPFiles(); 51 | 52 | private: 53 | PMixDocument doc; 54 | 55 | AudioProcessorGraph graph; 56 | AudioPluginFormatManager formatManager; // for internal I/O and VST plugins etc 57 | AudioPluginFormatManager JITformatManager; // for FAUST formats ... 58 | 59 | OwnedArray internalTypes; // includes FAUST plugin type 60 | 61 | KnownPluginList knownPluginList; 62 | KnownPluginList::SortMethod pluginSortMethod; 63 | 64 | OwnedArray faustDSPFiles; 65 | 66 | PMixLogger logger; 67 | 68 | std::unique_ptr appProperties; 69 | 70 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixAudioEngine) 71 | }; 72 | -------------------------------------------------------------------------------- /Source/pMixCodeEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixCodeEditor.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixAudioEngine.h" 14 | #include "pMixSVGDisplay.h" 15 | #include "pMixConsole.h" 16 | #include "pMixGraphEditor.h" 17 | 18 | namespace CodeEditorBottomViewIDs 19 | { 20 | static const int diagram = 1; 21 | static const int console = 2; 22 | }; 23 | 24 | class CompileButton : public TextButton 25 | { 26 | public: 27 | CompileButton(String buttonName) 28 | : TextButton(buttonName) 29 | , highlight(false) 30 | { 31 | } 32 | 33 | ~CompileButton() 34 | { 35 | } 36 | 37 | void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) 38 | { 39 | LookAndFeel& lf = getLookAndFeel(); 40 | 41 | Colour bgColour; 42 | 43 | if(highlight) 44 | bgColour = getToggleState() ? findColour(buttonOnColourId) : Colours::red; 45 | else 46 | bgColour = findColour (getToggleState() ? buttonOnColourId : buttonColourId); 47 | 48 | lf.drawButtonBackground (g, *this,bgColour, isMouseOverButton, isButtonDown); 49 | 50 | lf.drawButtonText (g, *this, isMouseOverButton, isButtonDown); 51 | } 52 | 53 | void setHighlight(bool v) 54 | { 55 | highlight = v; 56 | repaint(); 57 | } 58 | 59 | private: 60 | bool highlight; 61 | }; 62 | 63 | class CodeEditorToolbarItemFactory; 64 | 65 | class CodeEditor : public Component 66 | , public ChangeListener 67 | , public Button::Listener 68 | , public ApplicationCommandTarget 69 | { 70 | public: 71 | CodeEditor(PMixAudioEngine& audioEngine, GraphEditor& graphEditor); 72 | ~CodeEditor(); 73 | void paint (Graphics& g) override; 74 | 75 | void resized() override; 76 | 77 | void changeListenerCallback (ChangeBroadcaster* source) override; 78 | void buttonClicked (Button* button) override; 79 | 80 | //ApplicationCommandTarget 81 | ApplicationCommandTarget* getNextCommandTarget() override; 82 | void getAllCommands (Array & commands) override; 83 | void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override; 84 | bool perform (const InvocationInfo& info) override; 85 | 86 | void clear(); 87 | 88 | void showConsoleOrBrowser(int which); 89 | 90 | CompileButton* compileButton; 91 | 92 | private: 93 | FaustTokeniser tokeniser; 94 | CodeDocument codeDocument; 95 | 96 | std::unique_ptr toolBar; 97 | 98 | std::unique_ptr editor; 99 | std::unique_ptr svgDisplay; 100 | std::unique_ptr console; 101 | 102 | PMixAudioEngine& audioEngine; 103 | GraphEditor& graphEditor; 104 | 105 | StretchableLayoutManager verticalLayout; 106 | std::unique_ptr dividerBar1, dividerBar2; 107 | FaustAudioPluginInstance* selectedFaustAudioPluginInstance; 108 | NodeID selectedNodeId; 109 | int show; 110 | File lastDirectory; 111 | 112 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CodeEditor); 113 | }; 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Source/pMixCommandIDs.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixCommandIDs.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | namespace MenuIDs 13 | { 14 | static const int fileMenu = 0x000000; 15 | static const int editMenu = 0x000001; 16 | static const int viewMenu = 0x000002; 17 | static const int codeMenu = 0x000003; 18 | static const int optionsMenu = 0x000004; 19 | } 20 | 21 | namespace CommandIDs 22 | { 23 | static const int faustDSPFilesMenu = 0x100000; 24 | // ... 0x100064 reserved 25 | 26 | static const int recentFilesMenu = 0x200000; 27 | // ... 0x200064 reserved 28 | static const int newdoc = 0x2FFFFF; 29 | static const int showParameters = 0x300000; 30 | static const int open = 0x300001; 31 | static const int save = 0x300002; 32 | static const int saveAs = 0x300003; 33 | static const int showPrefs = 0x300004; 34 | static const int aboutBox = 0x300005; 35 | static const int cut = StandardApplicationCommandIDs::cut; 36 | static const int copy = StandardApplicationCommandIDs::copy; 37 | static const int paste = StandardApplicationCommandIDs::paste; 38 | static const int del = StandardApplicationCommandIDs::del; 39 | static const int quit = StandardApplicationCommandIDs::quit; 40 | static const int undo = StandardApplicationCommandIDs::undo; 41 | static const int redo = StandardApplicationCommandIDs::redo; 42 | static const int selectAll = StandardApplicationCommandIDs::selectAll; 43 | static const int deselectAll = StandardApplicationCommandIDs::deselectAll; 44 | static const int zoomIn = 0x30000A; 45 | static const int zoomOut = 0x30000B; 46 | static const int zoomNormal = 0x30000C; 47 | 48 | static const int showISpace = 0x30000D; 49 | static const int showConsole = 0x30000E; 50 | static const int showCodeEditor = 0x30000F; 51 | 52 | static const int newAudioInput = 0x300010; 53 | static const int newAudioOutput = 0x300011; 54 | static const int newMIDIInput = 0x300012; 55 | static const int newMIDIOutput = 0x300013; 56 | static const int newFaustEffect = 0x300014; 57 | 58 | static const int floatConsole = 0x300015; 59 | static const int floatISpace = 0x300016; 60 | static const int floatCodeEditor = 0x300017; 61 | //static const int floatParameters = 0x300018; 62 | static const int faustDSPFiles = 0x300019; 63 | 64 | static const int compile = 0x300020; 65 | } 66 | 67 | 68 | -------------------------------------------------------------------------------- /Source/pMixConsole.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixConsole.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixConsole.h" 11 | #include "pMixLogger.h" 12 | 13 | PMixConsole::PMixConsole() 14 | : listBoxModel (messageList) 15 | { 16 | setOpaque (true); 17 | 18 | addAndMakeVisible (messageListBox); 19 | messageListBox.setModel (&listBoxModel); 20 | messageListBox.setColour (ListBox::backgroundColourId, Colour (0x32ffffff)); 21 | messageListBox.setColour (ListBox::outlineColourId, Colours::black); 22 | } 23 | 24 | PMixConsole::~PMixConsole() 25 | { 26 | } 27 | 28 | void PMixConsole::paint (Graphics& g) 29 | { 30 | g.fillAll (Colours::white); 31 | } 32 | 33 | void PMixConsole::resized() 34 | { 35 | Rectangle area (getLocalBounds()); 36 | messageListBox.setBounds (area.reduced (8)); 37 | } 38 | 39 | void PMixConsole::postMessageToList (const String& message) 40 | { 41 | (new IncomingMessageCallback (this, message))->post(); 42 | } 43 | 44 | void PMixConsole::addMessageToList (const String& message) 45 | { 46 | messageList.add (message); 47 | triggerAsyncUpdate(); 48 | } 49 | 50 | void PMixConsole::handleAsyncUpdate() 51 | { 52 | messageListBox.updateContent(); 53 | messageListBox.scrollToEnsureRowIsOnscreen (messageList.size() - 1); 54 | messageListBox.repaint(); 55 | } 56 | 57 | void PMixConsole::changeListenerCallback (ChangeBroadcaster* source) 58 | { 59 | PMixLogger* logger = dynamic_cast(source); 60 | 61 | if (logger) 62 | { 63 | String message; 64 | while (logger->getLastMessage(message)) 65 | { 66 | postMessageToList(message); 67 | } 68 | } 69 | } 70 | 71 | void PMixConsole::clear() 72 | { 73 | messageList.clear(); 74 | messageListBox.updateContent(); 75 | messageListBox.scrollToEnsureRowIsOnscreen (messageList.size() - 1); 76 | messageListBox.repaint(); 77 | } -------------------------------------------------------------------------------- /Source/pMixConsole.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixConsole.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class PMixConsoleListBoxModel : public ListBoxModel 15 | { 16 | public: 17 | PMixConsoleListBoxModel (const Array& list) 18 | : messageList (list) 19 | { 20 | } 21 | 22 | int getNumRows() override { return messageList.size(); } 23 | 24 | void paintListBoxItem (int row, Graphics& g, int width, int height, bool rowIsSelected) override 25 | { 26 | if (rowIsSelected) 27 | g.fillAll (Colours::blue.withAlpha (0.2f)); 28 | 29 | if (isPositiveAndBelow (row, messageList.size())) 30 | { 31 | g.setColour (Colours::black); 32 | const String& message = messageList.getReference (row); 33 | 34 | g.drawText (message, 35 | Rectangle (width, height).reduced (4, 0), 36 | Justification::centredLeft, true); 37 | } 38 | } 39 | 40 | private: 41 | const Array& messageList; 42 | 43 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixConsoleListBoxModel) 44 | }; 45 | 46 | class PMixConsole : public Component 47 | , private AsyncUpdater 48 | , public ChangeListener 49 | { 50 | public: 51 | PMixConsole(); 52 | ~PMixConsole(); 53 | 54 | void paint (Graphics& g) override; 55 | 56 | void resized() override; 57 | 58 | void changeListenerCallback (ChangeBroadcaster* source) override; 59 | 60 | void clear(); 61 | 62 | private: 63 | ListBox messageListBox; 64 | Array messageList; 65 | PMixConsoleListBoxModel listBoxModel; 66 | 67 | 68 | // This is used to dispach an incoming message to the message thread 69 | struct IncomingMessageCallback : public CallbackMessage 70 | { 71 | IncomingMessageCallback (PMixConsole* d, const String& m) 72 | : PMixConsole (d), message (m) {} 73 | 74 | void messageCallback() override 75 | { 76 | if (PMixConsole != nullptr) 77 | PMixConsole->addMessageToList (message); 78 | } 79 | 80 | Component::SafePointer PMixConsole; 81 | String message; 82 | }; 83 | 84 | void postMessageToList (const String& message); 85 | void addMessageToList (const String& message); 86 | 87 | void handleAsyncUpdate() override; 88 | 89 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixConsole); 90 | }; 91 | 92 | 93 | -------------------------------------------------------------------------------- /Source/pMixConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixConstants.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | const char* const filenameSuffix = ".pmix"; 15 | const char* const filenameWildcard = "*.pmix"; 16 | 17 | const int kUIStatusNone = 0; 18 | const int kUIStatusEmbed = 1; 19 | //const int kUIStatusFloating = 1; 20 | 21 | using NodeID = juce::AudioProcessorGraph::NodeID; 22 | 23 | #define DEFAULT_FAUST_DSP_SEARCHPATH "~/Library/Application Support/pMix2/FaustNodes" 24 | 25 | #define OFFSET_BETWEEN_PINS 15 26 | #define PINS_LEFT_OFFSET 10 27 | #define MIN_RADIUS 50.f 28 | #define RADIUS_RANGE 100.f 29 | 30 | #define MAX_NAUDIO_IO 32 31 | 32 | #if JUCE_MAC 33 | #define FAUST_LIBRARY_PATH "/Contents/Resources/" 34 | #elif JUCE_WIN32 35 | //#define FAUST_LIBRARY_PATH "\\faustgen-resources\\" 36 | #endif 37 | 38 | #if JUCE_MAC || JUCE_LINUX 39 | #define FAUST_DRAW_PATH "/var/tmp/" 40 | #elif JUCE_WIN32 41 | //#define FAUST_DRAW_PATH "\\faustgen-resources\\" 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /Source/pMixDefaultColours.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixDefaultColours.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class PMixDefaultColours 15 | { 16 | public: 17 | PMixDefaultColours() 18 | : idx(0) 19 | { 20 | mColours.add(Colours::red); 21 | mColours.add(Colours::green); 22 | mColours.add(Colours::blue); 23 | mColours.add(Colours::yellow); 24 | mColours.add(Colours::magenta); 25 | mColours.add(Colours::skyblue); 26 | } 27 | 28 | ~PMixDefaultColours() 29 | { 30 | 31 | } 32 | 33 | Colour getNextColour() 34 | { 35 | Colour nextColour = mColours[idx++]; 36 | 37 | if (idx > mColours.size()) 38 | idx = 0; 39 | 40 | return nextColour; 41 | } 42 | 43 | private: 44 | Array mColours; 45 | uint32 idx; 46 | }; 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Source/pMixDocument.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixDocument.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixDefaultColours.h" 14 | #include "pMixConstants.h" 15 | 16 | class PMixAudioEngine; 17 | 18 | class PMixDocument : public FileBasedDocument 19 | , public Timer 20 | 21 | { 22 | public: 23 | PMixDocument (PMixAudioEngine& audioEngine); 24 | ~PMixDocument(); 25 | 26 | void timerCallback(); 27 | 28 | DynamicObject* getPresetWithUID(NodeID nodeID, int presetId) const; 29 | void addPreset(NodeID nodeID, double x, double y); 30 | void setPresetPosition(NodeID nodeID, int presetId, double x, double y); 31 | void getPresetPosition(NodeID nodeID, int presetId, double& x, double& y) const; 32 | double getPresetWeight(NodeID nodeID, int presetId); 33 | void removePreset(NodeID nodeID, int presetId); 34 | void setPresetName(NodeID nodeID, int presetId, String newName); 35 | int getNumPresetsForNode(NodeID nodeID); 36 | 37 | void setNodeIPos(NodeID nodeID, double x, double y); 38 | void getNodeIPos(NodeID nodeID, double& x, double& y) const; 39 | void updateCoefficients(const AudioProcessorGraph::Node::Ptr node); 40 | 41 | void setNodeColour(NodeID nodeID, const Colour& colour); 42 | Colour getNodeColour(NodeID nodeID) const; 43 | 44 | int getNumNodes() const noexcept; 45 | const AudioProcessorGraph::Node::Ptr getNode (int index) const noexcept; 46 | const AudioProcessorGraph::Node::Ptr getNodeForId (NodeID nodeID) const noexcept; 47 | 48 | NodeID addNode(const PluginDescription* desc, double x, double y); 49 | void removeNode(NodeID nodeID); 50 | void disconnectNode(NodeID nodeID); 51 | 52 | void setNodeUIStatus(NodeID nodeID, uint32 uiStatus); 53 | 54 | bool getParameterIsInterpolated(NodeID nodeID, int paramIdx); 55 | void setParameterToInterpolate(NodeID nodeID, int paramIdx, bool interpolate); 56 | 57 | void removeIllegalConnections(); 58 | void setNodePosition(NodeID nodeID, double x, double y); 59 | void getNodePosition(NodeID nodeID, double& x, double& y) const; 60 | int getNumConnections() const noexcept; 61 | const AudioProcessorGraph::Connection getConnection (int index) const noexcept; 62 | bool isConnected(NodeID sourceNodeId, int sourceNodeChannel, NodeID destNodeId, int destNodeChannel) const noexcept; 63 | bool canConnect(NodeID sourceNodeId, int sourceNodeChannel, NodeID destNodeId, int destNodeChannel) const noexcept; 64 | bool addConnection(NodeID sourceNodeId, int sourceNodeChannel, NodeID destNodeId, int destNodeChannel); 65 | void removeConnection(int index); 66 | void removeConnection(NodeID sourceNodeId, int sourceNodeChannel, NodeID destNodeId, int destNodeChannel); 67 | void clear(); 68 | 69 | std::unique_ptr createXml() const; 70 | void createNodeFromXml(XmlElement& xml, const String& newSourceCode = String()); 71 | void restoreFromXml(const XmlElement& xml); 72 | static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcept; 73 | 74 | String getDocumentTitle(); 75 | Result loadDocument(const File& file); 76 | Result saveDocument(const File& file); 77 | 78 | File getLastDocumentOpened(); 79 | void setLastDocumentOpened (const File& file); 80 | // The special channel index used to refer to a node's midi channel 81 | static const int midiChannelNumber; 82 | 83 | void setSnappingGrid (int numPixels, bool active, bool shown); 84 | 85 | int getSnappingGridSize() const noexcept { return snapGridPixels; } 86 | bool isSnapActive(bool disableIfCtrlKeyDown) const noexcept; 87 | bool isSnapShown() const noexcept { return snapShown; } 88 | 89 | int snapPosition (int pos) const noexcept; 90 | void setComponentOverlayOpacity (float alpha); 91 | float getComponentOverlayOpacity() const noexcept { return componentOverlayOpacity; } 92 | 93 | void beginTransaction(); 94 | void beginTransaction (const String& name); 95 | bool perform (UndoableAction* const action, const String& actionName); 96 | 97 | UndoManager& getUndoManager() noexcept { return undoManager; } 98 | 99 | void initialize(); 100 | 101 | String getLibraryPath(); 102 | 103 | private: 104 | UndoManager undoManager; 105 | PMixAudioEngine& audioEngine; 106 | uint32 lastUID; 107 | uint32 getNextUID() noexcept; 108 | 109 | int lastPresetUID; 110 | int getNextPresetUID() noexcept; 111 | 112 | int snapGridPixels; 113 | bool snapActive, snapShown; 114 | float componentOverlayOpacity; 115 | PMixDefaultColours defaultColours; 116 | const File drawPath; 117 | 118 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixDocument) 119 | }; 120 | 121 | 122 | -------------------------------------------------------------------------------- /Source/pMixFileBrowser.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixFileBrowser.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class ThumbnailComponent : public Component, 15 | public ChangeListener, 16 | public FileDragAndDropTarget, 17 | public ChangeBroadcaster, 18 | private ScrollBar::Listener, 19 | private Timer 20 | { 21 | public: 22 | ThumbnailComponent (AudioFormatManager& formatManager, AudioTransportSource& transportSource_, Slider& slider); 23 | ~ThumbnailComponent(); 24 | void setFile (const File& file); 25 | File getLastDroppedFile() const noexcept; 26 | void setZoomFactor (double amount); 27 | void setRange (Range newRange); 28 | 29 | void setFollowsTransport (bool shouldFollow); 30 | void paint (Graphics& g) override; 31 | 32 | void resized() override; 33 | void changeListenerCallback (ChangeBroadcaster*) override; 34 | bool isInterestedInFileDrag (const StringArray& /*files*/) override; 35 | void filesDropped (const StringArray& files, int /*x*/, int /*y*/) override; 36 | void mouseDown (const MouseEvent& e) override; 37 | void mouseDrag (const MouseEvent& e) override; 38 | void mouseUp (const MouseEvent&) override; 39 | 40 | void mouseWheelMove (const MouseEvent&, const MouseWheelDetails& wheel) override; 41 | 42 | private: 43 | AudioTransportSource& transportSource; 44 | Slider& zoomSlider; 45 | ScrollBar scrollbar; 46 | 47 | AudioThumbnailCache thumbnailCache; 48 | AudioThumbnail thumbnail; 49 | Range visibleRange; 50 | bool isFollowingTransport; 51 | File lastFileDropped; 52 | 53 | DrawableRectangle currentPositionMarker; 54 | 55 | float timeToX (const double time) const; 56 | double xToTime (const float x) const; 57 | bool canMoveTransport() const noexcept; 58 | void scrollBarMoved (ScrollBar* scrollBarThatHasMoved, double newRangeStart) override; 59 | void timerCallback() override; 60 | void updateCursorPosition(); 61 | }; 62 | 63 | class FileBrowser : public Component, 64 | private FileBrowserListener, 65 | private Button::Listener, 66 | private Slider::Listener, 67 | private ChangeListener 68 | { 69 | public: 70 | FileBrowser(); 71 | ~FileBrowser(); 72 | 73 | void paint (Graphics& g) override; 74 | void resized() override; 75 | 76 | private: 77 | //AudioDeviceManager& deviceManager; 78 | AudioFormatManager formatManager; 79 | TimeSliceThread thread; 80 | DirectoryContentsList directoryList; 81 | 82 | AudioSourcePlayer audioSourcePlayer; 83 | AudioTransportSource transportSource; 84 | std::unique_ptr currentAudioFileSource; 85 | 86 | std::unique_ptr thumbnail; 87 | Label zoomLabel; 88 | Slider zoomSlider; 89 | ToggleButton followTransportButton; 90 | TextButton startStopButton; 91 | FileTreeComponent fileTreeComp; 92 | 93 | void showFile (const File& file); 94 | 95 | void loadFileIntoTransport (const File& audioFile); 96 | 97 | void selectionChanged() override; 98 | 99 | void fileClicked (const File&, const MouseEvent&) override {} 100 | void fileDoubleClicked (const File&) override {} 101 | void browserRootChanged (const File&) override {} 102 | 103 | void sliderValueChanged (Slider* sliderThatWasMoved) override; 104 | void buttonClicked (Button* buttonThatWasClicked) override; 105 | void changeListenerCallback (ChangeBroadcaster* source) override; 106 | 107 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileBrowser); 108 | }; 109 | 110 | 111 | -------------------------------------------------------------------------------- /Source/pMixFloatWindow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixFloatWindow.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixFloatWindow.h" 11 | #include "pMixMainComponent.h" 12 | 13 | PMixFloatWindow::PMixFloatWindow (const String &name, Component* parent, int windowID) 14 | : DocumentWindow(name, Colours::white, DocumentWindow::allButtons, true) 15 | , parent(parent) 16 | , windowID(windowID) 17 | { 18 | setUsingNativeTitleBar(true); 19 | centreWithSize (400, 400); 20 | setResizable(true, true); 21 | } 22 | 23 | PMixFloatWindow::~PMixFloatWindow() 24 | { 25 | }; 26 | 27 | void PMixFloatWindow::closeButtonPressed() 28 | { 29 | dynamic_cast(parent)->floatWindow(windowID, false); 30 | } 31 | 32 | void PMixFloatWindow::attachContent(Component* content) 33 | { 34 | setContentNonOwned(content, true); 35 | } -------------------------------------------------------------------------------- /Source/pMixFloatWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixFloatWindow.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class PMixFloatWindow : public DocumentWindow 15 | { 16 | public: 17 | PMixFloatWindow (const String &name, Component* parent, int windowID); 18 | ~PMixFloatWindow(); 19 | 20 | void closeButtonPressed(); 21 | 22 | void attachContent(Component* content); 23 | private: 24 | Component *parent; 25 | int windowID; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /Source/pMixGenericEditor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGenericEditor.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixGenericEditor.h" 11 | 12 | 13 | PMixParamSlider::PMixParamSlider (PMixAudioEngine &audioEngine, AudioProcessor& p, int paramIdx, NodeID nodeID) 14 | : audioEngine(audioEngine) 15 | , owner (p) 16 | , index (paramIdx) 17 | , nodeID(nodeID) 18 | { 19 | const int steps = owner.getParameterNumSteps (index); 20 | 21 | if (steps > 1 && steps < 0x7fffffff) 22 | setRange (0.0, 1.0, 1.0 / (steps - 1.0)); 23 | else 24 | setRange (0.0, 1.0); 25 | 26 | setSliderStyle (Slider::LinearHorizontal); 27 | setTextBoxStyle (Slider::NoTextBox, false, 0, 0); 28 | //setTextBoxIsEditable (true); 29 | //setPopupMenuEnabled(true); 30 | setScrollWheelEnabled (false); 31 | } 32 | 33 | void PMixParamSlider::valueChanged() 34 | { 35 | const float newVal = (float) getValue(); 36 | 37 | if (owner.getParameter (index) != newVal) 38 | { 39 | owner.setParameterNotifyingHost (index, newVal); 40 | updateText(); 41 | } 42 | } 43 | 44 | String PMixParamSlider::getTextFromValue (double value) 45 | { 46 | return owner.getParameterText (index) + " " + owner.getParameterLabel (index).trimEnd(); 47 | } 48 | 49 | Colour PMixParamSlider::getSliderColour() 50 | { 51 | Colour sliderColour; 52 | if (audioEngine.getDoc().getParameterIsInterpolated(nodeID, index)) 53 | sliderColour = audioEngine.getDoc().getNodeColour(nodeID); 54 | else 55 | sliderColour = Colours::white; 56 | 57 | return sliderColour; 58 | } 59 | 60 | PMixProcessorParameterPropertyComp::PMixProcessorParameterPropertyComp (PMixAudioEngine &audioEngine, const String& name, AudioProcessor& p, int paramIdx, NodeID nodeID) 61 | : PropertyComponent (name) 62 | , audioEngine(audioEngine) 63 | , owner (p) 64 | , index (paramIdx) 65 | , paramHasChanged (false) 66 | , slider (audioEngine, p, paramIdx, nodeID) 67 | , nodeID(nodeID) 68 | { 69 | startTimer (100); 70 | setPreferredHeight(16); 71 | //slider.setPopupDisplayEnabled(true, 0); 72 | addAndMakeVisible (slider); 73 | owner.addListener (this); 74 | } 75 | 76 | PMixProcessorParameterPropertyComp::~PMixProcessorParameterPropertyComp() 77 | { 78 | owner.removeListener (this); 79 | } 80 | 81 | void PMixProcessorParameterPropertyComp::refresh() 82 | { 83 | paramHasChanged = false; 84 | 85 | if (slider.getThumbBeingDragged() < 0) 86 | slider.setValue (owner.getParameter (index), dontSendNotification); 87 | 88 | slider.updateText(); 89 | } 90 | 91 | void PMixProcessorParameterPropertyComp::audioProcessorParameterChanged (AudioProcessor* p, int parameterIndex, float newValue) 92 | { 93 | if (parameterIndex == index) 94 | paramHasChanged = true; 95 | } 96 | 97 | void PMixProcessorParameterPropertyComp::timerCallback() 98 | { 99 | if (paramHasChanged) 100 | { 101 | refresh(); 102 | startTimerHz (50); 103 | } 104 | else 105 | { 106 | startTimer (jmin (1000 / 4, getTimerInterval() + 10)); 107 | } 108 | } 109 | 110 | void PMixProcessorParameterPropertyComp::mouseDown (const MouseEvent& e) 111 | { 112 | bool isInterpolated = audioEngine.getDoc().getParameterIsInterpolated(nodeID, index); 113 | 114 | if (e.mods.isPopupMenu()) 115 | { 116 | PopupMenu m; 117 | 118 | if (isInterpolated) 119 | m.addItem (1, "Don't Interpolate Parameter"); 120 | else 121 | m.addItem (1, "Interpolate Parameter"); 122 | 123 | const int r = m.show(); 124 | 125 | if (r == 1) 126 | { 127 | audioEngine.getDoc().setParameterToInterpolate(nodeID, index, !isInterpolated); 128 | repaint(); 129 | } 130 | } 131 | else if(e.mods.isShiftDown()) 132 | { 133 | audioEngine.getDoc().setParameterToInterpolate(nodeID, index, !isInterpolated); 134 | repaint(); 135 | } 136 | } 137 | 138 | PMixGenericAudioProcessorEditor::PMixGenericAudioProcessorEditor (PMixAudioEngine &audioEngine, AudioProcessor* const p, NodeID nodeID) 139 | : AudioProcessorEditor (p) 140 | , audioEngine(audioEngine) 141 | { 142 | jassert (p != nullptr); 143 | //setOpaque (true); 144 | 145 | addAndMakeVisible (panel); 146 | 147 | Array params; 148 | 149 | const int numParams = p->getNumParameters(); 150 | int totalHeight = 0; 151 | 152 | for (int i = 0; i < numParams; ++i) 153 | { 154 | String name (p->getParameterName (i)); 155 | if (name.trim().isEmpty()) 156 | name = "Unnamed"; 157 | 158 | PMixProcessorParameterPropertyComp* const pc = new PMixProcessorParameterPropertyComp (audioEngine, name, *p, i, nodeID); 159 | params.add (pc); 160 | totalHeight += pc->getPreferredHeight(); 161 | } 162 | 163 | panel.addProperties (params); 164 | 165 | setSize (200, jlimit (25, 400, totalHeight)); 166 | } 167 | 168 | PMixGenericAudioProcessorEditor::~PMixGenericAudioProcessorEditor() 169 | { 170 | } 171 | 172 | void PMixGenericAudioProcessorEditor::paint (Graphics& g) 173 | { 174 | //g.fillAll (Colours::white); 175 | } 176 | 177 | void PMixGenericAudioProcessorEditor::resized() 178 | { 179 | panel.setBounds (getLocalBounds()); 180 | } 181 | 182 | -------------------------------------------------------------------------------- /Source/pMixGenericEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGenericEditor.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixAudioEngine.h" 14 | 15 | class PMixParamSlider : public Slider 16 | { 17 | public: 18 | PMixParamSlider (PMixAudioEngine &audioEngine, AudioProcessor& p, int paramIdx, NodeID nodeID); 19 | 20 | void valueChanged() override; 21 | String getTextFromValue (double value) override; 22 | 23 | Colour getSliderColour(); 24 | 25 | private: 26 | PMixAudioEngine &audioEngine; 27 | AudioProcessor& owner; 28 | const int index; 29 | NodeID nodeID; 30 | 31 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixParamSlider) 32 | }; 33 | 34 | class PMixProcessorParameterPropertyComp : public PropertyComponent 35 | , private AudioProcessorListener 36 | , private Timer 37 | { 38 | public: 39 | PMixProcessorParameterPropertyComp (PMixAudioEngine &audioEngine, const String& name, AudioProcessor& p, int paramIdx, NodeID nodeID); 40 | ~PMixProcessorParameterPropertyComp(); 41 | 42 | void refresh() override; 43 | 44 | void audioProcessorChanged (AudioProcessor*) override {} 45 | 46 | void audioProcessorParameterChanged (AudioProcessor* p, int parameterIndex, float newValue) override; 47 | void timerCallback() override; 48 | void mouseDown (const MouseEvent& e) override; 49 | private: 50 | PMixAudioEngine &audioEngine; 51 | AudioProcessor& owner; 52 | const int index; 53 | bool volatile paramHasChanged; 54 | PMixParamSlider slider; 55 | NodeID nodeID; 56 | 57 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixProcessorParameterPropertyComp) 58 | }; 59 | 60 | class PMixGenericAudioProcessorEditor : public AudioProcessorEditor 61 | { 62 | public: 63 | PMixGenericAudioProcessorEditor (PMixAudioEngine &audioEngine, AudioProcessor* owner, NodeID nodeID); 64 | ~PMixGenericAudioProcessorEditor(); 65 | 66 | void paint (Graphics&) override; 67 | void resized() override; 68 | 69 | int getContentHeight() { return panel.getTotalContentHeight(); } 70 | 71 | private: 72 | PropertyPanel panel; 73 | PMixAudioEngine &audioEngine; 74 | 75 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixGenericAudioProcessorEditor) 76 | }; 77 | 78 | 79 | -------------------------------------------------------------------------------- /Source/pMixGraphEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGraphEditor.h 5 | based on JUCE demo host 6 | Author: Oliver Larkin 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "pMixAudioEngine.h" 14 | #include "pMixPluginWindow.h" 15 | #include "pMixGraphEditorParts.h" 16 | 17 | class NodeComponent; 18 | class ConnectorComponent; 19 | class PinComponent; 20 | 21 | class GraphEditor : public Component, 22 | public ChangeListener, 23 | public LassoSource, 24 | public ChangeBroadcaster, 25 | public ApplicationCommandTarget, 26 | public FileDragAndDropTarget 27 | { 28 | public: 29 | GraphEditor (PMixAudioEngine& audioEngine); 30 | ~GraphEditor(); 31 | 32 | void paint (Graphics& g) override; 33 | void mouseDown (const MouseEvent& e) override; 34 | void mouseDrag (const MouseEvent& e) override; 35 | void mouseUp (const MouseEvent& e) override; 36 | void mouseDoubleClick (const MouseEvent&) override; 37 | 38 | void createNewNode (const PluginDescription* desc, int x, int y); 39 | 40 | NodeComponent* getComponentForNode (NodeID nodeID) const; 41 | ConnectorComponent* getComponentForConnection (const AudioProcessorGraph::Connection& conn) const; 42 | PinComponent* findPinAt (int x, int y) const; 43 | 44 | void resized() override; 45 | void changeListenerCallback (ChangeBroadcaster* source) override; 46 | 47 | void updateComponents(); 48 | void clear(); 49 | 50 | void beginConnectorDrag (NodeID sourceNodeId, int sourceNodeChannel, NodeID destNodeId, int destNodeChannel, const MouseEvent& e); 51 | void dragConnector (const MouseEvent& e); 52 | void endDraggingConnector (const MouseEvent& e); 53 | 54 | void clearSelection(); 55 | void deleteSelection(); 56 | void selectAll(); 57 | 58 | void updateFaustNode (NodeID nodeID, String& newSourceCode); 59 | 60 | //LassoSource 61 | void findLassoItemsInArea (Array & results, const Rectangle& area) override; 62 | SelectedItemSet& getLassoSelection() override; 63 | 64 | //ApplicationCommandTarget 65 | ApplicationCommandTarget* getNextCommandTarget() override; 66 | void getAllCommands (Array & commands) override; 67 | void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override; 68 | bool perform (const InvocationInfo& info) override; 69 | 70 | // FileDragAndDropTarget 71 | bool isInterestedInFileDrag (const StringArray& files) override; 72 | void fileDragEnter (const StringArray& files, int x, int y) override; 73 | void fileDragMove (const StringArray& files, int x, int y) override; 74 | void fileDragExit (const StringArray& files) override; 75 | void filesDropped (const StringArray& files, int x, int y) override; 76 | 77 | private: 78 | PMixAudioEngine& audioEngine; 79 | LassoComponent lassoComp; 80 | SelectedItemSet selectedItems; 81 | std::unique_ptr draggingConnector; 82 | bool somethingIsBeingDraggedOver; 83 | 84 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphEditor) 85 | }; 86 | 87 | -------------------------------------------------------------------------------- /Source/pMixGraphEditorActions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGraphEditorActions.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixGraphEditorActions.h" 11 | #include "pMixPluginWindow.h" 12 | 13 | CreateNodeAction::CreateNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, const PluginDescription* desc, double x, double y) noexcept 14 | : audioEngine(audioEngine) 15 | , graphEditor(graphEditor) 16 | , x(x) 17 | , y(y) 18 | , desc(*desc) 19 | { 20 | } 21 | 22 | bool CreateNodeAction::perform() 23 | { 24 | nodeID = audioEngine.getDoc().addNode (&desc, x, y); 25 | 26 | if (nodeID < NodeID(0xFFFFFFFF)) 27 | return true; 28 | else 29 | return false; 30 | 31 | } 32 | 33 | bool CreateNodeAction::undo() 34 | { 35 | PluginWindow::closeCurrentlyOpenWindowsFor (nodeID); 36 | audioEngine.getDoc().removeNode(nodeID); 37 | graphEditor.getLassoSelection().deselectAll(); 38 | 39 | return true; 40 | } 41 | 42 | int CreateNodeAction::getSizeInUnits() 43 | { 44 | return (int) sizeof (*this); //xxx should be more accurate 45 | } 46 | 47 | RemoveNodeAction::RemoveNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, NodeID nodeID) noexcept 48 | : audioEngine(audioEngine) 49 | , graphEditor(graphEditor) 50 | , nodeID(nodeID) 51 | { 52 | nodeXML = std::unique_ptr(audioEngine.getDoc().createNodeXml(audioEngine.getGraph().getNodeForId(juce::AudioProcessorGraph::NodeID(nodeID)))); 53 | } 54 | 55 | bool RemoveNodeAction::perform() 56 | { 57 | PluginWindow::closeCurrentlyOpenWindowsFor (nodeID); 58 | 59 | audioEngine.getDoc().removeNode (nodeID); 60 | 61 | if (nodeID < NodeID(0xFFFFFFFF)) 62 | return true; 63 | else 64 | return false; 65 | 66 | } 67 | 68 | bool RemoveNodeAction::undo() 69 | { 70 | audioEngine.getDoc().createNodeFromXml(*nodeXML); 71 | return true; 72 | } 73 | 74 | int RemoveNodeAction::getSizeInUnits() 75 | { 76 | return (int) sizeof (*this); //xxx should be more accurate 77 | } 78 | 79 | MoveNodeAction::MoveNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, NodeID nodeID, Point startPos, Point endPos) noexcept 80 | : audioEngine(audioEngine) 81 | , graphEditor(graphEditor) 82 | , nodeID(nodeID) 83 | , startPos(startPos) 84 | , endPos(endPos) 85 | { 86 | } 87 | 88 | bool MoveNodeAction::perform() 89 | { 90 | audioEngine.getDoc().setNodePosition (nodeID, endPos.x, endPos.y); 91 | graphEditor.updateComponents(); 92 | return true; 93 | } 94 | 95 | bool MoveNodeAction::undo() 96 | { 97 | audioEngine.getDoc().setNodePosition (nodeID, startPos.x, startPos.y); 98 | graphEditor.updateComponents(); 99 | return true; 100 | } 101 | 102 | int MoveNodeAction::getSizeInUnits() 103 | { 104 | return (int) sizeof (*this); //xxx should be more accurate 105 | } 106 | 107 | CreateConnectionAction::CreateConnectionAction (PMixAudioEngine& audioEngine, NodeID srcNodeId, int srcChannel, NodeID dstNodeId, int dstChannel) noexcept 108 | : audioEngine(audioEngine) 109 | , srcNodeId(srcNodeId) 110 | , srcChannel(srcChannel) 111 | , dstNodeId(dstNodeId) 112 | , dstChannel(dstChannel) 113 | { 114 | } 115 | 116 | bool CreateConnectionAction::perform() 117 | { 118 | return audioEngine.getDoc().addConnection (srcNodeId, srcChannel, dstNodeId, dstChannel); 119 | } 120 | 121 | bool CreateConnectionAction::undo() 122 | { 123 | audioEngine.getDoc().removeConnection (srcNodeId, srcChannel, dstNodeId, dstChannel); 124 | 125 | return true; 126 | } 127 | 128 | int CreateConnectionAction::getSizeInUnits() 129 | { 130 | return (int) sizeof (*this); //xxx should be more accurate 131 | } 132 | -------------------------------------------------------------------------------- /Source/pMixGraphEditorActions.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGraphEditorActions.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "pMixAudioEngine.h" 13 | #include "pMixGraphEditorParts.h" 14 | 15 | class NodeComponent; 16 | class ConnectorComponent; 17 | class PinComponent; 18 | 19 | #pragma mark - 20 | #pragma mark UndoableActions 21 | 22 | class CreateNodeAction : public UndoableAction 23 | { 24 | public: 25 | CreateNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, const PluginDescription* desc, double x, double y) noexcept; 26 | bool perform(); 27 | bool undo(); 28 | int getSizeInUnits(); 29 | 30 | private: 31 | PMixAudioEngine& audioEngine; 32 | GraphEditor& graphEditor; 33 | double x, y; 34 | PluginDescription desc; 35 | NodeID nodeID; 36 | JUCE_DECLARE_NON_COPYABLE (CreateNodeAction) 37 | }; 38 | 39 | class RemoveNodeAction : public UndoableAction 40 | { 41 | public: 42 | RemoveNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, NodeID nodeID) noexcept; 43 | bool perform(); 44 | bool undo(); 45 | int getSizeInUnits(); 46 | 47 | private: 48 | PMixAudioEngine& audioEngine; 49 | GraphEditor& graphEditor; 50 | NodeID nodeID; 51 | std::unique_ptr nodeXML; 52 | JUCE_DECLARE_NON_COPYABLE (RemoveNodeAction) 53 | }; 54 | 55 | class MoveNodeAction : public UndoableAction 56 | { 57 | public: 58 | MoveNodeAction (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, NodeID nodeID, Point startPos, Point endPos) noexcept; 59 | bool perform(); 60 | bool undo(); 61 | int getSizeInUnits(); 62 | 63 | private: 64 | PMixAudioEngine& audioEngine; 65 | GraphEditor& graphEditor; 66 | NodeID nodeID; 67 | Point startPos; 68 | Point endPos; 69 | JUCE_DECLARE_NON_COPYABLE (MoveNodeAction) 70 | }; 71 | 72 | class CreateConnectionAction : public UndoableAction 73 | { 74 | public: 75 | CreateConnectionAction (PMixAudioEngine& audioEngine, NodeID srcNodeId, int srcChannel, NodeID dstNodeId, int dstChannel) noexcept; 76 | bool perform(); 77 | bool undo(); 78 | int getSizeInUnits(); 79 | 80 | private: 81 | PMixAudioEngine& audioEngine; 82 | NodeID srcNodeId; 83 | int srcChannel; 84 | NodeID dstNodeId; 85 | int dstChannel; 86 | JUCE_DECLARE_NON_COPYABLE (CreateConnectionAction) 87 | }; 88 | 89 | -------------------------------------------------------------------------------- /Source/pMixGraphEditorParts.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixGraphEditorParts.h 5 | based on JUCE demo host 6 | Author: Oliver Larkin 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "pMixGraphEditor.h" 14 | #include "pMixGenericEditor.h" 15 | 16 | class GraphEditor; 17 | 18 | class PinComponent : public Component 19 | , public SettableTooltipClient 20 | { 21 | public: 22 | PinComponent (PMixAudioEngine& audio, NodeID nodeID, const int index_, const bool isInput_); 23 | void paint (Graphics& g) override; 24 | void mouseDown (const MouseEvent& e) override; 25 | void mouseDrag (const MouseEvent& e) override; 26 | void mouseUp (const MouseEvent& e) override; 27 | void mouseEnter (const MouseEvent& e) override; 28 | void mouseExit (const MouseEvent& e) override; 29 | 30 | NodeID nodeID; 31 | const int index; 32 | const bool isInput; 33 | bool mouseOver; 34 | int busIdx; 35 | 36 | private: 37 | PMixAudioEngine& audioEngine; 38 | 39 | GraphEditor* getGraphEditor() const noexcept; 40 | 41 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PinComponent) 42 | }; 43 | 44 | #pragma mark - 45 | #pragma mark NodeComponent 46 | 47 | class NodeComponent : public Component 48 | , public ChangeListener 49 | { 50 | public: 51 | NodeComponent (PMixAudioEngine& audioEngine, NodeID nodeID); 52 | ~NodeComponent(); 53 | void mouseDown (const MouseEvent& e) override; 54 | void mouseDrag (const MouseEvent& e) override; 55 | void mouseUp (const MouseEvent& e) override; 56 | void mouseDoubleClick (const MouseEvent&) override; 57 | 58 | bool hitTest (int x, int y) override; 59 | void paint (Graphics& g) override; 60 | void resized() override; 61 | 62 | void getPinPos (int index, bool isInput, float& x, float& y); 63 | void update(); 64 | 65 | void removeEditor(); 66 | 67 | void changeListenerCallback (ChangeBroadcaster* source) override; 68 | 69 | void bubbleMessage(String msg); 70 | 71 | public: 72 | PMixAudioEngine& audioEngine; 73 | NodeID nodeID; 74 | int numInputs, numOutputs; 75 | 76 | private: 77 | int pinSize; 78 | Point originalPos; 79 | Point endPos; 80 | Point startPos; 81 | Font font; 82 | int numIns, numOuts; 83 | bool moving; 84 | //DropShadowEffect shadow; 85 | friend class MoveNodeAction; 86 | PMixGenericAudioProcessorEditor* editor; 87 | Label* nodeName; 88 | bool highlight; 89 | GraphEditor* getGraphEditor() const noexcept; 90 | 91 | NodeComponent (const NodeComponent&); 92 | NodeComponent& operator= (const NodeComponent&); 93 | BubbleMessageComponent bbl; 94 | }; 95 | 96 | #pragma mark - 97 | #pragma mark ConnectorComponent 98 | 99 | class ConnectorComponent : public Component 100 | , public SettableTooltipClient 101 | { 102 | public: 103 | ConnectorComponent (PMixAudioEngine& audioEngine); 104 | void setInput (NodeID sourceNodeId_, const int sourceNodeChannel_); 105 | void setOutput (NodeID destNodeId_, const int destNodeChannel_); 106 | void dragStart (int x, int y); 107 | void dragEnd (int x, int y); 108 | void update(); 109 | void resizeToFit(); 110 | void getPoints (float& x1, float& y1, float& x2, float& y2) const; 111 | void paint (Graphics& g); 112 | bool hitTest (int x, int y); 113 | void mouseDown (const MouseEvent&); 114 | void mouseDrag (const MouseEvent& e); 115 | void mouseUp (const MouseEvent& e); 116 | void resized(); 117 | 118 | NodeID sourceNodeId, destNodeId; 119 | int sourceNodeChannel, destNodeChannel; 120 | 121 | private: 122 | PMixAudioEngine& audioEngine; 123 | float lastInputX, lastInputY, lastOutputX, lastOutputY; 124 | Path linePath, hitPath; 125 | bool dragging; 126 | 127 | GraphEditor* getGraphEditor() const noexcept; 128 | void getDistancesFromEnds (int x, int y, double& distanceFromStart, double& distanceFromEnd) const; 129 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConnectorComponent) 130 | }; 131 | 132 | -------------------------------------------------------------------------------- /Source/pMixInternalPluginFormat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInternalPluginFormat.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixInternalPluginFormat.h" 11 | 12 | InternalPluginFormat::InternalPluginFormat() 13 | { 14 | { 15 | AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode); 16 | p.fillInPluginDescription (audioOutDesc); 17 | } 18 | 19 | { 20 | AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::audioInputNode); 21 | p.fillInPluginDescription (audioInDesc); 22 | } 23 | 24 | { 25 | AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::midiInputNode); 26 | p.fillInPluginDescription (midiInDesc); 27 | } 28 | 29 | { 30 | AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::midiOutputNode); 31 | p.fillInPluginDescription (midiOutDesc); 32 | } 33 | } 34 | 35 | std::unique_ptr InternalPluginFormat::createInstance (const String& name) 36 | { 37 | if (name == audioOutDesc.name) return std::make_unique (AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode); 38 | if (name == audioInDesc.name) return std::make_unique (AudioProcessorGraph::AudioGraphIOProcessor::audioInputNode); 39 | if (name == midiInDesc.name) return std::make_unique (AudioProcessorGraph::AudioGraphIOProcessor::midiInputNode); 40 | if (name == midiOutDesc.name) return std::make_unique (AudioProcessorGraph::AudioGraphIOProcessor::midiOutputNode); 41 | 42 | return {}; 43 | } 44 | 45 | void InternalPluginFormat::createPluginInstance (const PluginDescription& desc, double, int initialBufferSize, PluginCreationCallback callback) 46 | { 47 | if (auto p = createInstance (desc.name)) 48 | callback (std::move (p), {}); 49 | else 50 | callback (nullptr, NEEDS_TRANS ("Invalid internal plugin name")); 51 | } 52 | 53 | const PluginDescription* InternalPluginFormat::getDescriptionFor (const InternalNodeType type) 54 | { 55 | switch (type) 56 | { 57 | case audioInputNode: return &audioInDesc; 58 | case audioOutputNode: return &audioOutDesc; 59 | case midiInputNode: return &midiInDesc; 60 | case midiOutputNode: return &midiOutDesc; 61 | default: break; 62 | } 63 | 64 | return 0; 65 | } 66 | 67 | void InternalPluginFormat::getAllTypes (OwnedArray & results) 68 | { 69 | for (int i = 0; i < (int) endOfNodeTypes; ++i) 70 | results.add (new PluginDescription (*getDescriptionFor ((InternalNodeType) i))); 71 | } 72 | 73 | 74 | bool InternalPluginFormat::isInternalFormat(String name) 75 | { 76 | if (name == "Audio Input") return true; 77 | if (name == "Audio Output") return true; 78 | if (name == "Midi Input") return true; 79 | if (name == "Midi Output") return true; 80 | return false; 81 | } 82 | -------------------------------------------------------------------------------- /Source/pMixInternalPluginFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInternalPluginFormat.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class InternalPluginFormat : public AudioPluginFormat 15 | { 16 | public: 17 | InternalPluginFormat(); 18 | ~InternalPluginFormat() {} 19 | 20 | enum InternalNodeType 21 | { 22 | audioInputNode = 0, 23 | audioOutputNode, 24 | midiInputNode, 25 | midiOutputNode, 26 | endOfNodeTypes 27 | }; 28 | 29 | const PluginDescription* getDescriptionFor (const InternalNodeType type); 30 | 31 | void getAllTypes (OwnedArray & results); 32 | 33 | String getName() const override { return "Internal"; } 34 | bool fileMightContainThisPluginType (const String&) override { return true; } 35 | FileSearchPath getDefaultLocationsToSearch() override { return FileSearchPath(); } 36 | bool canScanForPlugins() const override { return false; } 37 | void findAllTypesForFile (OwnedArray &, const String&) override {} 38 | bool doesPluginStillExist (const PluginDescription&) override { return true; } 39 | String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override { return fileOrIdentifier; } 40 | bool pluginNeedsRescanning (const PluginDescription&) override { return false; } 41 | StringArray searchPathsForPlugins (const FileSearchPath& directoriesToSearch, const bool recursive, bool allowPluginsWhichRequireAsynchronousInstantiation = false) override { return StringArray(); } 42 | 43 | static bool isInternalFormat(String name); 44 | bool isTrivialToScan() const override { return true; } 45 | 46 | private: 47 | std::unique_ptr createInstance (const String& name); 48 | void createPluginInstance (const PluginDescription&, double initialSampleRate, int initialBufferSize, PluginCreationCallback) override; 49 | 50 | bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept override { return false; } 51 | 52 | PluginDescription audioInDesc; 53 | PluginDescription audioOutDesc; 54 | PluginDescription midiInDesc; 55 | PluginDescription midiOutDesc; 56 | }; 57 | 58 | 59 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpace.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpace.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixInterpolationSpace.h" 11 | 12 | InterpolationSpace::InterpolationSpace (PMixAudioEngine& audioEngine, GraphEditor& graphEditor) 13 | { 14 | layout = std::make_unique(audioEngine, graphEditor); 15 | crosshairs = std::make_unique(audioEngine, *layout); 16 | addAndMakeVisible(*layout); 17 | addAndMakeVisible(*crosshairs); 18 | } 19 | 20 | InterpolationSpace::~InterpolationSpace () 21 | { 22 | } 23 | 24 | void InterpolationSpace::resized () 25 | { 26 | layout->setBounds(getLocalBounds()); 27 | crosshairs->setBounds(getLocalBounds()); 28 | } 29 | 30 | void InterpolationSpace::paint (Graphics& g) 31 | { 32 | g.fillAll (Colours::white); 33 | } 34 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpace.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpace.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixGraphEditor.h" 14 | #include "pMixAudioEngine.h" 15 | #include "pMixInterpolationSpaceLayout.h" 16 | #include "pMixInterpolationSpaceCrosshairs.h" 17 | 18 | class InterpolationSpace : public Component 19 | { 20 | public: 21 | InterpolationSpace (PMixAudioEngine& audioEngine, GraphEditor& graphEditor); 22 | ~InterpolationSpace (); 23 | void resized () override; 24 | void paint (Graphics& g) override; 25 | 26 | private: 27 | std::unique_ptr layout; 28 | std::unique_ptr crosshairs; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpaceActions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpaceActions.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixInterpolationSpaceActions.h" 11 | #include "pMixInterpolationSpaceLayout.h" 12 | 13 | MovePresetAction::MovePresetAction (PMixInterpolationSpaceLayout* interpolationSpace, const String& componentID, Rectangle startBounds, Rectangle endBounds) noexcept 14 | : interpolationSpace(interpolationSpace) 15 | , componentID(componentID) 16 | , startBounds(startBounds) 17 | , endBounds(endBounds) 18 | { 19 | } 20 | 21 | bool MovePresetAction::perform() 22 | { 23 | doStuff(endBounds); 24 | return true; 25 | } 26 | 27 | bool MovePresetAction::undo() 28 | { 29 | doStuff(startBounds); 30 | return true; 31 | } 32 | 33 | int MovePresetAction::getSizeInUnits() 34 | { 35 | return (int) sizeof (*this); //xxx should be more accurate 36 | } 37 | 38 | void MovePresetAction::doStuff(Rectangle& whichBounds) 39 | { 40 | InterpolationSpacePreset* presetComp = dynamic_cast(interpolationSpace->findChildWithID(componentID)); 41 | presetComp->setBounds(whichBounds); 42 | 43 | Point normalizedPos; 44 | normalizedPos.x = whichBounds.getCentreX() / (double) presetComp->getParentWidth(); 45 | normalizedPos.y = whichBounds.getCentreY() / (double) presetComp->getParentHeight(); 46 | presetComp->audioEngine.getDoc().setPresetPosition(presetComp->nodeID, presetComp->presetId, normalizedPos.x, normalizedPos.y); 47 | 48 | interpolationSpace->repaintPresetsForNode(presetComp->nodeID); 49 | } 50 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpaceActions.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpaceActions.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | 14 | class PMixInterpolationSpaceLayout; 15 | 16 | class MovePresetAction : public UndoableAction 17 | { 18 | public: 19 | MovePresetAction (PMixInterpolationSpaceLayout* interpolationSpace, const String& componentID, Rectangle startBounds, Rectangle endBounds) noexcept; 20 | bool perform() override; 21 | bool undo() override; 22 | int getSizeInUnits() override; 23 | 24 | void doStuff(Rectangle& whichBounds); 25 | 26 | private: 27 | PMixInterpolationSpaceLayout* interpolationSpace; 28 | String componentID; 29 | Rectangle startBounds; 30 | Rectangle endBounds; 31 | JUCE_DECLARE_NON_COPYABLE (MovePresetAction) 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpaceCrosshairs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpaceCrosshairs.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixInterpolationSpaceCrosshairs.h" 11 | 12 | InterpolationSpaceIPos::InterpolationSpaceIPos(PMixAudioEngine& audioEngine, PMixInterpolationSpaceLayout& layout, NodeID nodeID, Colour colour) 13 | : audioEngine(audioEngine) 14 | , layout(layout) 15 | , colour(colour) 16 | , nodeID(nodeID) 17 | { 18 | } 19 | 20 | InterpolationSpaceIPos::~InterpolationSpaceIPos () 21 | { 22 | } 23 | 24 | void InterpolationSpaceIPos::resized () 25 | { 26 | int radius = getWidth()/2; 27 | boundsConstrainer.setMinimumOnscreenAmounts(radius, radius, radius, radius); 28 | // label->centreWithSize(getWidth()-5, 20); 29 | } 30 | 31 | void InterpolationSpaceIPos::mouseDown (const MouseEvent& e) 32 | { 33 | setMouseCursor (MouseCursor::NoCursor); 34 | myDragger.startDraggingComponent (this, e); 35 | toFront (true); 36 | } 37 | 38 | void InterpolationSpaceIPos::mouseDrag (const MouseEvent& e) 39 | { 40 | Point normalizedPos; 41 | Rectangle bounds = getBounds(); 42 | normalizedPos.x = bounds.getCentreX() / (double) getParentWidth(); 43 | normalizedPos.y = bounds.getCentreY() / (double) getParentHeight(); 44 | audioEngine.getDoc().setNodeIPos(nodeID, normalizedPos.x, normalizedPos.y); 45 | 46 | myDragger.dragComponent (this, e, &boundsConstrainer); 47 | 48 | layout.repaintPresetsForNode(nodeID); 49 | } 50 | 51 | void InterpolationSpaceIPos::mouseUp (const MouseEvent& e) 52 | { 53 | setMouseCursor (MouseCursor::NormalCursor); 54 | } 55 | 56 | void InterpolationSpaceIPos::paint (Graphics& g) 57 | { 58 | g.setColour(colour); 59 | 60 | PathStrokeType stroke (2.5f); 61 | 62 | Path linePath; 63 | 64 | float mw = getWidth()/2.f; 65 | float mh = getHeight()/2.f; 66 | 67 | linePath.startNewSubPath(0, mh); 68 | linePath.lineTo(getWidth(), mh); 69 | linePath.startNewSubPath(mw, 0); 70 | linePath.lineTo(mw, getHeight()); 71 | g.strokePath(linePath, stroke); 72 | 73 | g.fillEllipse ((getWidth()/2.f) - 5.f, (getHeight()/2.f) - 5.f, 10.f, 10.f); 74 | g.setColour(Colours::black); 75 | g.drawEllipse((getWidth()/2.f) - 5.f, (getHeight()/2.f) - 5.f, 10.f, 10.f, 1.f); 76 | } 77 | 78 | void InterpolationSpaceIPos::update() 79 | { 80 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId (nodeID)); 81 | 82 | if (f == nullptr) 83 | { 84 | delete this; 85 | return; 86 | } 87 | 88 | colour = audioEngine.getDoc().getNodeColour(nodeID); 89 | repaint(); 90 | } 91 | 92 | pMixInterpolationSpaceCrossHairs::pMixInterpolationSpaceCrossHairs(PMixAudioEngine& audioEngine, PMixInterpolationSpaceLayout& layout) 93 | : audioEngine(audioEngine) 94 | , layout(layout) 95 | { 96 | setInterceptsMouseClicks(false, true); 97 | audioEngine.getDoc().addChangeListener (this); 98 | } 99 | 100 | pMixInterpolationSpaceCrossHairs::~pMixInterpolationSpaceCrossHairs() 101 | { 102 | audioEngine.getDoc().removeChangeListener(this); 103 | deleteAllChildren(); 104 | } 105 | 106 | void pMixInterpolationSpaceCrossHairs::changeListenerCallback (ChangeBroadcaster* source) 107 | { 108 | updateComponents(); 109 | repaint(); 110 | } 111 | 112 | void pMixInterpolationSpaceCrossHairs::paint (Graphics& g) 113 | { 114 | // g.setColour(Colours::black); 115 | // 116 | // PathStrokeType stroke (2.5f); 117 | // 118 | // for (int f=0; f>& positions = presetsLocations.getReference(f); 121 | // Path linePath; 122 | // 123 | // float mw = getChildComponent(f)->getX() + getChildComponent(f)->getWidth()/2.f; 124 | // float mh = getChildComponent(f)->getY() + getChildComponent(f)->getHeight()/2.f; 125 | // 126 | // for (int preset = 0; preset < positions.size(); preset++) 127 | // { 128 | // linePath.startNewSubPath(mw, mh); 129 | // linePath.lineTo(positions[preset]); 130 | // } 131 | // 132 | // g.strokePath(linePath, stroke); 133 | // } 134 | } 135 | 136 | void pMixInterpolationSpaceCrossHairs::resized() 137 | { 138 | } 139 | 140 | void pMixInterpolationSpaceCrossHairs::updateComponents() 141 | { 142 | for (int i = audioEngine.getDoc().getNumNodes(); --i >= 0;) 143 | { 144 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNode (i)); 145 | 146 | InterpolationSpaceIPos* ipos = getComponentForNode (f->nodeID); 147 | 148 | if (ipos == nullptr) // need to create a new InterpolationSpaceIPos 149 | { 150 | if (f->properties.getVarPointer("presets") != nullptr) 151 | { 152 | var iposx = f->properties["iposx"]; 153 | var iposy = f->properties["iposy"]; 154 | Array* presets = f->properties.getVarPointer("presets")->getArray(); 155 | 156 | if (presets->size() >= 2) 157 | { 158 | InterpolationSpaceIPos* comp = new InterpolationSpaceIPos(audioEngine, layout, f->nodeID, audioEngine.getDoc().getNodeColour(juce::AudioProcessorGraph::NodeID(f->nodeID))); 159 | float r = 25.f; 160 | float x = getWidth() * (float) iposx; 161 | float y = getHeight() * (float) iposy; 162 | comp->setSize(r*2.f, r*2.f); 163 | comp->setCentrePosition(x, y); 164 | comp->update(); 165 | addAndMakeVisible(comp); 166 | } 167 | } 168 | } 169 | else 170 | { 171 | Array* presets = f->properties.getVarPointer("presets")->getArray(); 172 | 173 | if (presets->size() < 2) 174 | delete ipos; 175 | else 176 | { 177 | var iposx = f->properties["iposx"]; 178 | var iposy = f->properties["iposy"]; 179 | float x = getWidth() * (float) iposx; 180 | float y = getHeight() * (float) iposy; 181 | ipos->setCentrePosition(x, y); 182 | ipos->update(); 183 | } 184 | } 185 | } 186 | } 187 | 188 | InterpolationSpaceIPos* pMixInterpolationSpaceCrossHairs::getComponentForNode (NodeID nodeID) const 189 | { 190 | for (int i = getNumChildComponents(); --i >= 0;) 191 | { 192 | if (InterpolationSpaceIPos* const ic = dynamic_cast (getChildComponent (i))) 193 | if (ic->nodeID == nodeID) 194 | return ic; 195 | } 196 | 197 | return nullptr; 198 | } 199 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpaceCrosshairs.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpaceCrosshairs.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixAudioEngine.h" 14 | #include "pMixInterpolationSpaceLayout.h" 15 | 16 | class InterpolationSpaceIPos : public Component 17 | { 18 | public: 19 | InterpolationSpaceIPos(PMixAudioEngine& audioEngine, PMixInterpolationSpaceLayout& layout, NodeID nodeID, Colour colour); 20 | ~InterpolationSpaceIPos(); 21 | 22 | void resized () override; 23 | void mouseDown (const MouseEvent& e) override; 24 | void mouseDrag (const MouseEvent& e) override; 25 | void mouseUp (const MouseEvent& e) override; 26 | void paint (Graphics& g) override; 27 | 28 | void update(); 29 | 30 | private: 31 | PMixAudioEngine& audioEngine; 32 | PMixInterpolationSpaceLayout& layout; 33 | 34 | ComponentDragger myDragger; 35 | ComponentBoundsConstrainer boundsConstrainer; 36 | Colour colour; 37 | 38 | public: 39 | NodeID nodeID; 40 | }; 41 | 42 | class pMixInterpolationSpaceCrossHairs : public Component 43 | , public ChangeListener 44 | { 45 | public: 46 | pMixInterpolationSpaceCrossHairs(PMixAudioEngine& audioEngine, PMixInterpolationSpaceLayout& layout); 47 | ~pMixInterpolationSpaceCrossHairs(); 48 | 49 | void paint (Graphics&) override; 50 | void resized() override; 51 | 52 | void changeListenerCallback (ChangeBroadcaster* source) override; 53 | 54 | void updateComponents(); 55 | InterpolationSpaceIPos* getComponentForNode (NodeID nodeID) const; 56 | 57 | private: 58 | PMixAudioEngine& audioEngine; 59 | PMixInterpolationSpaceLayout& layout; 60 | 61 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (pMixInterpolationSpaceCrossHairs) 62 | }; 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Source/pMixInterpolationSpaceLayout.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixInterpolationSpaceLayout.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixAudioEngine.h" 14 | #include "pMixInterpolationSpaceActions.h" 15 | #include "pMixGraphEditor.h" 16 | 17 | class InterpolationSpaceLabel : public Label 18 | { 19 | public: 20 | InterpolationSpaceLabel(const String& labelText); 21 | }; 22 | 23 | class InterpolationSpacePreset : public Component 24 | , public ChangeListener 25 | , public Label::Listener 26 | { 27 | public: 28 | InterpolationSpacePreset(PMixAudioEngine& audioEngine, String& initalLabel, NodeID nodeID, const int presetId, Colour colour); 29 | ~InterpolationSpacePreset (); 30 | void resized () override; 31 | void mouseDown (const MouseEvent& e) override; 32 | void mouseDrag (const MouseEvent& e) override; 33 | void mouseUp (const MouseEvent& e) override; 34 | void paint (Graphics& g) override; 35 | 36 | void changeListenerCallback (ChangeBroadcaster* source) override; 37 | 38 | void labelTextChanged (Label* labelThatHasChanged) override; 39 | 40 | void update(); 41 | 42 | public: 43 | PMixAudioEngine& audioEngine; 44 | NodeID nodeID; 45 | const int presetId; 46 | 47 | private: 48 | ComponentDragger myDragger; 49 | ComponentBoundsConstrainer boundsConstrainer; 50 | Rectangle startBounds, endBounds; 51 | std::unique_ptr label; 52 | Colour colour; 53 | float opacity; 54 | bool dragging; 55 | }; 56 | 57 | class PMixInterpolationSpaceLayout : public Component 58 | , public LassoSource 59 | , public ChangeListener 60 | , public ApplicationCommandTarget 61 | { 62 | public: 63 | PMixInterpolationSpaceLayout(PMixAudioEngine& audioEngine, GraphEditor& graphEditor); 64 | ~PMixInterpolationSpaceLayout(); 65 | 66 | void paint (Graphics&) override; 67 | void resized () override; 68 | 69 | void mouseDown (const MouseEvent& e) override; 70 | void mouseDrag (const MouseEvent& e) override; 71 | void mouseUp (const MouseEvent& e) override; 72 | void mouseDoubleClick (const MouseEvent& e) override; 73 | 74 | void findLassoItemsInArea (Array & results, const Rectangle& area) override; 75 | SelectedItemSet & getLassoSelection() override; 76 | 77 | //ApplicationCommandTarget 78 | ApplicationCommandTarget* getNextCommandTarget() override; 79 | void getAllCommands (Array & commands) override; 80 | void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override; 81 | bool perform (const InvocationInfo& info) override; 82 | 83 | void changeListenerCallback (ChangeBroadcaster* source) override; 84 | 85 | void getComponentsForNode (NodeID nodeID, Array& components) const; 86 | void repaintPresetsForNode (NodeID nodeID); 87 | void deleteSelection(); 88 | void selectAll(); 89 | 90 | private: 91 | //TooltipWindow tooltipWindow; 92 | PMixAudioEngine& audioEngine; 93 | GraphEditor& graphEditor; 94 | SelectedItemSet selectedItems; 95 | LassoComponent lassoComp; 96 | void updateComponents(); 97 | 98 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixInterpolationSpaceLayout) 99 | }; 100 | 101 | 102 | -------------------------------------------------------------------------------- /Source/pMixLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixLogger.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | 13 | #include "JuceHeader.h" 14 | #include 15 | 16 | class PMixLogger : public Logger 17 | , public ChangeBroadcaster 18 | { 19 | public: 20 | PMixLogger() 21 | { 22 | 23 | } 24 | 25 | ~PMixLogger() 26 | { 27 | 28 | } 29 | 30 | void logMessage (const String& message) 31 | { 32 | // printf("size %i\n", messageList.size()); 33 | String str = message; 34 | messageList.push_back(str); 35 | sendChangeMessage(); 36 | //sendSynchronousChangeMessage(); 37 | } 38 | 39 | bool getLastMessage(String& theMessage) 40 | { 41 | while (messageList.size()) 42 | { 43 | theMessage = messageList.front(); 44 | messageList.pop_front(); 45 | return true; 46 | } 47 | 48 | return false; 49 | } 50 | 51 | private: 52 | std::list messageList; 53 | 54 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixLogger) 55 | }; 56 | 57 | 58 | -------------------------------------------------------------------------------- /Source/pMixLookAndFeel.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "JuceHeader.h" 5 | 6 | class pMixLookAndFeel : public LookAndFeel_V3 7 | { 8 | public: 9 | pMixLookAndFeel(); 10 | void drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component); 11 | void drawLinearSliderBackground (Graphics& g, int x, int y, int width, int height, 12 | float sliderPos, float minSliderPos, float maxSliderPos, 13 | const Slider::SliderStyle, Slider& slider); 14 | void drawLinearSliderThumb (Graphics& g, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const Slider::SliderStyle style, Slider& slider); 15 | void drawLasso (Graphics& g, Component& lassoComp); 16 | Font getPopupMenuFont(); 17 | void drawStretchableLayoutResizerBar (Graphics& g, int /*w*/, int /*h*/, bool /*isVerticalBar*/, 18 | bool isMouseOver, bool isMouseDragging); 19 | 20 | void drawLabel(Graphics&, Label&); 21 | void drawCallOutBoxBackground (CallOutBox &, Graphics &, const Path &, Image &cachedImage); 22 | private: 23 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (pMixLookAndFeel); 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /Source/pMixMainAppWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixMainAppWindow.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "pMixAudioEngine.h" 13 | #include "pMixMainComponent.h" 14 | #include "pMixCommandIDs.h" 15 | 16 | ApplicationCommandManager& getCommandManager(); 17 | AudioDeviceManager& getDeviceManager(); 18 | 19 | class MainAppWindow : public DocumentWindow, 20 | public MenuBarModel, 21 | public ApplicationCommandTarget, 22 | public FileDragAndDropTarget 23 | { 24 | public: 25 | MainAppWindow(PMixAudioEngine& audioEngine); 26 | ~MainAppWindow(); 27 | 28 | //DocumentWindow 29 | void closeButtonPressed(); 30 | 31 | //FileDragAndDropTarget 32 | bool isInterestedInFileDrag (const StringArray& files); 33 | void fileDragEnter (const StringArray& files, int, int); 34 | void fileDragMove (const StringArray& files, int, int); 35 | void fileDragExit (const StringArray& files); 36 | void filesDropped (const StringArray& files, int, int); 37 | 38 | //MenuBarModel 39 | StringArray getMenuBarNames(); 40 | PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName); 41 | void menuItemSelected (int menuItemID, int topLevelMenuIndex); 42 | 43 | //ApplicationCommandTarget 44 | ApplicationCommandTarget* getNextCommandTarget(); 45 | void getAllCommands (Array & commands); 46 | void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result); 47 | bool perform (const InvocationInfo& info); 48 | 49 | //Unique 50 | bool tryToQuitApplication(); 51 | MainComponent* getMainComponent() const; 52 | PMixAudioEngine& getAudioEngine() { return audioEngine; } 53 | void showPreferences(); 54 | void showAbout(); 55 | 56 | private: 57 | PMixAudioEngine& audioEngine; 58 | 59 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainAppWindow) 60 | }; 61 | 62 | 63 | -------------------------------------------------------------------------------- /Source/pMixMainComponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixMainComponent.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixMainComponent.h" 11 | 12 | MainComponent::MainComponent (PMixAudioEngine& audioEngine) 13 | : audioEngine(audioEngine) 14 | , iSpaceWindow(nullptr) 15 | , codeEditorWindow(nullptr) 16 | { 17 | //setOpenGLRenderingEngine(); 18 | LookAndFeel::setDefaultLookAndFeel (&lookAndFeel); 19 | 20 | horizontalLayout.setItemLayout (0, -0.2, -0.8, -0.35); 21 | horizontalLayout.setItemLayout (1, 8, 8, 8); 22 | horizontalLayout.setItemLayout (2, 150, -1.0, -0.65); 23 | 24 | horizontalDividerBar = std::make_unique(&horizontalLayout, 1, true); 25 | addAndMakeVisible (*horizontalDividerBar); 26 | 27 | graphEditor = std::make_unique(audioEngine); 28 | addAndMakeVisible (*graphEditor); 29 | 30 | codeEditor = std::make_unique(audioEngine, *graphEditor); 31 | iSpace = std::make_unique(audioEngine, *graphEditor); 32 | 33 | rightHandPanel = std::make_unique(audioEngine, *graphEditor, *codeEditor, *iSpace); 34 | addAndMakeVisible(*rightHandPanel); 35 | 36 | graphEditor->updateComponents(); 37 | 38 | // if (audioEngine.getAppProperties().getUserSettings()->getBoolValue("floatInterpolationSpace")) { 39 | // floatWindow(true); 40 | // } 41 | } 42 | 43 | MainComponent::~MainComponent() 44 | { 45 | LookAndFeel::setDefaultLookAndFeel (nullptr); 46 | // logger.removeChangeListener(codeEditor->console); 47 | Logger::setCurrentLogger (nullptr); 48 | 49 | if(iSpaceWindow != nullptr) 50 | delete iSpaceWindow; 51 | 52 | if(codeEditorWindow != nullptr) 53 | delete codeEditorWindow; 54 | 55 | removeAllChildren(); 56 | } 57 | 58 | void MainComponent::paint (Graphics& g) 59 | { 60 | g.fillAll (Colours::white); 61 | } 62 | 63 | void MainComponent::resized() 64 | { 65 | Component* hcomps[] = { graphEditor.get(), horizontalDividerBar.get(), rightHandPanel.get() }; 66 | 67 | horizontalLayout.layOutComponents (hcomps, 3, 0, 0, getWidth(), getHeight(), false, true); 68 | } 69 | 70 | void MainComponent::setZoom (double scale) 71 | { 72 | } 73 | 74 | double MainComponent::getZoom() const 75 | { 76 | return 1.0; 77 | } 78 | 79 | void MainComponent::clear() 80 | { 81 | graphEditor->clear(); 82 | rightHandPanel->getCodeEditor()->clear(); 83 | } 84 | 85 | void MainComponent::floatWindow(int whichWindow, bool floatIt) 86 | { 87 | if (whichWindow == kWindowCodeEditor ) 88 | { 89 | bool isFloating = !(codeEditorWindow == nullptr); 90 | 91 | if (isFloating) // Allready floating 92 | { 93 | if (floatIt) 94 | { 95 | return; 96 | } 97 | else // close floating window, move content to tab and update prefs 98 | { 99 | delete codeEditorWindow; 100 | codeEditorWindow = nullptr; 101 | rightHandPanel->addTabForContent(*codeEditor, kWindowCodeEditor); 102 | audioEngine.getAppProperties().getUserSettings()->setValue("floatCodeEditor", false); 103 | } 104 | } 105 | else // not yet floating: create window, move content and update prefs 106 | { 107 | codeEditorWindow = new PMixFloatWindow("Code Editor", this, kWindowCodeEditor); 108 | rightHandPanel->removeTabForContent(*codeEditor); 109 | codeEditorWindow->attachContent(codeEditor.get()); 110 | codeEditorWindow->setVisible(true); 111 | 112 | audioEngine.getAppProperties().getUserSettings()->setValue("floatCodeEditor", true); 113 | } 114 | } 115 | else if (whichWindow == kWindowISpace) 116 | { 117 | bool isFloating = !(iSpaceWindow == nullptr); 118 | 119 | if (isFloating) // Allready floating 120 | { 121 | if (floatIt) 122 | { 123 | return; 124 | } 125 | else // close floating window, move content to tab and update prefs 126 | { 127 | delete iSpaceWindow; 128 | iSpaceWindow = nullptr; 129 | rightHandPanel->addTabForContent(*iSpace, kWindowISpace); 130 | audioEngine.getAppProperties().getUserSettings()->setValue("floatInterpolationSpace", false); 131 | } 132 | } 133 | else // not yet floating: create window, move content and update prefs 134 | { 135 | iSpaceWindow = new PMixFloatWindow("Interpolation Space", this, kWindowISpace); 136 | rightHandPanel->removeTabForContent(*iSpace); 137 | iSpaceWindow->attachContent(iSpace.get()); 138 | iSpaceWindow->setVisible(true); 139 | 140 | audioEngine.getAppProperties().getUserSettings()->setValue("floatInterpolationSpace", true); 141 | } 142 | } 143 | 144 | } 145 | 146 | static const char* openGLRendererName = "OpenGL Renderer"; 147 | 148 | StringArray MainComponent::getRenderingEngines() const 149 | { 150 | StringArray renderingEngines; 151 | 152 | if (ComponentPeer* peer = getPeer()) 153 | renderingEngines = peer->getAvailableRenderingEngines(); 154 | 155 | #if JUCE_OPENGL 156 | renderingEngines.add (openGLRendererName); 157 | #endif 158 | 159 | return renderingEngines; 160 | } 161 | 162 | void MainComponent::setRenderingEngine (int index) 163 | { 164 | // showMessageBubble (getRenderingEngines()[index]); 165 | 166 | #if JUCE_OPENGL 167 | if (getRenderingEngines()[index] == openGLRendererName) 168 | { 169 | openGLContext.attachTo (*getTopLevelComponent()); 170 | return; 171 | } 172 | 173 | openGLContext.detach(); 174 | #endif 175 | 176 | if (ComponentPeer* peer = getPeer()) 177 | peer->setCurrentRenderingEngine (index); 178 | } 179 | 180 | void MainComponent::setOpenGLRenderingEngine() 181 | { 182 | setRenderingEngine (getRenderingEngines().indexOf (openGLRendererName)); 183 | } 184 | 185 | int MainComponent::getActiveRenderingEngine() const 186 | { 187 | #if JUCE_OPENGL 188 | if (openGLContext.isAttached()) 189 | return getRenderingEngines().indexOf (openGLRendererName); 190 | #endif 191 | 192 | if (ComponentPeer* peer = getPeer()) 193 | return peer->getCurrentRenderingEngine(); 194 | 195 | return 0; 196 | } 197 | -------------------------------------------------------------------------------- /Source/pMixMainComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixMainComponent.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "pMixAudioEngine.h" 13 | #include "pMixInterpolationSpace.h" 14 | #include "pMixGraphEditor.h" 15 | #include "pMixCodeEditor.h" 16 | #include "pMixLookAndFeel.h" 17 | #include "pMixRHPTabContainer.h" 18 | #include "pMixFloatWindow.h" 19 | 20 | class MainComponent : public Component 21 | { 22 | public: 23 | enum EFloatWindows 24 | { 25 | kWindowCodeEditor = 0, 26 | kWindowISpace, 27 | kWindowConsole 28 | }; 29 | 30 | MainComponent (PMixAudioEngine& audioEngine); 31 | ~MainComponent(); 32 | 33 | void paint (Graphics& g); 34 | void resized(); 35 | void setZoom (double scale); 36 | double getZoom() const; 37 | void clear(); 38 | 39 | void floatWindow(int whichWindow, bool floatIt); 40 | 41 | StringArray getRenderingEngines() const; 42 | int getActiveRenderingEngine() const; 43 | void setRenderingEngine (int index); 44 | void setOpenGLRenderingEngine(); 45 | 46 | private: 47 | pMixLookAndFeel lookAndFeel; 48 | PMixAudioEngine& audioEngine; 49 | 50 | std::unique_ptr graphEditor; 51 | std::unique_ptr codeEditor; 52 | std::unique_ptr iSpace; 53 | 54 | StretchableLayoutManager horizontalLayout; 55 | std::unique_ptr horizontalDividerBar; 56 | 57 | std::unique_ptr rightHandPanel; 58 | 59 | PMixFloatWindow* iSpaceWindow; 60 | PMixFloatWindow* codeEditorWindow; 61 | 62 | #if JUCE_OPENGL 63 | OpenGLContext openGLContext; 64 | #endif 65 | 66 | 67 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainComponent) 68 | }; 69 | 70 | 71 | -------------------------------------------------------------------------------- /Source/pMixParamTreeView.cpp: -------------------------------------------------------------------------------- 1 | #include "pMixParamTreeView.h" 2 | 3 | ParamTreeViewRootItem::ParamTreeViewRootItem () 4 | { 5 | } 6 | 7 | ParamTreeViewRootItem::~ParamTreeViewRootItem() 8 | { 9 | } 10 | 11 | int ParamTreeViewRootItem::getItemWidth() const 12 | { 13 | return 100; 14 | } 15 | 16 | int ParamTreeViewRootItem::getItemHeight() const 17 | { 18 | return 15; 19 | } 20 | 21 | String ParamTreeViewRootItem::getUniqueName() const 22 | { 23 | return String("root"); 24 | } 25 | 26 | bool ParamTreeViewRootItem::mightContainSubItems() 27 | { 28 | return true; 29 | } 30 | 31 | void ParamTreeViewRootItem::paintItem (Graphics& g, int width, int height) 32 | { 33 | // dont paint root 34 | } 35 | 36 | void ParamTreeViewRootItem::itemOpennessChanged (bool isNowOpen) 37 | { 38 | /* 39 | if (isNowOpen) 40 | { 41 | if (getNumSubItems() == 0) 42 | { 43 | 44 | } 45 | } 46 | else 47 | { 48 | 49 | } 50 | 51 | */ 52 | } 53 | 54 | ParamTreeViewParamItem::ParamTreeViewParamItem (String paramName) 55 | { 56 | mName = paramName; 57 | } 58 | 59 | ParamTreeViewParamItem::~ParamTreeViewParamItem() 60 | { 61 | } 62 | 63 | int ParamTreeViewParamItem::getItemWidth() const 64 | { 65 | return 100; 66 | } 67 | 68 | int ParamTreeViewParamItem::getItemHeight() const 69 | { 70 | return 15; 71 | } 72 | 73 | String ParamTreeViewParamItem::getUniqueName() const 74 | { 75 | return mName; 76 | } 77 | 78 | bool ParamTreeViewParamItem::mightContainSubItems() 79 | { 80 | return false; 81 | } 82 | 83 | void ParamTreeViewParamItem::paintItem (Graphics& g, int width, int height) 84 | { 85 | // if this item is selected, fill it with a background colour.. 86 | if (isSelected()) 87 | g.fillAll (Colours::blue.withAlpha (0.3f)); 88 | 89 | // use a "colour" attribute in the xml tag for this node to set the text colour.. 90 | g.setColour (Colours::black); 91 | 92 | g.setFont (height * 0.8f); 93 | 94 | // draw the xml element's tag name.. 95 | g.drawText (mName, 96 | 4, 0, width - 4, height, 97 | Justification::centredLeft, true); 98 | 99 | } 100 | 101 | void ParamTreeViewParamItem::itemOpennessChanged (bool isNowOpen) 102 | { 103 | } 104 | 105 | ParamTreeViewPluginItem::ParamTreeViewPluginItem (PMixAudioEngine& audioEngine, const uint32 filterID_) 106 | : audioEngine (audioEngine), 107 | filterID (filterID_) 108 | { 109 | } 110 | 111 | ParamTreeViewPluginItem::~ParamTreeViewPluginItem() 112 | { 113 | } 114 | 115 | int ParamTreeViewPluginItem::getItemWidth() const 116 | { 117 | return 100; 118 | } 119 | 120 | int ParamTreeViewPluginItem::getItemHeight() const 121 | { 122 | return 15; 123 | } 124 | 125 | String ParamTreeViewPluginItem::getUniqueName() const 126 | { 127 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId (filterID)); 128 | return f->getProcessor()->getName(); // Unique? 129 | // return xml.getTagName(); 130 | } 131 | 132 | bool ParamTreeViewPluginItem::mightContainSubItems() 133 | { 134 | return false; 135 | //return xml.getFirstChildElement() != 0; 136 | } 137 | 138 | void ParamTreeViewPluginItem::paintItem (Graphics& g, int width, int height) 139 | { 140 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId (filterID)); 141 | 142 | // if this item is selected, fill it with a background colour.. 143 | if (isSelected()) 144 | g.fillAll (Colours::blue.withAlpha (0.3f)); 145 | 146 | // use a "colour" attribute in the xml tag for this node to set the text colour.. 147 | g.setColour (Colours::black); 148 | 149 | g.setFont (height * 0.8f); 150 | 151 | // draw the xml element's tag name.. 152 | g.drawText (f->getProcessor()->getName(), 153 | 4, 0, width - 4, height, 154 | Justification::centredLeft, true); 155 | 156 | } 157 | 158 | void ParamTreeViewPluginItem::itemOpennessChanged (bool isNowOpen) 159 | { 160 | if (isNowOpen) 161 | { 162 | if (getNumSubItems() == 0) 163 | { 164 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId (filterID)); 165 | 166 | for(int i = 0; i < f->getProcessor()->getNumParameters(); i++) 167 | { 168 | addSubItem (new ParamTreeViewParamItem (f->getProcessor()->getParameterName(i))); 169 | } 170 | } 171 | } 172 | else 173 | { 174 | } 175 | } 176 | 177 | ParamTreeView::ParamTreeView(PMixAudioEngine& audioEngine) 178 | : audioEngine (audioEngine) 179 | , treeView (0) 180 | { 181 | audioEngine.getDoc().addChangeListener (this); 182 | setName ("Tree Views"); 183 | 184 | rootItem = new ParamTreeViewRootItem(); 185 | rootItem->setOpen (true); 186 | 187 | showCustomTreeView(); 188 | } 189 | 190 | ParamTreeView::~ParamTreeView() 191 | { 192 | } 193 | 194 | void ParamTreeView::paint (Graphics& g) 195 | { 196 | g.setColour (Colours::white); 197 | 198 | if (treeView != 0) 199 | g.drawRect (treeView->getX(), treeView->getY(), 200 | treeView->getWidth(), treeView->getHeight()); 201 | } 202 | 203 | void ParamTreeView::resized() 204 | { 205 | if (treeView != 0) 206 | treeView->setBoundsInset (BorderSize (40, 10, 10, 10)); 207 | } 208 | 209 | void ParamTreeView::showCustomTreeView() 210 | { 211 | treeView = 0; 212 | 213 | addAndMakeVisible (treeView = new TreeView()); 214 | treeView->setRootItemVisible(false); 215 | treeView->setRootItem (rootItem); 216 | treeView->setMultiSelectEnabled (true); 217 | 218 | resized(); 219 | } 220 | 221 | void ParamTreeView::changeListenerCallback (ChangeBroadcaster*) 222 | { 223 | rootItem->clearSubItems(); 224 | for(int i = 3; i < audioEngine.getDoc().getNumFilters(); i++) 225 | { 226 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNode (i)); 227 | addPlugin(f->nodeId); 228 | } 229 | } 230 | 231 | void ParamTreeView::addPlugin(const uint32 filterID_) 232 | { 233 | rootItem->addSubItem (new ParamTreeViewPluginItem (audioEngine, filterID_)); 234 | } 235 | 236 | //void buttonClicked (Button*) {} -------------------------------------------------------------------------------- /Source/pMixParamTreeView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "JuceHeader.h" 4 | #include "pMixAudioEngine.h" 5 | 6 | class ParamTreeViewRootItem : public TreeViewItem 7 | { 8 | public: 9 | ParamTreeViewRootItem (); 10 | ~ParamTreeViewRootItem(); 11 | int getItemWidth() const; 12 | int getItemHeight() const; 13 | String getUniqueName() const; 14 | bool mightContainSubItems(); 15 | void paintItem (Graphics& g, int width, int height); 16 | void itemOpennessChanged (bool isNowOpen); 17 | }; 18 | 19 | class ParamTreeViewParamItem : public TreeViewItem 20 | { 21 | public: 22 | ParamTreeViewParamItem (String paramName); 23 | ~ParamTreeViewParamItem(); 24 | int getItemWidth() const; 25 | int getItemHeight() const; 26 | String getUniqueName() const; 27 | bool mightContainSubItems(); 28 | void paintItem (Graphics& g, int width, int height); 29 | void itemOpennessChanged (bool isNowOpen); 30 | 31 | private: 32 | String mName; 33 | }; 34 | 35 | class ParamTreeViewPluginItem : public TreeViewItem 36 | { 37 | public: 38 | ParamTreeViewPluginItem (PMixAudioEngine& audioEngine, const uint32 filterID_); 39 | ~ParamTreeViewPluginItem(); 40 | int getItemWidth() const; 41 | int getItemHeight() const; 42 | String getUniqueName() const; 43 | bool mightContainSubItems(); 44 | void paintItem (Graphics& g, int width, int height); 45 | void itemOpennessChanged (bool isNowOpen); 46 | 47 | private: 48 | PMixAudioEngine& audioEngine; 49 | const uint32 filterID; 50 | }; 51 | 52 | class ParamTreeView : public Component, 53 | public ChangeListener 54 | /*, public DragAndDropContainer */ 55 | /*, public ButtonListener*/ 56 | { 57 | public: 58 | ParamTreeView(PMixAudioEngine& audioEngine); 59 | ~ParamTreeView(); 60 | 61 | void paint (Graphics& g); 62 | void resized(); 63 | void showCustomTreeView(); 64 | void changeListenerCallback (ChangeBroadcaster*); 65 | void addPlugin(const uint32 filterID_); 66 | //void buttonClicked (Button*) 67 | 68 | juce_UseDebuggingNewOperator 69 | 70 | private: 71 | PMixAudioEngine& audioEngine; 72 | std::unique_ptr rootItem; 73 | std::unique_ptr treeView; 74 | }; 75 | 76 | 77 | -------------------------------------------------------------------------------- /Source/pMixParamView.cpp: -------------------------------------------------------------------------------- 1 | #include "pMixParamView.h" 2 | 3 | ParamSlider::ParamSlider (AudioProcessor& p, const int index_) 4 | : owner (p), 5 | index (index_) 6 | { 7 | // int steps = owner.getParameterNumSteps(index); 8 | 9 | float div = 0.; 10 | 11 | // if (steps > 0) { 12 | // div = 1.f/steps; 13 | // } 14 | 15 | setRange (0.0, 1.0, div); 16 | setSliderStyle (Slider::LinearHorizontal); 17 | setTextBoxIsEditable (false); 18 | setScrollWheelEnabled (false); 19 | } 20 | 21 | void ParamSlider::setValueEx(float value) 22 | { 23 | if (getThumbBeingDragged() == -1) 24 | { 25 | setValue(value, dontSendNotification); 26 | } 27 | } 28 | 29 | void ParamSlider::valueChanged() 30 | { 31 | const float newVal = (float) getValue(); 32 | 33 | if (owner.getParameter (index) != newVal) 34 | owner.setParameterNotifyingHost (index, newVal); 35 | } 36 | 37 | String ParamSlider::getTextFromValue (double /*value*/) 38 | { 39 | return owner.getParameterText (index); 40 | } 41 | 42 | ProcessorParameterPropertyComp::ProcessorParameterPropertyComp(const String& name, AudioProcessor& p, const int index_) 43 | : PropertyComponent (name, 20), 44 | owner (p), 45 | index (index_), 46 | paramHasChanged (false), 47 | slider (p, index_) 48 | { 49 | startTimer (100); 50 | addAndMakeVisible (slider); 51 | owner.addListener (this); 52 | } 53 | 54 | ProcessorParameterPropertyComp::~ProcessorParameterPropertyComp() 55 | { 56 | // owner.removeListener (this); 57 | } 58 | 59 | void ProcessorParameterPropertyComp::refresh() 60 | { 61 | paramHasChanged = false; 62 | slider.setValueEx (owner.getParameter (index)); 63 | } 64 | 65 | void ProcessorParameterPropertyComp::audioProcessorChanged (AudioProcessor*) {} 66 | 67 | void ProcessorParameterPropertyComp::audioProcessorParameterChanged (AudioProcessor*, int parameterIndex, float) 68 | { 69 | if (parameterIndex == index) 70 | paramHasChanged = true; 71 | } 72 | 73 | void ProcessorParameterPropertyComp::timerCallback() 74 | { 75 | if (paramHasChanged) 76 | { 77 | refresh(); 78 | startTimer (1000 / 50); 79 | } 80 | else 81 | { 82 | startTimer (jmin (1000 / 4, getTimerInterval() + 10)); 83 | } 84 | } 85 | 86 | ParamView::ParamView(PMixAudioEngine& audioEngine) 87 | : audioEngine (audioEngine) 88 | { 89 | audioEngine.getDoc().addChangeListener (this); 90 | 91 | setOpaque (true); 92 | addAndMakeVisible (&panel); 93 | } 94 | 95 | ParamView::~ParamView() 96 | { 97 | audioEngine.getDoc().removeChangeListener (this); 98 | } 99 | 100 | void ParamView::paint (Graphics& g) 101 | { 102 | g.fillAll (Colour::greyLevel (0.8f)); 103 | } 104 | 105 | void ParamView::resized() 106 | { 107 | panel.setBounds (getLocalBounds().reduced (4)); 108 | } 109 | 110 | void ParamView::changeListenerCallback (ChangeBroadcaster* source) 111 | { 112 | bool deletedNodes = false; 113 | 114 | for (int i = 0; i < sectionNodes.size(); i++) 115 | { 116 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNodeForId(sectionNodes[i])); 117 | 118 | if (f == nullptr) 119 | { 120 | deletedNodes = true; 121 | } 122 | } 123 | 124 | if (deletedNodes) 125 | { 126 | sectionNodes.clear(); 127 | panel.clear(); 128 | } 129 | 130 | for (int i = audioEngine.getDoc().getNumFilters(); --i >= 0;) 131 | { 132 | const AudioProcessorGraph::Node::Ptr f (audioEngine.getDoc().getNode (i)); 133 | 134 | if (f->getProcessor()->getName() != "Audio Input" 135 | && f->getProcessor()->getName() != "Audio Output" 136 | && f->getProcessor()->getName() != "Midi Input" 137 | && f->getProcessor()->getName() != "Midi Output") 138 | { 139 | if (!sectionNodes.contains(f->nodeId)) 140 | { 141 | sectionNodes.add(f->nodeId); 142 | addEditor(f->getProcessor()); 143 | } 144 | } 145 | } 146 | } 147 | 148 | void ParamView::addEditor(AudioProcessor* p) 149 | { 150 | Array params; 151 | 152 | const int numParams = p->getNumParameters(); 153 | int totalHeight = 0; 154 | 155 | for (int i = 0; i < numParams; ++i) 156 | { 157 | String name (p->getParameterName (i)); 158 | if (name.trim().isEmpty()) 159 | name = "Unnamed"; 160 | 161 | ProcessorParameterPropertyComp* const pc = new ProcessorParameterPropertyComp (name, *p, i); 162 | params.add (pc); 163 | totalHeight += pc->getPreferredHeight(); 164 | } 165 | 166 | panel.addSection (p->getName(), params, false); 167 | } -------------------------------------------------------------------------------- /Source/pMixParamView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "JuceHeader.h" 4 | #include "pMixAudioEngine.h" 5 | 6 | class ParamSlider : public Slider 7 | { 8 | public: 9 | ParamSlider (AudioProcessor& p, const int index_); 10 | void setValueEx(float value); 11 | void valueChanged(); 12 | String getTextFromValue (double /*value*/); 13 | 14 | private: 15 | AudioProcessor& owner; 16 | const int index; 17 | 18 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ParamSlider) 19 | }; 20 | 21 | #pragma mark ProcessorParameterPropertyComp 22 | class ProcessorParameterPropertyComp : public PropertyComponent 23 | , private AudioProcessorListener 24 | , private Timer 25 | { 26 | public: 27 | ProcessorParameterPropertyComp (const String& name, AudioProcessor& p, const int index_); 28 | ~ProcessorParameterPropertyComp(); 29 | void refresh(); 30 | void audioProcessorChanged (AudioProcessor*); 31 | void audioProcessorParameterChanged (AudioProcessor*, int parameterIndex, float); 32 | void timerCallback() override; 33 | 34 | private: 35 | AudioProcessor& owner; 36 | const int index; 37 | bool volatile paramHasChanged; 38 | ParamSlider slider; 39 | 40 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProcessorParameterPropertyComp) 41 | }; 42 | 43 | class ParamView : public Component 44 | , public ChangeListener 45 | { 46 | public: 47 | ParamView(PMixAudioEngine& audioEngine); 48 | 49 | ~ParamView(); 50 | void paint (Graphics& g) override; 51 | void resized() override; 52 | void changeListenerCallback (ChangeBroadcaster* source); 53 | void addEditor(AudioProcessor* p); 54 | 55 | private: 56 | PMixAudioEngine& audioEngine; 57 | Array sectionNodes; 58 | PropertyPanel panel; 59 | }; 60 | 61 | -------------------------------------------------------------------------------- /Source/pMixPluginWindow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixPluginWindow.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixPluginWindow.h" 11 | #include "pMixGenericEditor.h" 12 | 13 | class PluginWindow; 14 | static Array activePluginWindows; 15 | 16 | PluginWindow::PluginWindow (Component* const pluginEditor, AudioProcessorGraph::Node* const o, WindowFormatType t) 17 | : DocumentWindow (pluginEditor->getName(), Colours::lightblue, DocumentWindow::minimiseButton | DocumentWindow::closeButton), 18 | owner (o), 19 | type (t) 20 | { 21 | setSize (400, 300); 22 | setUsingNativeTitleBar(true); 23 | setAlwaysOnTop(true); 24 | setContentOwned (pluginEditor, true); 25 | 26 | setTopLeftPosition (owner->properties.getWithDefault ("uiLastX", Random::getSystemRandom().nextInt (500)), 27 | owner->properties.getWithDefault ("uiLastY", Random::getSystemRandom().nextInt (500))); 28 | setVisible (true); 29 | activePluginWindows.add (this); 30 | } 31 | 32 | void PluginWindow::closeCurrentlyOpenWindowsFor (NodeID nodeID) 33 | { 34 | for (int i = activePluginWindows.size(); --i >= 0;) 35 | if (activePluginWindows.getUnchecked(i)->owner->nodeID == nodeID) 36 | delete activePluginWindows.getUnchecked (i); 37 | } 38 | 39 | void PluginWindow::closeAllCurrentlyOpenWindows() 40 | { 41 | if (activePluginWindows.size() > 0) 42 | { 43 | for (int i = activePluginWindows.size(); --i >= 0;) 44 | delete activePluginWindows.getUnchecked (i); 45 | 46 | Component dummyModalComp; 47 | dummyModalComp.enterModalState(); 48 | MessageManager::getInstance()->runDispatchLoopUntil (50); 49 | } 50 | } 51 | 52 | PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node, 53 | WindowFormatType type) 54 | { 55 | jassert (node != nullptr); 56 | 57 | for (int i = activePluginWindows.size(); --i >= 0;) 58 | if (activePluginWindows.getUnchecked(i)->owner == node 59 | && activePluginWindows.getUnchecked(i)->type == type) 60 | return activePluginWindows.getUnchecked(i); 61 | 62 | AudioProcessor* processor = node->getProcessor(); 63 | AudioProcessorEditor* ui = nullptr; 64 | 65 | if (type == Normal) 66 | { 67 | ui = processor->createEditorIfNeeded(); 68 | 69 | if (ui == nullptr) 70 | type = Generic; 71 | } 72 | 73 | if (ui == nullptr) 74 | { 75 | //if (type == Generic || type == Parameters) 76 | //ui = new PMixGenericAudioProcessorEditor (processor); 77 | // else if (type == Programs) 78 | // ui = new ProgramAudioProcessorEditor (processor); 79 | } 80 | 81 | if (ui != nullptr) 82 | { 83 | if (AudioPluginInstance* const plugin = dynamic_cast (processor)) 84 | ui->setName (plugin->getName()); 85 | 86 | return new PluginWindow (ui, node, type); 87 | } 88 | 89 | return nullptr; 90 | } 91 | 92 | PluginWindow::~PluginWindow() 93 | { 94 | dynamic_cast (owner->getProcessor())->editorBeingDeleted( dynamic_cast(getContentComponent()) ); 95 | activePluginWindows.removeFirstMatchingValue (this); 96 | clearContentComponent(); 97 | } 98 | 99 | void PluginWindow::moved() 100 | { 101 | owner->properties.set ("uiLastX", getX()); 102 | owner->properties.set ("uiLastY", getY()); 103 | } 104 | 105 | void PluginWindow::closeButtonPressed() 106 | { 107 | dynamic_cast (owner->getProcessor())->editorBeingDeleted( dynamic_cast(getContentComponent()) ); 108 | delete this; 109 | } 110 | -------------------------------------------------------------------------------- /Source/pMixPluginWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixPluginWindow.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixConstants.h" 14 | 15 | class PluginWindow : public DocumentWindow 16 | { 17 | public: 18 | enum WindowFormatType 19 | { 20 | Normal = 0, 21 | Generic, 22 | // Programs, 23 | Parameters 24 | }; 25 | 26 | PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType); 27 | ~PluginWindow(); 28 | 29 | static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType); 30 | 31 | static void closeCurrentlyOpenWindowsFor (NodeID nodeID); 32 | static void closeAllCurrentlyOpenWindows(); 33 | 34 | void moved() override; 35 | void closeButtonPressed() override; 36 | 37 | private: 38 | AudioProcessorGraph::Node* owner; 39 | WindowFormatType type; 40 | 41 | float getDesktopScaleFactor() const override { return 1.0f; } 42 | 43 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginWindow) 44 | }; 45 | 46 | -------------------------------------------------------------------------------- /Source/pMixPrefsAudio.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Introjucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Introjucer version: 3.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | #include "pMixConstants.h" 22 | //[/Headers] 23 | 24 | #include "pMixPrefsAudio.h" 25 | 26 | 27 | //[MiscUserDefs] You can add your own user definitions and misc code here... 28 | //[/MiscUserDefs] 29 | 30 | //============================================================================== 31 | PMixPrefsAudio::PMixPrefsAudio (AudioDeviceManager& deviceManager) 32 | : AudioDeviceSelectorComponent(deviceManager, 0, MAX_NAUDIO_IO, 0, MAX_NAUDIO_IO, true, true, true, false) 33 | { 34 | //[Constructor_pre] You can add your own custom stuff here.. 35 | //[/Constructor_pre] 36 | 37 | 38 | //[UserPreSize] 39 | //[/UserPreSize] 40 | 41 | setSize (600, 400); 42 | 43 | 44 | //[Constructor] You can add your own custom stuff here.. 45 | //[/Constructor] 46 | } 47 | 48 | PMixPrefsAudio::~PMixPrefsAudio() 49 | { 50 | //[Destructor_pre]. You can add your own custom destruction code here.. 51 | //[/Destructor_pre] 52 | 53 | 54 | 55 | //[Destructor]. You can add your own custom destruction code here.. 56 | //[/Destructor] 57 | } 58 | 59 | //============================================================================== 60 | void PMixPrefsAudio::paint (Graphics& g) 61 | { 62 | //[UserPrePaint] Add your own custom painting code here.. 63 | //[/UserPrePaint] 64 | 65 | g.fillAll (Colours::white); 66 | 67 | //[UserPaint] Add your own custom painting code here.. 68 | AudioDeviceSelectorComponent::paint(g); 69 | //[/UserPaint] 70 | } 71 | 72 | void PMixPrefsAudio::resized() 73 | { 74 | //[UserPreResize] Add your own custom resize code here.. 75 | //[/UserPreResize] 76 | 77 | //[UserResized] Add your own custom resize handling here.. 78 | AudioDeviceSelectorComponent::resized(); 79 | //[/UserResized] 80 | } 81 | 82 | 83 | 84 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 85 | //[/MiscUserCode] 86 | 87 | 88 | //============================================================================== 89 | #if 0 90 | /* -- Introjucer information section -- 91 | 92 | This is where the Introjucer stores the metadata that describe this GUI layout, so 93 | make changes in here at your peril! 94 | 95 | BEGIN_JUCER_METADATA 96 | 97 | 102 | 103 | 104 | 105 | END_JUCER_METADATA 106 | */ 107 | #endif 108 | 109 | 110 | //[EndFile] You can add extra defines here... 111 | //[/EndFile] 112 | -------------------------------------------------------------------------------- /Source/pMixPrefsAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Introjucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Introjucer version: 3.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | //[/Headers] 25 | 26 | 27 | 28 | //============================================================================== 29 | /** 30 | //[Comments] 31 | An auto-generated component, created by the Introjucer. 32 | 33 | Describe your class and how it works here! 34 | //[/Comments] 35 | */ 36 | class PMixPrefsAudio : public AudioDeviceSelectorComponent 37 | { 38 | public: 39 | //============================================================================== 40 | PMixPrefsAudio (AudioDeviceManager& deviceManager); 41 | ~PMixPrefsAudio(); 42 | 43 | //============================================================================== 44 | //[UserMethods] -- You can add your own custom methods in this section. 45 | //[/UserMethods] 46 | 47 | void paint (Graphics& g); 48 | void resized(); 49 | 50 | 51 | 52 | private: 53 | //[UserVariables] -- You can add your own custom variables in this section. 54 | //[/UserVariables] 55 | 56 | //============================================================================== 57 | 58 | 59 | //============================================================================== 60 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsAudio) 61 | }; 62 | 63 | //[EndFile] You can add extra defines here... 64 | //[/EndFile] 65 | 66 | -------------------------------------------------------------------------------- /Source/pMixPrefsColours.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | //[/Headers] 22 | 23 | #include "pMixPrefsColours.h" 24 | 25 | 26 | //[MiscUserDefs] You can add your own user definitions and misc code here... 27 | //[/MiscUserDefs] 28 | 29 | //============================================================================== 30 | PMixPrefsColours::PMixPrefsColours () 31 | { 32 | //[Constructor_pre] You can add your own custom stuff here.. 33 | //[/Constructor_pre] 34 | 35 | 36 | //[UserPreSize] 37 | //[/UserPreSize] 38 | 39 | setSize (600, 400); 40 | 41 | 42 | //[Constructor] You can add your own custom stuff here.. 43 | //[/Constructor] 44 | } 45 | 46 | PMixPrefsColours::~PMixPrefsColours() 47 | { 48 | //[Destructor_pre]. You can add your own custom destruction code here.. 49 | //[/Destructor_pre] 50 | 51 | 52 | 53 | //[Destructor]. You can add your own custom destruction code here.. 54 | //[/Destructor] 55 | } 56 | 57 | //============================================================================== 58 | void PMixPrefsColours::paint (Graphics& g) 59 | { 60 | //[UserPrePaint] Add your own custom painting code here.. 61 | //[/UserPrePaint] 62 | 63 | g.fillAll (Colours::white); 64 | 65 | g.setColour (Colours::red); 66 | g.setFont (Font (83.10f, Font::plain)); 67 | g.drawText (TRANS("TODO!"), 68 | 20, 20, 316, 100, 69 | Justification::centred, true); 70 | 71 | //[UserPaint] Add your own custom painting code here.. 72 | //[/UserPaint] 73 | } 74 | 75 | void PMixPrefsColours::resized() 76 | { 77 | //[UserPreResize] Add your own custom resize code here.. 78 | //[/UserPreResize] 79 | 80 | //[UserResized] Add your own custom resize handling here.. 81 | //[/UserResized] 82 | } 83 | 84 | 85 | 86 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 87 | //[/MiscUserCode] 88 | 89 | 90 | //============================================================================== 91 | #if 0 92 | /* -- Projucer information section -- 93 | 94 | This is where the Projucer stores the metadata that describe this GUI layout, so 95 | make changes in here at your peril! 96 | 97 | BEGIN_JUCER_METADATA 98 | 99 | 103 | 104 | 107 | 108 | 109 | 110 | END_JUCER_METADATA 111 | */ 112 | #endif 113 | 114 | 115 | //[EndFile] You can add extra defines here... 116 | //[/EndFile] 117 | -------------------------------------------------------------------------------- /Source/pMixPrefsColours.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | //[/Headers] 25 | 26 | 27 | 28 | //============================================================================== 29 | /** 30 | //[Comments] 31 | An auto-generated component, created by the Introjucer. 32 | 33 | Describe your class and how it works here! 34 | //[/Comments] 35 | */ 36 | class PMixPrefsColours : public Component 37 | { 38 | public: 39 | //============================================================================== 40 | PMixPrefsColours (); 41 | ~PMixPrefsColours(); 42 | 43 | //============================================================================== 44 | //[UserMethods] -- You can add your own custom methods in this section. 45 | //[/UserMethods] 46 | 47 | void paint (Graphics& g) override; 48 | void resized() override; 49 | 50 | 51 | 52 | private: 53 | //[UserVariables] -- You can add your own custom variables in this section. 54 | //[/UserVariables] 55 | 56 | //============================================================================== 57 | 58 | 59 | //============================================================================== 60 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsColours) 61 | }; 62 | 63 | //[EndFile] You can add extra defines here... 64 | //[/EndFile] 65 | 66 | -------------------------------------------------------------------------------- /Source/pMixPrefsComponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | //[/Headers] 22 | 23 | #include "pMixPrefsComponent.h" 24 | 25 | 26 | //[MiscUserDefs] You can add your own user definitions and misc code here... 27 | AudioDeviceManager& getDeviceManager(); 28 | //[/MiscUserDefs] 29 | 30 | //============================================================================== 31 | PMixPrefsComponent::PMixPrefsComponent (PMixAudioEngine& audioEngine) 32 | { 33 | //[Constructor_pre] You can add your own custom stuff here.. 34 | //[/Constructor_pre] 35 | 36 | tabbedComponent = std::make_unique(TabbedButtonBar::TabsAtTop); 37 | addAndMakeVisible (*tabbedComponent); 38 | tabbedComponent->setTabBarDepth (23); 39 | tabbedComponent->addTab (TRANS("General"), Colours::lightgrey, new PMixPrefsGeneral(), true); 40 | tabbedComponent->addTab (TRANS("Controllers"), Colours::lightgrey, new PMixPrefsControllers(), true); 41 | #ifndef PMIX_PLUGIN 42 | tabbedComponent->addTab (TRANS("Audio"), Colours::lightgrey, new PMixPrefsAudio (getDeviceManager()), true); 43 | #endif 44 | tabbedComponent->addTab (TRANS("Plug-Ins"), Colours::lightgrey, new PMixPrefsPlugins (audioEngine), true); 45 | tabbedComponent->addTab (TRANS("Colours"), Colours::lightgrey, new PMixPrefsColours(), true); 46 | tabbedComponent->setCurrentTabIndex (0); 47 | 48 | 49 | //[UserPreSize] 50 | //[/UserPreSize] 51 | 52 | setSize (800, 600); 53 | 54 | 55 | //[Constructor] You can add your own custom stuff here.. 56 | //[/Constructor] 57 | } 58 | 59 | PMixPrefsComponent::~PMixPrefsComponent() 60 | { 61 | //[Destructor_pre]. You can add your own custom destruction code here.. 62 | //[/Destructor_pre] 63 | 64 | tabbedComponent = nullptr; 65 | 66 | 67 | //[Destructor]. You can add your own custom destruction code here.. 68 | //[/Destructor] 69 | } 70 | 71 | //============================================================================== 72 | void PMixPrefsComponent::paint (Graphics& g) 73 | { 74 | //[UserPrePaint] Add your own custom painting code here.. 75 | //[/UserPrePaint] 76 | 77 | g.fillAll (Colours::white); 78 | 79 | //[UserPaint] Add your own custom painting code here.. 80 | //[/UserPaint] 81 | } 82 | 83 | void PMixPrefsComponent::resized() 84 | { 85 | //[UserPreResize] Add your own custom resize code here.. 86 | //[/UserPreResize] 87 | 88 | tabbedComponent->setBounds (8, 8, getWidth() - 16, getHeight() - 16); 89 | //[UserResized] Add your own custom resize handling here.. 90 | //[/UserResized] 91 | } 92 | 93 | 94 | 95 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 96 | //[/MiscUserCode] 97 | 98 | 99 | //============================================================================== 100 | #if 0 101 | /* -- Projucer information section -- 102 | 103 | This is where the Projucer stores the metadata that describe this GUI layout, so 104 | make changes in here at your peril! 105 | 106 | BEGIN_JUCER_METADATA 107 | 108 | 112 | 113 | 116 | 118 | 120 | 122 | 124 | 126 | 127 | 128 | 129 | END_JUCER_METADATA 130 | */ 131 | #endif 132 | 133 | 134 | //[EndFile] You can add extra defines here... 135 | //[/EndFile] 136 | -------------------------------------------------------------------------------- /Source/pMixPrefsComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | #include "pMixPrefsControllers.h" 25 | #include "pMixPrefsAudio.h" 26 | #include "pMixPrefsColours.h" 27 | #include "pMixPrefsGeneral.h" 28 | #include "pMixPrefsPlugins.h" 29 | //[/Headers] 30 | 31 | 32 | 33 | //============================================================================== 34 | /** 35 | //[Comments] 36 | An auto-generated component, created by the Introjucer. 37 | 38 | Describe your class and how it works here! 39 | //[/Comments] 40 | */ 41 | class PMixPrefsComponent : public Component 42 | { 43 | public: 44 | //============================================================================== 45 | PMixPrefsComponent (PMixAudioEngine& audioEngine); 46 | ~PMixPrefsComponent(); 47 | 48 | //============================================================================== 49 | //[UserMethods] -- You can add your own custom methods in this section. 50 | //[/UserMethods] 51 | 52 | void paint (Graphics& g) override; 53 | void resized() override; 54 | 55 | 56 | 57 | private: 58 | //[UserVariables] -- You can add your own custom variables in this section. 59 | //[/UserVariables] 60 | 61 | //============================================================================== 62 | std::unique_ptr tabbedComponent; 63 | 64 | 65 | //============================================================================== 66 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsComponent) 67 | }; 68 | 69 | //[EndFile] You can add extra defines here... 70 | //[/EndFile] 71 | 72 | -------------------------------------------------------------------------------- /Source/pMixPrefsControllers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | //[/Headers] 22 | 23 | #include "pMixPrefsControllers.h" 24 | 25 | 26 | //[MiscUserDefs] You can add your own user definitions and misc code here... 27 | //[/MiscUserDefs] 28 | 29 | //============================================================================== 30 | PMixPrefsControllers::PMixPrefsControllers () 31 | { 32 | //[Constructor_pre] You can add your own custom stuff here.. 33 | //[/Constructor_pre] 34 | 35 | 36 | //[UserPreSize] 37 | //[/UserPreSize] 38 | 39 | setSize (600, 400); 40 | 41 | 42 | //[Constructor] You can add your own custom stuff here.. 43 | //[/Constructor] 44 | } 45 | 46 | PMixPrefsControllers::~PMixPrefsControllers() 47 | { 48 | //[Destructor_pre]. You can add your own custom destruction code here.. 49 | //[/Destructor_pre] 50 | 51 | 52 | 53 | //[Destructor]. You can add your own custom destruction code here.. 54 | //[/Destructor] 55 | } 56 | 57 | //============================================================================== 58 | void PMixPrefsControllers::paint (Graphics& g) 59 | { 60 | //[UserPrePaint] Add your own custom painting code here.. 61 | //[/UserPrePaint] 62 | 63 | g.fillAll (Colours::white); 64 | 65 | g.setColour (Colours::red); 66 | g.setFont (Font (83.10f, Font::plain)); 67 | g.drawText (TRANS("TODO!"), 68 | 20, 20, 316, 100, 69 | Justification::centred, true); 70 | 71 | //[UserPaint] Add your own custom painting code here.. 72 | //[/UserPaint] 73 | } 74 | 75 | void PMixPrefsControllers::resized() 76 | { 77 | //[UserPreResize] Add your own custom resize code here.. 78 | //[/UserPreResize] 79 | 80 | //[UserResized] Add your own custom resize handling here.. 81 | //[/UserResized] 82 | } 83 | 84 | 85 | 86 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 87 | //[/MiscUserCode] 88 | 89 | 90 | //============================================================================== 91 | #if 0 92 | /* -- Projucer information section -- 93 | 94 | This is where the Projucer stores the metadata that describe this GUI layout, so 95 | make changes in here at your peril! 96 | 97 | BEGIN_JUCER_METADATA 98 | 99 | 103 | 104 | 107 | 108 | 109 | 110 | END_JUCER_METADATA 111 | */ 112 | #endif 113 | 114 | 115 | //[EndFile] You can add extra defines here... 116 | //[/EndFile] 117 | -------------------------------------------------------------------------------- /Source/pMixPrefsControllers.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | //[/Headers] 25 | 26 | 27 | 28 | //============================================================================== 29 | /** 30 | //[Comments] 31 | An auto-generated component, created by the Introjucer. 32 | 33 | Describe your class and how it works here! 34 | //[/Comments] 35 | */ 36 | class PMixPrefsControllers : public Component 37 | { 38 | public: 39 | //============================================================================== 40 | PMixPrefsControllers (); 41 | ~PMixPrefsControllers(); 42 | 43 | //============================================================================== 44 | //[UserMethods] -- You can add your own custom methods in this section. 45 | //[/UserMethods] 46 | 47 | void paint (Graphics& g) override; 48 | void resized() override; 49 | 50 | 51 | 52 | private: 53 | //[UserVariables] -- You can add your own custom variables in this section. 54 | //[/UserVariables] 55 | 56 | //============================================================================== 57 | 58 | 59 | //============================================================================== 60 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsControllers) 61 | }; 62 | 63 | //[EndFile] You can add extra defines here... 64 | //[/EndFile] 65 | 66 | -------------------------------------------------------------------------------- /Source/pMixPrefsGeneral.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | //[/Headers] 22 | 23 | #include "pMixPrefsGeneral.h" 24 | 25 | 26 | //[MiscUserDefs] You can add your own user definitions and misc code here... 27 | //[/MiscUserDefs] 28 | 29 | //============================================================================== 30 | PMixPrefsGeneral::PMixPrefsGeneral () 31 | { 32 | //[Constructor_pre] You can add your own custom stuff here.. 33 | //[/Constructor_pre] 34 | 35 | 36 | //[UserPreSize] 37 | //[/UserPreSize] 38 | 39 | setSize (600, 400); 40 | 41 | 42 | //[Constructor] You can add your own custom stuff here.. 43 | //[/Constructor] 44 | } 45 | 46 | PMixPrefsGeneral::~PMixPrefsGeneral() 47 | { 48 | //[Destructor_pre]. You can add your own custom destruction code here.. 49 | //[/Destructor_pre] 50 | 51 | 52 | 53 | //[Destructor]. You can add your own custom destruction code here.. 54 | //[/Destructor] 55 | } 56 | 57 | //============================================================================== 58 | void PMixPrefsGeneral::paint (Graphics& g) 59 | { 60 | //[UserPrePaint] Add your own custom painting code here.. 61 | //[/UserPrePaint] 62 | 63 | g.fillAll (Colours::white); 64 | 65 | g.setColour (Colours::red); 66 | g.setFont (Font (83.10f, Font::plain)); 67 | g.drawText (TRANS("TODO!"), 68 | 20, 20, 316, 100, 69 | Justification::centred, true); 70 | 71 | //[UserPaint] Add your own custom painting code here.. 72 | //[/UserPaint] 73 | } 74 | 75 | void PMixPrefsGeneral::resized() 76 | { 77 | //[UserPreResize] Add your own custom resize code here.. 78 | //[/UserPreResize] 79 | 80 | //[UserResized] Add your own custom resize handling here.. 81 | //[/UserResized] 82 | } 83 | 84 | 85 | 86 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 87 | //[/MiscUserCode] 88 | 89 | 90 | //============================================================================== 91 | #if 0 92 | /* -- Projucer information section -- 93 | 94 | This is where the Projucer stores the metadata that describe this GUI layout, so 95 | make changes in here at your peril! 96 | 97 | BEGIN_JUCER_METADATA 98 | 99 | 103 | 104 | 107 | 108 | 109 | 110 | END_JUCER_METADATA 111 | */ 112 | #endif 113 | 114 | 115 | //[EndFile] You can add extra defines here... 116 | //[/EndFile] 117 | -------------------------------------------------------------------------------- /Source/pMixPrefsGeneral.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | //[/Headers] 25 | 26 | 27 | 28 | //============================================================================== 29 | /** 30 | //[Comments] 31 | An auto-generated component, created by the Introjucer. 32 | 33 | Describe your class and how it works here! 34 | //[/Comments] 35 | */ 36 | class PMixPrefsGeneral : public Component 37 | { 38 | public: 39 | //============================================================================== 40 | PMixPrefsGeneral (); 41 | ~PMixPrefsGeneral(); 42 | 43 | //============================================================================== 44 | //[UserMethods] -- You can add your own custom methods in this section. 45 | //[/UserMethods] 46 | 47 | void paint (Graphics& g) override; 48 | void resized() override; 49 | 50 | 51 | 52 | private: 53 | //[UserVariables] -- You can add your own custom variables in this section. 54 | //[/UserVariables] 55 | 56 | //============================================================================== 57 | 58 | 59 | //============================================================================== 60 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsGeneral) 61 | }; 62 | 63 | //[EndFile] You can add extra defines here... 64 | //[/EndFile] 65 | 66 | -------------------------------------------------------------------------------- /Source/pMixPrefsPlugins.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | //[Headers] You can add your own extra header files here... 21 | //[/Headers] 22 | 23 | #include "pMixPrefsPlugins.h" 24 | 25 | 26 | //[MiscUserDefs] You can add your own user definitions and misc code here... 27 | //[/MiscUserDefs] 28 | 29 | //============================================================================== 30 | PMixPrefsPlugins::PMixPrefsPlugins (PMixAudioEngine& audioEngine) 31 | : audioEngine(audioEngine) 32 | { 33 | //[Constructor_pre] You can add your own custom stuff here.. 34 | //[/Constructor_pre] 35 | 36 | pluginListComponent = std::make_unique(audioEngine.getFormatManager(), audioEngine.getKnownPluginList(), audioEngine.getDMPFile(), audioEngine.getAppProperties().getUserSettings()); 37 | addAndMakeVisible (*pluginListComponent); 38 | 39 | 40 | //[UserPreSize] 41 | //[/UserPreSize] 42 | 43 | setSize (600, 400); 44 | 45 | 46 | //[Constructor] You can add your own custom stuff here.. 47 | //[/Constructor] 48 | } 49 | 50 | PMixPrefsPlugins::~PMixPrefsPlugins() 51 | { 52 | //[Destructor_pre]. You can add your own custom destruction code here.. 53 | //[/Destructor_pre] 54 | 55 | pluginListComponent = nullptr; 56 | 57 | 58 | //[Destructor]. You can add your own custom destruction code here.. 59 | //[/Destructor] 60 | } 61 | 62 | //============================================================================== 63 | void PMixPrefsPlugins::paint (Graphics& g) 64 | { 65 | //[UserPrePaint] Add your own custom painting code here.. 66 | //[/UserPrePaint] 67 | 68 | g.fillAll (Colours::white); 69 | 70 | //[UserPaint] Add your own custom painting code here.. 71 | //[/UserPaint] 72 | } 73 | 74 | void PMixPrefsPlugins::resized() 75 | { 76 | //[UserPreResize] Add your own custom resize code here.. 77 | //[/UserPreResize] 78 | 79 | pluginListComponent->setBounds (8, 8, getWidth() - 16, getHeight() - 16); 80 | //[UserResized] Add your own custom resize handling here.. 81 | //[/UserResized] 82 | } 83 | 84 | 85 | 86 | //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... 87 | //[/MiscUserCode] 88 | 89 | 90 | //============================================================================== 91 | #if 0 92 | /* -- Projucer information section -- 93 | 94 | This is where the Projucer stores the metadata that describe this GUI layout, so 95 | make changes in here at your peril! 96 | 97 | BEGIN_JUCER_METADATA 98 | 99 | 104 | 105 | 108 | 109 | 110 | END_JUCER_METADATA 111 | */ 112 | #endif 113 | 114 | 115 | //[EndFile] You can add extra defines here... 116 | //[/EndFile] 117 | -------------------------------------------------------------------------------- /Source/pMixPrefsPlugins.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This is an automatically generated GUI class created by the Projucer! 5 | 6 | Be careful when adding custom code to these files, as only the code within 7 | the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded 8 | and re-saved. 9 | 10 | Created with Projucer version: 4.2.0 11 | 12 | ------------------------------------------------------------------------------ 13 | 14 | The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" 15 | Copyright (c) 2015 - ROLI Ltd. 16 | 17 | ============================================================================== 18 | */ 19 | 20 | #pragma once 21 | 22 | //[Headers] -- You can add your own extra header files here -- 23 | #include "JuceHeader.h" 24 | #include "pMixAudioEngine.h" 25 | //[/Headers] 26 | 27 | 28 | 29 | //============================================================================== 30 | /** 31 | //[Comments] 32 | An auto-generated component, created by the Introjucer. 33 | 34 | Describe your class and how it works here! 35 | //[/Comments] 36 | */ 37 | class PMixPrefsPlugins : public Component 38 | { 39 | public: 40 | //============================================================================== 41 | PMixPrefsPlugins (PMixAudioEngine& audioEngine); 42 | ~PMixPrefsPlugins(); 43 | 44 | //============================================================================== 45 | //[UserMethods] -- You can add your own custom methods in this section. 46 | //[/UserMethods] 47 | 48 | void paint (Graphics& g) override; 49 | void resized() override; 50 | 51 | 52 | 53 | private: 54 | //[UserVariables] -- You can add your own custom variables in this section. 55 | PMixAudioEngine& audioEngine; 56 | //[/UserVariables] 57 | 58 | //============================================================================== 59 | std::unique_ptr pluginListComponent; 60 | 61 | 62 | //============================================================================== 63 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPrefsPlugins) 64 | }; 65 | 66 | //[EndFile] You can add extra defines here... 67 | //[/EndFile] 68 | 69 | -------------------------------------------------------------------------------- /Source/pMixRHPTabContainer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixRHPTabContainer.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | 11 | #include "pMixRHPTabContainer.h" 12 | #include "pMixMainComponent.h" 13 | 14 | PMixTabContainer::PMixTabContainer (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, CodeEditor& codeEditor, InterpolationSpace& iSpace) 15 | : iSpace(iSpace) 16 | , codeEditor(codeEditor) 17 | { 18 | tabbedComponent = std::make_unique(TabbedButtonBar::TabsAtTop); 19 | addAndMakeVisible (*tabbedComponent); 20 | tabbedComponent->setTabBarDepth (23); 21 | tabbedComponent->addTab (TRANS("Code Editor"), Colours::lightgrey, &codeEditor, false); 22 | tabbedComponent->addTab (TRANS("Interpolation Space"), Colours::lightgrey, &iSpace, false); 23 | tabbedComponent->addTab (TRANS("Documentation"), Colours::lightgrey, &docsBrowser, false); 24 | 25 | tabbedComponent->setCurrentTabIndex (0); 26 | 27 | tabbedComponent->setOutline(0.); 28 | 29 | docsBrowser.goToURL("https://faust.grame.fr/doc/libraries/index.html"); 30 | 31 | setSize (600, 400); 32 | } 33 | 34 | PMixTabContainer::~PMixTabContainer() 35 | { 36 | tabbedComponent = nullptr; 37 | } 38 | 39 | void PMixTabContainer::paint (Graphics& g) 40 | { 41 | g.fillAll (Colours::white); 42 | } 43 | 44 | void PMixTabContainer::resized() 45 | { 46 | tabbedComponent->setBounds (0, 0, getWidth() - 0, getHeight() - 0); 47 | } 48 | 49 | void PMixTabContainer::addTabForContent(Component& content, int window) 50 | { 51 | switch (window) { 52 | case MainComponent::kWindowCodeEditor: 53 | tabbedComponent->addTab (TRANS("Code Editor"), Colours::lightgrey, &codeEditor, false); 54 | break; 55 | case MainComponent::kWindowISpace: 56 | tabbedComponent->addTab (TRANS("Interpolation Space"), Colours::lightgrey, &content, false); 57 | break; 58 | case MainComponent::kWindowConsole: 59 | break; 60 | default: 61 | break; 62 | } 63 | } 64 | 65 | void PMixTabContainer::removeTabForContent(Component& content) 66 | { 67 | for (int i=0; igetNumTabs(); i++) { 68 | if (tabbedComponent->getTabContentComponent(i) == &content) { 69 | tabbedComponent->removeTab(i); 70 | } 71 | } 72 | tabbedComponent->setCurrentTabIndex(0); 73 | } 74 | -------------------------------------------------------------------------------- /Source/pMixRHPTabContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixRHPTabContainer.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixInterpolationSpace.h" 14 | #include "pMixCodeEditor.h" 15 | #include "pMixGraphEditor.h" 16 | 17 | class PMixTabContainer : public Component 18 | { 19 | public: 20 | PMixTabContainer (PMixAudioEngine& audioEngine, GraphEditor& graphEditor, CodeEditor& codeEditor, InterpolationSpace& iSpace); 21 | ~PMixTabContainer(); 22 | 23 | CodeEditor* getCodeEditor() { return dynamic_cast(tabbedComponent->getTabContentComponent(0)); } 24 | 25 | void paint (Graphics& g); 26 | void resized(); 27 | 28 | void addTabForContent(Component& content, int window); 29 | void removeTabForContent(Component& content); 30 | 31 | private: 32 | std::unique_ptr tabbedComponent; 33 | InterpolationSpace& iSpace; 34 | CodeEditor& codeEditor; 35 | WebBrowserComponent docsBrowser; 36 | 37 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixTabContainer) 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /Source/pMixSVGDisplay.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixSVGDisplay.cpp 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #include "pMixSVGDisplay.h" 11 | #include "pMixGraphEditor.h" 12 | 13 | SVGDisplay::SVGDisplay(PMixAudioEngine& audioEngine, GraphEditor& graphEditor) 14 | : audioEngine(audioEngine) 15 | , graphEditor(graphEditor) 16 | , svgDrawable(nullptr) 17 | , browser(nullptr) 18 | { 19 | //browser = new WebBrowserComponent(); 20 | 21 | if (browser) { 22 | addAndMakeVisible (*browser); 23 | } 24 | 25 | graphEditor.addChangeListener(this); 26 | audioEngine.getDoc().addChangeListener(this); 27 | 28 | clearDisplay(); 29 | } 30 | 31 | SVGDisplay::~SVGDisplay() 32 | { 33 | graphEditor.removeChangeListener(this); 34 | audioEngine.getDoc().removeChangeListener(this); 35 | 36 | if (svgDrawable) { 37 | svgDrawable = nullptr; 38 | } 39 | } 40 | 41 | void SVGDisplay::paint (Graphics& g) 42 | { 43 | if (browser == nullptr) 44 | { 45 | g.fillAll (Colours::white); 46 | 47 | if (svgDrawable) 48 | svgDrawable->drawWithin(g, Rectangle(0, 0, getWidth(), getHeight()), RectanglePlacement::Flags::centred, 1.0f); 49 | } 50 | } 51 | 52 | void SVGDisplay::resized() 53 | { 54 | Rectangle r (getLocalBounds()); 55 | 56 | if (browser) 57 | browser->setBounds (r); 58 | } 59 | 60 | void SVGDisplay::changeListenerCallback (ChangeBroadcaster* source) 61 | { 62 | PMixDocument* doc = dynamic_cast(source); 63 | 64 | // every time the doc changes, loop over nodes and register as a listener to all the faust nodes. 65 | if (doc) { 66 | for (int i = 0; i (audioEngine.getDoc().getNode(i)->getProcessor()); 68 | 69 | if (faustProc) 70 | faustProc->getFactory()->registerSVGThreadListenser(this); 71 | } 72 | 73 | return; 74 | } 75 | 76 | GraphEditor* pgraphEditor = dynamic_cast(source); 77 | 78 | if (pgraphEditor) 79 | { 80 | if(pgraphEditor->getLassoSelection().getNumSelected() == 1) 81 | { 82 | NodeComponent* selectedItem = dynamic_cast(pgraphEditor->getLassoSelection().getSelectedItem(0)); 83 | 84 | if (selectedItem) 85 | { 86 | FaustAudioPluginInstance* faustProc = dynamic_cast(audioEngine.getDoc().getNodeForId(selectedItem->nodeID)->getProcessor()); 87 | 88 | if (faustProc) 89 | { 90 | if (!faustProc->getHighlight()) 91 | { 92 | if (browser) 93 | browser->goToURL(audioEngine.getDoc().getLibraryPath() + "wait.html"); 94 | else 95 | { 96 | //TODO:SVG wait 97 | } 98 | } 99 | else 100 | clearDisplay(); 101 | 102 | return; 103 | } 104 | } 105 | } 106 | } 107 | 108 | FaustgenFactory::SVGRenderThread* thread = dynamic_cast(source); 109 | 110 | // if an SVGRenderThread has triggered this change message 111 | if (thread) 112 | { 113 | // if a single item is selected in the graph editor update the browser 114 | if(graphEditor.getLassoSelection().getNumSelected() == 1) 115 | { 116 | NodeComponent* selectedItem = dynamic_cast(graphEditor.getLassoSelection().getSelectedItem(0)); 117 | 118 | if (selectedItem) { 119 | if (browser) 120 | loadSVG(thread->getFactory()->getHTMLURI()); 121 | else 122 | loadSVG(thread->getFactory()->getSVGFile().getFullPathName()); 123 | 124 | return; 125 | } 126 | } 127 | } 128 | 129 | } 130 | 131 | void SVGDisplay::clearDisplay() 132 | { 133 | if (browser) { 134 | browser->goToURL(""); 135 | } 136 | else { 137 | svgDrawable = nullptr; 138 | repaint(); 139 | } 140 | } 141 | 142 | void SVGDisplay::loadSVG(const String& url) 143 | { 144 | if (browser) 145 | browser->goToURL(url); 146 | else 147 | { 148 | svgDrawable = Drawable::createFromImageFile(File(url)); 149 | repaint(); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Source/pMixSVGDisplay.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | pMixSVGDisplay.h 5 | Author: Oliver Larkin 6 | 7 | ============================================================================== 8 | */ 9 | 10 | #pragma once 11 | 12 | #include "JuceHeader.h" 13 | #include "pMixAudioEngine.h" 14 | #include "pMixGraphEditor.h" 15 | 16 | class SVGDisplay : public Component 17 | , public ChangeListener 18 | //, public Button::Listener 19 | { 20 | public: 21 | SVGDisplay(PMixAudioEngine& audioEngine, GraphEditor& graphEditor); 22 | ~SVGDisplay(); 23 | void paint (Graphics& g) override; 24 | void resized() override; 25 | 26 | void changeListenerCallback (ChangeBroadcaster* source) override; 27 | //void buttonClicked (Button* button); 28 | 29 | void clearDisplay(); 30 | void loadSVG(const String& url); 31 | 32 | private: 33 | PMixAudioEngine& audioEngine; 34 | GraphEditor& graphEditor; 35 | std::unique_ptr svgDrawable; // used if no webbrowser component 36 | std::unique_ptr browser; 37 | 38 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SVGDisplay); 39 | }; 40 | 41 | 42 | -------------------------------------------------------------------------------- /manual/pMix-manual.tex: -------------------------------------------------------------------------------- 1 | %PREAMBLE -------------------------------------------------------------------------------------------------------- 2 | 3 | \documentclass[a4paper,14pt]{report} 4 | 5 | \usepackage{geometry} 6 | \geometry{ 7 | a4paper, 8 | total={210mm,297mm}, 9 | left=25mm, 10 | right=25mm, 11 | top=30mm, 12 | bottom=30mm, 13 | } 14 | 15 | \setlength\parindent{0pt} 16 | 17 | \usepackage{booktabs} 18 | \usepackage{tabularx} 19 | 20 | \usepackage{nameref} 21 | \usepackage{pdflscape} 22 | \usepackage{float} 23 | \usepackage[scaled]{helvet} 24 | \renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif 25 | \usepackage[T1]{fontenc} 26 | 27 | %for RTF import 28 | \usepackage{fancyvrb,standalone} 29 | 30 | \usepackage{graphicx} 31 | 32 | \graphicspath{ {images/} } 33 | 34 | \usepackage{tikz} 35 | 36 | \usepackage[hidelinks]{hyperref} 37 | \hypersetup{ 38 | colorlinks = true, 39 | linkcolor = black, 40 | urlcolor = blue, 41 | citecolor = gray 42 | } 43 | 44 | \usepackage{titlesec, blindtext, color} 45 | \definecolor{gray75}{gray}{0.75} 46 | \newcommand{\hsp}{\hspace{10pt}} 47 | \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries} 48 | \titlespacing*{\chapter}{0pt}{-60pt}{20pt} 49 | \renewcommand{\chaptername}{} 50 | %\renewcommand{\thechapter}{} 51 | 52 | \usepackage[toc,nonumberlist,numberedsection]{glossaries} 53 | \makeglossaries 54 | 55 | 56 | %glossary terms 57 | \newacronym{DAW}{DAW}{Digital Audio Workstation} 58 | \newacronym{VST}{VST}{Virtual Studio Technology} 59 | \newglossaryentry{preset} 60 | { 61 | name={preset}, 62 | description={A stored configuration of parameters/settings that represents the state of an audio effect or synthesiser} 63 | } 64 | 65 | %\usepackage{todonotes} 66 | % 67 | %\usepackage{draftwatermark} 68 | %\SetWatermarkText{DRAFT} 69 | %\SetWatermarkLightness{0.99} 70 | %\SetWatermarkScale{1} 71 | 72 | %PREAMBLE -------------------------------------------------------------------------------------------------------- 73 | 74 | \begin{document} 75 | 76 | \begin{titlepage}~\\[4cm] 77 | \begin{center} 78 | %\includegraphics[scale=0.8]{pMix_Logo}\\[2cm] 79 | \textsc{\huge pMix - Preset Mixer}\\[2cm] 80 | \textsc{\LARGE User Manual}\\[1cm] 81 | \textsc{Oli Larkin 2015}\\[8cm] 82 | %\includegraphics[scale=0.4]{PIB_logo_vector} 83 | \end{center} 84 | \end{titlepage} 85 | \large 86 | 87 | \marginparwidth = 25pt 88 | 89 | %\listoftodos 90 | \tableofcontents 91 | \setcounter{tocdepth}{1} 92 | 93 | %\begin{tikzpicture} 94 | % \node at (0,0) {\includegraphics[scale=0.4]{pMix_screenshot_actualsize_980x581}}; 95 | % \draw[red,ultra thick,rounded corners] (7.5,5.3) rectangle (9.4,6.2); 96 | %\end{tikzpicture} 97 | 98 | \chapter{Introduction} 99 | 100 | 101 | \section{Key Features} 102 | 103 | \begin{itemize} 104 | \item 105 | \end{itemize} 106 | 107 | \section{System Requirements} 108 | 109 | \subsection*{Mac} 110 | \begin{itemize} 111 | \item OSX Lion (10.7) or higher 112 | \item 32bit or 64bit VST 2.4, VST 3 or Audio Unit host for plug-in version 113 | \item Minimum Intel i5 CPU and 4GB ram or more recommended 114 | \end{itemize} 115 | \subsection*{Windows} 116 | \begin{itemize} 117 | \item Windows XP, Vista, 7 or 8 118 | \item 32bit or 64bit VST 2.4, VST 3 host for plug-in version 119 | \item Minimum Intel i5 CPU and 4GB ram or more recommended 120 | \end{itemize} 121 | \subsection*{Linux} 122 | \begin{itemize} 123 | \item Minimum Intel i5 CPU and 4GB ram or more recommended 124 | \end{itemize} 125 | 126 | \section{Installation} 127 | \subsection*{Mac} 128 | \subsection*{Windows} 129 | \subsection*{Linux} 130 | 131 | 132 | \chapter{Getting Started} 133 | 134 | 135 | \chapter{Global Settings} 136 | 137 | 138 | \chapter{Stand-alone Application} 139 | 140 | 141 | \chapter{Host Notes} 142 | This section contains information regarding using pMix in specific plug-in host applications. 143 | 144 | \chapter{Further Reading} \label{chap:furtherreading} 145 | 146 | TODO: 147 | 148 | \begin{itemize} 149 | \item \href{http://www.olilarkin.co.uk}{Preset Interpolators} 150 | \end{itemize} 151 | 152 | \chapter{Support Info} 153 | TODO: 154 | 155 | %\begin{itemize} 156 | %\item What is the pMix version number? \\* 157 | %\emph{e.g. v1.0.0} 158 | %\item What plug-in format were you using? \\* 159 | %\emph{e.g. VST2, VST3, Audio Unit or Stand-alone app} 160 | %\end{itemize} 161 | 162 | \section*{Feature Requests and Feedback} 163 | If you like (or dislike) aspects of pMix we'd really appreciate your feedback. 164 | 165 | \chapter{Credits and Acknowledgements} 166 | pMix is designed and developed by Oli Larkin \\* 167 | \section*{Thanks:} 168 | \begin{itemize} 169 | \item pMix beta testers 170 | \end{itemize} 171 | 172 | \printglossaries 173 | 174 | \chapter{License} 175 | 176 | \subsection*{Copyrights and trademarks:} 177 | pMix \copyright Copyright Oliver Larkin 2008 - 2015\\* 178 | \href{www.olilarkin.co.uk}{www.olilarkin.co.uk}\\*\\* 179 | 180 | VST is a trademark of Steinberg Media Technologies GmbH\\* 181 | Audio Unit is a trademark of Apple, Inc.\\* 182 | 183 | \end{document} -------------------------------------------------------------------------------- /misc/pMixVimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/misc/pMixVimeo.png -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/Info-AU.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${EXECUTABLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | $(PRODUCT_BUNDLE_IDENTIFIER) 12 | CFBundleName 13 | pMixPlugin 14 | CFBundleDisplayName 15 | pMixPlugin 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | 0.0.2 22 | CFBundleVersion 23 | 0.0.2 24 | NSHumanReadableCopyright 25 | Oli Larkin Plugins 26 | NSHighResolutionCapable 27 | 28 | AudioComponents 29 | 30 | 31 | name 32 | OliLarkin: pMix 33 | description 34 | pMix 35 | factoryFunction 36 | pMixPluginAUFactory 37 | manufacturer 38 | oliL 39 | type 40 | aumf 41 | subtype 42 | pMix 43 | version 44 | 2 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/Info-Shared_Code.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${EXECUTABLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | $(PRODUCT_BUNDLE_IDENTIFIER) 12 | CFBundleName 13 | pMixPlugin 14 | CFBundleDisplayName 15 | pMixPlugin 16 | CFBundlePackageType 17 | FMWK 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | 0.0.1 22 | CFBundleVersion 23 | 0.0.1 24 | NSHumanReadableCopyright 25 | Oli Larkin Plugins 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/Info-VST.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${EXECUTABLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | com.OliLarkin.pMixPlugin 12 | CFBundleName 13 | pMixPlugin 14 | CFBundleDisplayName 15 | pMixPlugin 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | 0.0.2 22 | CFBundleVersion 23 | 0.0.2 24 | NSHumanReadableCopyright 25 | 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/Info-VST3.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${EXECUTABLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | $(PRODUCT_BUNDLE_IDENTIFIER) 12 | CFBundleName 13 | pMixPlugin 14 | CFBundleDisplayName 15 | pMixPlugin 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | 0.0.1 22 | CFBundleVersion 23 | 0.0.1 24 | NSHumanReadableCopyright 25 | Oli Larkin Plugins 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/RecentFilesMenuTemplate.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olilarkin/pMix2/b552566724fdf861c0c553c5b3c20def4078c493/pMixPlugin/Builds/MacOSX/RecentFilesMenuTemplate.nib -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/pMixPlugin.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pMixPlugin/Builds/MacOSX/pMixPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pMixPlugin/JUCE.patch: -------------------------------------------------------------------------------- 1 | diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp 2 | index 84dd0e2..87a8ea9 100644 3 | --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp 4 | +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp 5 | @@ -1183,7 +1183,7 @@ void AudioProcessorGraph::buildRenderingSequence() 6 | int numMidiBuffersNeeded = 1; 7 | 8 | { 9 | - MessageManagerLock mml; 10 | + //MessageManagerLock mml; 11 | 12 | Array orderedNodes; 13 | 14 | diff --git a/modules/juce_core/text/juce_Identifier.cpp b/modules/juce_core/text/juce_Identifier.cpp 15 | index bac4dd5..7e670dd 100644 16 | --- a/modules/juce_core/text/juce_Identifier.cpp 17 | +++ b/modules/juce_core/text/juce_Identifier.cpp 18 | @@ -42,7 +42,7 @@ Identifier::Identifier (const String& nm) 19 | { 20 | /* An Identifier string must be suitable for use as a script variable or XML 21 | attribute, so it can only contain this limited set of characters.. */ 22 | - jassert (isValidIdentifier (toString())); 23 | + //jassert (isValidIdentifier (toString())); 24 | } 25 | 26 | Identifier::Identifier (const char* nm) 27 | -------------------------------------------------------------------------------- /pMixPlugin/JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | #if ! DONT_SET_USING_JUCE_NAMESPACE 35 | // If your code uses a lot of JUCE classes, then this will obviously save you 36 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 37 | using namespace juce; 38 | #endif 39 | 40 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 41 | namespace ProjectInfo 42 | { 43 | const char* const projectName = "pMixPlugin"; 44 | const char* const versionString = "0.0.2"; 45 | const int versionNumber = 0x2; 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /pMixPlugin/JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Important Note!! 3 | ================ 4 | 5 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 7 | the Projucer saves your project. 8 | 9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 10 | put any of your own files in here if you don't want to lose them. (Of course you may choose 11 | to add the folder's contents to your version-control system so that you can re-merge your own 12 | modifications after the Projucer has saved its changes). 13 | -------------------------------------------------------------------------------- /pMixPlugin/README.md: -------------------------------------------------------------------------------- 1 | # pMixPlugin - Plug-in version 2 | 3 | A VST2, VST3 and AudioUnit version of pMix. Possibly LV2 in the future. 4 | 5 | ## Dependencies: 6 | 7 | See main README.md for pMix standalone. 8 | 9 | ## Compiling: 10 | 11 | See instructions for pMix standalone in [../README.md](../README.md) 12 | 13 | If you need to change any paths etc, you should do so using the JUCE .jucer project. 14 | 15 | ## Notes: 16 | 17 | Currently JUCE must be modified in order to avoid a deadlock when AudioProcessorGraph is used in a plug-in setting. The JUCE.patch file has a temporary hack, until a better solution is found. 18 | 19 | For further info, see [http://www.juce.com/forum/topic/ableton-live-deadlock-plugin-audioprocessorgraph]() 20 | 21 | 22 | **License:** 23 | 24 | pMix 25 | Copyright Oliver Larkin 2008 - 2017 26 | License: GPL 27 | www.olilarkin.co.uk 28 | -------------------------------------------------------------------------------- /pMixPlugin/Source/PluginEditor.cpp: -------------------------------------------------------------------------------- 1 | #include "PluginProcessor.h" 2 | #include "PluginEditor.h" 3 | 4 | PMixPluginAudioProcessorEditor::PMixPluginAudioProcessorEditor (PMixPluginAudioProcessor& p) 5 | : AudioProcessorEditor (&p), processor (p) 6 | { 7 | mainComponent = new MainComponent (processor.getAudioEngine()); 8 | addAndMakeVisible(mainComponent); 9 | 10 | addAndMakeVisible (resizer = new ResizableCornerComponent (this, &resizeLimits)); 11 | resizeLimits.setSizeLimits (500, 300, 1920, 1200); 12 | 13 | setSize (1200, 800); 14 | } 15 | 16 | PMixPluginAudioProcessorEditor::~PMixPluginAudioProcessorEditor() 17 | { 18 | mainComponent = nullptr; 19 | } 20 | 21 | void PMixPluginAudioProcessorEditor::paint (Graphics& g) 22 | { 23 | g.fillAll (Colours::lightgrey); 24 | } 25 | 26 | void PMixPluginAudioProcessorEditor::resized() 27 | { 28 | mainComponent->setBounds (0, 0, getWidth(), getHeight()); 29 | resizer->setBounds (getWidth() - 16, getHeight() - 16, 16, 16); 30 | } 31 | -------------------------------------------------------------------------------- /pMixPlugin/Source/PluginEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../JuceLibraryCode/JuceHeader.h" 4 | #include "PluginProcessor.h" 5 | #include "pMixMainComponent.h" 6 | 7 | class PMixPluginAudioProcessorEditor : public AudioProcessorEditor 8 | { 9 | public: 10 | PMixPluginAudioProcessorEditor (PMixPluginAudioProcessor&); 11 | ~PMixPluginAudioProcessorEditor(); 12 | 13 | void paint (Graphics&) override; 14 | void resized() override; 15 | 16 | private: 17 | PMixPluginAudioProcessor& processor; 18 | ScopedPointer mainComponent; 19 | ScopedPointer resizer; 20 | ComponentBoundsConstrainer resizeLimits; 21 | 22 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPluginAudioProcessorEditor) 23 | }; -------------------------------------------------------------------------------- /pMixPlugin/Source/PluginProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include "PluginProcessor.h" 2 | #include "PluginEditor.h" 3 | 4 | PMixPluginAudioProcessor::PMixPluginAudioProcessor() 5 | { 6 | audioEngine.getDoc().initialize(); 7 | } 8 | 9 | PMixPluginAudioProcessor::~PMixPluginAudioProcessor() 10 | { 11 | } 12 | 13 | void PMixPluginAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) 14 | { 15 | audioEngine.getGraph().setPlayConfigDetails (getTotalNumInputChannels(), getTotalNumOutputChannels(), sampleRate, samplesPerBlock); 16 | audioEngine.getGraph().prepareToPlay (sampleRate, samplesPerBlock); 17 | } 18 | 19 | void PMixPluginAudioProcessor::releaseResources() 20 | { 21 | audioEngine.getGraph().releaseResources(); 22 | } 23 | 24 | void PMixPluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) 25 | { 26 | audioEngine.getGraph().processBlock (buffer, midiMessages); 27 | } 28 | 29 | void PMixPluginAudioProcessor::getStateInformation (MemoryBlock& destData) 30 | { 31 | ScopedPointer xml = audioEngine.getDoc().createXml(); 32 | copyXmlToBinary(*xml, destData); 33 | } 34 | 35 | void PMixPluginAudioProcessor::setStateInformation (const void* data, int sizeInBytes) 36 | { 37 | ScopedPointer xmlState (getXmlFromBinary (data, sizeInBytes)); 38 | 39 | if (xmlState != nullptr) 40 | { 41 | audioEngine.getDoc().restoreFromXml(*xmlState); 42 | } 43 | } 44 | 45 | AudioProcessorEditor* PMixPluginAudioProcessor::createEditor() 46 | { 47 | return new PMixPluginAudioProcessorEditor (*this); 48 | } 49 | 50 | AudioProcessor* JUCE_CALLTYPE createPluginFilter() 51 | { 52 | return new PMixPluginAudioProcessor(); 53 | } 54 | -------------------------------------------------------------------------------- /pMixPlugin/Source/PluginProcessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../JuceLibraryCode/JuceHeader.h" 4 | #include "pMixAudioEngine.h" 5 | 6 | class PMixPluginAudioProcessor : public AudioProcessor 7 | { 8 | public: 9 | 10 | PMixPluginAudioProcessor(); 11 | ~PMixPluginAudioProcessor(); 12 | 13 | const String getName() const override { return JucePlugin_Name; } 14 | bool acceptsMidi() const override { return true; } 15 | bool producesMidi() const override { return true; } 16 | double getTailLengthSeconds() const override { return 0.0; } 17 | int getNumPrograms() override { return 1; } 18 | int getCurrentProgram() override { return 0; } 19 | void setCurrentProgram (int index) override {} 20 | const String getProgramName (int index) override { return String(); } 21 | void changeProgramName (int index, const String& newName) override {} 22 | bool hasEditor() const override { return true; } 23 | 24 | void prepareToPlay (double sampleRate, int samplesPerBlock) override; 25 | void releaseResources() override; 26 | 27 | void processBlock (AudioSampleBuffer&, MidiBuffer&) override; 28 | 29 | AudioProcessorEditor* createEditor() override; 30 | 31 | // int getNumParameters() override; 32 | // float getParameter (int index) override; 33 | // void setParameter (int index, float newValue) override; 34 | 35 | void getStateInformation (MemoryBlock& destData) override; 36 | void setStateInformation (const void* data, int sizeInBytes) override; 37 | 38 | PMixAudioEngine& getAudioEngine() { return audioEngine; } 39 | 40 | private: 41 | PMixAudioEngine audioEngine; 42 | 43 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PMixPluginAudioProcessor) 44 | }; 45 | --------------------------------------------------------------------------------