コード例 #1
0
void MusicSimilarFoundWidget::queryAllFinished()
{
    MusicObject::MusicSongInfomations musicSongInfos(m_downloadThread->getMusicSongInfos());
    if(musicSongInfos.isEmpty())
    {
        m_statusLabel->setPixmap(QPixmap(":/share/noSimilar"));
    }
    else
    {
        delete m_statusLabel;
        m_statusLabel = nullptr;

        foreach(MusicObject::MusicSongInfomation info, musicSongInfos)
        {
            DownloadData *data = new DownloadData;
            data->m_songName = info.m_songName;
            data->m_songArtist = info.m_singerName;
            data->m_time = info.m_timeLength;
            data->m_picUrl = info.m_smallPicUrl;
            if(!info.m_songAttrs.isEmpty())
            {
                MusicObject::MusicSongAttribute atrr = info.m_songAttrs.first();
                data->m_songUrl = atrr.m_url;
                data->m_format = atrr.m_format;
            }
            m_likeDownloadDatas << data;
        }

        createLabels();
    }
コード例 #2
0
void MusicDownloadWidget::queryAllFinishedMusic()
{
    MusicObject::MusicSongInfomations musicSongInfos(m_downloadThread->getMusicSongInfos());
    if(!musicSongInfos.isEmpty())
    {
        QString filename = m_downloadThread->getSearchedText();
        QString artistName = filename.split('-').front().trimmed();
        QString songName = filename.split('-').back().trimmed();
        MusicObject::MusicSongInfomation musicSongInfo = musicSongInfos.first();
        foreach(MusicObject::MusicSongInfomation var, musicSongInfos)
        {
            if( var.m_singerName.contains(artistName, Qt::CaseInsensitive) &&
                var.m_songName.contains(songName, Qt::CaseInsensitive) )
            {
                musicSongInfo = var;
                break;
            }
        }

        MusicObject::MusicSongAttributes attrs = musicSongInfo.m_songAttrs;
        foreach(MusicObject::MusicSongAttribute attr, attrs)
        {
            if(attr.m_bitrate == MB_32)         ///st
            {
                ui->viewArea->createItem(MB_32, tr("ST"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/stQuality"));
            }
            else if(attr.m_bitrate == MB_128)   ///sd
            {
                ui->viewArea->createItem(MB_128, tr("SD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/sdQuality"));
            }
            else if(attr.m_bitrate == MB_192)   ///hd
            {
                ui->viewArea->createItem(MB_192, tr("HD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/hdQuality"));
            }
            else if(attr.m_bitrate == MB_320)   ///sq
            {
                ui->viewArea->createItem(MB_320, tr("SQ"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/sqQuality"));
            }
            else if(attr.m_bitrate > MB_320)   ///cd
            {
                ui->viewArea->createItem(MB_500, tr("CD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/cdQuality"));
            }
            else
            {
                break;
            }
        }
    }
コード例 #3
0
void MusicVideoTableWidget::itemDoubleClicked(int row, int column)
{
    if(column <= 0 || row < 0)
    {
        return;
    }
    MusicSongInfomations musicSongInfos(m_downLoadManager->getMusicSongInfos());
    emit mvURLNameChanged(item(row, 2)->toolTip() + " - " + item(row, 1)->toolTip(),
                          musicSongInfos[row].m_songAttrs.first().m_url);
}
コード例 #4
0
void MusicLrcSearchTableWidget::musicDownloadLocal(int row)
{
    if(row < 0)
    {
        MusicMessageBox message;
        message.setText(tr("Please Select One Item First!"));
        message.exec();
        return;
    }
    MusicSongInfomations musicSongInfos(m_downLoadManager->getMusicSongInfo());

    MusicTextDownLoadThread* lrcDownload = new MusicTextDownLoadThread(musicSongInfos[row].m_lrcUrl,
                             LRC_DOWNLOAD_AL + m_currentSongName + LRC_FILE, Download_Lrc, this);
    connect(lrcDownload, SIGNAL(musicDownLoadFinished(QString)),
                         SIGNAL(lrcDownloadStateChanged(QString)));
    lrcDownload->startToDownload();
}
コード例 #5
0
void MusicLrcSearchTableWidget::musicDownloadLocal(int row)
{
    if(row < 0 || (row >= rowCount() - 1))
    {
        MusicMessageBox message;
        message.setText(tr("Please Select One Item First!"));
        message.exec();
        return;
    }

    MusicObject::MusicSongInformations musicSongInfos(m_downLoadManager->getMusicSongInfos());
    ///download lrc
    MusicDownLoadThreadAbstract *d = M_DOWNLOAD_QUERY_PTR->getDownloadLrcThread(musicSongInfos[row].m_lrcUrl,
                             MusicUtils::Core::lrcPrefix() + m_downLoadManager->getSearchedText() + LRC_FILE,
                             MusicDownLoadThreadAbstract::DownloadLrc, this);
    connect(d, SIGNAL(downLoadDataChanged(QString)), SIGNAL(lrcDownloadStateChanged(QString)));
    d->startToDownload();
}
コード例 #6
0
void MusicDownloadWidget::queryAllFinishedMusic()
{
    MusicSongInfomations musicSongInfos(m_downloadThread->getMusicSongInfos());
    if(!musicSongInfos.isEmpty())
    {
        MusicSongAttributes attrs = musicSongInfos.first().m_songAttrs;
        foreach(MusicSongAttribute attr, attrs)
        {
            if(attr.m_bitrate == 32)         ///st
            {
                ui->viewArea->createItem(32, tr("ST"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/stQuality"));
            }
            else if(attr.m_bitrate == 128)   ///sd
            {
                ui->viewArea->createItem(128, tr("SD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/sdQuality"));
            }
            else if(attr.m_bitrate == 192)   ///hd
            {
                ui->viewArea->createItem(192, tr("HD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/hdQuality"));
            }
            else if(attr.m_bitrate == 320)   ///sq
            {
                ui->viewArea->createItem(320, tr("SQ"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/sqQuality"));
            }
            else if(attr.m_bitrate > 320)   ///cd
            {
                ui->viewArea->createItem(321, tr("CD"), QString("%1/%2KBPS/%3").arg(attr.m_size)
                                         .arg(attr.m_bitrate).arg(attr.m_format.toUpper()),
                                         QString(":/quality/cdQuality"));
            }
            else
            {
                break;
            }
        }
    }
コード例 #7
0
void MusicDownloadStatusLabel::musicHaveNoLrcAlready()
{
    if(!M_NETWORK->isOnline())
    {   //no network connection
        showDownLoadInfoFor(MusicObject::DisConnection);
        return;
    }
    MusicSongInfomations musicSongInfos(m_downloadLrcThread->getMusicSongInfos());
    if(!musicSongInfos.isEmpty())
    {
        QString filename = m_parentWidget->getCurrentFileName();
        int count = filename.split('-').count();
        QString artistName = filename.split('-').front().trimmed();
        QString songName = filename.split('-').back().trimmed();

        MusicSongInfomation musicSongInfo = musicSongInfos.first();
        foreach(MusicSongInfomation var, musicSongInfos)
        {
            if( var.m_singerName.contains(artistName, Qt::CaseInsensitive) &&
                var.m_songName.contains(songName, Qt::CaseInsensitive) )
            {
                musicSongInfo = var;
                break;
            }
        }

        ///download lrc
        MusicTextDownLoadThread* lrc = new MusicTextDownLoadThread(musicSongInfo.m_lrcUrl,
                                 LRC_DOWNLOAD_AL + filename + LRC_FILE,
                                 MusicDownLoadThreadAbstract::Download_Lrc, this);
        lrc->startToDownload();

        ///download art picture
#ifndef USE_MULTIPLE_QUERY
        (new MusicData2DownloadThread(musicSongInfo.m_smallPicUrl, ART_DOWNLOAD_AL + artistName + SKN_FILE,
                                 MusicDownLoadThreadAbstract::Download_SmlBG, this))->startToDownload();
#else
        (new MusicDataDownloadThread(musicSongInfo.m_smallPicUrl, ART_DOWNLOAD_AL + artistName + SKN_FILE,
                                 MusicDownLoadThreadAbstract::Download_SmlBG, this))->startToDownload();
#endif
        ///download big picture
        (new MusicBackgroundDownload( count == 1 ? musicSongInfo.m_singerName : artistName, artistName, this))->startToDownload();
    }
コード例 #8
0
MusicObject::MusicSongInformation MusicDownloadWidget::getMatchMusicSongInformation()
{
    MusicObject::MusicSongInformations musicSongInfos(m_downloadThread->getMusicSongInfos());
    if(!musicSongInfos.isEmpty())
    {
        QString filename = m_downloadThread->getSearchedText();
        QString artistName = MusicUtils::String::artistName(filename);
        QString songName = MusicUtils::String::songName(filename);
        MusicObject::MusicSongInformation musicSongInfo;
        foreach(const MusicObject::MusicSongInformation &var, musicSongInfos)
        {
            if(var.m_singerName.contains(artistName, Qt::CaseInsensitive) &&
               var.m_songName.contains(songName, Qt::CaseInsensitive))
            {
                musicSongInfo = var;
                break;
            }
        }
        qSort(musicSongInfo.m_songAttrs);
        return musicSongInfo;
    }
コード例 #9
0
void MusicSongSearchOnlineTableWidget::addSearchMusicToPlayList(int row)
{
    if(!M_NETWORK->isOnline())
    {   //no network connection
        emit showDownLoadInfoFor(MusicObject::DisConnection);
        return;
    }
    if(row < 0)
    {
        MusicMessageBox message;
        message.setText(tr("Please Select One Item First!"));
        message.exec();
        return;
    }
    emit showDownLoadInfoFor(MusicObject::DownLoading);

    MusicSongInfomations musicSongInfos(m_downLoadManager->getMusicSongInfos());
    MusicSongInfomation musicSongInfo = musicSongInfos[row];
    MusicSongAttribute musicSongAttr = musicSongInfo.m_songAttrs.first();
    QString musicSong = item(row, 2)->toolTip() + " - " + item(row, 1)->toolTip();
    QString downloadName = QString("%1%2.%3").arg(MUSIC_DOWNLOAD_AL)
                                             .arg(musicSong).arg(musicSongAttr.m_format);

    MusicDataDownloadThread *downSong = new MusicDataDownloadThread( musicSongAttr.m_url, downloadName,
                                                                     MusicDownLoadThreadAbstract::Download_Music, this);
    downSong->startToDownload();

    (new MusicTextDownLoadThread(musicSongInfo.m_lrcUrl, LRC_DOWNLOAD_AL + musicSong + LRC_FILE,
                                 MusicDownLoadThreadAbstract::Download_Lrc, this))->startToDownload();
    (new MusicData2DownloadThread(musicSongInfo.m_smallPicUrl, ART_DOWNLOAD_AL + musicSongInfo.m_singerName + SKN_FILE,
                                  MusicDownLoadThreadAbstract::Download_SmlBG, this))->startToDownload();
    ///download big picture
    (new MusicBgThemeDownload(musicSongInfo.m_singerName, musicSongInfo.m_singerName, this))->startToDownload();

    emit muiscSongToPlayListChanged( musicSong, item(row, 3)->text(), musicSongAttr.m_format);
}
コード例 #10
0
void MusicSongSearchOnlineTableWidget::auditionToMusic(int row)
{
    MusicSongInfomations musicSongInfos(m_downLoadManager->getMusicSongInfos());
    if(musicSongInfos.isEmpty() || row < 0)
    {
        MusicMessageBox message;
        message.setText(tr("Please Select One Item First!"));
        message.exec();
        return;
    }
    if(m_audition == nullptr)
    {
        m_audition = new MusicCoreMPlayer(this);
    }
    m_audition->setMedia(MusicCoreMPlayer::MusicCategory,
                         musicSongInfos[row].m_songAttrs.first().m_url, -1);

    if(m_previousAuditionRow != -1)
    {
        item(m_previousAuditionRow, 0)->setData(MUSIC_AUDIT_ROLE, AUDITION_STOP);
    }
    item(m_previousAuditionRow = row, 0)->setData(MUSIC_AUDIT_ROLE, AUDITION_PLAY);
    emit auditionIsPlaying(false);
}
コード例 #11
0
void MusicVideoTableWidget::getMusicMvInfo(MusicSongAttributes &data)
{
    MusicSongInfomations musicSongInfos(m_downLoadManager->getMusicSongInfos());
    data =  (!musicSongInfos.isEmpty() && m_previousClickRow != -1) ?
            musicSongInfos[m_previousClickRow].m_songAttrs : MusicSongAttributes();
}