Debian Codegraph @

include/progress.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2021 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
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