| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef H_FREAC_PROGRESS |
| 14 |
#define H_FREAC_PROGRESS |
| 15 |
|
| 16 |
#include <smooth.h> |
| 17 |
#include <boca.h> |
| 18 |
|
| 19 |
using namespace smooth; |
| 20 |
|
| 21 |
namespace freac |
| 22 |
{ |
| 23 |
class Progress |
| 24 |
{ |
| 25 |
private: |
| 26 |
static Array<Progress *> progressIndicators; |
| 27 |
|
| 28 |
Threads::Mutex mutex; |
| 29 |
|
| 30 |
Window *window; |
| 31 |
protected: |
| 32 |
const BoCA::Config *configuration; |
| 33 |
Bool consoleMode; |
| 34 |
|
| 35 |
UnsignedInt64 lastInvoked; |
| 36 |
|
| 37 |
Int64 totalSamplesLeft; |
| 38 |
Int totalSamplesMultiplier; |
| 39 |
|
| 40 |
Float totalProgressDone; |
| 41 |
|
| 42 |
Array<BoCA::Track> trackList; |
| 43 |
Array<UnsignedInt64> trackStartTicks; |
| 44 |
Array<Int64> trackPositions; |
| 45 |
|
| 46 |
UnsignedInt64 startTicks; |
| 47 |
UnsignedInt64 pauseTicks; |
| 48 |
public: |
| 49 |
Progress(const BoCA::Config *); |
| 50 |
~Progress(); |
| 51 |
|
| 52 |
Void ComputeTotalSamples(const Array<BoCA::Track> &); |
| 53 |
Void FixTotalSamples(const BoCA::Track &, const BoCA::Track &); |
| 54 |
|
| 55 |
Int64 GetTotalSamples() const; |
| 56 |
|
| 57 |
Void Start(); |
| 58 |
Void Pause(); |
| 59 |
Void Resume(); |
| 60 |
|
| 61 |
Void StartTrack(const BoCA::Track &); |
| 62 |
Void UpdateTrack(const BoCA::Track &, Int64); |
| 63 |
Void FinishTrack(const BoCA::Track &, Bool); |
| 64 |
signals: |
| 65 |
Signal4<Void, Int, Int, Int, Int> onReportProgress; |
| 66 |
}; |
| 67 |
}; |
| 68 |
|
| 69 |
#endif |