Browse Source

Small fix to audio plugin host demo; updated plugin characteristics file to allow a standalone build flag; added VST speaker arrangement fixes as suggested by Andy; added some options for ignoring hidden files to the file browser comp; minor update to the Variant class.

tags/2021-05-28
jules 16 years ago
parent
commit
65e1eabca3
11 changed files with 130 additions and 46 deletions
  1. +2
    -2
      extras/audio plugin host/src/host/GraphEditorPanel.cpp
  2. +9
    -4
      extras/audio plugins/demo/src/JucePluginCharacteristics.h
  3. +65
    -35
      extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp
  4. +1
    -1
      extras/audio plugins/wrapper/juce_IncludeCharacteristics.h
  5. +15
    -0
      juce_amalgamated.cpp
  6. +7
    -2
      juce_amalgamated.h
  7. +5
    -0
      src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsList.h
  8. +15
    -0
      src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp
  9. +2
    -2
      src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.h
  10. +7
    -0
      src/juce_core/containers/juce_Variant.cpp
  11. +2
    -0
      src/juce_core/containers/juce_Variant.h

+ 2
- 2
extras/audio plugin host/src/host/GraphEditorPanel.cpp View File

@@ -1050,14 +1050,14 @@ GraphDocumentComponent::GraphDocumentComponent (AudioDeviceManager* deviceManage
addAndMakeVisible (statusBar = new TooltipBar()); addAndMakeVisible (statusBar = new TooltipBar());
deviceManager->setAudioCallback (&graphPlayer);
deviceManager->addAudioCallback (&graphPlayer);
graphPanel->updateComponents(); graphPanel->updateComponents();
} }
GraphDocumentComponent::~GraphDocumentComponent() GraphDocumentComponent::~GraphDocumentComponent()
{ {
deviceManager->setAudioCallback (0);
deviceManager->removeAudioCallback (&graphPlayer);
deleteAllChildren(); deleteAllChildren();
graphPlayer.setProcessor (0); graphPlayer.setProcessor (0);


+ 9
- 4
extras/audio plugins/demo/src/JucePluginCharacteristics.h View File

@@ -44,10 +44,15 @@
//============================================================================== //==============================================================================
/* Plugin Formats to build */ /* Plugin Formats to build */
#define JucePlugin_Build_VST 1
#define JucePlugin_Build_RTAS 0
#define JucePlugin_Build_AU 1
// If your project is building a standalone app to run your plugin, you should
// set the JucePlugin_Build_Standalone flag in the project's settings..
#if ! JucePlugin_Build_Standalone
// You should turn on these flags to enable the different types of plugin..
#define JucePlugin_Build_VST 1
#define JucePlugin_Build_RTAS 0
#define JucePlugin_Build_AU 1
#endif
//============================================================================== //==============================================================================
/* Generic settings */ /* Generic settings */


+ 65
- 35
extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp View File

@@ -352,6 +352,10 @@ public:
firstProcessCallback = true; firstProcessCallback = true;
shouldDeleteEditor = false; shouldDeleteEditor = false;
channels = 0; channels = 0;
speakerIn = kSpeakerArrEmpty;
speakerOut = kSpeakerArrEmpty;
speakerInChans = 0;
speakerOutChans = 0;
numInChans = JucePlugin_MaxNumInputChannels; numInChans = JucePlugin_MaxNumInputChannels;
numOutChans = JucePlugin_MaxNumOutputChannels; numOutChans = JucePlugin_MaxNumOutputChannels;
@@ -513,40 +517,56 @@ public:
bool getInputProperties (VstInt32 index, VstPinProperties* properties) bool getInputProperties (VstInt32 index, VstPinProperties* properties)
{ {
if (filter == 0 || index >= filter->getNumInputChannels())
if (filter == 0 || index >= JucePlugin_MaxNumInputChannels)
return false; return false;
const String name (filter->getInputChannelName ((int) index)); const String name (filter->getInputChannelName ((int) index));
name.copyToBuffer (properties->label, kVstMaxLabelLen - 1); name.copyToBuffer (properties->label, kVstMaxLabelLen - 1);
name.copyToBuffer (properties->shortLabel, kVstMaxShortLabelLen - 1); name.copyToBuffer (properties->shortLabel, kVstMaxShortLabelLen - 1);
properties->flags = kVstPinIsActive;
if (filter->isInputChannelStereoPair ((int) index))
properties->flags |= kVstPinIsStereo;
properties->arrangementType = 0;
if (speakerIn != kSpeakerArrEmpty)
{
properties->flags = kVstPinUseSpeaker;
properties->arrangementType = speakerIn;
}
else
{
properties->flags = kVstPinIsActive;
if (filter->isInputChannelStereoPair ((int) index))
properties->flags |= kVstPinIsStereo;
properties->arrangementType = 0;
}
return true; return true;
} }
bool getOutputProperties (VstInt32 index, VstPinProperties* properties) bool getOutputProperties (VstInt32 index, VstPinProperties* properties)
{ {
if (filter == 0 || index >= filter->getNumOutputChannels())
if (filter == 0 || index >= JucePlugin_MaxNumOutputChannels)
return false; return false;
const String name (filter->getOutputChannelName ((int) index)); const String name (filter->getOutputChannelName ((int) index));
name.copyToBuffer (properties->label, kVstMaxLabelLen - 1); name.copyToBuffer (properties->label, kVstMaxLabelLen - 1);
name.copyToBuffer (properties->shortLabel, kVstMaxShortLabelLen - 1); name.copyToBuffer (properties->shortLabel, kVstMaxShortLabelLen - 1);
properties->flags = kVstPinIsActive;
if (filter->isOutputChannelStereoPair ((int) index))
properties->flags |= kVstPinIsStereo;
properties->arrangementType = 0;
if (speakerOut != kSpeakerArrEmpty)
{
properties->flags = kVstPinUseSpeaker;
properties->arrangementType = speakerOut;
}
else
{
properties->flags = kVstPinIsActive;
if (filter->isOutputChannelStereoPair ((int) index))
properties->flags |= kVstPinIsStereo;
properties->arrangementType = 0;
}
return true; return true;
} }
@@ -969,25 +989,33 @@ public:
return filter != 0 && filter->isParameterAutomatable ((int) index); return filter != 0 && filter->isParameterAutomatable ((int) index);
} }
bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput,
bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput,
VstSpeakerArrangement* pluginOutput) VstSpeakerArrangement* pluginOutput)
{ {
if (numInChans != pluginInput->numChannels
|| numOutChans != pluginOutput->numChannels)
{
setNumInputs (pluginInput->numChannels);
setNumOutputs (pluginOutput->numChannels);
ioChanged();
}
const short channelConfigs[][2] = { JucePlugin_PreferredChannelConfigurations };
numInChans = pluginInput->numChannels;
numOutChans = pluginOutput->numChannels;
for (int i = 0; i < numElementsInArray (channelConfigs); ++i)
{
bool configMono = (channelConfigs[i][1] == 1) && (pluginOutput->type == kSpeakerArrMono);
bool configStereo = (channelConfigs[i][1] == 2) && (pluginOutput->type == kSpeakerArrStereo);
bool inCountMatches = (channelConfigs[i][0] == pluginInput->numChannels);
bool outCountMatches = (channelConfigs[i][1] == pluginOutput->numChannels);
filter->setPlayConfigDetails (numInChans, numOutChans,
filter->getSampleRate(),
filter->getBlockSize());
if ((configMono || configStereo) && inCountMatches && outCountMatches)
{
speakerIn = pluginInput->type;
speakerOut = pluginOutput->type;
speakerInChans = pluginInput->numChannels;
speakerOutChans = pluginOutput->numChannels;
filter->setPlayConfigDetails (speakerInChans, speakerOutChans,
filter->getSampleRate(),
filter->getBlockSize());
return true;
}
}
return true;
return false;
} }
//============================================================================== //==============================================================================
@@ -1329,6 +1357,8 @@ private:
bool hasShutdown; bool hasShutdown;
bool firstProcessCallback; bool firstProcessCallback;
int diffW, diffH; int diffW, diffH;
VstSpeakerArrangementType speakerIn, speakerOut;
int speakerInChans, speakerOutChans;
int numInChans, numOutChans; int numInChans, numOutChans;
float** channels; float** channels;
VoidArray tempChannels; // see note in processReplacing() VoidArray tempChannels; // see note in processReplacing()


+ 1
- 1
extras/audio plugins/wrapper/juce_IncludeCharacteristics.h View File

@@ -92,7 +92,7 @@
#error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value in your JucePluginCharacteristics.h file!" #error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value in your JucePluginCharacteristics.h file!"
#endif #endif
#if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS)
#if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_Standalone)
#error "You need to define at least one plugin format value in your JucePluginCharacteristics.h file!" #error "You need to define at least one plugin format value in your JucePluginCharacteristics.h file!"
#endif #endif


+ 15
- 0
juce_amalgamated.cpp View File

@@ -54146,6 +54146,21 @@ void FileBrowserComponent::fileDoubleClicked (const File& f)
} }
} }


bool FileBrowserComponent::keyPressed (const KeyPress& key)
{
#if JUCE_LINUX || JUCE_WIN32
if (key.getModifiers().isCommandDown()
&& (key.getKeyCode() == 'H' || key.getKeyCode() == 'h'))
{
fileList->setIgnoresHiddenFiles (! fileList->ignoresHiddenFiles());
fileList->refresh();
return true;
}
#endif

return false;
}

void FileBrowserComponent::textEditorTextChanged (TextEditor&) void FileBrowserComponent::textEditorTextChanged (TextEditor&)
{ {
sendListenerChangeMessage(); sendListenerChangeMessage();


+ 7
- 2
juce_amalgamated.h View File

@@ -49587,6 +49587,11 @@ public:
*/ */
void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles); void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles);


/** Returns true if hidden files are ignored.
@see setIgnoresHiddenFiles
*/
bool ignoresHiddenFiles() const throw() { return ignoreHiddenFiles; }

/** Contains cached information about one of the files in a DirectoryContentsList. /** Contains cached information about one of the files in a DirectoryContentsList.
*/ */
struct FileInfo struct FileInfo
@@ -49965,7 +49970,6 @@ public:
void buttonClicked (Button* b); void buttonClicked (Button* b);
/** @internal */ /** @internal */
void comboBoxChanged (ComboBox*); void comboBoxChanged (ComboBox*);

/** @internal */ /** @internal */
void textEditorTextChanged (TextEditor& editor); void textEditorTextChanged (TextEditor& editor);
/** @internal */ /** @internal */
@@ -49974,7 +49978,8 @@ public:
void textEditorEscapeKeyPressed (TextEditor& editor); void textEditorEscapeKeyPressed (TextEditor& editor);
/** @internal */ /** @internal */
void textEditorFocusLost (TextEditor& editor); void textEditorFocusLost (TextEditor& editor);

/** @internal */
bool keyPressed (const KeyPress& key);
/** @internal */ /** @internal */
void selectionChanged(); void selectionChanged();
/** @internal */ /** @internal */


+ 5
- 0
src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsList.h View File

@@ -106,6 +106,11 @@ public:
By default these are ignored. By default these are ignored.
*/ */
void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles); void setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles);
/** Returns true if hidden files are ignored.
@see setIgnoresHiddenFiles
*/
bool ignoresHiddenFiles() const throw() { return ignoreHiddenFiles; }
//============================================================================== //==============================================================================
/** Contains cached information about one of the files in a DirectoryContentsList. /** Contains cached information about one of the files in a DirectoryContentsList.


+ 15
- 0
src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -346,6 +346,21 @@ void FileBrowserComponent::fileDoubleClicked (const File& f)
} }
} }
bool FileBrowserComponent::keyPressed (const KeyPress& key)
{
#if JUCE_LINUX || JUCE_WIN32
if (key.getModifiers().isCommandDown()
&& (key.getKeyCode() == 'H' || key.getKeyCode() == 'h'))
{
fileList->setIgnoresHiddenFiles (! fileList->ignoresHiddenFiles());
fileList->refresh();
return true;
}
#endif
return false;
}
//============================================================================== //==============================================================================
void FileBrowserComponent::textEditorTextChanged (TextEditor&) void FileBrowserComponent::textEditorTextChanged (TextEditor&)
{ {


+ 2
- 2
src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.h View File

@@ -162,7 +162,6 @@ public:
void buttonClicked (Button* b); void buttonClicked (Button* b);
/** @internal */ /** @internal */
void comboBoxChanged (ComboBox*); void comboBoxChanged (ComboBox*);
/** @internal */ /** @internal */
void textEditorTextChanged (TextEditor& editor); void textEditorTextChanged (TextEditor& editor);
/** @internal */ /** @internal */
@@ -171,7 +170,8 @@ public:
void textEditorEscapeKeyPressed (TextEditor& editor); void textEditorEscapeKeyPressed (TextEditor& editor);
/** @internal */ /** @internal */
void textEditorFocusLost (TextEditor& editor); void textEditorFocusLost (TextEditor& editor);
/** @internal */
bool keyPressed (const KeyPress& key);
/** @internal */ /** @internal */
void selectionChanged(); void selectionChanged();
/** @internal */ /** @internal */


+ 7
- 0
src/juce_core/containers/juce_Variant.cpp View File

@@ -337,6 +337,13 @@ const var var::call (const var::identifier& method, const var& arg1, const var&
return invoke (method, args, 4); return invoke (method, args, 4);
} }
const var var::call (const var::identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const
{
var args[] = { arg1, arg2, arg3, arg4, arg5 };
return invoke (method, args, 5);
}
//============================================================================== //==============================================================================
var::identifier::identifier (const String& name_) throw() var::identifier::identifier (const String& name_) throw()
: name (name_), : name (name_),


+ 2
- 0
src/juce_core/containers/juce_Variant.h View File

@@ -124,6 +124,8 @@ public:
const var call (const identifier& method, const var& arg1, const var& arg2, const var& arg3); const var call (const identifier& method, const var& arg1, const var& arg2, const var& arg3);
/** If this variant is an object, this invokes one of its methods with 4 arguments. */ /** If this variant is an object, this invokes one of its methods with 4 arguments. */
const var call (const identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const; const var call (const identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const;
/** If this variant is an object, this invokes one of its methods with 5 arguments. */
const var call (const identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const;
/** If this variant is an object, this invokes one of its methods with a list of arguments. */ /** If this variant is an object, this invokes one of its methods with a list of arguments. */
const var invoke (const identifier& method, const var* arguments, int numArguments) const; const var invoke (const identifier& method, const var* arguments, int numArguments) const;


Loading…
Cancel
Save