Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

EffectParameter Class

(Phonon::EffectParameter)

TheEffectParameter class describes one parameter of an effect.More...

Header:#include <Phonon/EffectParameter>
Since: Qt 4.4

Public Types

enumHint { ToggledHint, LogarithmicHint, IntegerHint }
flagsHints

Public Functions

EffectParameter(const EffectParameter & other)
EffectParameter(int parameterId, const QString & name, Hints hints, const QVariant & defaultValue, const QVariant & min = QVariant(), const QVariant & max = QVariant(), const QVariantList & values = QVariantList(), const QString & description = QString())
~EffectParameter()
QVariantdefaultValue() const
const QString &description() const
boolisLogarithmicControl() const
QVariantmaximumValue() const
QVariantminimumValue() const
const QString &name() const
QVariantListpossibleValues() const
QVariant::Typetype() const
EffectParameter &operator=(const EffectParameter & other)

Detailed Description

TheEffectParameter class describes one parameter of an effect.

You fetch the parameters of anEffect with Effect::parameters().

QList<Phonon::EffectParameter> parameters= effect->parameters();    foreach(Phonon::EffectParameter parameter, parameters) {// Do something with parameter    }

To describe itself, an effect parameter gives aname() and possiblydescription() (depending on the backend used). These are suited to present the effect parameter to the user of a Phonon application.

Note that effects are created by the backend, and that their name and descriptions may vary.

The value of an effect parameter is stored in aQVariant, of whichtype() is usuallyint ordouble.

The value is retrieved with Effect::parameterValue() and set with setParameterValue() - both of which takes theEffectParameter as argument. Note that not all effect parameters support setting of their value.

You get the values a parameter can take withpossibleValues(); an empty list is returned if the values are continuous.

A parameter may also specify default(), minimum(), and maximum() values. Values are returned asQVariants. If the parameter does not have the requested value, anQVariant::Invalid invalidQVariant is returned from these functions.

TheEffectWidget provides a widget with which one can control the parameters of anEffect.

    Phonon::EffectWidget*effectWidget=new Phonon::EffectWidget(effect);

See alsoEffect,EffectWidget,Capabilities Example, andPhonon Module.

Member Type Documentation

enum EffectParameter::Hint
flags EffectParameter::Hints

Only for backend developers:

Flags to set the return values of isToggleControl(),isLogarithmicControl(), isIntegerControl(), isBoundedBelow() and isBoundedAbove(). The values of the flags correspond to the values used for LADSPA effects.

ConstantValueDescription
Phonon::EffectParameter::ToggledHint0x04If this hint is set it means that the control has only two states: zero and non-zero (see isToggleControl()).
Phonon::EffectParameter::LogarithmicHint0x10LADSPA's SAMPLE_RATE hint needs to be translated by the backend to normal bounds, as the backend knows the sample rate - and the frontend doesn't (seeisLogarithmicControl()).
Phonon::EffectParameter::IntegerHint0x20See isIntegerControl().

The Hints type is a typedef forQFlags<Hint>. It stores an OR combination of Hint values.

Member Function Documentation

EffectParameter::EffectParameter(constEffectParameter & other)

Constructs a copy of theother effect parameter.

EffectParameter::EffectParameter(int parameterId, constQString & name,Hints hints, constQVariant & defaultValue, constQVariant & min = QVariant(), constQVariant & max = QVariant(), constQVariantList & values = QVariantList(), constQString & description = QString())

Only to be used by backend implementations:

Creates a new effect parameter.

parameterId This is a number to uniquely identify the parameter. The id is used for value() and setValue().

name is the name/label for this parameter.

hints sets the hints for the type of parameter.

defaultValue The value that should be used as a default.

min is the minimum value allowed for this parameter. You only need to set this if the BoundedBelowHint is set.

max is the maximum value allowed for this parameter. You only need to set this if the BoundedAboveHint is set.

Thevalues parameter is the values that the effect parameter can take (only applies if non-continuous)

description is a descriptive text for the parameter (explaining what it controls) to be used as a tooltip or WhatsThis help.

EffectParameter::~EffectParameter()

Destroys the effect parameter.

QVariant EffectParameter::defaultValue() const

The default value.

constQString & EffectParameter::description() const

The parameter may come with a description (LADSPA doesn't have a field for this, so don't expect many effects to provide a description).

The description can be used for a tooltip or WhatsThis help.

Returns A text describing the parameter.

bool EffectParameter::isLogarithmicControl() const

Returns whether the parameter should be displayed using a logarithmic scale. This is particularly useful for frequencies and gains.

QVariant EffectParameter::maximumValue() const

The maximum value to be used for the control to edit the parameter.

If the returnedQVariant is invalid the value is not bounded from above.

QVariant EffectParameter::minimumValue() const

The minimum value to be used for the control to edit the parameter.

If the returnedQVariant is invalid the value is not bounded from below.

constQString & EffectParameter::name() const

The name of the parameter. Can be used as the label.

Returns A label for the parameter.

QVariantList EffectParameter::possibleValues() const

The possible values to be used for the control to edit the parameter.

if the value of this parameter is to be picked from predefined values this returns the list (otherwise it returns an emptyQVariantList).

QVariant::Type EffectParameter::type() const

Returns the parameter type.

Common types areQVariant::Int,QVariant::Double,QVariant::Bool andQVariant::String. WhenQVariant::String is returned you get the possible values frompossibleValues.

EffectParameter & EffectParameter::operator=(constEffectParameter & other)

Assigns theother effect parameter to this parameter and returns a reference to this parameter.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp