1
0
Fork 0
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:
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());
deviceManager->setAudioCallback (&graphPlayer);
deviceManager->addAudioCallback (&graphPlayer);
graphPanel->updateComponents();
}
GraphDocumentComponent::~GraphDocumentComponent()
{
deviceManager->setAudioCallback (0);
deviceManager->removeAudioCallback (&graphPlayer);
deleteAllChildren();
graphPlayer.setProcessor (0);

View file

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

View file

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

View file

@ -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