void AudioProcessor::setLatencySamples (const int newLatency)
{
    if (latencySamples != newLatency)
    {
        latencySamples = newLatency;
        updateHostDisplay();
    }
}
示例#2
0
void HoaToolsAudioProcessor::numChannelsChanged()
{
    AudioProcessorEditor* Editor = NULL;
    Editor = getActiveEditor();
    if(Editor)
        Editor->repaint();

    updateHostDisplay();
}
示例#3
0
void InstanceProcessor::parametersChanged()
{
    size_t index = 0;
    lock();
    for(size_t i = 0; i < m_parameters.size(); i++)
    {
        m_parameters[i] = pd::Parameter();
    }
    unlock();
    pd::Patch patch(getPatch());
    if(patch.isValid())
    {
        std::vector<pd::Gui> guis(patch.getGuis());
        for(auto const& gui : guis)
        {
            if(gui.isParameter())
            {
                bool ok = true;
                for(size_t i = 0; i < m_parameters.size() && m_parameters[i].isValid(); i++)
                {
                    if(gui.getName() == m_parameters[i].getName())
                    {
                        sendConsoleError("Warning in patch " + patch.getName() + ": "  + gui.getName() + " parameter is duplicated !");
                        ok = false;
                        break;
                    }
                    else if(gui.getReceiveTie() == m_parameters[i].getTie())
                    {
                        sendConsoleError("Warning in patch " + patch.getName() + ": "  + gui.getName() + " parameter shares the same receive symbol with another parameter !");
                        ok = false;
                        break;
                    }
                }
                if(ok)
                {
                    m_parameters[index] = pd::Parameter(gui);
                    index++;
                }
            }
        }
    }
    updateHostDisplay();
    for(size_t i = 0; i < m_parameters.size(); i++)
    {
        if(m_parameters[i].isValid())
        {
            setParameterNotifyingHost(i, m_parameters[i].getValueNormalized());
        }
    }
}