1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

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.

This commit is contained in:
jules 2009-05-11 09:57:40 +00:00
parent f0c030e330
commit 65e1eabca3
11 changed files with 129 additions and 45 deletions

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);

View file

@ -44,10 +44,15 @@
//============================================================================== //==============================================================================
/* Plugin Formats to build */ /* Plugin Formats to build */
#define JucePlugin_Build_VST 1 // If your project is building a standalone app to run your plugin, you should
#define JucePlugin_Build_RTAS 0 // set the JucePlugin_Build_Standalone flag in the project's settings..
#define JucePlugin_Build_AU 1 #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 */

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 (speakerIn != kSpeakerArrEmpty)
{
if (filter->isInputChannelStereoPair ((int) index)) properties->flags = kVstPinUseSpeaker;
properties->flags |= kVstPinIsStereo; properties->arrangementType = speakerIn;
}
properties->arrangementType = 0; 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 (speakerOut != kSpeakerArrEmpty)
{
if (filter->isOutputChannelStereoPair ((int) index)) properties->flags = kVstPinUseSpeaker;
properties->flags |= kVstPinIsStereo; properties->arrangementType = speakerOut;
}
properties->arrangementType = 0; 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 const short channelConfigs[][2] = { JucePlugin_PreferredChannelConfigurations };
|| numOutChans != pluginOutput->numChannels)
for (int i = 0; i < numElementsInArray (channelConfigs); ++i)
{ {
setNumInputs (pluginInput->numChannels); bool configMono = (channelConfigs[i][1] == 1) && (pluginOutput->type == kSpeakerArrMono);
setNumOutputs (pluginOutput->numChannels); bool configStereo = (channelConfigs[i][1] == 2) && (pluginOutput->type == kSpeakerArrStereo);
ioChanged(); bool inCountMatches = (channelConfigs[i][0] == pluginInput->numChannels);
bool outCountMatches = (channelConfigs[i][1] == pluginOutput->numChannels);
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;
}
} }
numInChans = pluginInput->numChannels; return false;
numOutChans = pluginOutput->numChannels;
filter->setPlayConfigDetails (numInChans, numOutChans,
filter->getSampleRate(),
filter->getBlockSize());
return true;
} }
//============================================================================== //==============================================================================
@ -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()

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

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();

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 */

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.

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&)
{ {

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 */

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_),

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;