kwave
18.07.70
|
#include <FileProgress.h>
Public Slots | |
void | setValue (qreal percent) |
void | setBytePosition (quint64 pos) |
void | setLength (quint64 samples) |
Signals | |
void | canceled () |
Public Member Functions | |
FileProgress (QWidget *parent, const QUrl &url, quint64 size, sample_index_t samples, double rate, unsigned int bits, unsigned int tracks) | |
virtual | ~FileProgress () Q_DECL_OVERRIDE |
bool | isCanceled () |
Protected Slots | |
void | cancel () |
Protected Member Functions | |
virtual void | resizeEvent (QResizeEvent *) Q_DECL_OVERRIDE |
virtual void | closeEvent (QCloseEvent *e) Q_DECL_OVERRIDE |
void | fitUrlLabel () |
QLabel * | addInfoLabel (QGridLayout *layout, const QString text, int row, int column) |
void | updateStatistics (double rate, double rest, quint64 pos) |
Protected Attributes | |
QUrl | m_url |
quint64 | m_size |
QLabel * | m_lbl_url |
QLabel * | m_lbl_length |
QProgressBar * | m_progress |
QLabel * | m_stat_transfer |
QLabel * | m_stat_bytes |
QTime | m_time |
bool | m_canceled |
int | m_last_percent |
unsigned int | m_bits_per_sample |
double | m_sample_rate |
unsigned int | m_tracks |
Definition at line 41 of file FileProgress.h.
Kwave::FileProgress::FileProgress | ( | QWidget * | parent, |
const QUrl & | url, | ||
quint64 | size, | ||
sample_index_t | samples, | ||
double | rate, | ||
unsigned int | bits, | ||
unsigned int | tracks | ||
) |
Constructor
parent | the parent widget |
url | the URL of the file |
size | the size of the file in bytes |
samples | the number of samples |
rate | sample rate in samples per second |
bits | number of bits per sample |
tracks | number of tracks |
Definition at line 44 of file FileProgress.cpp.
References _, addInfoLabel(), cancel(), Kwave::connect(), fitUrlLabel(), m_canceled, m_lbl_length, m_lbl_url, m_progress, m_stat_bytes, m_stat_transfer, m_time, m_url, setLength(), and updateStatistics().
|
inlinevirtual |
|
protected |
Adds a label to an info field. Used within the constructor.
layout | the QGridLayout with the labels |
text | the content of the label, localized |
row | the row within the layout [0...rows-1] |
column | the column within the layout [0...columns-1] |
Definition at line 246 of file FileProgress.cpp.
Referenced by FileProgress().
|
protectedslot |
Connected to the "cancel" button to set the "m_canceled" flag if the user wants to abort.
Definition at line 372 of file FileProgress.cpp.
References canceled(), and m_canceled.
Referenced by FileProgress().
|
signal |
Emitted when the user has pressed the Cancel button and has confirmed with "Yes".
Referenced by cancel().
|
protectedvirtual |
Called if the window is to be closed.
Definition at line 198 of file FileProgress.cpp.
References m_canceled, and Kwave::MessageBox::warningYesNo().
|
protected |
Fits the URL text into the available area, with shortening it if necessary.
Definition at line 223 of file FileProgress.cpp.
References _, m_lbl_url, and m_url.
Referenced by FileProgress(), and resizeEvent().
|
inline |
Returns true if the dialog is unusable or the user has pressed the "cancel" button.
Definition at line 67 of file FileProgress.h.
Referenced by Kwave::SignalManager::save().
|
protectedvirtual |
Fits again the URL label on resize events.
Definition at line 192 of file FileProgress.cpp.
References fitUrlLabel().
|
slot |
Like setValue, but takes position in bytes as argument
pos | position within the file, in bytes [0...m_size-1] |
Definition at line 316 of file FileProgress.cpp.
References m_last_percent, m_progress, m_size, m_time, m_url, Kwave::toInt(), and updateStatistics().
Referenced by Kwave::SignalManager::loadFile(), and setValue().
|
slot |
Updates the length information, needed in stream mode.
samples | total number of samples, must be divided through the number of tracks for getting the real length |
Definition at line 352 of file FileProgress.cpp.
References m_lbl_length, m_sample_rate, m_tracks, and Kwave::ms2string().
Referenced by FileProgress(), and Kwave::SignalManager::loadFile().
|
slot |
Advances the progress to a given position within the file.
percent | position within the file, in percent |
Definition at line 308 of file FileProgress.cpp.
References m_size, and setBytePosition().
|
protected |
Updates the statistics of the transferred bytes and transfer rate.
rate | transfer rate in kilobytes per seconds |
rest | remaining time in seconds |
pos | position in the file |
Definition at line 264 of file FileProgress.cpp.
References m_size, m_stat_bytes, and m_stat_transfer.
Referenced by FileProgress(), and setBytePosition().
|
protected |
number of bits per sample
Definition at line 180 of file FileProgress.h.
|
protected |
true if the dialog is unusable or canceled by the user
Definition at line 174 of file FileProgress.h.
Referenced by cancel(), closeEvent(), and FileProgress().
|
protected |
last displayed percent value
Definition at line 177 of file FileProgress.h.
Referenced by setBytePosition().
|
protected |
label with length info, changes in streaming mode
Definition at line 159 of file FileProgress.h.
Referenced by FileProgress(), and setLength().
|
protected |
label with the url, shortened when too long
Definition at line 156 of file FileProgress.h.
Referenced by FileProgress(), and fitUrlLabel().
|
protected |
progress bar
Definition at line 162 of file FileProgress.h.
Referenced by FileProgress(), and setBytePosition().
|
protected |
number of samples per second, used for output
Definition at line 183 of file FileProgress.h.
Referenced by setLength().
|
protected |
size of the file [Bytes]
Definition at line 153 of file FileProgress.h.
Referenced by setBytePosition(), setValue(), and updateStatistics().
|
protected |
label with progress statistics
Definition at line 168 of file FileProgress.h.
Referenced by FileProgress(), and updateStatistics().
|
protected |
label with transfer statistics
Definition at line 165 of file FileProgress.h.
Referenced by FileProgress(), and updateStatistics().
|
protected |
start time, set on initialization of this dialog
Definition at line 171 of file FileProgress.h.
Referenced by FileProgress(), and setBytePosition().
|
protected |
|
protected |
url of the file
Definition at line 150 of file FileProgress.h.
Referenced by FileProgress(), fitUrlLabel(), and setBytePosition().