Ejemplo n.º 1
0
void KNMusicStandardBackend::previewPlay()
{
    //If the origial volume is not -1, means smart volume has been turned on.
    if(m_originalVolume==-1)
    {
        //Turn on the smart volume.
        smartVolumeOn();
    }
    //Play the preview thread.
    threadPlay(m_preview);
}
Ejemplo n.º 2
0
void KNMusicStandardBackend::playPreviewSection(const QString &fileName,
                                                const qint64 &start,
                                                const qint64 &duration)
{
    //Load the music file first.
    loadPreview(fileName);
    //Turn on the smart volume.
    smartVolumeOn();
    //Play the section
    m_preview->playSection(start, duration);
}
Ejemplo n.º 3
0
inline void KNMusicStandardBackend::synchronizeThreadVolume(const int &volume)
{
    //Check whether the preview smart volume is enabled.
    bool smartVolumeEnabled=(m_originalVolume!=-1);
    //If the smart volume is enabled, disabled it temporarily.
    if(smartVolumeEnabled)
    {
        //Turn off the smart volume.
        smartVolumeOff();
    }
    //Change the global volume size.
    setGlobalVolume(volume);
    //If the smart volume is enabled before, enabled it again.
    if(smartVolumeEnabled)
    {
        //Turn on the smart volume.
        smartVolumeOn();
    }
}
Ejemplo n.º 4
0
void KNMusicStandardBackend::playPreview()
{
    smartVolumeOn();
    //Play the preview.
    m_preview->play();
}