示例#1
0
文件: effect.cpp 项目: phen89/rtqt
 QVariant Effect::parameterValue(const Phonon::EffectParameter &p) const
 {
     QVariant ret;
     ComPointer<IMediaParams> params(m_filters[0], IID_IMediaParams);
     Q_ASSERT(params);
     MP_DATA data;
     HRESULT hr = params->GetParam(p.id(), &data);
     if(SUCCEEDED(hr))
         return data;
     else
         return QVariant();
 }
示例#2
0
文件: effect.cpp 项目: phen89/rtqt
        void Effect::setParameterValue(const Phonon::EffectParameter &p, const QVariant &v)
        {
            if (v.isNull()) {
                return;
            }

            for(int i=0; i < FILTER_COUNT ; ++i) {
                const Filter &filter = m_filters[i];
                ComPointer<IMediaParams> params(filter, IID_IMediaParams);
                Q_ASSERT(params);

                params->SetParam(p.id(), v.toFloat());
            }
        }
示例#3
0
 QVariant Effect::parameterValue(const Phonon::EffectParameter &p) const
 {
     QVariant ret;
     if (!m_filters.isEmpty()) {
         ComPointer<IMediaParams> params(m_filters.first(), IID_IMediaParams);
         Q_ASSERT(params);
         MP_DATA data;
         HRESULT hr = params->GetParam(p.id(), &data);
         Q_ASSERT(SUCCEEDED(hr));
         Q_UNUSED(hr);
         ret = data;
     }
     return ret;
 }
示例#4
0
        void Effect::setParameterValue(const Phonon::EffectParameter &p, const QVariant &v)
        {
            if (v.isNull()) {
                return;
            }

            for(QVector<Filter>::iterator it = m_filters.begin(); it != m_filters.end(); ++it) {
                Filter &filter = *it;
                ComPointer<IMediaParams> params(filter, IID_IMediaParams);
                Q_ASSERT(params);

                MP_DATA data = float(v.toDouble());
                params->SetParam(p.id(), data);
            }
        }
示例#5
0
uint qHash(const Phonon::EffectParameter &param)
{
    return param.id();
}