kopia lustrzana https://gitlab.com/eliggett/wfview
Added code to copy the UI control data into the plugin.
rodzic
42dc2439e0
commit
5447af6225
|
@ -351,6 +351,7 @@ void audioPlugin::runPlugin(int samples)
|
|||
|
||||
|
||||
convertInputBuffer();
|
||||
copyControlsToPluginInterface();
|
||||
lilv_instance_run(instance, inputBufferSampleCount);
|
||||
convertOutputBuffer();
|
||||
|
||||
|
@ -380,7 +381,33 @@ void audioPlugin::handleAdjustedPluginControls(controlsType control)
|
|||
// Access the local vector of controls, called "controls".
|
||||
// Alter the control->controlsIndex member to have equal value.
|
||||
|
||||
(void)control;
|
||||
if(control.controlsIndex <= (unsigned int)controls.size())
|
||||
{
|
||||
controls[control.controlsIndex].value = control.value;
|
||||
} else {
|
||||
emit pluginErrorMessage(QString("Error in plugin [%1]: Asked to adjust control at index %2 when the max index is %3.")\
|
||||
.arg(pluginNameAsQString)\
|
||||
.arg(control.controlsIndex)\
|
||||
.arg(controls.size()));
|
||||
}
|
||||
}
|
||||
|
||||
void audioPlugin::copyControlsToPluginInterface()
|
||||
{
|
||||
// Haven't figured out exactly how to do this one yet. Something like this:
|
||||
// Loop across all ports, modify if matching index.
|
||||
|
||||
// Should I have used the n_params variable here instead of portIndex?
|
||||
|
||||
// I have assumed that "value" is the control value.
|
||||
|
||||
controlsType c;
|
||||
|
||||
for(int i=0; i < controls.size(); i++)
|
||||
{
|
||||
c = controls.at(i);
|
||||
this->ports[ c.portIndex ].value = c.value;
|
||||
}
|
||||
}
|
||||
|
||||
void audioPlugin::convertInputBuffer()
|
||||
|
|
|
@ -94,10 +94,12 @@ public slots:
|
|||
void getPluginControlPorts();
|
||||
void handleAdjustedPluginControls(controlsType control);
|
||||
|
||||
// These functions are not complete yet:
|
||||
void selectPluginByName(QString pluginName);
|
||||
void selectPluginByLabel(QString pluginLabel);
|
||||
void selectPluginByID(int pluginId);
|
||||
void debugThis();
|
||||
|
||||
void debugThis(); // nice debug info here
|
||||
|
||||
private:
|
||||
pluginType kind;
|
||||
|
@ -146,7 +148,7 @@ private:
|
|||
|
||||
void createControls();
|
||||
void deleteControls();
|
||||
void copyControls();
|
||||
void copyControlsToPluginInterface();
|
||||
|
||||
bool activatePlugin();
|
||||
// Plugin world items:
|
||||
|
|
Ładowanie…
Reference in New Issue