• PySide 模块
  • PySide.phonon
  • 内容表

    上一话题

    Phonon.MediaSource

    下一话题

    Phonon.EffectInterface

    Phonon.EffectParameter

    详细描述

    EffectParameter class describes one parameter of an effect.

    You fetch the parameters of an Phonon.Effect 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 a PySide.phonon.Phonon::EffectParameter.name() and possibly PySide.phonon.Phonon::EffectParameter.description() (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 a PySide.QtCore.QVariant , of which PySide.phonon.Phonon::EffectParameter.type() is usually int or double .

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

    You get the values a parameter can take with PySide.phonon.Phonon::EffectParameter.possibleValues() ; an empty list is returned if the values are continuous.

    A parameter may also specify default , minimum(), and maximum() values. Values are returned as PySide.QtCore.QVariant s. If the parameter does not have the requested value, an QVariant.Invalid invalid PySide.QtCore.QVariant is returned from these functions.

    Phonon.EffectWidget provides a widget with which one can control the parameters of an Phonon.Effect .

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

    另请参阅

    Effect EffectWidget Capabilities Example Phonon Module

    class PySide.phonon.Phonon. EffectParameter ( rhs )
    class PySide.phonon.Phonon. EffectParameter ( parameterId , name , hints , defaultValue [ , min=None [ , max=None [ , values=QVariantList() [ , description="" ] ] ] ] )
    参数:
    • defaultValue – object
    • values
    • rhs PySide.phonon.Phonon::EffectParameter
    • hints PySide.phonon.Phonon::EffectParameter.Hints
    • description – unicode
    • parameterId PySide.QtCore.int
    • min – object
    • name – unicode
    • max – object

    构造副本为 other effect parameter.

    PySide.phonon.Phonon.EffectParameter. Hint

    Only for backend developers:

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

    常量 描述
    Phonon.EffectParameter.ToggledHint If this hint is set it means that the control has only two states: zero and non-zero (see isToggleControl()).
    Phonon.EffectParameter.LogarithmicHint LADSPA'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 (see PySide.phonon.Phonon::EffectParameter.isLogarithmicControl() ).
    Phonon.EffectParameter.IntegerHint See isIntegerControl().
    PySide.phonon.Phonon.EffectParameter. defaultValue ( )
    返回类型: object

    The default value.

    PySide.phonon.Phonon.EffectParameter. description ( )
    返回类型: unicode

    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.

    PySide.phonon.Phonon.EffectParameter. isLogarithmicControl ( )
    返回类型: PySide.QtCore.bool

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

    PySide.phonon.Phonon.EffectParameter. maximumValue ( )
    返回类型: object

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

    If the returned PySide.QtCore.QVariant is invalid the value is not bounded from above.

    PySide.phonon.Phonon.EffectParameter. minimumValue ( )
    返回类型: object

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

    If the returned PySide.QtCore.QVariant is invalid the value is not bounded from below.

    PySide.phonon.Phonon.EffectParameter. name ( )
    返回类型: unicode

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

    Returns A label for the parameter.

    PySide.phonon.Phonon.EffectParameter. possibleValues ( )
    返回类型:

    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 empty QVariantList ).

    PySide.phonon.Phonon.EffectParameter. type ( )
    返回类型: PySide.QtCore.QVariant::Type

    Returns the parameter type.

    Common types are QVariant.Int , QVariant.Double , QVariant.Bool and QVariant.String 。当 QVariant.String is returned you get the possible values from possibleValues.