Logo Search packages:      
Sourcecode: qt4-x11 version File versions

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

Sets the audio output object to be controlled by this slider.

Definition at line 134 of file volumeslider.cpp.

References QObject::connect(), QObject::disconnect(), Phonon::AudioOutput::isMuted(), and Phonon::AudioOutput::volume.

Referenced by MainWindow::setupUi().

{
    K_D(VolumeSlider);
    if (d->output) {
        disconnect(d->output, 0, this, 0);
    }
    d->output = output;
    if (output) {
        d->slider.setValue(qRound(100 * output->volume()));
        d->slider.setEnabled(true);
        d->muteButton.setEnabled(true);

        d->_k_volumeChanged(output->volume());
        d->_k_mutedChanged(output->isMuted());

        connect(output, SIGNAL(volumeChanged(qreal)), SLOT(_k_volumeChanged(qreal)));
        connect(output, SIGNAL(mutedChanged(bool)), SLOT(_k_mutedChanged(bool)));
    } else {
        d->slider.setValue(100);
        d->slider.setEnabled(false);
        d->muteButton.setEnabled(false);
    }
}


Generated by  Doxygen 1.6.0   Back to index