- clean working copy for leaving SVN

This commit is contained in:
2022-06-28 19:04:46 +02:00
parent 62a2d47cb3
commit 762b8f0e7d
1966 changed files with 699872 additions and 126 deletions
@@ -0,0 +1,186 @@
# Automatically generated makefile, created by the Introjucer
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
# (this disables dependency generation if multiple architectures are set)
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)
ifndef CONFIG
CONFIG=Debug
endif
ifeq ($(CONFIG),Debug)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Debug
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/SDKs/vstsdk2.4 -I ../../JuceLibraryCode -I ../../../../modules
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/SDKs/vstsdk2.4 -I ../../JuceLibraryCode -I ../../../../modules
TARGET := Plugin\ Host
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR)
endif
ifeq ($(CONFIG),Release)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Release
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/SDKs/vstsdk2.4 -I ../../JuceLibraryCode -I ../../../../modules
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -Os
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ~/SDKs/vstsdk2.4 -I ../../JuceLibraryCode -I ../../../../modules
TARGET := Plugin\ Host
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR)
endif
OBJECTS := \
$(OBJDIR)/FilterGraph_62e9c017.o \
$(OBJDIR)/GraphEditorPanel_3dbd4872.o \
$(OBJDIR)/HostStartup_5ce96f96.o \
$(OBJDIR)/InternalFilters_beb54bdf.o \
$(OBJDIR)/MainHostWindow_e920295a.o \
$(OBJDIR)/juce_audio_basics_399a455e.o \
$(OBJDIR)/juce_audio_devices_c1c9ba9c.o \
$(OBJDIR)/juce_audio_formats_f04b043c.o \
$(OBJDIR)/juce_audio_processors_eb9ae116.o \
$(OBJDIR)/juce_audio_utils_cf18005c.o \
$(OBJDIR)/juce_core_1ee54a40.o \
$(OBJDIR)/juce_cryptography_3b1f489a.o \
$(OBJDIR)/juce_data_structures_84790dfc.o \
$(OBJDIR)/juce_events_584896b4.o \
$(OBJDIR)/juce_graphics_f9afc18.o \
$(OBJDIR)/juce_gui_basics_90929794.o \
$(OBJDIR)/juce_gui_extra_b81d9e1c.o \
$(OBJDIR)/juce_opengl_1890bee0.o \
$(OBJDIR)/juce_video_86a19d3c.o \
.PHONY: clean
$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking Plugin Host
-@mkdir -p $(BINDIR)
-@mkdir -p $(LIBDIR)
-@mkdir -p $(OUTDIR)
@$(BLDCMD)
clean:
@echo Cleaning Plugin Host
@$(CLEANCMD)
strip:
@echo Stripping Plugin Host
-@strip --strip-unneeded $(OUTDIR)/$(TARGET)
$(OBJDIR)/FilterGraph_62e9c017.o: ../../Source/FilterGraph.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling FilterGraph.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/GraphEditorPanel_3dbd4872.o: ../../Source/GraphEditorPanel.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling GraphEditorPanel.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/HostStartup_5ce96f96.o: ../../Source/HostStartup.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling HostStartup.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/InternalFilters_beb54bdf.o: ../../Source/InternalFilters.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling InternalFilters.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/MainHostWindow_e920295a.o: ../../Source/MainHostWindow.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling MainHostWindow.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_basics_399a455e.o: ../../../../modules/juce_audio_basics/juce_audio_basics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_basics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_devices_c1c9ba9c.o: ../../../../modules/juce_audio_devices/juce_audio_devices.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_devices.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_formats_f04b043c.o: ../../../../modules/juce_audio_formats/juce_audio_formats.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_formats.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_processors_eb9ae116.o: ../../../../modules/juce_audio_processors/juce_audio_processors.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_processors.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_utils_cf18005c.o: ../../../../modules/juce_audio_utils/juce_audio_utils.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_utils.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_core_1ee54a40.o: ../../../../modules/juce_core/juce_core.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_core.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_cryptography_3b1f489a.o: ../../../../modules/juce_cryptography/juce_cryptography.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_cryptography.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_data_structures_84790dfc.o: ../../../../modules/juce_data_structures/juce_data_structures.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_data_structures.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_events_584896b4.o: ../../../../modules/juce_events/juce_events.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_events.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_graphics_f9afc18.o: ../../../../modules/juce_graphics/juce_graphics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_graphics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_gui_basics_90929794.o: ../../../../modules/juce_gui_basics/juce_gui_basics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_gui_basics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_gui_extra_b81d9e1c.o: ../../../../modules/juce_gui_extra/juce_gui_extra.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_gui_extra.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_opengl_1890bee0.o: ../../../../modules/juce_opengl/juce_opengl.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_opengl.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_video_86a19d3c.o: ../../../../modules/juce_video/juce_video.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_video.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.rawmaterialsoftware.pluginhost</string>
<key>CFBundleName</key>
<string>Plugin Host</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSHumanReadableCopyright</key>
<string>Raw Material Software Ltd.</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{1432F632-8806-81AA-A50D-5B2696FD2BC8}") = "Plugin Host", "Plugin Host.vcxproj", "{0628E63C-9BCD-C866-7DA3-ACF9F6AD986E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0628E63C-9BCD-C866-7DA3-ACF9F6AD986E}.Debug|Win32.ActiveCfg = Debug|Win32
{0628E63C-9BCD-C866-7DA3-ACF9F6AD986E}.Debug|Win32.Build.0 = Debug|Win32
{0628E63C-9BCD-C866-7DA3-ACF9F6AD986E}.Release|Win32.ActiveCfg = Release|Win32
{0628E63C-9BCD-C866-7DA3-ACF9F6AD986E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,30 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Raw Material Software Ltd.\0"
VALUE "FileDescription", "Plugin Host\0"
VALUE "FileVersion", "1.0.0\0"
VALUE "ProductName", "Plugin Host\0"
VALUE "ProductVersion", "1.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif
@@ -0,0 +1,197 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
There's a section below where you can add your own custom code safely, and the
Introjucer will preserve the contents of that block, but the best way to change
any of these definitions is by using the Introjucer's project settings.
Any commented-out settings will assume their default values.
*/
#ifndef __JUCE_APPCONFIG_NTE0XB0IJ__
#define __JUCE_APPCONFIG_NTE0XB0IJ__
//==============================================================================
// [BEGIN_USER_CODE_SECTION]
// (You can add your own code in this section, and the Introjucer will not overwrite it)
// [END_USER_CODE_SECTION]
//==============================================================================
#define JUCE_MODULE_AVAILABLE_juce_audio_basics 1
#define JUCE_MODULE_AVAILABLE_juce_audio_devices 1
#define JUCE_MODULE_AVAILABLE_juce_audio_formats 1
#define JUCE_MODULE_AVAILABLE_juce_audio_processors 1
#define JUCE_MODULE_AVAILABLE_juce_audio_utils 1
#define JUCE_MODULE_AVAILABLE_juce_core 1
#define JUCE_MODULE_AVAILABLE_juce_cryptography 1
#define JUCE_MODULE_AVAILABLE_juce_data_structures 1
#define JUCE_MODULE_AVAILABLE_juce_events 1
#define JUCE_MODULE_AVAILABLE_juce_graphics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_basics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1
#define JUCE_MODULE_AVAILABLE_juce_opengl 1
#define JUCE_MODULE_AVAILABLE_juce_video 1
//==============================================================================
// juce_audio_devices flags:
#ifndef JUCE_ASIO
//#define JUCE_ASIO
#endif
#ifndef JUCE_WASAPI
#define JUCE_WASAPI 1
#endif
#ifndef JUCE_DIRECTSOUND
#define JUCE_DIRECTSOUND 1
#endif
#ifndef JUCE_ALSA
#define JUCE_ALSA 1
#endif
#ifndef JUCE_JACK
//#define JUCE_JACK
#endif
#ifndef JUCE_USE_ANDROID_OPENSLES
//#define JUCE_USE_ANDROID_OPENSLES
#endif
#ifndef JUCE_USE_CDREADER
#define JUCE_USE_CDREADER 0
#endif
#ifndef JUCE_USE_CDBURNER
#define JUCE_USE_CDBURNER 0
#endif
//==============================================================================
// juce_audio_formats flags:
#ifndef JUCE_USE_FLAC
#define JUCE_USE_FLAC 0
#endif
#ifndef JUCE_USE_OGGVORBIS
#define JUCE_USE_OGGVORBIS 0
#endif
#ifndef JUCE_USE_MP3AUDIOFORMAT
//#define JUCE_USE_MP3AUDIOFORMAT
#endif
#ifndef JUCE_USE_LAME_AUDIO_FORMAT
//#define JUCE_USE_LAME_AUDIO_FORMAT
#endif
#ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT
//#define JUCE_USE_WINDOWS_MEDIA_FORMAT
#endif
//==============================================================================
// juce_audio_processors flags:
#ifndef JUCE_PLUGINHOST_VST
#define JUCE_PLUGINHOST_VST 1
#endif
#ifndef JUCE_PLUGINHOST_VST3
#define JUCE_PLUGINHOST_VST3 1
#endif
#ifndef JUCE_PLUGINHOST_AU
#define JUCE_PLUGINHOST_AU 1
#endif
//==============================================================================
// juce_core flags:
#ifndef JUCE_FORCE_DEBUG
//#define JUCE_FORCE_DEBUG
#endif
#ifndef JUCE_LOG_ASSERTIONS
//#define JUCE_LOG_ASSERTIONS
#endif
#ifndef JUCE_CHECK_MEMORY_LEAKS
//#define JUCE_CHECK_MEMORY_LEAKS
#endif
#ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
#ifndef JUCE_INCLUDE_ZLIB_CODE
//#define JUCE_INCLUDE_ZLIB_CODE
#endif
//==============================================================================
// juce_graphics flags:
#ifndef JUCE_USE_COREIMAGE_LOADER
//#define JUCE_USE_COREIMAGE_LOADER
#endif
#ifndef JUCE_USE_DIRECTWRITE
//#define JUCE_USE_DIRECTWRITE
#endif
//==============================================================================
// juce_gui_basics flags:
#ifndef JUCE_ENABLE_REPAINT_DEBUGGING
//#define JUCE_ENABLE_REPAINT_DEBUGGING
#endif
#ifndef JUCE_USE_XSHM
//#define JUCE_USE_XSHM
#endif
#ifndef JUCE_USE_XRENDER
//#define JUCE_USE_XRENDER
#endif
#ifndef JUCE_USE_XCURSOR
//#define JUCE_USE_XCURSOR
#endif
//==============================================================================
// juce_gui_extra flags:
#ifndef JUCE_WEB_BROWSER
#define JUCE_WEB_BROWSER 0
#endif
#ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR
//#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR
#endif
//==============================================================================
// juce_video flags:
#ifndef JUCE_DIRECTSHOW
//#define JUCE_DIRECTSHOW
#endif
#ifndef JUCE_MEDIAFOUNDATION
//#define JUCE_MEDIAFOUNDATION
#endif
#ifndef JUCE_QUICKTIME
#define JUCE_QUICKTIME 0
#endif
#ifndef JUCE_USE_CAMERA
#define JUCE_USE_CAMERA 0
#endif
#endif // __JUCE_APPCONFIG_NTE0XB0IJ__
@@ -0,0 +1,47 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
This is the header file that your files should include in order to get all the
JUCE library headers. You should avoid including the JUCE headers directly in
your own source files, because that wouldn't pick up the correct configuration
options for your app.
*/
#ifndef __APPHEADERFILE_NTE0XB0IJ__
#define __APPHEADERFILE_NTE0XB0IJ__
#include "AppConfig.h"
#include "modules/juce_audio_basics/juce_audio_basics.h"
#include "modules/juce_audio_devices/juce_audio_devices.h"
#include "modules/juce_audio_formats/juce_audio_formats.h"
#include "modules/juce_audio_processors/juce_audio_processors.h"
#include "modules/juce_audio_utils/juce_audio_utils.h"
#include "modules/juce_core/juce_core.h"
#include "modules/juce_cryptography/juce_cryptography.h"
#include "modules/juce_data_structures/juce_data_structures.h"
#include "modules/juce_events/juce_events.h"
#include "modules/juce_graphics/juce_graphics.h"
#include "modules/juce_gui_basics/juce_gui_basics.h"
#include "modules/juce_gui_extra/juce_gui_extra.h"
#include "modules/juce_opengl/juce_opengl.h"
#include "modules/juce_video/juce_video.h"
#if ! DONT_SET_USING_JUCE_NAMESPACE
// If your code uses a lot of JUCE classes, then this will obviously save you
// a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
using namespace juce;
#endif
#if ! JUCE_DONT_DECLARE_PROJECTINFO
namespace ProjectInfo
{
const char* const projectName = "Plugin Host";
const char* const versionString = "1.0.0";
const int versionNumber = 0x10000;
}
#endif
#endif // __APPHEADERFILE_NTE0XB0IJ__
@@ -0,0 +1,12 @@
Important Note!!
================
The purpose of this folder is to contain files that are auto-generated by the Introjucer,
and ALL files in this folder will be mercilessly DELETED and completely re-written whenever
the Introjucer saves your project.
Therefore, it's a bad idea to make any manual changes to the files in here, or to
put any of your own files in here if you don't want to lose them. (Of course you may choose
to add the folder's contents to your version-control system so that you can re-merge your own
modifications after the Introjucer has saved its changes).
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_basics/juce_audio_basics.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_devices/juce_audio_devices.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_formats/juce_audio_formats.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_processors/juce_audio_processors.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_utils/juce_audio_utils.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_core/juce_core.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_cryptography/juce_cryptography.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_data_structures/juce_data_structures.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_events/juce_events.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_graphics/juce_graphics.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_gui_basics/juce_gui_basics.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_gui_extra/juce_gui_extra.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_opengl/juce_opengl.h"
@@ -0,0 +1,5 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_video/juce_video.h"
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="NTe0XB0ij" name="Plugin Host" projectType="guiapp" version="1.0.0"
juceLinkage="amalg_multi" juceFolder="../../../juce" buildVST="1"
buildRTAS="0" buildAU="1" vstFolderMac="~/SDKs/vstsdk2.4" vstFolderPC="c:\SDKs\vstsdk2.4"
rtasFolderMac="~/SDKs/PT_80_SDK" rtasFolderPC="c:\SDKs\PT_80_SDK"
pluginName="Juce Project" pluginDesc="Juce Project" pluginManufacturer="yourcompany"
pluginManufacturerCode="abcd" pluginCode="Abcd" pluginChannelConfigs="{1, 1}, {2, 2}"
pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0"
pluginSilenceInIsSilenceOut="0" pluginTailLength="0" pluginEditorRequiresKeys="0"
pluginAUExportPrefix="JuceProjectAU" pluginAUViewClass="JuceProjectAU_V1"
pluginRTASCategory="" bundleIdentifier="com.rawmaterialsoftware.pluginhost"
jucerVersion="3.1.0" companyName="Raw Material Software Ltd."
includeBinaryInAppConfig="1">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
objCExtraSuffix="M73TRi" vst3Folder="~/SDKs/VST3 SDK">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Plugin Host"
osxSDK="default" osxCompatibility="default" osxArchitecture="default"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Plugin Host"
osxSDK="default" osxCompatibility="10.5 SDK" osxArchitecture="default"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</XCODE_MAC>
<VS2010 targetFolder="Builds/VisualStudio2010" vstFolder="c:\SDKs\vstsdk2.4"
vst3Folder="c:\SDKs\VST3 SDK">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="1" optimisation="1" targetName="Plugin Host"/>
<CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="0" optimisation="2" targetName="Plugin Host"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</VS2010>
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Plugin Host"
libraryPath="/usr/X11R6/lib/"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Plugin Host"
libraryPath="/usr/X11R6/lib/"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</LINUX_MAKE>
</EXPORTFORMATS>
<MAINGROUP id="YdWL7hi7p" name="Plugin Host">
<FILE id="8tLeuntR4" name="FilterGraph.cpp" compile="1" resource="0"
file="Source/FilterGraph.cpp"/>
<FILE id="auGSxnlTU" name="FilterGraph.h" compile="0" resource="0"
file="Source/FilterGraph.h"/>
<FILE id="2b09bSUt" name="GraphEditorPanel.cpp" compile="1" resource="0"
file="Source/GraphEditorPanel.cpp"/>
<FILE id="sj8Yug8cu" name="GraphEditorPanel.h" compile="0" resource="0"
file="Source/GraphEditorPanel.h"/>
<FILE id="nehnGjkrX" name="HostStartup.cpp" compile="1" resource="0"
file="Source/HostStartup.cpp"/>
<FILE id="J6HWWSQP1" name="InternalFilters.cpp" compile="1" resource="0"
file="Source/InternalFilters.cpp"/>
<FILE id="AplCcJ0La" name="InternalFilters.h" compile="0" resource="0"
file="Source/InternalFilters.h"/>
<FILE id="mFVSjbHfN" name="MainHostWindow.cpp" compile="1" resource="0"
file="Source/MainHostWindow.cpp"/>
<FILE id="h1kpxyzHi" name="MainHostWindow.h" compile="0" resource="0"
file="Source/MainHostWindow.h"/>
</MAINGROUP>
<JUCEOPTIONS JUCE_WASAPI="enabled" JUCE_DIRECTSOUND="enabled" JUCE_ALSA="enabled"
JUCE_QUICKTIME="disabled" JUCE_USE_FLAC="disabled" JUCE_USE_OGGVORBIS="disabled"
JUCE_USE_CDBURNER="disabled" JUCE_USE_CDREADER="disabled" JUCE_USE_CAMERA="disabled"
JUCE_PLUGINHOST_VST="enabled" JUCE_PLUGINHOST_AU="enabled" JUCE_WEB_BROWSER="disabled"
JUCE_PLUGINHOST_VST3="enabled"/>
<MODULES>
<MODULE id="juce_audio_basics" showAllCode="1"/>
<MODULE id="juce_audio_devices" showAllCode="1"/>
<MODULE id="juce_audio_formats" showAllCode="1"/>
<MODULE id="juce_audio_processors" showAllCode="1"/>
<MODULE id="juce_audio_utils" showAllCode="1"/>
<MODULE id="juce_core" showAllCode="1"/>
<MODULE id="juce_cryptography" showAllCode="1"/>
<MODULE id="juce_data_structures" showAllCode="1"/>
<MODULE id="juce_events" showAllCode="1"/>
<MODULE id="juce_graphics" showAllCode="1"/>
<MODULE id="juce_gui_basics" showAllCode="1"/>
<MODULE id="juce_gui_extra" showAllCode="1"/>
<MODULE id="juce_opengl" showAllCode="1"/>
<MODULE id="juce_video" showAllCode="1"/>
</MODULES>
</JUCERPROJECT>
@@ -0,0 +1,372 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "MainHostWindow.h"
#include "FilterGraph.h"
#include "InternalFilters.h"
#include "GraphEditorPanel.h"
//==============================================================================
const int FilterGraph::midiChannelNumber = 0x1000;
FilterGraph::FilterGraph (AudioPluginFormatManager& formatManager_)
: FileBasedDocument (filenameSuffix,
filenameWildcard,
"Load a filter graph",
"Save a filter graph"),
formatManager (formatManager_), lastUID (0)
{
InternalPluginFormat internalFormat;
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioInputFilter), 0.5f, 0.1f);
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiInputFilter), 0.25f, 0.1f);
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioOutputFilter), 0.5f, 0.9f);
setChangedFlag (false);
}
FilterGraph::~FilterGraph()
{
graph.clear();
}
uint32 FilterGraph::getNextUID() noexcept
{
return ++lastUID;
}
//==============================================================================
int FilterGraph::getNumFilters() const noexcept
{
return graph.getNumNodes();
}
const AudioProcessorGraph::Node::Ptr FilterGraph::getNode (const int index) const noexcept
{
return graph.getNode (index);
}
const AudioProcessorGraph::Node::Ptr FilterGraph::getNodeForId (const uint32 uid) const noexcept
{
return graph.getNodeForId (uid);
}
void FilterGraph::addFilter (const PluginDescription* desc, double x, double y)
{
if (desc != nullptr)
{
AudioProcessorGraph::Node* node = nullptr;
String errorMessage;
if (AudioPluginInstance* instance = formatManager.createPluginInstance (*desc, graph.getSampleRate(), graph.getBlockSize(), errorMessage))
node = graph.addNode (instance);
if (node != nullptr)
{
node->properties.set ("x", x);
node->properties.set ("y", y);
changed();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
TRANS("Couldn't create filter"),
errorMessage);
}
}
}
void FilterGraph::removeFilter (const uint32 id)
{
PluginWindow::closeCurrentlyOpenWindowsFor (id);
if (graph.removeNode (id))
changed();
}
void FilterGraph::disconnectFilter (const uint32 id)
{
if (graph.disconnectNode (id))
changed();
}
void FilterGraph::removeIllegalConnections()
{
if (graph.removeIllegalConnections())
changed();
}
void FilterGraph::setNodePosition (const int nodeId, double x, double y)
{
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
if (n != nullptr)
{
n->properties.set ("x", jlimit (0.0, 1.0, x));
n->properties.set ("y", jlimit (0.0, 1.0, y));
}
}
void FilterGraph::getNodePosition (const int nodeId, double& x, double& y) const
{
x = y = 0;
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
if (n != nullptr)
{
x = (double) n->properties ["x"];
y = (double) n->properties ["y"];
}
}
//==============================================================================
int FilterGraph::getNumConnections() const noexcept
{
return graph.getNumConnections();
}
const AudioProcessorGraph::Connection* FilterGraph::getConnection (const int index) const noexcept
{
return graph.getConnection (index);
}
const AudioProcessorGraph::Connection* FilterGraph::getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const noexcept
{
return graph.getConnectionBetween (sourceFilterUID, sourceFilterChannel,
destFilterUID, destFilterChannel);
}
bool FilterGraph::canConnect (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const noexcept
{
return graph.canConnect (sourceFilterUID, sourceFilterChannel,
destFilterUID, destFilterChannel);
}
bool FilterGraph::addConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel)
{
const bool result = graph.addConnection (sourceFilterUID, sourceFilterChannel,
destFilterUID, destFilterChannel);
if (result)
changed();
return result;
}
void FilterGraph::removeConnection (const int index)
{
graph.removeConnection (index);
changed();
}
void FilterGraph::removeConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel)
{
if (graph.removeConnection (sourceFilterUID, sourceFilterChannel,
destFilterUID, destFilterChannel))
changed();
}
void FilterGraph::clear()
{
PluginWindow::closeAllCurrentlyOpenWindows();
graph.clear();
changed();
}
//==============================================================================
String FilterGraph::getDocumentTitle()
{
if (! getFile().exists())
return "Unnamed";
return getFile().getFileNameWithoutExtension();
}
Result FilterGraph::loadDocument (const File& file)
{
XmlDocument doc (file);
ScopedPointer<XmlElement> xml (doc.getDocumentElement());
if (xml == nullptr || ! xml->hasTagName ("FILTERGRAPH"))
return Result::fail ("Not a valid filter graph file");
restoreFromXml (*xml);
return Result::ok();
}
Result FilterGraph::saveDocument (const File& file)
{
ScopedPointer<XmlElement> xml (createXml());
if (! xml->writeToFile (file, String::empty))
return Result::fail ("Couldn't write to the file");
return Result::ok();
}
File FilterGraph::getLastDocumentOpened()
{
RecentlyOpenedFilesList recentFiles;
recentFiles.restoreFromString (getAppProperties().getUserSettings()
->getValue ("recentFilterGraphFiles"));
return recentFiles.getFile (0);
}
void FilterGraph::setLastDocumentOpened (const File& file)
{
RecentlyOpenedFilesList recentFiles;
recentFiles.restoreFromString (getAppProperties().getUserSettings()
->getValue ("recentFilterGraphFiles"));
recentFiles.addFile (file);
getAppProperties().getUserSettings()
->setValue ("recentFilterGraphFiles", recentFiles.toString());
}
//==============================================================================
static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcept
{
AudioPluginInstance* plugin = dynamic_cast <AudioPluginInstance*> (node->getProcessor());
if (plugin == nullptr)
{
jassertfalse;
return nullptr;
}
XmlElement* e = new XmlElement ("FILTER");
e->setAttribute ("uid", (int) node->nodeId);
e->setAttribute ("x", node->properties ["x"].toString());
e->setAttribute ("y", node->properties ["y"].toString());
e->setAttribute ("uiLastX", node->properties ["uiLastX"].toString());
e->setAttribute ("uiLastY", node->properties ["uiLastY"].toString());
PluginDescription pd;
plugin->fillInPluginDescription (pd);
e->addChildElement (pd.createXml());
XmlElement* state = new XmlElement ("STATE");
MemoryBlock m;
node->getProcessor()->getStateInformation (m);
state->addTextElement (m.toBase64Encoding());
e->addChildElement (state);
return e;
}
void FilterGraph::createNodeFromXml (const XmlElement& xml)
{
PluginDescription pd;
forEachXmlChildElement (xml, e)
{
if (pd.loadFromXml (*e))
break;
}
String errorMessage;
AudioPluginInstance* instance = formatManager.createPluginInstance (pd, graph.getSampleRate(), graph.getBlockSize(), errorMessage);
if (instance == nullptr)
{
// xxx handle ins + outs
}
if (instance == nullptr)
return;
AudioProcessorGraph::Node::Ptr node (graph.addNode (instance, xml.getIntAttribute ("uid")));
if (const XmlElement* const state = xml.getChildByName ("STATE"))
{
MemoryBlock m;
m.fromBase64Encoding (state->getAllSubText());
node->getProcessor()->setStateInformation (m.getData(), (int) m.getSize());
}
node->properties.set ("x", xml.getDoubleAttribute ("x"));
node->properties.set ("y", xml.getDoubleAttribute ("y"));
node->properties.set ("uiLastX", xml.getIntAttribute ("uiLastX"));
node->properties.set ("uiLastY", xml.getIntAttribute ("uiLastY"));
}
XmlElement* FilterGraph::createXml() const
{
XmlElement* xml = new XmlElement ("FILTERGRAPH");
for (int i = 0; i < graph.getNumNodes(); ++i)
xml->addChildElement (createNodeXml (graph.getNode (i)));
for (int i = 0; i < graph.getNumConnections(); ++i)
{
const AudioProcessorGraph::Connection* const fc = graph.getConnection(i);
XmlElement* e = new XmlElement ("CONNECTION");
e->setAttribute ("srcFilter", (int) fc->sourceNodeId);
e->setAttribute ("srcChannel", fc->sourceChannelIndex);
e->setAttribute ("dstFilter", (int) fc->destNodeId);
e->setAttribute ("dstChannel", fc->destChannelIndex);
xml->addChildElement (e);
}
return xml;
}
void FilterGraph::restoreFromXml (const XmlElement& xml)
{
clear();
forEachXmlChildElementWithTagName (xml, e, "FILTER")
{
createNodeFromXml (*e);
changed();
}
forEachXmlChildElementWithTagName (xml, e, "CONNECTION")
{
addConnection ((uint32) e->getIntAttribute ("srcFilter"),
e->getIntAttribute ("srcChannel"),
(uint32) e->getIntAttribute ("dstFilter"),
e->getIntAttribute ("dstChannel"));
}
graph.removeIllegalConnections();
}
@@ -0,0 +1,113 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __FILTERGRAPH_JUCEHEADER__
#define __FILTERGRAPH_JUCEHEADER__
class FilterInGraph;
class FilterGraph;
const char* const filenameSuffix = ".filtergraph";
const char* const filenameWildcard = "*.filtergraph";
//==============================================================================
/**
A collection of filters and some connections between them.
*/
class FilterGraph : public FileBasedDocument
{
public:
//==============================================================================
FilterGraph (AudioPluginFormatManager& formatManager);
~FilterGraph();
//==============================================================================
AudioProcessorGraph& getGraph() noexcept { return graph; }
int getNumFilters() const noexcept;
const AudioProcessorGraph::Node::Ptr getNode (const int index) const noexcept;
const AudioProcessorGraph::Node::Ptr getNodeForId (const uint32 uid) const noexcept;
void addFilter (const PluginDescription* desc, double x, double y);
void removeFilter (const uint32 filterUID);
void disconnectFilter (const uint32 filterUID);
void removeIllegalConnections();
void setNodePosition (const int nodeId, double x, double y);
void getNodePosition (const int nodeId, double& x, double& y) const;
//==============================================================================
int getNumConnections() const noexcept;
const AudioProcessorGraph::Connection* getConnection (const int index) const noexcept;
const AudioProcessorGraph::Connection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const noexcept;
bool canConnect (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const noexcept;
bool addConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void removeConnection (const int index);
void removeConnection (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel);
void clear();
//==============================================================================
XmlElement* createXml() const;
void restoreFromXml (const XmlElement& xml);
//==============================================================================
String getDocumentTitle();
Result loadDocument (const File& file);
Result saveDocument (const File& file);
File getLastDocumentOpened();
void setLastDocumentOpened (const File& file);
/** The special channel index used to refer to a filter's midi channel.
*/
static const int midiChannelNumber;
private:
//==============================================================================
AudioPluginFormatManager& formatManager;
AudioProcessorGraph graph;
uint32 lastUID;
uint32 getNextUID() noexcept;
void createNodeFromXml (const XmlElement& xml);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilterGraph)
};
#endif // __FILTERGRAPH_JUCEHEADER__
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,144 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __GRAPHEDITORPANEL_JUCEHEADER__
#define __GRAPHEDITORPANEL_JUCEHEADER__
#include "FilterGraph.h"
class FilterComponent;
class ConnectorComponent;
class PinComponent;
//==============================================================================
/**
A panel that displays and edits a FilterGraph.
*/
class GraphEditorPanel : public Component,
public ChangeListener
{
public:
GraphEditorPanel (FilterGraph& graph);
~GraphEditorPanel();
void paint (Graphics& g);
void mouseDown (const MouseEvent& e);
void createNewPlugin (const PluginDescription* desc, int x, int y);
FilterComponent* getComponentForFilter (uint32 filterID) const;
ConnectorComponent* getComponentForConnection (const AudioProcessorGraph::Connection& conn) const;
PinComponent* findPinAt (int x, int y) const;
void resized();
void changeListenerCallback (ChangeBroadcaster*);
void updateComponents();
//==============================================================================
void beginConnectorDrag (uint32 sourceFilterID, int sourceFilterChannel,
uint32 destFilterID, int destFilterChannel,
const MouseEvent& e);
void dragConnector (const MouseEvent& e);
void endDraggingConnector (const MouseEvent& e);
//==============================================================================
private:
FilterGraph& graph;
ScopedPointer<ConnectorComponent> draggingConnector;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphEditorPanel)
};
//==============================================================================
/**
A panel that embeds a GraphEditorPanel with a midi keyboard at the bottom.
It also manages the graph itself, and plays it.
*/
class GraphDocumentComponent : public Component
{
public:
//==============================================================================
GraphDocumentComponent (AudioPluginFormatManager& formatManager,
AudioDeviceManager* deviceManager);
~GraphDocumentComponent();
//==============================================================================
void createNewPlugin (const PluginDescription* desc, int x, int y);
//==============================================================================
FilterGraph graph;
//==============================================================================
void resized();
private:
//==============================================================================
AudioDeviceManager* deviceManager;
AudioProcessorPlayer graphPlayer;
MidiKeyboardState keyState;
GraphEditorPanel* graphPanel;
Component* keyboardComp;
Component* statusBar;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphDocumentComponent)
};
//==============================================================================
/** A desktop window containing a plugin's UI. */
class PluginWindow : public DocumentWindow
{
public:
enum WindowFormatType
{
Normal = 0,
Generic,
Programs,
Parameters
};
PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType);
~PluginWindow();
static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType);
static void closeCurrentlyOpenWindowsFor (const uint32 nodeId);
static void closeAllCurrentlyOpenWindows();
void moved() override;
void closeButtonPressed() override;
private:
AudioProcessorGraph::Node* owner;
WindowFormatType type;
float getDesktopScaleFactor() const override { return 1.0f; }
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginWindow)
};
#endif // __GRAPHEDITORPANEL_JUCEHEADER__
@@ -0,0 +1,102 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "MainHostWindow.h"
#include "InternalFilters.h"
#if ! (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU)
#error "If you're building the audio plugin host, you probably want to enable VST and/or AU support"
#endif
//==============================================================================
class PluginHostApp : public JUCEApplication
{
public:
PluginHostApp() {}
void initialise (const String& commandLine) override
{
// initialise our settings file..
PropertiesFile::Options options;
options.applicationName = "Juce Audio Plugin Host";
options.filenameSuffix = "settings";
options.osxLibrarySubFolder = "Preferences";
appProperties = new ApplicationProperties();
appProperties->setStorageParameters (options);
LookAndFeel::setDefaultLookAndFeel (&lookAndFeel);
mainWindow = new MainHostWindow();
mainWindow->setUsingNativeTitleBar (true);
commandManager.registerAllCommandsForTarget (this);
commandManager.registerAllCommandsForTarget (mainWindow);
mainWindow->menuItemsChanged();
if (commandLine.isNotEmpty()
&& ! commandLine.trimStart().startsWith ("-")
&& mainWindow->getGraphEditor() != nullptr)
mainWindow->getGraphEditor()->graph.loadFrom (File::getCurrentWorkingDirectory()
.getChildFile (commandLine), true);
}
void shutdown() override
{
mainWindow = nullptr;
appProperties = nullptr;
LookAndFeel::setDefaultLookAndFeel (nullptr);
}
void systemRequestedQuit() override
{
if (mainWindow != nullptr)
mainWindow->tryToQuitApplication();
else
JUCEApplicationBase::quit();
}
const String getApplicationName() override { return "Juce Plug-In Host"; }
const String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }
ApplicationCommandManager commandManager;
ScopedPointer<ApplicationProperties> appProperties;
LookAndFeel_V3 lookAndFeel;
private:
ScopedPointer<MainHostWindow> mainWindow;
};
static PluginHostApp& getApp() { return *dynamic_cast<PluginHostApp*>(JUCEApplication::getInstance()); }
ApplicationCommandManager& getCommandManager() { return getApp().commandManager; }
ApplicationProperties& getAppProperties() { return *getApp().appProperties; }
// This kicks the whole thing off..
START_JUCE_APPLICATION (PluginHostApp)
@@ -0,0 +1,81 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "InternalFilters.h"
#include "FilterGraph.h"
//==============================================================================
InternalPluginFormat::InternalPluginFormat()
{
{
AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode);
p.fillInPluginDescription (audioOutDesc);
}
{
AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::audioInputNode);
p.fillInPluginDescription (audioInDesc);
}
{
AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::midiInputNode);
p.fillInPluginDescription (midiInDesc);
}
}
AudioPluginInstance* InternalPluginFormat::createInstanceFromDescription (const PluginDescription& desc,
double /*sampleRate*/, int /*blockSize*/)
{
if (desc.name == audioOutDesc.name)
return new AudioProcessorGraph::AudioGraphIOProcessor (AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode);
if (desc.name == audioInDesc.name)
return new AudioProcessorGraph::AudioGraphIOProcessor (AudioProcessorGraph::AudioGraphIOProcessor::audioInputNode);
if (desc.name == midiInDesc.name)
return new AudioProcessorGraph::AudioGraphIOProcessor (AudioProcessorGraph::AudioGraphIOProcessor::midiInputNode);
return 0;
}
const PluginDescription* InternalPluginFormat::getDescriptionFor (const InternalFilterType type)
{
switch (type)
{
case audioInputFilter: return &audioInDesc;
case audioOutputFilter: return &audioOutDesc;
case midiInputFilter: return &midiInDesc;
default: break;
}
return 0;
}
void InternalPluginFormat::getAllTypes (OwnedArray <PluginDescription>& results)
{
for (int i = 0; i < (int) endOfFilterTypes; ++i)
results.add (new PluginDescription (*getDescriptionFor ((InternalFilterType) i)));
}
@@ -0,0 +1,76 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __INTERNALFILTERS_JUCEHEADER__
#define __INTERNALFILTERS_JUCEHEADER__
#include "FilterGraph.h"
//==============================================================================
/**
Manages the internal plugin types.
*/
class InternalPluginFormat : public AudioPluginFormat
{
public:
//==============================================================================
InternalPluginFormat();
~InternalPluginFormat() {}
//==============================================================================
enum InternalFilterType
{
audioInputFilter = 0,
audioOutputFilter,
midiInputFilter,
endOfFilterTypes
};
const PluginDescription* getDescriptionFor (const InternalFilterType type);
void getAllTypes (OwnedArray <PluginDescription>& results);
//==============================================================================
String getName() const override { return "Internal"; }
bool fileMightContainThisPluginType (const String&) override { return false; }
FileSearchPath getDefaultLocationsToSearch() override { return FileSearchPath(); }
bool canScanForPlugins() const override { return false; }
void findAllTypesForFile (OwnedArray <PluginDescription>&, const String&) override {}
bool doesPluginStillExist (const PluginDescription&) override { return true; }
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override { return fileOrIdentifier; }
bool pluginNeedsRescanning (const PluginDescription&) override { return false; }
StringArray searchPathsForPlugins (const FileSearchPath&, bool) override { return StringArray(); }
AudioPluginInstance* createInstanceFromDescription (const PluginDescription&, double, int) override;
private:
//==============================================================================
PluginDescription audioInDesc;
PluginDescription audioOutDesc;
PluginDescription midiInDesc;
};
#endif // __INTERNALFILTERS_JUCEHEADER__
@@ -0,0 +1,483 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "MainHostWindow.h"
#include "InternalFilters.h"
//==============================================================================
class MainHostWindow::PluginListWindow : public DocumentWindow
{
public:
PluginListWindow (MainHostWindow& owner_, AudioPluginFormatManager& formatManager)
: DocumentWindow ("Available Plugins", Colours::white,
DocumentWindow::minimiseButton | DocumentWindow::closeButton),
owner (owner_)
{
const File deadMansPedalFile (getAppProperties().getUserSettings()
->getFile().getSiblingFile ("RecentlyCrashedPluginsList"));
setContentOwned (new PluginListComponent (formatManager,
owner.knownPluginList,
deadMansPedalFile,
getAppProperties().getUserSettings()), true);
setResizable (true, false);
setResizeLimits (300, 400, 800, 1500);
setTopLeftPosition (60, 60);
restoreWindowStateFromString (getAppProperties().getUserSettings()->getValue ("listWindowPos"));
setVisible (true);
}
~PluginListWindow()
{
getAppProperties().getUserSettings()->setValue ("listWindowPos", getWindowStateAsString());
clearContentComponent();
}
void closeButtonPressed()
{
owner.pluginListWindow = nullptr;
}
private:
MainHostWindow& owner;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginListWindow)
};
//==============================================================================
MainHostWindow::MainHostWindow()
: DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey,
DocumentWindow::allButtons)
{
formatManager.addDefaultFormats();
formatManager.addFormat (new InternalPluginFormat());
ScopedPointer<XmlElement> savedAudioState (getAppProperties().getUserSettings()
->getXmlValue ("audioDeviceState"));
deviceManager.initialise (256, 256, savedAudioState, true);
setResizable (true, false);
setResizeLimits (500, 400, 10000, 10000);
centreWithSize (800, 600);
setContentOwned (new GraphDocumentComponent (formatManager, &deviceManager), false);
restoreWindowStateFromString (getAppProperties().getUserSettings()->getValue ("mainWindowPos"));
setVisible (true);
InternalPluginFormat internalFormat;
internalFormat.getAllTypes (internalTypes);
ScopedPointer<XmlElement> savedPluginList (getAppProperties().getUserSettings()->getXmlValue ("pluginList"));
if (savedPluginList != nullptr)
knownPluginList.recreateFromXml (*savedPluginList);
pluginSortMethod = (KnownPluginList::SortMethod) getAppProperties().getUserSettings()
->getIntValue ("pluginSortMethod", KnownPluginList::sortByManufacturer);
knownPluginList.addChangeListener (this);
addKeyListener (getCommandManager().getKeyMappings());
Process::setPriority (Process::HighPriority);
#if JUCE_MAC
setMacMainMenu (this);
#else
setMenuBar (this);
#endif
getCommandManager().setFirstCommandTarget (this);
}
MainHostWindow::~MainHostWindow()
{
pluginListWindow = nullptr;
#if JUCE_MAC
setMacMainMenu (nullptr);
#else
setMenuBar (nullptr);
#endif
knownPluginList.removeChangeListener (this);
getAppProperties().getUserSettings()->setValue ("mainWindowPos", getWindowStateAsString());
clearContentComponent();
}
void MainHostWindow::closeButtonPressed()
{
tryToQuitApplication();
}
bool MainHostWindow::tryToQuitApplication()
{
PluginWindow::closeAllCurrentlyOpenWindows();
if (getGraphEditor() == nullptr
|| getGraphEditor()->graph.saveIfNeededAndUserAgrees() == FileBasedDocument::savedOk)
{
JUCEApplication::quit();
return true;
}
return false;
}
void MainHostWindow::changeListenerCallback (ChangeBroadcaster*)
{
menuItemsChanged();
// save the plugin list every time it gets chnaged, so that if we're scanning
// and it crashes, we've still saved the previous ones
ScopedPointer<XmlElement> savedPluginList (knownPluginList.createXml());
if (savedPluginList != nullptr)
{
getAppProperties().getUserSettings()->setValue ("pluginList", savedPluginList);
getAppProperties().saveIfNeeded();
}
}
StringArray MainHostWindow::getMenuBarNames()
{
const char* const names[] = { "File", "Plugins", "Options", nullptr };
return StringArray (names);
}
PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/)
{
PopupMenu menu;
if (topLevelMenuIndex == 0)
{
// "File" menu
menu.addCommandItem (&getCommandManager(), CommandIDs::open);
RecentlyOpenedFilesList recentFiles;
recentFiles.restoreFromString (getAppProperties().getUserSettings()
->getValue ("recentFilterGraphFiles"));
PopupMenu recentFilesMenu;
recentFiles.createPopupMenuItems (recentFilesMenu, 100, true, true);
menu.addSubMenu ("Open recent file", recentFilesMenu);
menu.addCommandItem (&getCommandManager(), CommandIDs::save);
menu.addCommandItem (&getCommandManager(), CommandIDs::saveAs);
menu.addSeparator();
menu.addCommandItem (&getCommandManager(), StandardApplicationCommandIDs::quit);
}
else if (topLevelMenuIndex == 1)
{
// "Plugins" menu
PopupMenu pluginsMenu;
addPluginsToMenu (pluginsMenu);
menu.addSubMenu ("Create plugin", pluginsMenu);
menu.addSeparator();
menu.addItem (250, "Delete all plugins");
}
else if (topLevelMenuIndex == 2)
{
// "Options" menu
menu.addCommandItem (&getCommandManager(), CommandIDs::showPluginListEditor);
PopupMenu sortTypeMenu;
sortTypeMenu.addItem (200, "List plugins in default order", true, pluginSortMethod == KnownPluginList::defaultOrder);
sortTypeMenu.addItem (201, "List plugins in alphabetical order", true, pluginSortMethod == KnownPluginList::sortAlphabetically);
sortTypeMenu.addItem (202, "List plugins by category", true, pluginSortMethod == KnownPluginList::sortByCategory);
sortTypeMenu.addItem (203, "List plugins by manufacturer", true, pluginSortMethod == KnownPluginList::sortByManufacturer);
sortTypeMenu.addItem (204, "List plugins based on the directory structure", true, pluginSortMethod == KnownPluginList::sortByFileSystemLocation);
menu.addSubMenu ("Plugin menu type", sortTypeMenu);
menu.addSeparator();
menu.addCommandItem (&getCommandManager(), CommandIDs::showAudioSettings);
menu.addSeparator();
menu.addCommandItem (&getCommandManager(), CommandIDs::aboutBox);
}
return menu;
}
void MainHostWindow::menuItemSelected (int menuItemID, int /*topLevelMenuIndex*/)
{
GraphDocumentComponent* const graphEditor = getGraphEditor();
if (menuItemID == 250)
{
if (graphEditor != nullptr)
graphEditor->graph.clear();
}
else if (menuItemID >= 100 && menuItemID < 200)
{
RecentlyOpenedFilesList recentFiles;
recentFiles.restoreFromString (getAppProperties().getUserSettings()
->getValue ("recentFilterGraphFiles"));
if (graphEditor != nullptr && graphEditor->graph.saveIfNeededAndUserAgrees() == FileBasedDocument::savedOk)
graphEditor->graph.loadFrom (recentFiles.getFile (menuItemID - 100), true);
}
else if (menuItemID >= 200 && menuItemID < 210)
{
if (menuItemID == 200) pluginSortMethod = KnownPluginList::defaultOrder;
else if (menuItemID == 201) pluginSortMethod = KnownPluginList::sortAlphabetically;
else if (menuItemID == 202) pluginSortMethod = KnownPluginList::sortByCategory;
else if (menuItemID == 203) pluginSortMethod = KnownPluginList::sortByManufacturer;
else if (menuItemID == 204) pluginSortMethod = KnownPluginList::sortByFileSystemLocation;
getAppProperties().getUserSettings()->setValue ("pluginSortMethod", (int) pluginSortMethod);
menuItemsChanged();
}
else
{
createPlugin (getChosenType (menuItemID),
proportionOfWidth (0.3f + Random::getSystemRandom().nextFloat() * 0.6f),
proportionOfHeight (0.3f + Random::getSystemRandom().nextFloat() * 0.6f));
}
}
void MainHostWindow::createPlugin (const PluginDescription* desc, int x, int y)
{
GraphDocumentComponent* const graphEditor = getGraphEditor();
if (graphEditor != nullptr)
graphEditor->createNewPlugin (desc, x, y);
}
void MainHostWindow::addPluginsToMenu (PopupMenu& m) const
{
for (int i = 0; i < internalTypes.size(); ++i)
m.addItem (i + 1, internalTypes.getUnchecked(i)->name);
m.addSeparator();
knownPluginList.addToMenu (m, pluginSortMethod);
}
const PluginDescription* MainHostWindow::getChosenType (const int menuID) const
{
if (menuID >= 1 && menuID < 1 + internalTypes.size())
return internalTypes [menuID - 1];
return knownPluginList.getType (knownPluginList.getIndexChosenByMenu (menuID));
}
//==============================================================================
ApplicationCommandTarget* MainHostWindow::getNextCommandTarget()
{
return findFirstTargetParentComponent();
}
void MainHostWindow::getAllCommands (Array <CommandID>& commands)
{
// this returns the set of all commands that this target can perform..
const CommandID ids[] = { CommandIDs::open,
CommandIDs::save,
CommandIDs::saveAs,
CommandIDs::showPluginListEditor,
CommandIDs::showAudioSettings,
CommandIDs::aboutBox
};
commands.addArray (ids, numElementsInArray (ids));
}
void MainHostWindow::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
const String category ("General");
switch (commandID)
{
case CommandIDs::open:
result.setInfo ("Open...",
"Opens a filter graph file",
category, 0);
result.defaultKeypresses.add (KeyPress ('o', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::save:
result.setInfo ("Save",
"Saves the current graph to a file",
category, 0);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::saveAs:
result.setInfo ("Save As...",
"Saves a copy of the current graph to a file",
category, 0);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::shiftModifier | ModifierKeys::commandModifier, 0));
break;
case CommandIDs::showPluginListEditor:
result.setInfo ("Edit the list of available plug-Ins...", String::empty, category, 0);
result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
break;
case CommandIDs::showAudioSettings:
result.setInfo ("Change the audio device settings", String::empty, category, 0);
result.addDefaultKeypress ('a', ModifierKeys::commandModifier);
break;
case CommandIDs::aboutBox:
result.setInfo ("About...", String::empty, category, 0);
break;
default:
break;
}
}
bool MainHostWindow::perform (const InvocationInfo& info)
{
GraphDocumentComponent* const graphEditor = getGraphEditor();
switch (info.commandID)
{
case CommandIDs::open:
if (graphEditor != nullptr && graphEditor->graph.saveIfNeededAndUserAgrees() == FileBasedDocument::savedOk)
graphEditor->graph.loadFromUserSpecifiedFile (true);
break;
case CommandIDs::save:
if (graphEditor != nullptr)
graphEditor->graph.save (true, true);
break;
case CommandIDs::saveAs:
if (graphEditor != nullptr)
graphEditor->graph.saveAs (File::nonexistent, true, true, true);
break;
case CommandIDs::showPluginListEditor:
if (pluginListWindow == nullptr)
pluginListWindow = new PluginListWindow (*this, formatManager);
pluginListWindow->toFront (true);
break;
case CommandIDs::showAudioSettings:
showAudioSettings();
break;
case CommandIDs::aboutBox:
// TODO
break;
default:
return false;
}
return true;
}
void MainHostWindow::showAudioSettings()
{
AudioDeviceSelectorComponent audioSettingsComp (deviceManager,
0, 256,
0, 256,
true, true, true, false);
audioSettingsComp.setSize (500, 450);
DialogWindow::LaunchOptions o;
o.content.setNonOwned (&audioSettingsComp);
o.dialogTitle = "Audio Settings";
o.componentToCentreAround = this;
o.dialogBackgroundColour = Colours::azure;
o.escapeKeyTriggersCloseButton = true;
o.useNativeTitleBar = false;
o.resizable = false;
o.runModal();
ScopedPointer<XmlElement> audioState (deviceManager.createStateXml());
getAppProperties().getUserSettings()->setValue ("audioDeviceState", audioState);
getAppProperties().getUserSettings()->saveIfNeeded();
GraphDocumentComponent* const graphEditor = getGraphEditor();
if (graphEditor != nullptr)
graphEditor->graph.removeIllegalConnections();
}
bool MainHostWindow::isInterestedInFileDrag (const StringArray&)
{
return true;
}
void MainHostWindow::fileDragEnter (const StringArray&, int, int)
{
}
void MainHostWindow::fileDragMove (const StringArray&, int, int)
{
}
void MainHostWindow::fileDragExit (const StringArray&)
{
}
void MainHostWindow::filesDropped (const StringArray& files, int x, int y)
{
GraphDocumentComponent* const graphEditor = getGraphEditor();
if (graphEditor != nullptr)
{
if (files.size() == 1 && File (files[0]).hasFileExtension (filenameSuffix))
{
if (graphEditor->graph.saveIfNeededAndUserAgrees() == FileBasedDocument::savedOk)
graphEditor->graph.loadFrom (File (files[0]), true);
}
else
{
OwnedArray <PluginDescription> typesFound;
knownPluginList.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound);
Point<int> pos (graphEditor->getLocalPoint (this, Point<int> (x, y)));
for (int i = 0; i < jmin (5, typesFound.size()); ++i)
createPlugin (typesFound.getUnchecked(i), pos.getX(), pos.getY());
}
}
}
GraphDocumentComponent* MainHostWindow::getGraphEditor() const
{
return dynamic_cast <GraphDocumentComponent*> (getContentComponent());
}
@@ -0,0 +1,105 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __MAINHOSTWINDOW_JUCEHEADER__
#define __MAINHOSTWINDOW_JUCEHEADER__
#include "FilterGraph.h"
#include "GraphEditorPanel.h"
//==============================================================================
namespace CommandIDs
{
static const int open = 0x30000;
static const int save = 0x30001;
static const int saveAs = 0x30002;
static const int showPluginListEditor = 0x30100;
static const int showAudioSettings = 0x30200;
static const int aboutBox = 0x30300;
}
ApplicationCommandManager& getCommandManager();
ApplicationProperties& getAppProperties();
//==============================================================================
/**
*/
class MainHostWindow : public DocumentWindow,
public MenuBarModel,
public ApplicationCommandTarget,
public ChangeListener,
public FileDragAndDropTarget
{
public:
//==============================================================================
MainHostWindow();
~MainHostWindow();
//==============================================================================
void closeButtonPressed();
void changeListenerCallback (ChangeBroadcaster*);
bool isInterestedInFileDrag (const StringArray& files);
void fileDragEnter (const StringArray& files, int, int);
void fileDragMove (const StringArray& files, int, int);
void fileDragExit (const StringArray& files);
void filesDropped (const StringArray& files, int, int);
StringArray getMenuBarNames();
PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName);
void menuItemSelected (int menuItemID, int topLevelMenuIndex);
ApplicationCommandTarget* getNextCommandTarget();
void getAllCommands (Array <CommandID>& commands);
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
bool perform (const InvocationInfo& info);
bool tryToQuitApplication();
void createPlugin (const PluginDescription* desc, int x, int y);
void addPluginsToMenu (PopupMenu& m) const;
const PluginDescription* getChosenType (const int menuID) const;
GraphDocumentComponent* getGraphEditor() const;
private:
//==============================================================================
AudioDeviceManager deviceManager;
AudioPluginFormatManager formatManager;
OwnedArray <PluginDescription> internalTypes;
KnownPluginList knownPluginList;
KnownPluginList::SortMethod pluginSortMethod;
class PluginListWindow;
ScopedPointer <PluginListWindow> pluginListWindow;
void showAudioSettings();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainHostWindow)
};
#endif // __MAINHOSTWINDOW_JUCEHEADER__