当前位置: 首页>>代码示例>>C++>>正文


C++ AudioParameter::part方法代码示例

本文整理汇总了C++中AudioParameter::part方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioParameter::part方法的具体用法?C++ AudioParameter::part怎么用?C++ AudioParameter::part使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AudioParameter的用法示例。


在下文中一共展示了AudioParameter::part方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadPluginStuff

bool WrappedJucePlugin::loadPluginStuff ()
{
   if (instance)
   {
      int numParams = instance->getNumParameters();
    setNumParameters (numParams);
    for (int i=0; i<numParams; i++)
    {
      AudioParameter* parameter = new AudioParameter ();
        parameter->part (i);
        parameter->name (instance->getParameterName(i));
        parameter->get (MakeDelegate (this, &WrappedJucePlugin::getParameterReal));
        parameter->set (MakeDelegate (this, &WrappedJucePlugin::setParameterReal));
        parameter->text (MakeDelegate (this, &WrappedJucePlugin::getParameterTextReal));
      registerParameter(i, parameter);
    }

   }
   
   return true;
}
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:21,代码来源:WrappedJucePlugin.cpp

示例2: loadPluginFromFile

//==============================================================================
bool LadspaPlugin::loadPluginFromFile (const File& filePath)
{
    ptrLibrary = PlatformUtilities::loadDynamicLibrary (filePath.getFullPathName());

    if (ptrLibrary != 0)
    {
        LADSPA_Descriptor_Function pfDescriptorFunction
                = (LADSPA_Descriptor_Function)
                        PlatformUtilities::getProcedureEntryPoint (ptrLibrary, T("ladspa_descriptor"));

        if (pfDescriptorFunction != 0)
        {
            for (uint32 iPluginIndex = 0;; iPluginIndex++)
            {
                ptrPlug = pfDescriptorFunction (iPluginIndex);
                if (ptrPlug != NULL)
                    break;
            }

            if (ptrPlug == 0)
            {
                printf ("Cannot find any valid descriptor in shared library \n");
                return false;
            }
        }
        else
        {
            // plugin raised an exception
            printf ("Cannot find any valid plugin in shared library \n");
            return false;
        }
    }
    else
    {
        printf ("You are trying to load a shared library ? \n");
        return false;
    }

    jassert (ptrPlug);

    pluginFile = filePath;
    plugin = ptrPlug->instantiate (ptrPlug, (unsigned int) samplingRate);

    ins.clear ();
    outs.clear ();
    pars.clear ();

    for (unsigned int i = 0; i < ptrPlug->PortCount; i++)
    {
        if (ptrPlug->PortDescriptors [i] & LADSPA_PORT_CONTROL)      pars.add (i);
        if (ptrPlug->PortDescriptors [i] & LADSPA_PORT_AUDIO)
        {
            if (ptrPlug->PortDescriptors [i] & LADSPA_PORT_INPUT)    ins.add (i);
            if (ptrPlug->PortDescriptors [i] & LADSPA_PORT_OUTPUT)   outs.add (i);
        }
    }

    int numParams = pars.size ();
    params = new float [numParams];
    normalized = new float [numParams];
    memset (params, 0, numParams * sizeof (float));
    memset (normalized, 0, numParams * sizeof (float));

    for (int i = 0; i < numParams; i++)
        ptrPlug->connect_port (plugin, pars [i], &normalized[i]);

    // create params
    setNumParameters (numParams);

    for (int i = 0; i < numParams; i++)
    {
        AudioParameter* parameter = new AudioParameter ();
        
        parameter->part (i);
        parameter->name (ptrPlug->PortNames [pars [i]]);
        parameter->get (MakeDelegate (this, &LadspaPlugin::getParameterReal));
        parameter->set (MakeDelegate (this, &LadspaPlugin::setParameterReal));
        parameter->text (MakeDelegate (this, &LadspaPlugin::getParameterTextReal));
        
        registerParameter (i, parameter);
    }

//    setCurrentProgram (0);

    return true;
}
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:87,代码来源:LadspaPlugin.cpp

示例3: loadPluginFromFile


//.........这里部分代码省略.........
        }
        else
        {
            // plugin raised an exception
            printf ("Cannot find any valid plugin in shared library \n");
            return false;
        }
    }
    else
    {
        printf ("You are trying to load a shared library ? \n");
        return false;
    }

    jassert (ptrPlug);

    pluginFile = filePath;
    ladspa = ptrPlug->LADSPA_Plugin;
    // version = ptrPlug->DSSI_API_Version;

    plugin = ladspa->instantiate (ladspa, (unsigned int) samplingRate);

/*
    if (ptrPlug->configure)
        ptrPlug->configure (DSSI_PROJECT_DIRECTORY_KEY, (const char*) filePath.getParentDirectory()
                                                                              .getFullPathName ());
*/

    // count ports
    ins.clear ();
    outs.clear ();
    pars.clear ();
    
    for (uint i = 0; i < ladspa->PortCount; i++)
    {
        LADSPA_PortDescriptor pod = ladspa->PortDescriptors[i];
    
        if (pod & LADSPA_PORT_AUDIO)
        {
            if (pod & LADSPA_PORT_INPUT)         ins.add (i);
            else if (pod & LADSPA_PORT_OUTPUT)   outs.add (i);
        }
        else if (pod & LADSPA_PORT_CONTROL)
        {
            pars.add (i);
        }
    }
    
    // create ports
    int numParams = pars.size ();
    params = new float [numParams];
    normalized = new float [numParams];
    memset (params, 0, numParams * sizeof (float));
    memset (normalized, 0, numParams * sizeof (float));

    // connect ports
    if (ladspa->connect_port)
    {
        for (int i = 0; i < pars.size (); i++)
            ladspa->connect_port (plugin, pars [i], &normalized[i]);
        for (int i = 0; i < ins.size (); i++)
            ladspa->connect_port (plugin, ins [i], emptyBuffer.getSampleData (0));
        for (int i = 0; i < outs.size (); i++)
            ladspa->connect_port (plugin, outs [i], emptyBuffer.getSampleData (0));
    }

    // count programs
    if (ptrPlug->get_program)
        for (numPrograms = 0; ptrPlug->get_program (plugin, numPrograms); ++numPrograms);

    // set default to 0
//    setCurrentProgram (0);
    setDefaultProgram ();

    // start osc listener to itself
    osc.setPort (18910);
    osc.setRootAddress ("dssi");
    osc.addListener (this);
    osc.startListening ();

    DBG ("DssiPlugin::loadPluginFromFile");

    // create params
    setNumParameters (numParams);

    for (int i = 0; i < numParams; i++)
    {
        AudioParameter* parameter = new AudioParameter ();
        
        parameter->part (i);
        parameter->name (ladspa->PortNames [pars [i]]);
        parameter->get (MakeDelegate (this, &DssiPlugin::getParameterReal));
        parameter->set (MakeDelegate (this, &DssiPlugin::setParameterReal));
        parameter->text (MakeDelegate (this, &DssiPlugin::getParameterTextReal));
        
        registerParameter (i, parameter);
    }

    return true;
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:101,代码来源:DssiPlugin.cpp


注:本文中的AudioParameter::part方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。