|
TTKMusicPlayer
4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the download the type of data. More...
#include <musicdownloaddatarequest.h>
Inheritance diagram for MusicDownloadDataRequest:Public Slots | |
| virtual void | downloadFinished () override |
| virtual void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) overridefinal |
| virtual void | updateDownloadSpeed () overridefinal |
| void | handleReadyRead () |
Public Slots inherited from MusicAbstractDownloadRequest | |
| virtual void | downloadFinished () override |
| virtual void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| virtual void | updateDownloadSpeed () |
Public Slots inherited from MusicAbstractNetwork | |
| virtual void | replyError (QNetworkReply::NetworkError error) override |
| virtual void | sslErrors (QNetworkReply *reply, const QList< QSslError > &errors) override |
Public Slots inherited from TTKAbstractNetwork | |
| 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) |
Signals | |
| void | downloadUrlChanged (const QString &url) |
| void | downloadSpeedLabelChanged (const QString &speed, qint64 timeLeft) |
| void | downloadProgressChanged (float percent, const QString &total, qint64 time) |
| void | createDownloadItem (const QString &name, qint64 time) |
Signals inherited from TTKAbstractNetwork | |
| void | downloadDataChanged (const QString &bytes) |
| void | downloadRawDataChanged (const QByteArray &bytes) |
Public Member Functions | |
| MusicDownloadDataRequest (const QString &url, const QString &path, TTK::Download type, QObject *parent=nullptr) | |
| MusicDownloadDataRequest (const QString &url, const QString &path, TTK::Download type, TTK::Record record, QObject *parent=nullptr) | |
| virtual void | startToRequest () override |
Public Member Functions inherited from MusicAbstractDownloadRequest | |
| MusicAbstractDownloadRequest (const QString &url, const QString &path, TTK::Download type, QObject *parent=nullptr) | |
| ~MusicAbstractDownloadRequest () | |
| virtual void | deleteAll () overridefinal |
Public Member Functions inherited from MusicAbstractNetwork | |
| MusicAbstractNetwork (QObject *parent=nullptr) | |
Public Member Functions inherited from TTKAbstractNetwork | |
| TTKAbstractNetwork (QObject *parent=nullptr) | |
| ~TTKAbstractNetwork () | |
| void | setHeader (const QString &key, const QVariant &value) noexcept |
| const QVariant | header (const QString &key) const noexcept |
Protected Member Functions | |
| void | startToRequest (const QString &url) |
Protected Member Functions inherited from MusicAbstractDownloadRequest | |
| QString | mapCurrentQueryData () const |
Protected Attributes | |
| qint64 | m_createTime |
| bool | m_redirection |
| bool | m_needUpdate |
| TTK::Record | m_recordType |
Protected Attributes inherited from MusicAbstractDownloadRequest | |
| 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 |
Protected Attributes inherited from TTKAbstractNetwork | |
| QVariantMap | m_rawData |
| volatile bool | m_interrupt |
| volatile TTK::NetworkCode | m_stateCode |
| QNetworkReply * | m_reply |
| QNetworkAccessManager | m_manager |
The class of the download the type of data.
Definition at line 27 of file musicdownloaddatarequest.h.
| MusicDownloadDataRequest::MusicDownloadDataRequest | ( | 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 4 of file musicdownloaddatarequest.cpp.
| MusicDownloadDataRequest::MusicDownloadDataRequest | ( | const QString & | url, |
| const QString & | path, | ||
| TTK::Download | type, | ||
| TTK::Record | record, | ||
| QObject * | parent = nullptr |
||
| ) |
Definition at line 10 of file musicdownloaddatarequest.cpp.
|
signal |
Create download item from download name and total time.
Referenced by startToRequest().
|
overridevirtualslot |
Download data from net finished.
Definition at line 57 of file musicdownloaddatarequest.cpp.
References MusicAbstractDownloadRequest::deleteAll(), TTKAbstractNetwork::deleteAll(), TTKAbstractNetwork::downloadDataChanged(), MusicAbstractDownloadRequest::downloadFinished(), MusicAbstractDownloadRequest::m_file, m_needUpdate, m_redirection, TTKAbstractNetwork::m_reply, MusicAbstractDownloadRequest::mapCurrentQueryData(), startToRequest(), and TTK_INFO_STREAM.
Referenced by MusicDownloadMetaDataRequest::downloadFinished(), and startToRequest().
|
finaloverridevirtualslot |
Get download received and total data.
only download media data or other type can that show progress
Definition at line 106 of file musicdownloaddatarequest.cpp.
References MusicAbstractDownloadRequest::downloadProgress(), downloadProgressChanged(), TTK::Extra, m_createTime, MusicAbstractDownloadRequest::m_downloadType, TTK::Music, and TTK::Number::sizeByteToLabel().
Referenced by startToRequest().
|
signal |
Update download percent\ total time and current time progress.
Referenced by downloadProgress().
|
signal |
Update download speed label.
Referenced by updateDownloadSpeed().
|
signal |
Update download url finished.
|
slot |
Download received data ready.
Definition at line 98 of file musicdownloaddatarequest.cpp.
References MusicAbstractDownloadRequest::m_file, and TTKAbstractNetwork::m_reply.
Referenced by startToRequest().
|
overridevirtual |
Start to download data.
Implements MusicAbstractDownloadRequest.
Reimplemented in MusicDownloadMetaDataRequest.
Definition at line 20 of file musicdownloaddatarequest.cpp.
References MusicAbstractDownloadRequest::deleteAll(), TTKAbstractNetwork::downloadDataChanged(), MusicAbstractDownloadRequest::m_file, MusicAbstractDownloadRequest::m_url, and TTK_ERROR_STREAM.
Referenced by MusicIdentifySongWidget::createDetectedSuccessedWidget(), MusicCloudManagerTableWidget::downloadFileFromServer(), MusicBPDownloadBackgroundRequest::downloadFinished(), MusicKWDownloadBackgroundRequest::downloadFinished(), MusicResourceRequest::downloadFinished(), downloadFinished(), MusicTXDownloadBackgroundRequest::downloadUrlFinished(), MusicKGDownloadBackgroundRequest::parseFromBackgroundProperty(), MusicWebFMRadioPlayWidget::querySongInfoFinished(), MusicDownloadMetaDataRequest::startToRequest(), and MusicDownloadWidget::startToRequestMovie().
|
protected |
Start to download data by url.
only download media data can that show progress
Definition at line 33 of file musicdownloaddatarequest.cpp.
References createDownloadItem(), TTKDateTime::currentTimestamp(), downloadFinished(), downloadProgress(), G_DOWNLOAD_MANAGER_PTR, handleReadyRead(), m_createTime, MusicAbstractDownloadRequest::m_downloadType, TTKAbstractNetwork::m_manager, m_recordType, m_redirection, TTKAbstractNetwork::m_reply, MusicAbstractDownloadRequest::m_savePath, MusicAbstractDownloadRequest::m_speedTimer, TTK::Music, QtNetworkErrorConnect, MusicAbstractNetwork::replyError(), TTK::setContentTypeHeader(), TTK::setSslConfiguration(), and TTK_SLOT.
|
finaloverridevirtualslot |
Updata download speed due the user mod the net speed limited.
Definition at line 117 of file musicdownloaddatarequest.cpp.
References downloadSpeedLabelChanged(), MusicAbstractDownloadRequest::m_currentReceived, MusicAbstractDownloadRequest::m_hasReceived, MusicAbstractDownloadRequest::m_totalSize, TTK::Number::speedByteToLabel(), and MusicAbstractDownloadRequest::updateDownloadSpeed().
|
protected |
Definition at line 84 of file musicdownloaddatarequest.h.
Referenced by downloadProgress(), and startToRequest().
|
protected |
Definition at line 85 of file musicdownloaddatarequest.h.
Referenced by downloadFinished(), and MusicDownloadMetaDataRequest::MusicDownloadMetaDataRequest().
|
protected |
Definition at line 86 of file musicdownloaddatarequest.h.
Referenced by startToRequest().
|
protected |
Definition at line 85 of file musicdownloaddatarequest.h.
Referenced by MusicDownloadMetaDataRequest::downloadFinished(), downloadFinished(), and startToRequest().
1.8.8