Example #1
0
void KNMusicNowPlaying::onActionBackendFinished()
{
    //Add play times on current row.
    if(playingMusicModel() && m_playingIndex.isValid())
    {
        //Add play times on the playing index.
        playingMusicModel()->addPlayingTimes(m_playingIndex);
    }
    //Set the manual playing flag to become false.
    m_manualPlayed=false;
    //If current mode is repeat the current track, then just play it again.
    if(RepeatTrack==m_loopState)
    {
        //Check the backend first.
        if(m_backend!=nullptr &&
                m_playingAnalysisItem.detailInfo.duration>0)
        {
            //Check it's URL.
            if(m_playingAnalysisItem.detailInfo.url.isEmpty())
            {
                //Replay the backend.
                m_backend->play();
            }
            else
            {
                //Simply reset the model.
                reset();
            }
        }
        //Action finished.
        return;
    }
    //Or else, play next.
    playNextRow(false);
}
Example #2
0
void KNMusicNowPlaying::onActionLoadFailed()
{
    //Set the cannot playing flag.
    playingMusicModel()->setData(m_playingIndex,
                                 true,
                                 CannotPlayFlagRole);
    //Check if the user play flag is off, then automatically play the next song,
    //Or else we stops here, let user to do the next thing.
    if(m_manualPlayed)
    {
        //Reset the playing model data.
        resetCurrentPlayingModelData();
        //We don't need to tried continued.
        return;
    }
    //Play the next row without loop mode.
    playNextRow(true);
}
Example #3
0
void KNMusicNowPlaying::onActionBackendFinished()
{
    //Add play times on current row.
    if(playingMusicModel() && m_playingIndex.isValid())
    {
        //Add play times on the playing index.
        playingMusicModel()->addPlayingTimes(m_playingIndex);
    }
    //Set the manual playing flag to become false.
    m_manualPlayed=false;
    //If current mode is repeat the current track, then just play it again.
    if(RepeatTrack==m_loopState)
    {
        //Check the backend first.
        if(m_backend!=nullptr)
        {
            m_backend->play();
        }
        //Action finished.
        return;
    }
    //Or else, play next.
    playNextRow(false);
}
Example #4
0
void KNMusicNowPlaying::playNext()
{
    //Play the next music with the repeat mode.
    playNextRow(false);
}