1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
jules 2007-10-30 14:32:51 +00:00
parent bf5c5ac68a
commit e5dc936c5b
15 changed files with 1719 additions and 311 deletions

View file

@ -7,7 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
840A4D4A0CD774A000445927 /* juce_AudioUnitPluginFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840A4D460CD774A000445927 /* juce_AudioUnitPluginFormat.cpp */; };
840A4D4B0CD774A000445927 /* juce_VSTPluginFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840A4D480CD774A000445927 /* juce_VSTPluginFormat.cpp */; };
8411682E0CBBEE0500232E45 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8411682D0CBBEE0500232E45 /* OpenGL.framework */; };
84CF14390CD6367800A8D756 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84CF14380CD6367800A8D756 /* AudioUnit.framework */; };
84FFAEAC0C6C8A6F009F6E72 /* FilterGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */; };
84FFAEAD0C6C8A6F009F6E72 /* GraphEditorPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */; };
84FFAEAE0C6C8A6F009F6E72 /* InternalFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE960C6C8A6F009F6E72 /* InternalFilters.cpp */; };
@ -19,8 +22,7 @@
84FFAEB40C6C8A6F009F6E72 /* juce_PluginDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAEA20C6C8A6F009F6E72 /* juce_PluginDescription.cpp */; };
84FFAEB50C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAEA40C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.cpp */; };
84FFAEB60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAEA60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp */; };
84FFAEB70C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAEAA0C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp */; };
84FFAEFE0C6C8E80009F6E72 /* libjucedebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FFAEFC0C6C8E76009F6E72 /* libjucedebug.a */; };
84FFAEFE0C6C8E80009F6E72 /* libjuce.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FFAEFC0C6C8E76009F6E72 /* libjuce.a */; };
84FFAF040C6C8ED5009F6E72 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FFAEFF0C6C8ED5009F6E72 /* CoreAudio.framework */; };
84FFAF050C6C8ED5009F6E72 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FFAF000C6C8ED5009F6E72 /* CoreMIDI.framework */; };
84FFAF060C6C8ED5009F6E72 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FFAF010C6C8ED5009F6E72 /* IOKit.framework */; };
@ -44,7 +46,12 @@
4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
508344B209E5C41E0093A071 /* Juce Plugin Host.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Juce Plugin Host.app"; sourceTree = BUILT_PRODUCTS_DIR; };
840A4D460CD774A000445927 /* juce_AudioUnitPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_AudioUnitPluginFormat.cpp; path = formats/juce_AudioUnitPluginFormat.cpp; sourceTree = "<group>"; };
840A4D470CD774A000445927 /* juce_AudioUnitPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_AudioUnitPluginFormat.h; path = formats/juce_AudioUnitPluginFormat.h; sourceTree = "<group>"; };
840A4D480CD774A000445927 /* juce_VSTPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_VSTPluginFormat.cpp; path = formats/juce_VSTPluginFormat.cpp; sourceTree = "<group>"; };
840A4D490CD774A000445927 /* juce_VSTPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_VSTPluginFormat.h; path = formats/juce_VSTPluginFormat.h; sourceTree = "<group>"; };
8411682D0CBBEE0500232E45 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
84CF14380CD6367800A8D756 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FilterGraph.cpp; path = ../../src/host/FilterGraph.cpp; sourceTree = SOURCE_ROOT; };
84FFAE930C6C8A6F009F6E72 /* FilterGraph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilterGraph.h; path = ../../src/host/FilterGraph.h; sourceTree = SOURCE_ROOT; };
84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GraphEditorPanel.cpp; path = ../../src/host/GraphEditorPanel.cpp; sourceTree = SOURCE_ROOT; };
@ -66,9 +73,6 @@
84FFAEA50C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_PluginDirectoryScanner.h; path = ../../src/plugins/juce_PluginDirectoryScanner.h; sourceTree = SOURCE_ROOT; };
84FFAEA60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PluginListComponent.cpp; path = ../../src/plugins/juce_PluginListComponent.cpp; sourceTree = SOURCE_ROOT; };
84FFAEA70C6C8A6F009F6E72 /* juce_PluginListComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_PluginListComponent.h; path = ../../src/plugins/juce_PluginListComponent.h; sourceTree = SOURCE_ROOT; };
84FFAEA90C6C8A6F009F6E72 /* juce_VSTPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_VSTPluginFormat.h; path = ../../src/plugins/vst/juce_VSTPluginFormat.h; sourceTree = SOURCE_ROOT; };
84FFAEAA0C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_VSTPluginInstance.cpp; path = ../../src/plugins/vst/juce_VSTPluginInstance.cpp; sourceTree = SOURCE_ROOT; };
84FFAEAB0C6C8A6F009F6E72 /* juce_VSTPluginInstance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_VSTPluginInstance.h; path = ../../src/plugins/vst/juce_VSTPluginInstance.h; sourceTree = SOURCE_ROOT; };
84FFAEF70C6C8E76009F6E72 /* Juce.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Juce.xcodeproj; path = ../../../../build/macosx/Juce.xcodeproj; sourceTree = SOURCE_ROOT; };
84FFAEFF0C6C8ED5009F6E72 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
84FFAF000C6C8ED5009F6E72 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = "<absolute>"; };
@ -83,7 +87,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
84FFAEFE0C6C8E80009F6E72 /* libjucedebug.a in Frameworks */,
84FFAEFE0C6C8E80009F6E72 /* libjuce.a in Frameworks */,
8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */,
84FFAF040C6C8ED5009F6E72 /* CoreAudio.framework in Frameworks */,
84FFAF050C6C8ED5009F6E72 /* CoreMIDI.framework in Frameworks */,
@ -91,6 +95,7 @@
84FFAF080C6C8ED5009F6E72 /* QuickTime.framework in Frameworks */,
84FFAF150C6C8EE8009F6E72 /* AGL.framework in Frameworks */,
8411682E0CBBEE0500232E45 /* OpenGL.framework in Frameworks */,
84CF14390CD6367800A8D756 /* AudioUnit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -137,6 +142,7 @@
20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
84CF14380CD6367800A8D756 /* AudioUnit.framework */,
8411682D0CBBEE0500232E45 /* OpenGL.framework */,
84FFAF140C6C8EE8009F6E72 /* AGL.framework */,
84FFAEFF0C6C8ED5009F6E72 /* CoreAudio.framework */,
@ -151,6 +157,17 @@
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
840A4D420CD7747400445927 /* formats */ = {
isa = PBXGroup;
children = (
840A4D460CD774A000445927 /* juce_AudioUnitPluginFormat.cpp */,
840A4D470CD774A000445927 /* juce_AudioUnitPluginFormat.h */,
840A4D480CD774A000445927 /* juce_VSTPluginFormat.cpp */,
840A4D490CD774A000445927 /* juce_VSTPluginFormat.h */,
);
name = formats;
sourceTree = "<group>";
};
84FFAE910C6C8A6F009F6E72 /* host */ = {
isa = PBXGroup;
children = (
@ -170,7 +187,7 @@
84FFAE9B0C6C8A6F009F6E72 /* plugins */ = {
isa = PBXGroup;
children = (
84FFAEA80C6C8A6F009F6E72 /* vst */,
840A4D420CD7747400445927 /* formats */,
84FFAE9C0C6C8A6F009F6E72 /* juce_AudioPluginFormat.cpp */,
84FFAE9D0C6C8A6F009F6E72 /* juce_AudioPluginFormat.h */,
84FFAE9E0C6C8A6F009F6E72 /* juce_AudioPluginInstance.cpp */,
@ -188,21 +205,10 @@
path = ../../src/plugins;
sourceTree = SOURCE_ROOT;
};
84FFAEA80C6C8A6F009F6E72 /* vst */ = {
isa = PBXGroup;
children = (
84FFAEA90C6C8A6F009F6E72 /* juce_VSTPluginFormat.h */,
84FFAEAA0C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp */,
84FFAEAB0C6C8A6F009F6E72 /* juce_VSTPluginInstance.h */,
);
name = vst;
path = ../../src/plugins/vst;
sourceTree = SOURCE_ROOT;
};
84FFAEF80C6C8E76009F6E72 /* Products */ = {
isa = PBXGroup;
children = (
84FFAEFC0C6C8E76009F6E72 /* libjucedebug.a */,
84FFAEFC0C6C8E76009F6E72 /* libjuce.a */,
);
name = Products;
sourceTree = "<group>";
@ -250,10 +256,10 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
84FFAEFC0C6C8E76009F6E72 /* libjucedebug.a */ = {
84FFAEFC0C6C8E76009F6E72 /* libjuce.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjucedebug.a;
path = libjuce.a;
remoteRef = 84FFAEFB0C6C8E76009F6E72 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
@ -285,7 +291,8 @@
84FFAEB40C6C8A6F009F6E72 /* juce_PluginDescription.cpp in Sources */,
84FFAEB50C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.cpp in Sources */,
84FFAEB60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp in Sources */,
84FFAEB70C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp in Sources */,
840A4D4A0CD774A000445927 /* juce_AudioUnitPluginFormat.cpp in Sources */,
840A4D4B0CD774A000445927 /* juce_VSTPluginFormat.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -266,18 +266,22 @@
>
</File>
<Filter
Name="vst"
Name="formats"
>
<File
RelativePath="..\..\src\plugins\vst\juce_VSTPluginFormat.h"
RelativePath="..\..\src\plugins\formats\juce_AudioUnitPluginFormat.cpp"
>
</File>
<File
RelativePath="..\..\src\plugins\vst\juce_VSTPluginInstance.cpp"
RelativePath="..\..\src\plugins\formats\juce_AudioUnitPluginFormat.h"
>
</File>
<File
RelativePath="..\..\src\plugins\vst\juce_VSTPluginInstance.h"
RelativePath="..\..\src\plugins\formats\juce_VSTPluginFormat.cpp"
>
</File>
<File
RelativePath="..\..\src\plugins\formats\juce_VSTPluginFormat.h"
>
</File>
</Filter>

View file

@ -420,14 +420,15 @@ void FilterGraph::addFilter (const PluginDescription* desc, double x, double y)
void FilterGraph::removeFilter (const uint32 uid)
{
FilterInGraph* const filter = getFilterForUID (uid);
disconnectFilter (uid);
if (filter != 0)
for (int i = filters.size(); --i >= 0;)
{
disconnectFilter (uid);
filters.removeObject (filter);
changed();
if (filters.getUnchecked(i)->uid == uid)
{
filters.remove (i);
changed();
}
}
}
@ -466,8 +467,8 @@ bool FilterGraph::isAnInputTo (const uint32 possibleInput, const uint32 possible
return isAnInputTo (possibleInput, possibleDestination, filters.size() + 1);
}
FilterConnection* FilterGraph::getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw()
const FilterConnection* FilterGraph::getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw()
{
for (int i = connections.size(); --i >= 0;)
{

View file

@ -157,10 +157,10 @@ public:
//==============================================================================
int getNumConnections() const throw() { return connections.size(); }
FilterConnection* getConnection (const int index) const throw() { return connections [index]; }
const FilterConnection* getConnection (const int index) const throw() { return connections [index]; }
FilterConnection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
const FilterConnection* getConnectionBetween (uint32 sourceFilterUID, int sourceFilterChannel,
uint32 destFilterUID, int destFilterChannel) const throw();
bool isAnInputTo (const uint32 possibleInput, const uint32 possibleDestination) const throw();
@ -211,7 +211,7 @@ private:
//==============================================================================
/**
An object the
*/
class FilterGraphPlayer : public AudioIODeviceCallback,
public MidiInputCallback,

View file

@ -47,7 +47,7 @@ public:
index (index_),
isInput (isInput_)
{
FilterInGraph* const f = graph.getFilterForUID (filterID_);
const FilterInGraph* const f = graph.getFilterForUID (filterID_);
if (f != 0)
{
@ -185,7 +185,7 @@ public:
}
else if (r == 3 || r == 4)
{
const FilterInGraph::Ptr f (graph.getFilterForUID (filterID));
FilterInGraph* const f = graph.getFilterForUID (filterID);
if (f != 0)
f->showUI (r == 4);
@ -771,7 +771,7 @@ void GraphEditorPanel::updateComponents()
for (i = graph.getNumConnections(); --i >= 0;)
{
FilterConnection* const c = graph.getConnection (i);
const FilterConnection* const c = graph.getConnection (i);
if (getComponentForConnection (*c) == 0)
{

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,63 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_VSTPLUGINFORMAT_JUCEHEADER__x
#define __JUCE_VSTPLUGINFORMAT_JUCEHEADER__x
#include "../juce_AudioPluginFormat.h"
#if JUCE_PLUGINHOST_AU && JUCE_MAC
//==============================================================================
/**
Implements a plugin format manager for AudioUnits.
*/
class AudioUnitPluginFormat : public AudioPluginFormat
{
public:
//==============================================================================
AudioUnitPluginFormat();
~AudioUnitPluginFormat();
//==============================================================================
const String getName() const { return "AudioUnit"; }
void findAllTypesForFile (OwnedArray <PluginDescription>& results, const File& file);
AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc);
bool fileMightContainThisPluginType (const File& file);
const FileSearchPath getDefaultLocationsToSearch();
//==============================================================================
juce_UseDebuggingNewOperator
};
#endif
#endif // __JUCE_VSTPLUGINFORMAT_JUCEHEADER__

View file

@ -0,0 +1,67 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_VSTPLUGINFORMAT_JUCEHEADER__xy
#define __JUCE_VSTPLUGINFORMAT_JUCEHEADER__xy
#include "../juce_AudioPluginFormat.h"
#if JUCE_PLUGINHOST_DX && JUCE_WIN32
// Sorry, this file is just a placeholder at the moment!...
//==============================================================================
/**
Implements a plugin format manager for DirectX plugins.
*/
class DirectXPluginFormat : public AudioPluginFormat
{
public:
//==============================================================================
DirectXPluginFormat();
~DirectXPluginFormat();
//==============================================================================
const String getName() const { return "DirectX"; }
void findAllTypesForFile (OwnedArray <PluginDescription>& results, const File& file);
AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc);
bool fileMightContainThisPluginType (const File& file);
const FileSearchPath getDefaultLocationsToSearch();
//==============================================================================
juce_UseDebuggingNewOperator
};
#endif
#endif // __JUCE_VSTPLUGINFORMAT_JUCEHEADER__

View file

@ -0,0 +1,67 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_VSTPLUGINFORMAT_JUCEHEADER__xyz
#define __JUCE_VSTPLUGINFORMAT_JUCEHEADER__xyz
#include "../juce_AudioPluginFormat.h"
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
// Sorry, this file is just a placeholder at the moment!...
//==============================================================================
/**
Implements a plugin format manager for DirectX plugins.
*/
class LADSPAPluginFormat : public AudioPluginFormat
{
public:
//==============================================================================
LADSPAPluginFormat();
~LADSPAPluginFormat();
//==============================================================================
const String getName() const { return "LADSPA"; }
void findAllTypesForFile (OwnedArray <PluginDescription>& results, const File& file);
AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc);
bool fileMightContainThisPluginType (const File& file);
const FileSearchPath getDefaultLocationsToSearch();
//==============================================================================
juce_UseDebuggingNewOperator
};
#endif
#endif // __JUCE_VSTPLUGINFORMAT_JUCEHEADER__

View file

@ -29,13 +29,19 @@
==============================================================================
*/
#ifndef JUCE_PLUGINHOST_VST // xxx temporary..
#define JUCE_PLUGINHOST_VST 1
#endif
#if JUCE_PLUGINHOST_VST
#ifdef _WIN32
#define _WIN32_WINNT 0x500
#define STRICT
#include <windows.h>
#include <float.h>
#pragma warning (disable : 4312)
#elif defined LINUX
#elif defined (LINUX)
#include <float.h>
#include <sys/time.h>
#include <X11/Xlib.h>
@ -45,19 +51,38 @@
#undef KeyPress
#undef Drawable
#undef Time
class VSTPluginWindow;
#else
#include <Carbon/Carbon.h>
#endif
//==============================================================================
#include "../../../../../juce.h"
#include "juce_VSTPluginInstance.h"
#include "juce_VSTPluginFormat.h"
//==============================================================================
#undef PRAGMA_ALIGN_SUPPORTED
#define VST_FORCE_DEPRECATED 0
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
/* Obviously you're going to need the Steinberg vstsdk2.4 folder in
your include path if you want to add VST support...
*/
#include "pluginterfaces/vst2.x/aeffectx.h"
#ifdef _MSC_VER
#pragma warning (pop)
#endif
//==============================================================================
#if JUCE_LINUX
#define Font JUCE_NAMESPACE::Font
#define KeyPress JUCE_NAMESPACE::KeyPress
#define Drawable JUCE_NAMESPACE::Drawable
#define Time JUCE_NAMESPACE::Time
#define Font JUCE_NAMESPACE::Font
#define KeyPress JUCE_NAMESPACE::KeyPress
#define Drawable JUCE_NAMESPACE::Drawable
#define Time JUCE_NAMESPACE::Time
#endif
#include "../juce_PluginDescription.h"
@ -71,10 +96,10 @@ BEGIN_JUCE_NAMESPACE
extern void juce_callAnyTimersSynchronously();
END_JUCE_NAMESPACE
//==============================================================================
const int fxbVersionNum = 1;
//==============================================================================
struct fxProgram
{
long chunkMagic; // 'CcnK'
@ -157,7 +182,7 @@ static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstI
static int shellUIDToCreate = 0;
static int insideVSTCallback = 0;
static Array <VSTPluginWindow*> activeWindows;
class VSTPluginWindow;
//==============================================================================
// Change this to disable logging of various VST activities
@ -429,8 +454,9 @@ public:
if (file.hasFileExtension (T(".vst")))
{
CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) (const char*) filename,
filename.length(), file.isDirectory());
const char* const utf8 = filename.toUTF8();
CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8,
strlen (utf8), file.isDirectory());
if (url != 0)
{
@ -630,6 +656,124 @@ public:
};
//==============================================================================
/**
An instance of a plugin, created by a VSTPluginFormat.
*/
class VSTPluginInstance : public AudioPluginInstance,
private Timer,
private AsyncUpdater
{
public:
//==============================================================================
~VSTPluginInstance();
//==============================================================================
// AudioPluginInstance methods:
const String getName() const { return name; }
const String getManufacturer() const;
const String getVersion() const;
bool isInstrument() const { return effect != 0 && (effect->flags & effFlagsIsSynth) != 0; }
const String getCategory() const;
const String getFormatName() const { return "VST"; }
const File getFile() const { return module->file; }
int getUID() const;
bool acceptsMidi() const { return wantsMidiMessages; }
bool producesMidi() const { return dispatch (effCanDo, 0, 0, (void*) "sendVstMidiEvent", 0) > 0; }
//==============================================================================
// AudioProcessor methods:
void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock);
void releaseResources();
void processBlock (AudioSampleBuffer& buffer,
MidiBuffer& midiMessages);
AudioProcessorEditor* createEditor();
const String getInputChannelName (const int index) const;
bool isInputChannelStereoPair (int index) const;
const String getOutputChannelName (const int index) const;
bool isOutputChannelStereoPair (int index) const;
//==============================================================================
int getNumParameters() { return effect != 0 ? effect->numParams : 0; }
float getParameter (int index);
void setParameter (int index, float newValue);
const String getParameterName (int index);
const String getParameterText (int index);
bool isParameterAutomatable (int index) const;
//==============================================================================
int getNumPrograms() { return effect != 0 ? effect->numPrograms : 0; }
int getCurrentProgram() { return dispatch (effGetProgram, 0, 0, 0, 0); }
void setCurrentProgram (int index);
const String getProgramName (int index);
void changeProgramName (int index, const String& newName);
//==============================================================================
void getStateInformation (MemoryBlock& destData);
void getCurrentProgramStateInformation (MemoryBlock& destData);
void setStateInformation (const void* data, int sizeInBytes);
void setCurrentProgramStateInformation (const void* data, int sizeInBytes);
//==============================================================================
void timerCallback();
void handleAsyncUpdate();
VstIntPtr handleCallback (VstInt32 opcode, VstInt32 index, VstInt32 value, void *ptr, float opt);
//==============================================================================
juce_UseDebuggingNewOperator
private:
friend class VSTPluginWindow;
friend class VSTPluginFormat;
AEffect* effect;
String name;
CriticalSection lock;
bool wantsMidiMessages, initialised, isPowerOn;
mutable StringArray programNames;
AudioSampleBuffer tempBuffer;
CriticalSection midiInLock;
MidiBuffer incomingMidi;
void* midiEventsToSend;
int numAllocatedMidiEvents;
VstTimeInfo vstHostTime;
float** channels;
ReferenceCountedObjectPtr <ModuleHandle> module;
//==============================================================================
int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) const;
bool restoreProgramSettings (const fxProgram* const prog);
const String getCurrentProgramName();
void setParamsInProgramBlock (fxProgram* const prog) throw();
void updateStoredProgramNames();
void initialise();
void ensureMidiEventSize (int numEventsNeeded);
void freeMidiEvents();
void handleMidiFromPlugin (const VstEvents* const events);
void createTempParameterStore (MemoryBlock& dest);
void restoreFromTempParameterStore (const MemoryBlock& mb);
const String getParameterLabel (int index) const;
bool usesChunks() const throw() { return effect != 0 && (effect->flags & effFlagsProgramChunks) != 0; }
void getChunkData (MemoryBlock& mb, bool isPreset, int maxSizeMB) const;
void setChunkData (const char* data, int size, bool isPreset);
bool loadFromFXBFile (const void* data, int numBytes);
bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB);
int getVersionNumber() const throw() { return effect != 0 ? effect->version : 0; }
bool hasEditor() const throw() { return effect != 0 && (effect->flags & effFlagsHasEditor) != 0; }
void setPower (const bool on);
VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHandle>& module);
};
//==============================================================================
VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHandle>& module_)
: effect (0),
@ -1030,6 +1174,9 @@ void VSTPluginInstance::handleMidiFromPlugin (const VstEvents* const events)
}
}
//==============================================================================
static Array <VSTPluginWindow*> activeWindows;
//==============================================================================
class VSTPluginWindow : public AudioProcessorEditor,
public Timer
@ -2281,11 +2428,6 @@ static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstI
}
//==============================================================================
const String VSTPluginInstance::getName() const
{
return name;
}
const String VSTPluginInstance::getManufacturer() const
{
char buffer [kVstMaxVendorStrLen + 8];
@ -2325,21 +2467,6 @@ const String VSTPluginInstance::getVersion() const
return s;
}
int VSTPluginInstance::getVersionNumber() const throw()
{
return effect != 0 ? effect->version : 0;
}
const String VSTPluginInstance::getFormatName() const
{
return "VST";
}
const File VSTPluginInstance::getFile() const
{
return module->file;
}
int VSTPluginInstance::getUID() const
{
int uid = effect != 0 ? effect->uniqueID : 0;
@ -2400,11 +2527,6 @@ const String VSTPluginInstance::getCategory() const
}
//==============================================================================
int VSTPluginInstance::getNumParameters()
{
return effect != 0 ? effect->numParams : 0;
}
float VSTPluginInstance::getParameter (int index)
{
if (effect != 0 && ((unsigned int) index) < (unsigned int) effect->numParams)
@ -2517,16 +2639,6 @@ void VSTPluginInstance::restoreFromTempParameterStore (const MemoryBlock& m)
}
//==============================================================================
int VSTPluginInstance::getNumPrograms()
{
return effect != 0 ? effect->numPrograms : 0;
}
int VSTPluginInstance::getCurrentProgram()
{
return dispatch (effGetProgram, 0, 0, 0, 0);
}
void VSTPluginInstance::setCurrentProgram (int newIndex)
{
if (getNumPrograms() > 0 && newIndex != getCurrentProgram())
@ -2667,48 +2779,12 @@ bool VSTPluginInstance::isOutputChannelStereoPair (int index) const
}
//==============================================================================
bool VSTPluginInstance::acceptsMidi() const
{
return wantsMidiMessages;
}
bool VSTPluginInstance::producesMidi() const
{
return dispatch (effCanDo, 0, 0, (void*) "sendVstMidiEvent", 0) > 0;
}
void VSTPluginInstance::setPower (const bool on)
{
dispatch (effMainsChanged, 0, on ? 1 : 0, 0, 0);
isPowerOn = on;
}
bool VSTPluginInstance::hasEditor() const throw()
{
return effect != 0 && (effect->flags & effFlagsHasEditor) != 0;
}
bool VSTPluginInstance::canMono() const throw()
{
return effect != 0 && (effect->flags & effFlagsCanMono) != 0;
}
bool VSTPluginInstance::isOffline() const throw()
{
return dispatch (effCanDo, 0, 0, (void*) "offline", 0) > 0;
}
bool VSTPluginInstance::isInstrument() const
{
return effect != 0 && (effect->flags & effFlagsIsSynth) != 0;
}
bool VSTPluginInstance::usesChunks() const throw()
{
return effect != 0 && (effect->flags & effFlagsProgramChunks) != 0;
}
//==============================================================================
const int defaultMaxSizeMB = 64;
@ -2902,3 +2978,5 @@ const FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch()
return FileSearchPath ("/usr/lib/vst");
#endif
}
#endif

View file

@ -34,6 +34,8 @@
#include "../juce_AudioPluginFormat.h"
#if JUCE_PLUGINHOST_VST
//==============================================================================
/**
@ -58,4 +60,5 @@ public:
};
#endif
#endif // __JUCE_VSTPLUGINFORMAT_JUCEHEADER__

View file

@ -31,7 +31,11 @@
#include "../../../../juce.h"
#include "juce_AudioPluginFormat.h"
#include "vst/juce_VSTPluginFormat.h"
#include "formats/juce_VSTPluginFormat.h"
#include "formats/juce_AudioUnitPluginFormat.h"
#include "formats/juce_DirectXPluginFormat.h"
#include "formats/juce_LADSPAPluginFormat.h"
//==============================================================================
@ -51,10 +55,40 @@ void AudioPluginFormatManager::addDefaultFormats()
#ifdef JUCE_DEBUG
// you should only call this method once!
for (int i = formats.size(); --i >= 0;)
{
#if JUCE_PLUGINHOST_VST
jassert (dynamic_cast <VSTPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_AU && JUCE_MAC
jassert (dynamic_cast <AudioUnitPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_DX && JUCE_WIN32
jassert (dynamic_cast <DirectXPluginFormat*> (formats[i]) == 0);
#endif
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
jassert (dynamic_cast <LADSPAPluginFormat*> (formats[i]) == 0);
#endif
}
#endif
#if JUCE_PLUGINHOST_VST
formats.add (new VSTPluginFormat());
#endif
#if JUCE_PLUGINHOST_AU && JUCE_MAC
formats.add (new AudioUnitPluginFormat());
#endif
#if JUCE_PLUGINHOST_DX && JUCE_WIN32
formats.add (new DirectXPluginFormat());
#endif
#if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX
formats.add (new LADSPAPluginFormat());
#endif
}
int AudioPluginFormatManager::getNumFormats() throw()

View file

@ -35,6 +35,10 @@
#include "juce_AudioPluginInstance.h"
class PluginDescription;
// XXX temporary place for these flags...
#define JUCE_PLUGINHOST_VST 1
#define JUCE_PLUGINHOST_AU 1
//==============================================================================
/**

View file

@ -1,180 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-7 by Raw Material Software ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the
GNU General Public License, as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with JUCE; if not, visit www.gnu.org/licenses or write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
If you'd like to release a closed-source product which uses JUCE, commercial
licenses are also available: visit www.rawmaterialsoftware.com/juce for
more information.
==============================================================================
*/
#ifndef __JUCE_VSTPLUGININSTANCE_JUCEHEADER__
#define __JUCE_VSTPLUGININSTANCE_JUCEHEADER__
#include "juce_VSTPluginFormat.h"
#undef PRAGMA_ALIGN_SUPPORTED
#define VST_FORCE_DEPRECATED 0
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
/* Obviously you're going to need the Steinberg vstsdk2.4 folder in
your include path.
*/
#include "pluginterfaces/vst2.x/aeffectx.h"
#ifdef _MSC_VER
#pragma warning (pop)
#endif
class ModuleHandle;
struct fxProgram;
//==============================================================================
/**
An instance of a plugin, created by a VSTPluginFormat.
*/
class VSTPluginInstance : public AudioPluginInstance,
private Timer,
private AsyncUpdater
{
public:
//==============================================================================
~VSTPluginInstance();
//==============================================================================
// AudioPluginInstance methods:
const String getName() const;
const String getManufacturer() const;
const String getVersion() const;
bool isInstrument() const;
const String getCategory() const;
const String getFormatName() const;
const File getFile() const;
int getUID() const;
bool acceptsMidi() const;
bool producesMidi() const;
//==============================================================================
// AudioProcessor methods:
void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock);
void releaseResources();
void processBlock (AudioSampleBuffer& buffer,
MidiBuffer& midiMessages);
AudioProcessorEditor* createEditor();
const String getInputChannelName (const int index) const;
bool isInputChannelStereoPair (int index) const;
const String getOutputChannelName (const int index) const;
bool isOutputChannelStereoPair (int index) const;
//==============================================================================
int getNumParameters();
float getParameter (int index);
void setParameter (int index, float newValue);
const String getParameterName (int index);
const String getParameterText (int index);
bool isParameterAutomatable (int index) const;
//==============================================================================
int getNumPrograms();
int getCurrentProgram();
void setCurrentProgram (int index);
const String getProgramName (int index);
void changeProgramName (int index, const String& newName);
//==============================================================================
void getStateInformation (MemoryBlock& destData);
void getCurrentProgramStateInformation (MemoryBlock& destData);
void setStateInformation (const void* data, int sizeInBytes);
void setCurrentProgramStateInformation (const void* data, int sizeInBytes);
//==============================================================================
void timerCallback();
void handleAsyncUpdate();
VstIntPtr handleCallback (VstInt32 opcode, VstInt32 index, VstInt32 value, void *ptr, float opt);
//==============================================================================
juce_UseDebuggingNewOperator
private:
friend class VSTPluginWindow;
friend class VSTPluginFormat;
AEffect* effect;
String name;
CriticalSection lock;
bool wantsMidiMessages, initialised, isPowerOn;
mutable StringArray programNames;
AudioSampleBuffer tempBuffer;
CriticalSection midiInLock;
MidiBuffer incomingMidi;
void* midiEventsToSend;
int numAllocatedMidiEvents;
VstTimeInfo vstHostTime;
float** channels;
ReferenceCountedObjectPtr <ModuleHandle> module;
//==============================================================================
int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) const;
bool restoreProgramSettings (const fxProgram* const prog);
const String getCurrentProgramName();
void setParamsInProgramBlock (fxProgram* const prog) throw();
void updateStoredProgramNames();
void initialise();
void ensureMidiEventSize (int numEventsNeeded);
void freeMidiEvents();
void handleMidiFromPlugin (const VstEvents* const events);
void createTempParameterStore (MemoryBlock& dest);
void restoreFromTempParameterStore (const MemoryBlock& mb);
const String getParameterLabel (int index) const;
bool usesChunks() const throw();
void getChunkData (MemoryBlock& mb, bool isPreset, int maxSizeMB) const;
void setChunkData (const char* data, int size, bool isPreset);
bool loadFromFXBFile (const void* data, int numBytes);
bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB);
int getVersionNumber() const throw();
bool hasEditor() const throw();
bool canMono() const throw();
bool isOffline() const throw();
void setPower (const bool on);
VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHandle>& module);
};
#endif // __JUCE_VSTPLUGININSTANCE_JUCEHEADER__