VolumeSlider Class

( Phonon::VolumeSlider )

The VolumeSlider widget provides a slider that is used to control the volume of an audio output device. 更多...

头: #include <Phonon/VolumeSlider>
Since: Qt 4.4
继承: QWidget

特性

公共函数

VolumeSlider (QWidget * parent = 0)
VolumeSlider (AudioOutput * output , QWidget * parent = 0)
~VolumeSlider ()
AudioOutput * audioOutput () const
bool hasTracking () const
QSize iconSize () const
bool isMuteVisible () const
qreal maximumVolume () const
Qt::Orientation orientation () const
int pageStep () const
void setPageStep (int 毫秒 )
void setSingleStep (int 毫秒 )
void setTracking (bool tracking )
int singleStep () const

公共槽

void setAudioOutput (Phonon::AudioOutput * output )
void setIconSize (const QSize & size )
void setMaximumVolume (qreal)
void setMuteVisible (bool)
void setOrientation (Qt::Orientation)

额外继承成员

详细描述

The VolumeSlider widget provides a slider that is used to control the volume of an audio output device.

The slider also displays an icon indicating if the volume of the AudioOutput it is connected to is muted. The icon can be removed with setMuteVisible ().

It is possible to set the maximum value of the slider. By default, the minimum and maximum values of the slider are 0.0 (no sound) to 1.0 (the maximum volume the audio output can produce).

Here follows a code example:

    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory);
    Phonon::createPath(mediaObject, audioOutput);
    Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider;
    volumeSlider->setAudioOutput(audioOutput);
					

另请参阅 Phonon 模块 .

特性文档编制

iconSize : QSize

This property holds the icon size used for the mute button/icon.

The default size is defined by the GUI style.

访问函数:

QSize iconSize () const
void setIconSize (const QSize & size )

maximumVolume : qreal

This property holds the maximum volume that can be set with this slider.

By default the maximum value is 1.0 (100%).

访问函数:

qreal maximumVolume () const
void setMaximumVolume (qreal)

muteVisible : bool

This property holds whether the mute button/icon next to the slider is visible.

By default the mute button/icon is visible.

访问函数:

bool isMuteVisible () const
void setMuteVisible (bool)

orientation : Qt::Orientation

This property holds the orientation of the slider.

取向必须是 Qt::Vertical (默认) 或 Qt::Horizontal .

访问函数:

Qt::Orientation orientation () const
void setOrientation (Qt::Orientation)

pageStep : int

此特性保持页面步幅。

The larger of two natural steps that a slider provides and typically corresponds to the user pressing PageUp or PageDown.

Defaults to 5 (5% of the voltage).

访问函数:

int pageStep () const
void setPageStep (int 毫秒 )

singleStep : int

此特性保持单步幅。

The smaller of two natural steps that a slider provides and typically corresponds to the user pressing an arrow key.

Defaults to 1 (1% of the voltage).

访问函数:

int singleStep () const
void setSingleStep (int 毫秒 )

tracking : bool

This property holds whether slider tracking is enabled.

If tracking is enabled (the default), the volume changes while the slider is being dragged. If tracking is disabled, the volume changes only when the user releases the slider.

访问函数:

bool hasTracking () const
void setTracking (bool tracking )

成员函数文档编制

VolumeSlider:: VolumeSlider ( QWidget * parent = 0)

Constructs a new volume slider with the given parent .

VolumeSlider:: VolumeSlider ( AudioOutput * output , QWidget * parent = 0)

Constructs a new volume slider with the given output object and parent .

VolumeSlider:: ~VolumeSlider ()

AudioOutput * VolumeSlider:: audioOutput () const

另请参阅 setAudioOutput ().

[slot] void VolumeSlider:: setAudioOutput ( Phonon::AudioOutput * output )

Sets the audio output object to be controlled by this slider to the specified output 对象。

另请参阅 audioOutput ().