本文整理汇总了C++中BasePlugin类的典型用法代码示例。如果您正苦于以下问题:C++ BasePlugin类的具体用法?C++ BasePlugin怎么用?C++ BasePlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BasePlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: size
void Pipeline::remove(int index)
{
int s = size();
if(index >= s)
return;
if(debugMsg)
qDebug(" Pipeline::remove(%d)", index);
BasePlugin* plugin = (*this)[index];
if (plugin && !(plugin->hints() & PLUGIN_IS_SYNTH))
{//Synth type plugins are deleted elsewhere in SynthPluginDevice::close(), DO NOT delete here
plugin->aboutToRemove();
// Delete the appropriate class
switch(plugin->type())
{
case PLUGIN_LADSPA:
delete (LadspaPlugin*)plugin;
break;
case PLUGIN_LV2:
delete (Lv2Plugin*)plugin;
break;
case PLUGIN_VST:
delete (VstPlugin*)plugin;
break;
default:
break;
}
}
erase(begin()+index);
//(*this)[index] = 0;
}
示例2: if
void GraphComponent::mouseUp (const MouseEvent& e)
{
if (e.mods.isLeftButtonDown())
{
lassoComponent->endLasso ();
}
else if (e.mods.isMiddleButtonDown ())
{
}
else if (e.mods.isRightButtonDown ())
{
// try to open internal plugins
BasePlugin* newPlugin = PluginLoader::handlePopupMenu (false, 0, owner->getFilter());
// now open plugin
if (host && newPlugin)
{
host->openPlugin (newPlugin);
host->addPlugin (newPlugin);
newPlugin->setValue (PROP_GRAPHXPOS, e.x);
newPlugin->setValue (PROP_GRAPHYPOS, e.y);
createPluginNode (newPlugin);
}
}
lassoComponent->endLasso ();
setMouseCursor (MouseCursor::NormalCursor);
}
示例3: DBG
bool GraphComponent::loadAndAppendPlugin (const File& file,
int mouseX,
int mouseY)
{
DBG ("GraphComponent::loadAndAppendPlugin");
jassert (host != 0);
BasePlugin* plugin = host->loadPlugin (file);
if (plugin)
{
Config::getInstance ()->addRecentPlugin (file);
plugin->setValue(PROP_GRAPHXPOS, mouseX);
plugin->setValue(PROP_GRAPHYPOS, mouseY);
host->addPlugin (plugin);
createPluginNode (plugin);
return true;
}
return false;
}
示例4: qDebug
void AudioTrack::addPlugin(BasePlugin* plugin, int idx)/*{{{*/
{
if(debugMsg)
qDebug("AudioTrack::addPlugin(%p, %d) \n", plugin, idx);
if (!plugin)
{
BasePlugin* oldPlugin = (*_efxPipe)[idx];
if (oldPlugin)
{
oldPlugin->setId(-1);
oldPlugin->setTrack(0);
uint32_t paramCount = oldPlugin->getParameterCount();
for (uint32_t i = 0; i < paramCount; i++)
{
ParameterPort* paramPort = oldPlugin->getParameterPort(i);
if (! paramPort || paramPort->type != PARAMETER_INPUT || (paramPort->hints & PARAMETER_IS_AUTOMABLE) == 0)
continue;
int id = genACnum(idx, i);
removeController(id);
}
_efxPipe->remove(idx);
}
}
if (plugin)
{
idx = efxPipe()->addPlugin(plugin, idx);
plugin->setId(idx);
plugin->setTrack(this);
uint32_t paramCount = plugin->getParameterCount();
for (uint32_t i = 0; i < paramCount; i++)
{
ParameterPort* paramPort = plugin->getParameterPort(i);
if (! paramPort || paramPort->type != PARAMETER_INPUT || (paramPort->hints & PARAMETER_IS_AUTOMABLE) == 0)
continue;
int id = genACnum(idx, i);
CtrlValueType t = plugin->valueType();
CtrlList* cl = new CtrlList(id);
cl->setRange(paramPort->ranges.min, paramPort->ranges.max);
cl->setName(plugin->getParameterName(i));
cl->setPluginName(plugin->name());
cl->setUnit(plugin->getParameterUnit(i));
cl->setValueType(t);
if (paramPort->hints & PARAMETER_IS_TOGGLED)
cl->setMode(CtrlList::DISCRETE);
else
cl->setMode(CtrlList::INTERPOLATE);
cl->setCurVal(plugin->getParameterValue(i));
addController(cl);
}
}
}/*}}}*/
示例5: fillPluginComboBox
//==============================================================================
void SurfaceComponent::fillPluginComboBox (ComboBox* combo)
{
combo->clear ();
for (int i = 0; i < host->getPluginsCount (); i++)
{
BasePlugin* plugin = host->getPluginByIndex (i);
combo->addItem (plugin->getName (), plugin->getUniqueHash ());
}
}
示例6: QString
QString Pipeline::name(int idx) const
{
int s = (*this).size();
if(idx >= s)
return QString("empty");
BasePlugin* p = (*this)[idx];
if (p)
return p->name();
return QString("empty");
}
示例7: sliderValueChanged
//==============================================================================
void SurfaceComponent::sliderValueChanged (Slider* sliderThatWasMoved)
{
SurfaceSlider* slider = dynamic_cast<SurfaceSlider*> (sliderThatWasMoved);
if (slider)
{
BasePlugin* plugin = host->getPluginByUniqueHash (slider->getPlugin ());
if (plugin)
{
plugin->setParameter (slider->getParameter (0), slider->getValue ());
}
}
}
示例8: closePluginEditorWindows
//==============================================================================
void HostFilterComponent::changeListenerCallback (void* source)
{
if (source == this)
{
closePluginEditorWindows ();
}
else if (source == getFilter())
{
clearComponents ();
rebuildComponents ();
// reopen windows saved with session
Host* host = getFilter()->host;
for (int j = 0; j < host->getPluginsCount(); j++)
{
BasePlugin* plugin = host->getPluginByIndex (j);
if (plugin && plugin->getIntValue (PROP_WINDOWOPEN, 0))
openPluginEditorWindow (plugin);
}
resized ();
}
else if (source == getFilter()->getTransport())
{
// update transport !
CommandManager::getInstance()->commandStatusChanged ();
}
else if (source == &knownPluginList)
{
// save the plugin list every time it gets changed, so that if we're scanning
// and it crashes, we've still saved the previous ones
XmlElement* const savedPluginList = knownPluginList.createXml();
if (savedPluginList != 0)
{
ApplicationProperties::getInstance()->getUserSettings()
->setValue (T("pluginList"), savedPluginList);
delete savedPluginList;
ApplicationProperties::getInstance()->saveIfNeeded();
}
}
else
{
for (int i = pluginWindows.size(); --i >= 0;)
{
VstPluginWindow* window = pluginWindows.getUnchecked (i);
if (window)
window->updateParameters ();
}
}
}
示例9: fillParametersComboBox
void SurfaceComponent::fillParametersComboBox (ComboBox* combo, const uint32 pluginHash)
{
combo->clear ();
BasePlugin* plugin = host->getPluginByUniqueHash (pluginHash);
if (plugin)
{
for (int i = 0; i < plugin->getNumParameters (); i++)
{
combo->addItem (plugin->getParameterName (i), i + 1);
}
}
}
示例10: updateGuis
void Pipeline::updateGuis()
{
for (iPluginI i = begin(); i != end(); ++i)
{
BasePlugin* p = (BasePlugin*)*i;
if(p)
{
p->updateNativeGui();
//if (p->gui())
// p->gui()->updateValues();
}
}
}
示例11: joystickValueChanged
void SurfaceComponent::joystickValueChanged (Joystick* joystickThatWasMoved)
{
SurfaceJoystick* joystick = dynamic_cast<SurfaceJoystick*> (joystickThatWasMoved);
if (joystick)
{
BasePlugin* plugin = host->getPluginByUniqueHash (joystick->getPlugin ());
if (plugin)
{
plugin->setParameter (joystick->getParameter (0), joystick->getHorizontalValue ());
plugin->setParameter (joystick->getParameter (1), joystick->getVerticalValue ());
}
}
}
示例12: choosePlugin
void EffectRack::choosePlugin(QListWidgetItem* it, bool replace)/*{{{*/
{
PluginI* plugi = PluginDialog::getPlugin(track->type(), this);
if (plugi)
{
BasePlugin* nplug = 0;
if (plugi->type() == PLUGIN_LADSPA)
nplug = new LadspaPlugin();
else if (plugi->type() == PLUGIN_LV2)
nplug = new Lv2Plugin();
else if (plugi->type() == PLUGIN_VST)
nplug = new VstPlugin();
if (nplug)
{
if (nplug->init(plugi->filename(), plugi->label()))
{
// just in case is needed later
//if (!audioDevice || audioDevice->deviceType() != AudioDevice::JACK_AUDIO)
// nplug->aboutToRemove();
int idx = row(it);
if (replace)
{
audio->msgAddPlugin(track, idx, 0);
//Do this part from the GUI context so user interfaces can be properly deleted
// track->efxPipe()->insert(0, idx); was set on lv2 only
}
audio->msgAddPlugin(track, idx, nplug);
nplug->setChannels(track->channels());
nplug->setActive(true);
song->dirty = true;
}
else
{
QMessageBox::warning(this, tr("Failed to load plugin"), tr("Plugin '%1'' failed to initialize properly, error was:\n%2").arg(plugi->name()).arg(get_last_error()));
nplug->deleteMe();
return;
}
}
updateContents();
}
}/*}}}*/
示例13: jassert
void GraphComponent::nodeMoved (GraphNodeComponent* node, const int deltaX, const int deltaY)
{
// DBG ("GraphComponent::nodeMoved " + String (deltaX) + " " + String (deltaY));
jassert (node != 0);
for (int i = 0; i < selectedNodes.getNumSelected (); i++)
{
GraphNodeComponent* selected = selectedNodes.getSelectedItem (i);
if (selected
&& selected != node
&& ! selected->isLocked ())
{
BasePlugin* plugin = (BasePlugin*) selected->getUserData ();
if (plugin)
{
int x = selected->getX() + deltaX;
int y = selected->getY() + deltaY;
x = jmax (0, jmin (getWidth () - selected->getWidth(), x));
y = jmax (0, jmin (getHeight () - selected->getHeight(), y));
plugin->setValue (PROP_GRAPHXPOS, x);
plugin->setValue (PROP_GRAPHYPOS, y);
selected->setTopLeftPosition (x, y);
}
}
}
BasePlugin* plugin = (BasePlugin*) node->getUserData ();
if (plugin)
{
plugin->setValue (PROP_GRAPHXPOS, node->getX());
plugin->setValue (PROP_GRAPHYPOS, node->getY());
}
Viewport* parent = findParentComponentOfClass ((Viewport*) 0);
if (parent)
{
parent->notifyComponentChanged ();
}
}
示例14: changeListenerCallback
//==============================================================================
void GraphComponent::changeListenerCallback (void* source)
{
ColourSelector* cs = (ColourSelector*) source;
if (currentClickedNode)
{
Colour currentColour = cs->getCurrentColour();
BasePlugin* plugin = (BasePlugin*) currentClickedNode->getUserData ();
if (plugin)
plugin->setValue (PROP_GRAPHCOLOUR, currentColour.toString ());
currentClickedNode->setNodeColour (currentColour);
currentClickedNode->repaint ();
Viewport* parent = findParentComponentOfClass ((Viewport*) 0);
if (parent)
{
parent->notifyComponentChanged ();
}
}
}
示例15: apply
void Pipeline::apply(int ports, uint32_t nframes, float** buffer1)
{
//fprintf(stderr, "Pipeline::apply data: nframes:%ld %e %e %e %e\n", nframes, buffer1[0][0], buffer1[0][1], buffer1[0][2], buffer1[0][3]);
bool swap = false;
for (iPluginI ip = begin(); ip != end(); ++ip)
{
BasePlugin* p = *ip;
if (p && p->enabled())
{
p->setChannels(ports);
if (p->hints() & PLUGIN_HAS_IN_PLACE_BROKEN)
{
if (swap)
p->process(nframes, buffer, buffer1, 0);
else
p->process(nframes, buffer1, buffer, 0);
swap = !swap;
}
else
{
if (swap)
p->process(nframes, buffer, buffer, 0);
else
p->process(nframes, buffer1, buffer1, 0);
}
}
}
if (swap)
{
for (int i = 0; i < ports; ++i)
AL::dsp->cpy(buffer1[i], buffer[i], nframes);
}
// p3.3.41
//fprintf(stderr, "Pipeline::apply after data: nframes:%ld %e %e %e %e\n", nframes, buffer1[0][0], buffer1[0][1], buffer1[0][2], buffer1[0][3]);
}