mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +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:
parent
f0c030e330
commit
65e1eabca3
11 changed files with 129 additions and 45 deletions
|
|
@ -1050,14 +1050,14 @@ GraphDocumentComponent::GraphDocumentComponent (AudioDeviceManager* deviceManage
|
|||
|
||||
addAndMakeVisible (statusBar = new TooltipBar());
|
||||
|
||||
deviceManager->setAudioCallback (&graphPlayer);
|
||||
deviceManager->addAudioCallback (&graphPlayer);
|
||||
|
||||
graphPanel->updateComponents();
|
||||
}
|
||||
|
||||
GraphDocumentComponent::~GraphDocumentComponent()
|
||||
{
|
||||
deviceManager->setAudioCallback (0);
|
||||
deviceManager->removeAudioCallback (&graphPlayer);
|
||||
deleteAllChildren();
|
||||
|
||||
graphPlayer.setProcessor (0);
|
||||
|
|
|
|||
|
|
@ -44,10 +44,15 @@
|
|||
//==============================================================================
|
||||
/* 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 */
|
||||
|
|
|
|||
|
|
@ -352,6 +352,10 @@ public:
|
|||
firstProcessCallback = true;
|
||||
shouldDeleteEditor = false;
|
||||
channels = 0;
|
||||
speakerIn = kSpeakerArrEmpty;
|
||||
speakerOut = kSpeakerArrEmpty;
|
||||
speakerInChans = 0;
|
||||
speakerOutChans = 0;
|
||||
numInChans = JucePlugin_MaxNumInputChannels;
|
||||
numOutChans = JucePlugin_MaxNumOutputChannels;
|
||||
|
||||
|
|
@ -513,40 +517,56 @@ public:
|
|||
|
||||
bool getInputProperties (VstInt32 index, VstPinProperties* properties)
|
||||
{
|
||||
if (filter == 0 || index >= filter->getNumInputChannels())
|
||||
if (filter == 0 || index >= JucePlugin_MaxNumInputChannels)
|
||||
return false;
|
||||
|
||||
|
||||
const String name (filter->getInputChannelName ((int) index));
|
||||
|
||||
|
||||
name.copyToBuffer (properties->label, kVstMaxLabelLen - 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;
|
||||
}
|
||||
|
||||
|
||||
bool getOutputProperties (VstInt32 index, VstPinProperties* properties)
|
||||
{
|
||||
if (filter == 0 || index >= filter->getNumOutputChannels())
|
||||
if (filter == 0 || index >= JucePlugin_MaxNumOutputChannels)
|
||||
return false;
|
||||
|
||||
|
||||
const String name (filter->getOutputChannelName ((int) index));
|
||||
|
||||
|
||||
name.copyToBuffer (properties->label, kVstMaxLabelLen - 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;
|
||||
}
|
||||
|
|
@ -969,25 +989,33 @@ public:
|
|||
return filter != 0 && filter->isParameterAutomatable ((int) index);
|
||||
}
|
||||
|
||||
bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput,
|
||||
bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput,
|
||||
VstSpeakerArrangement* pluginOutput)
|
||||
{
|
||||
if (numInChans != pluginInput->numChannels
|
||||
|| numOutChans != pluginOutput->numChannels)
|
||||
const short channelConfigs[][2] = { JucePlugin_PreferredChannelConfigurations };
|
||||
|
||||
for (int i = 0; i < numElementsInArray (channelConfigs); ++i)
|
||||
{
|
||||
setNumInputs (pluginInput->numChannels);
|
||||
setNumOutputs (pluginOutput->numChannels);
|
||||
ioChanged();
|
||||
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);
|
||||
|
||||
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;
|
||||
numOutChans = pluginOutput->numChannels;
|
||||
|
||||
filter->setPlayConfigDetails (numInChans, numOutChans,
|
||||
filter->getSampleRate(),
|
||||
filter->getBlockSize());
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -1329,6 +1357,8 @@ private:
|
|||
bool hasShutdown;
|
||||
bool firstProcessCallback;
|
||||
int diffW, diffH;
|
||||
VstSpeakerArrangementType speakerIn, speakerOut;
|
||||
int speakerInChans, speakerOutChans;
|
||||
int numInChans, numOutChans;
|
||||
float** channels;
|
||||
VoidArray tempChannels; // see note in processReplacing()
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
#error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value in your JucePluginCharacteristics.h file!"
|
||||
#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!"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -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&)
|
||||
{
|
||||
sendListenerChangeMessage();
|
||||
|
|
|
|||
|
|
@ -49587,6 +49587,11 @@ public:
|
|||
*/
|
||||
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.
|
||||
*/
|
||||
struct FileInfo
|
||||
|
|
@ -49965,7 +49970,6 @@ public:
|
|||
void buttonClicked (Button* b);
|
||||
/** @internal */
|
||||
void comboBoxChanged (ComboBox*);
|
||||
|
||||
/** @internal */
|
||||
void textEditorTextChanged (TextEditor& editor);
|
||||
/** @internal */
|
||||
|
|
@ -49974,7 +49978,8 @@ public:
|
|||
void textEditorEscapeKeyPressed (TextEditor& editor);
|
||||
/** @internal */
|
||||
void textEditorFocusLost (TextEditor& editor);
|
||||
|
||||
/** @internal */
|
||||
bool keyPressed (const KeyPress& key);
|
||||
/** @internal */
|
||||
void selectionChanged();
|
||||
/** @internal */
|
||||
|
|
|
|||
|
|
@ -106,6 +106,11 @@ public:
|
|||
By default these are ignored.
|
||||
*/
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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&)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ public:
|
|||
void buttonClicked (Button* b);
|
||||
/** @internal */
|
||||
void comboBoxChanged (ComboBox*);
|
||||
|
||||
/** @internal */
|
||||
void textEditorTextChanged (TextEditor& editor);
|
||||
/** @internal */
|
||||
|
|
@ -171,7 +170,8 @@ public:
|
|||
void textEditorEscapeKeyPressed (TextEditor& editor);
|
||||
/** @internal */
|
||||
void textEditorFocusLost (TextEditor& editor);
|
||||
|
||||
/** @internal */
|
||||
bool keyPressed (const KeyPress& key);
|
||||
/** @internal */
|
||||
void selectionChanged();
|
||||
/** @internal */
|
||||
|
|
|
|||
|
|
@ -337,6 +337,13 @@ const var var::call (const var::identifier& method, const var& arg1, const var&
|
|||
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()
|
||||
: name (name_),
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ public:
|
|||
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. */
|
||||
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. */
|
||||
const var invoke (const identifier& method, const var* arguments, int numArguments) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue