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(); }
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()); } }
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; }
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); } }
uint qHash(const Phonon::EffectParameter ¶m) { return param.id(); }