signals:
void statusChanged();
+ void bufferProgress(int percent);
void progress(int percent);
void finished();
+ void error(QString);
public:
DownloadItem(Video *video, QUrl url, QString filename, QObject *parent = 0);
+ ~DownloadItem();
qint64 bytesTotal() const;
qint64 bytesReceived() const;
double remainingTime() const;
+ double totalTime() { return m_totalTime; }
double currentSpeed() const;
int currentPercent() const { return percent; }
Video* getVideo() const { return video; }
DownloadItemStatus status() const { return m_status; }
static QString formattedFilesize(qint64 size);
static QString formattedSpeed(double speed);
- static QString formattedTime(double time);
+ static QString formattedTime(double time, bool remaining = true);
QString errorMessage() const;
public slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void metaDataChanged();
void requestFinished();
+ void gotStreamUrl(QUrl streamUrl);
+ void speedCheck();
private:
void init();
+ int initialBufferSize();
qint64 m_bytesReceived;
QTime m_downloadTime;
bool m_finishedDownloading;
QTime m_lastProgressTime;
int percent;
+ double m_totalTime;
QUrl m_url;
DownloadItemStatus m_status;
QString m_errorMessage;
+ QTimer *speedCheckTimer;
+
};
// This is required in order to use QPointer<DownloadItem> as a QVariant