void FilterGraph::buildI_O() { InternalPluginFormat internalFormat; // use the map to grab the input/output ids addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioInputFilter), 0.5f, 0.1f, 1); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiInputFilter), 0.25f, 0.1f, 3); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioOutputFilter), 0.5f, 0.9f, 2); }
void FilterGraph::backToDefault() { clear(); update_chklist(); InternalPluginFormat internalFormat; currentUid = ""; currentName = ""; addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioInputFilter), 0.5f, 0.1f, 1); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiInputFilter), 0.25f, 0.1f, 3); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioOutputFilter), 0.5f, 0.9f, 2); }
FilterGraph::FilterGraph (AudioPluginFormatManager& formatManager_) : FileBasedDocument (filenameSuffix, filenameWildcard, "Load a filter graph", "Save a filter graph"), formatManager (formatManager_), lastUID (0) { InternalPluginFormat internalFormat; addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioInputFilter), 0.5f, 0.1f); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiInputFilter), 0.25f, 0.1f); addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioOutputFilter), 0.5f, 0.9f); setChangedFlag (false); }
//------------------------------------------------------------------------------ void PluginField::enableAudioInput(bool val) { int i; audioInputEnabled = val; if(!val) { //Delete the filter(s) in the signal path. for(i=(signalPath->getNumFilters()-1);i>=0;--i) { if(signalPath->getNode(i)->getProcessor()->getName() == "Audio Input") deleteFilter(signalPath->getNode(i)); } //Delete the associated "Audio Input" PluginComponent(s). for(i=(getNumChildComponents()-1);i>=0;--i) { PluginComponent *comp = dynamic_cast<PluginComponent *>(getChildComponent(i)); if(comp) { if(comp->getNode()->getProcessor()->getName() == "Audio Input") delete removeChildComponent(i); } } } else { InternalPluginFormat internalFormat; //Add the filter to the signal path. signalPath->addFilter(internalFormat.getDescriptionFor(InternalPluginFormat::audioInputFilter), 10.0f, 10.0f); //Add the associated PluginComponent. addFilter(signalPath->getNumFilters()-1); } }
//------------------------------------------------------------------------------ void PluginField::enableMidiInput(bool val) { int i; AudioProcessorGraph::Node *tempNode = 0; multimap<uint32, Mapping *>::iterator it; midiInputEnabled = val; if(!val) { //Delete mappings. for(it=mappings.begin();it!=mappings.end();) { MidiMapping *midiMapping = dynamic_cast<MidiMapping *>(it->second); if(midiMapping) { delete it->second; mappings.erase(it++); } else ++it; } //Midi Input filter. { //Delete filter. for(i=(signalPath->getNumFilters()-1);i>=0;--i) { if(signalPath->getNode(i)->getProcessor()->getName() == "Midi Input") { tempNode = signalPath->getNode(i); deleteFilter(tempNode); } } //Delete PluginComponent. for(i=(getNumChildComponents()-1);i>=0;--i) { PluginComponent *comp = dynamic_cast<PluginComponent *>(getChildComponent(i)); if(comp) { if(comp->getNode() == tempNode) delete removeChildComponent(i); } } } //Midi Interceptor filter. { //Delete filter. for(i=(signalPath->getNumFilters()-1);i>=0;--i) { if(signalPath->getNode(i)->getProcessor()->getName() == "Midi Interceptor") deleteFilter(signalPath->getNode(i)); } } } else { InternalPluginFormat internalFormat; //Add the filter to the signal path. signalPath->addFilter(internalFormat.getDescriptionFor(InternalPluginFormat::midiInputFilter), 10.0f, 120.0f); //Add the associated PluginComponent. addFilter(signalPath->getNumFilters()-1); //Add the Midi Interceptor too. { MidiInterceptor p; PluginDescription desc; p.fillInPluginDescription(desc); signalPath->addFilter(&desc, 100, 100); //And connect it up to the midi input. { uint32 midiInput = 0; uint32 midiInterceptor = 0; for(i=0;i<signalPath->getNumFilters();++i) { if(signalPath->getNode(i)->getProcessor()->getName() == "Midi Input") midiInput = signalPath->getNode(i)->nodeId; else if(signalPath->getNode(i)->getProcessor()->getName() == "Midi Interceptor") { midiInterceptor = signalPath->getNode(i)->nodeId; dynamic_cast<MidiInterceptor *>(signalPath->getNode(i)->getProcessor())->setManager(&midiManager); } } signalPath->addConnection(midiInput, AudioProcessorGraph::midiChannelIndex, midiInterceptor, AudioProcessorGraph::midiChannelIndex); } } } }