Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
2c1b03cbf1
6 changed files with 238 additions and 6 deletions
  1. +6
    -0
      extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj
  2. +8
    -0
      extras/audio plugin host/build/win32/PluginHost.vcproj
  3. +6
    -5
      extras/audio plugin host/src/host/FilterGraph.cpp
  4. +146
    -0
      extras/audio plugin host/src/plugins/juce_GenericAudioFilterEditor.cpp
  5. +68
    -0
      extras/audio plugin host/src/plugins/juce_GenericAudioFilterEditor.h
  6. +4
    -1
      extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp

+ 6
- 0
extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj View File

@@ -7,6 +7,7 @@
objects = { objects = {


/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
84E5BB970C7203B70088E799 /* juce_GenericAudioFilterEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E5BB950C7203B70088E799 /* juce_GenericAudioFilterEditor.cpp */; };
84FFAEAC0C6C8A6F009F6E72 /* FilterGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */; }; 84FFAEAC0C6C8A6F009F6E72 /* FilterGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */; };
84FFAEAD0C6C8A6F009F6E72 /* GraphEditorPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */; }; 84FFAEAD0C6C8A6F009F6E72 /* GraphEditorPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */; };
84FFAEAE0C6C8A6F009F6E72 /* InternalFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE960C6C8A6F009F6E72 /* InternalFilters.cpp */; }; 84FFAEAE0C6C8A6F009F6E72 /* InternalFilters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE960C6C8A6F009F6E72 /* InternalFilters.cpp */; };
@@ -43,6 +44,8 @@
4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; }; 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>"; }; 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; }; 508344B209E5C41E0093A071 /* Juce Plugin Host.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Juce Plugin Host.app"; sourceTree = BUILT_PRODUCTS_DIR; };
84E5BB950C7203B70088E799 /* juce_GenericAudioFilterEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_GenericAudioFilterEditor.cpp; sourceTree = "<group>"; };
84E5BB960C7203B70088E799 /* juce_GenericAudioFilterEditor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_GenericAudioFilterEditor.h; sourceTree = "<group>"; };
84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FilterGraph.cpp; path = ../../src/host/FilterGraph.cpp; sourceTree = SOURCE_ROOT; }; 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; }; 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; }; 84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = GraphEditorPanel.cpp; path = ../../src/host/GraphEditorPanel.cpp; sourceTree = SOURCE_ROOT; };
@@ -171,6 +174,8 @@
84FFAE9D0C6C8A6F009F6E72 /* juce_AudioPluginFormat.h */, 84FFAE9D0C6C8A6F009F6E72 /* juce_AudioPluginFormat.h */,
84FFAE9E0C6C8A6F009F6E72 /* juce_AudioPluginInstance.cpp */, 84FFAE9E0C6C8A6F009F6E72 /* juce_AudioPluginInstance.cpp */,
84FFAE9F0C6C8A6F009F6E72 /* juce_AudioPluginInstance.h */, 84FFAE9F0C6C8A6F009F6E72 /* juce_AudioPluginInstance.h */,
84E5BB950C7203B70088E799 /* juce_GenericAudioFilterEditor.cpp */,
84E5BB960C7203B70088E799 /* juce_GenericAudioFilterEditor.h */,
84FFAEA00C6C8A6F009F6E72 /* juce_KnownPluginList.cpp */, 84FFAEA00C6C8A6F009F6E72 /* juce_KnownPluginList.cpp */,
84FFAEA10C6C8A6F009F6E72 /* juce_KnownPluginList.h */, 84FFAEA10C6C8A6F009F6E72 /* juce_KnownPluginList.h */,
84FFAEA20C6C8A6F009F6E72 /* juce_PluginDescription.cpp */, 84FFAEA20C6C8A6F009F6E72 /* juce_PluginDescription.cpp */,
@@ -282,6 +287,7 @@
84FFAEB50C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.cpp in Sources */, 84FFAEB50C6C8A6F009F6E72 /* juce_PluginDirectoryScanner.cpp in Sources */,
84FFAEB60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp in Sources */, 84FFAEB60C6C8A6F009F6E72 /* juce_PluginListComponent.cpp in Sources */,
84FFAEB70C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp in Sources */, 84FFAEB70C6C8A6F009F6E72 /* juce_VSTPluginInstance.cpp in Sources */,
84E5BB970C7203B70088E799 /* juce_GenericAudioFilterEditor.cpp in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };


+ 8
- 0
extras/audio plugin host/build/win32/PluginHost.vcproj View File

@@ -233,6 +233,14 @@
RelativePath="..\..\src\plugins\juce_AudioPluginInstance.h" RelativePath="..\..\src\plugins\juce_AudioPluginInstance.h"
> >
</File> </File>
<File
RelativePath="..\..\src\plugins\juce_GenericAudioFilterEditor.cpp"
>
</File>
<File
RelativePath="..\..\src\plugins\juce_GenericAudioFilterEditor.h"
>
</File>
<File <File
RelativePath="..\..\src\plugins\juce_KnownPluginList.cpp" RelativePath="..\..\src\plugins\juce_KnownPluginList.cpp"
> >


+ 6
- 5
extras/audio plugin host/src/host/FilterGraph.cpp View File

@@ -31,6 +31,7 @@
#include "FilterGraph.h" #include "FilterGraph.h"
#include "InternalFilters.h" #include "InternalFilters.h"
#include "../plugins/juce_GenericAudioFilterEditor.h"
//============================================================================== //==============================================================================
@@ -123,11 +124,11 @@ void FilterInGraph::showUI()
{ {
Component* ui = filter->createEditorIfNeeded(); Component* ui = filter->createEditorIfNeeded();
if (ui != 0)
{
ui->setName (filter->getName());
activeUI = new PluginWindow (ui, *this);
}
if (ui == 0)
ui = new GenericAudioFilterEditor (filter);
ui->setName (filter->getName());
activeUI = new PluginWindow (ui, *this);
} }
if (activeUI != 0) if (activeUI != 0)


+ 146
- 0
extras/audio plugin host/src/plugins/juce_GenericAudioFilterEditor.cpp View File

@@ -0,0 +1,146 @@
/*
==============================================================================
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.
==============================================================================
*/
#include "../../../../juce.h"
#include "juce_GenericAudioFilterEditor.h"
//==============================================================================
class FilterParameterPropertyComp : public PropertyComponent
{
public:
FilterParameterPropertyComp (AudioPluginInstance* const filter_,
const int index_)
: PropertyComponent (filter_->getParameterName (index_)),
filter (filter_),
index (index_)
{
addAndMakeVisible (slider = new PluginSlider (filter_, index_));
}
~FilterParameterPropertyComp()
{
deleteAllChildren();
}
void refresh()
{
slider->setValue (filter->getParameter (index), false);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
AudioPluginInstance* const filter;
const int index;
Slider* slider;
//==============================================================================
class PluginSlider : public Slider
{
public:
PluginSlider (AudioPluginInstance* const filter_, const int index_)
: Slider (String::empty),
filter (filter_),
index (index_)
{
setRange (0.0, 1.0, 0.0);
setSliderStyle (Slider::LinearBar);
setTextBoxIsEditable (false);
}
~PluginSlider()
{
}
void valueChanged()
{
const float newVal = (float) getValue();
if (filter->getParameter (index) != newVal)
filter->setParameter (index, newVal);
}
const String getTextFromValue (double /*value*/)
{
return filter->getParameterText (index);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
AudioPluginInstance* const filter;
const int index;
};
};
//==============================================================================
GenericAudioFilterEditor::GenericAudioFilterEditor (AudioPluginInstance* const filter)
: AudioFilterEditor (filter)
{
setOpaque (true);
addAndMakeVisible (panel = new PropertyPanel());
Array <PropertyComponent*> params;
const int numParams = filter->getNumParameters();
int totalHeight = 0;
for (int i = 0; i < numParams; ++i)
{
FilterParameterPropertyComp* const pc = new FilterParameterPropertyComp (filter, i);
params.add (pc);
totalHeight += pc->getPreferredHeight();
}
panel->addProperties (params);
setSize (400, jlimit (25, 400, totalHeight));
}
GenericAudioFilterEditor::~GenericAudioFilterEditor()
{
deleteAllChildren();
}
void GenericAudioFilterEditor::paint (Graphics& g)
{
g.fillAll (Colours::white);
}
void GenericAudioFilterEditor::resized()
{
panel->setSize (getWidth(), getHeight());
}

+ 68
- 0
extras/audio plugin host/src/plugins/juce_GenericAudioFilterEditor.h View File

@@ -0,0 +1,68 @@
/*
==============================================================================
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_GENERICFILTERUI_JUCEHEADER__
#define __JUCE_GENERICFILTERUI_JUCEHEADER__
#include "juce_AudioPluginInstance.h"
//==============================================================================
/**
A type of UI component that displays the parameters of an AudioFilterInstance as
a simple list of sliders.
This can be used for showing an editor for plugins that don't supply their own
editor.
@see AudioFilterBase, AudioPluginFormat
*/
class GenericAudioFilterEditor : public AudioFilterEditor
{
public:
//==============================================================================
GenericAudioFilterEditor (AudioPluginInstance* const ownerFilter);
~GenericAudioFilterEditor();
//==============================================================================
void paint (Graphics& g);
void resized();
//==============================================================================
juce_UseDebuggingNewOperator
private:
PropertyPanel* panel;
};
#endif

+ 4
- 1
extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp View File

@@ -1399,7 +1399,10 @@ private:
//============================================================================== //==============================================================================
AudioFilterEditor* JUCE_CALLTYPE VSTPluginInstance::createEditor() AudioFilterEditor* JUCE_CALLTYPE VSTPluginInstance::createEditor()
{ {
return new VSTPluginWindow (*this);
if (hasEditor())
return new VSTPluginWindow (*this);
return 0;
} }


Loading…
Cancel
Save