kwave  18.07.70
FileProgress.h
Go to the documentation of this file.
1 /***************************************************************************
2  FileProgress.h - progress window for loading/saving files
3  -------------------
4  begin : Mar 11 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef FILE_PROGRESS_H
19 #define FILE_PROGRESS_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QDialog>
25 #include <QLabel>
26 #include <QTime>
27 #include <QUrl>
28 
29 #include "libkwave/Sample.h"
30 
31 class QCloseEvent;
32 class QGridLayout;
33 class QLabel;
34 class QProgressBar;
35 class QResizeEvent;
36 class KProgress;
37 
38 namespace Kwave
39 {
40 
41  class Q_DECL_EXPORT FileProgress: public QDialog
42  {
43  Q_OBJECT
44  public:
55  FileProgress(QWidget *parent,
56  const QUrl &url, quint64 size,
57  sample_index_t samples, double rate, unsigned int bits,
58  unsigned int tracks);
59 
61  virtual ~FileProgress() Q_DECL_OVERRIDE {}
62 
67  inline bool isCanceled() { return m_canceled; }
68 
69  signals:
70 
75  void canceled();
76 
77  public slots:
78 
83  void setValue(qreal percent);
84 
89  void setBytePosition(quint64 pos);
90 
96  void setLength(quint64 samples);
97 
98  protected slots:
99 
104  void cancel();
105 
106  protected:
107 
112  virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
113 
117  virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
118 
123  void fitUrlLabel();
124 
134  QLabel *addInfoLabel(QGridLayout *layout, const QString text,
135  int row, int column);
136 
145  void updateStatistics(double rate, double rest, quint64 pos);
146 
147  protected:
148 
150  QUrl m_url;
151 
153  quint64 m_size;
154 
156  QLabel *m_lbl_url;
157 
159  QLabel *m_lbl_length;
160 
162  QProgressBar *m_progress;
163 
166 
168  QLabel *m_stat_bytes;
169 
171  QTime m_time;
172 
175 
178 
180  unsigned int m_bits_per_sample;
181 
184 
186  unsigned int m_tracks;
187 
188  };
189 
190 }
191 
192 #endif /* FILE_PROGRESS_H */
193 
194 //***************************************************************************
195 //***************************************************************************
virtual ~FileProgress() Q_DECL_OVERRIDE
Definition: FileProgress.h:61
Definition: App.h:33
QProgressBar * m_progress
Definition: FileProgress.h:162
QLabel * m_stat_transfer
Definition: FileProgress.h:165
quint64 sample_index_t
Definition: Sample.h:28
unsigned int m_bits_per_sample
Definition: FileProgress.h:180
unsigned int m_tracks
Definition: FileProgress.h:186