Example #1
0
 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();
 }
Example #2
0
        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());
            }
        }
Example #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;
 }
Example #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);
            }
        }
Example #5
0
uint qHash(const Phonon::EffectParameter &param)
{
    return param.id();
}