Logo Search packages:      
Sourcecode: vamp-plugin-sdk version File versions  Download package

PluginHostAdapter::OutputList Vamp::PluginHostAdapter::getOutputDescriptors (  )  const [virtual]

Get the outputs of this plugin. An output's index in this list is used as its numeric index when looking it up in the FeatureSet returned from the process() call.

Implements Vamp::Plugin.

Definition at line 302 of file PluginHostAdapter.cpp.

{
    OutputList list;
    if (!m_handle) {
//        std::cerr << "PluginHostAdapter::getOutputDescriptors: no handle " << std::endl;
        return list;
    }

    unsigned int count = m_descriptor->getOutputCount(m_handle);

    for (unsigned int i = 0; i < count; ++i) {
        VampOutputDescriptor *sd = m_descriptor->getOutputDescriptor(m_handle, i);
        OutputDescriptor d;
        d.identifier = sd->identifier;
        d.name = sd->name;
        d.description = sd->description;
        d.unit = sd->unit;
        d.hasFixedBinCount = sd->hasFixedBinCount;
        d.binCount = sd->binCount;
        if (d.hasFixedBinCount) {
            for (unsigned int j = 0; j < sd->binCount; ++j) {
                d.binNames.push_back(sd->binNames[j] ? sd->binNames[j] : "");
            }
        }
        d.hasKnownExtents = sd->hasKnownExtents;
        d.minValue = sd->minValue;
        d.maxValue = sd->maxValue;
        d.isQuantized = sd->isQuantized;
        d.quantizeStep = sd->quantizeStep;

        switch (sd->sampleType) {
        case vampOneSamplePerStep:
            d.sampleType = OutputDescriptor::OneSamplePerStep; break;
        case vampFixedSampleRate:
            d.sampleType = OutputDescriptor::FixedSampleRate; break;
        case vampVariableSampleRate:
            d.sampleType = OutputDescriptor::VariableSampleRate; break;
        }

        d.sampleRate = sd->sampleRate;

        list.push_back(d);

        m_descriptor->releaseOutputDescriptor(sd);
    }

    return list;
}


Generated by  Doxygen 1.6.0   Back to index