TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the abstract download data. More...
#include <musicabstractdownloadrequest.h>
Public Slots | |
virtual void | downLoadFinished () override |
virtual void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
virtual void | updateDownloadSpeed () |
![]() | |
virtual void | replyError (QNetworkReply::NetworkError error) override |
virtual void | sslErrors (QNetworkReply *reply, const QList< QSslError > &errors) override |
![]() | |
virtual void | downLoadFinished () |
virtual void | replyError (QNetworkReply::NetworkError error) |
virtual void | sslErrors (QNetworkReply *reply, const QList< QSslError > &errors) |
void | sslErrorsString (QNetworkReply *reply, const QList< QSslError > &errors) |
Public Member Functions | |
MusicAbstractDownLoadRequest (const QString &url, const QString &path, TTK::Download type, QObject *parent=nullptr) | |
~MusicAbstractDownLoadRequest () | |
virtual void | deleteAll () overridefinal |
virtual void | startToRequest ()=0 |
![]() | |
MusicAbstractNetwork (QObject *parent=nullptr) | |
![]() | |
TTKAbstractNetwork (QObject *parent=nullptr) | |
~TTKAbstractNetwork () | |
void | setHeader (const QString &key, const QVariant &value) |
const QVariant | header (const QString &key) const |
Protected Member Functions | |
QString | mapCurrentQueryData () const |
Protected Attributes | |
QFile * | m_file |
QString | m_url |
QString | m_savePath |
TTK::Download | m_downloadType |
qint64 | m_hasReceived |
qint64 | m_currentReceived |
qint64 | m_totalSize |
QTimer | m_speedTimer |
![]() | |
QVariantMap | m_rawData |
volatile bool | m_interrupt |
volatile TTK::NetworkCode | m_stateCode |
QNetworkReply * | m_reply |
QNetworkAccessManager | m_manager |
Additional Inherited Members | |
![]() | |
void | downLoadDataChanged (const QString &bytes) |
void | downLoadRawDataChanged (const QByteArray &bytes) |
The class of the abstract download data.
Definition at line 29 of file musicabstractdownloadrequest.h.
MusicAbstractDownLoadRequest::MusicAbstractDownLoadRequest | ( | const QString & | url, |
const QString & | path, | ||
TTK::Download | type, | ||
QObject * | parent = nullptr |
||
) |
Object constructor provide download url save local path and download type.
Definition at line 5 of file musicabstractdownloadrequest.cpp.
References G_DOWNLOAD_MANAGER_PTR, m_file, m_savePath, m_speedTimer, TTK_DN_S2MS, and updateDownloadSpeed().
MusicAbstractDownLoadRequest::~MusicAbstractDownLoadRequest | ( | ) |
Object destructor.
Definition at line 25 of file musicabstractdownloadrequest.cpp.
References G_DOWNLOAD_MANAGER_PTR, and m_speedTimer.
|
finaloverridevirtual |
Release the network object.
Reimplemented from TTKAbstractNetwork.
Definition at line 34 of file musicabstractdownloadrequest.cpp.
References TTKAbstractNetwork::deleteAll(), and m_file.
Referenced by MusicKWDownLoadTextRequest::downLoadFinished(), MusicWYDownLoadTextRequest::downLoadFinished(), MusicDownLoadTextRequest::downLoadFinished(), MusicDownloadDataRequest::downLoadFinished(), MusicKWDownLoadCoverRequest::downLoadFinished(), MusicWYDownLoadTextRequest::startToRequest(), MusicDownLoadTextRequest::startToRequest(), MusicKWDownLoadTextRequest::startToRequest(), MusicDownloadDataRequest::startToRequest(), MusicDownloadMetaDataRequest::startToRequest(), MusicKWDownLoadCoverRequest::startToRequest(), and MusicDownloadQueueRequest::~MusicDownloadQueueRequest().
|
overridevirtualslot |
Download data from net finished.
Definition at line 42 of file musicabstractdownloadrequest.cpp.
References TTKAbstractNetwork::downLoadFinished(), and m_speedTimer.
Referenced by MusicKWDownLoadTextRequest::downLoadFinished(), MusicDownLoadTextRequest::downLoadFinished(), MusicWYDownLoadTextRequest::downLoadFinished(), MusicDownloadDataRequest::downLoadFinished(), MusicDownloadQueueRequest::downLoadFinished(), and MusicKWDownLoadCoverRequest::downLoadFinished().
|
virtualslot |
Get download received and total data.
Definition at line 48 of file musicabstractdownloadrequest.cpp.
References m_currentReceived, and m_totalSize.
Referenced by MusicDownloadDataRequest::downloadProgress(), MusicDownLoadTextRequest::startToRequest(), MusicKWDownLoadTextRequest::startToRequest(), MusicWYDownLoadTextRequest::startToRequest(), and MusicKWDownLoadCoverRequest::startToRequest().
|
protected |
Map the enum type to string.
Definition at line 69 of file musicabstractdownloadrequest.cpp.
References TTK::Background, TTK::Cover, DOWNLOAD_KEY_BACKGROUND, DOWNLOAD_KEY_COVER, DOWNLOAD_KEY_LRC, DOWNLOAD_KEY_MUSIC, DOWNLOAD_KEY_OTHER, DOWNLOAD_KEY_VIDEO, TTK::Lrc, m_downloadType, TTK::Music, TTK::Other, and TTK::Video.
Referenced by MusicKWDownLoadTextRequest::downLoadFinished(), MusicDownLoadTextRequest::downLoadFinished(), MusicWYDownLoadTextRequest::downLoadFinished(), MusicDownloadMetaDataRequest::downLoadFinished(), MusicDownloadDataRequest::downLoadFinished(), and MusicKWDownLoadCoverRequest::downLoadFinished().
|
pure virtual |
Start to request data from net. Subclass should implement this function.
Implemented in MusicKWDownLoadCoverRequest, MusicDownloadQueueRequest, MusicDownloadMetaDataRequest, MusicDownloadDataRequest, MusicKWDownLoadTextRequest, MusicWYDownLoadTextRequest, and MusicDownLoadTextRequest.
Referenced by MusicIdentifySongWidget::createDetectedSuccessedWidget(), MusicLrcDownloadBatchWidget::downloadButtonClicked(), and MusicLrcSearchTableWidget::downloadQueryResult().
|
virtualslot |
Updata download speed due the user mod the net speed limited.
limit speed
Definition at line 54 of file musicabstractdownloadrequest.cpp.
References MusicSettingManager::DownloadDownloadLimitSize, MusicSettingManager::DownloadLimitEnable, G_SETTING_PTR, m_currentReceived, m_hasReceived, TTK::Core::sleep(), TTK_DN_S2MS, and TTK_SN_KB2B.
Referenced by MusicAbstractDownLoadRequest(), and MusicDownloadDataRequest::updateDownloadSpeed().
|
protected |
Definition at line 77 of file musicabstractdownloadrequest.h.
Referenced by downloadProgress(), updateDownloadSpeed(), and MusicDownloadDataRequest::updateDownloadSpeed().
|
protected |
Definition at line 76 of file musicabstractdownloadrequest.h.
Referenced by MusicDownloadDataRequest::downloadProgress(), mapCurrentQueryData(), and MusicDownloadDataRequest::startToRequest().
|
protected |
Definition at line 74 of file musicabstractdownloadrequest.h.
Referenced by MusicDownloadQueueRequest::abort(), deleteAll(), MusicWYDownLoadTextRequest::downLoadFinished(), MusicDownLoadTextRequest::downLoadFinished(), MusicKWDownLoadTextRequest::downLoadFinished(), MusicDownloadMetaDataRequest::downLoadFinished(), MusicDownloadDataRequest::downLoadFinished(), MusicDownloadQueueRequest::downLoadFinished(), MusicKWDownLoadCoverRequest::downLoadFinished(), MusicDownloadQueueRequest::handleError(), MusicDownloadDataRequest::handleReadyRead(), MusicDownloadQueueRequest::handleReadyRead(), MusicAbstractDownLoadRequest(), MusicDownloadQueueRequest::startDownload(), MusicKWDownLoadTextRequest::startToRequest(), MusicWYDownLoadTextRequest::startToRequest(), MusicDownLoadTextRequest::startToRequest(), MusicDownloadDataRequest::startToRequest(), MusicDownloadMetaDataRequest::startToRequest(), and MusicKWDownLoadCoverRequest::startToRequest().
|
protected |
Definition at line 77 of file musicabstractdownloadrequest.h.
Referenced by updateDownloadSpeed(), and MusicDownloadDataRequest::updateDownloadSpeed().
|
protected |
Definition at line 75 of file musicabstractdownloadrequest.h.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicAbstractDownLoadRequest(), and MusicDownloadDataRequest::startToRequest().
|
protected |
Definition at line 78 of file musicabstractdownloadrequest.h.
Referenced by downLoadFinished(), MusicAbstractDownLoadRequest(), MusicDownloadQueueRequest::startDownload(), MusicKWDownLoadTextRequest::startToRequest(), MusicWYDownLoadTextRequest::startToRequest(), MusicDownLoadTextRequest::startToRequest(), MusicKWDownLoadCoverRequest::startToRequest(), MusicDownloadDataRequest::startToRequest(), and ~MusicAbstractDownLoadRequest().
|
protected |
Definition at line 77 of file musicabstractdownloadrequest.h.
Referenced by downloadProgress(), and MusicDownloadDataRequest::updateDownloadSpeed().
|
protected |
Definition at line 75 of file musicabstractdownloadrequest.h.
Referenced by MusicKWDownLoadTextRequest::startToRequest(), MusicDownLoadTextRequest::startToRequest(), MusicWYDownLoadTextRequest::startToRequest(), MusicDownloadDataRequest::startToRequest(), MusicDownloadMetaDataRequest::startToRequest(), and MusicKWDownLoadCoverRequest::startToRequest().