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); }
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); }
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(); } }
void KNMusicStandardBackend::playPreview() { smartVolumeOn(); //Play the preview. m_preview->play(); }