r870: Merge 2.1:
[cinelerra_cv.git] / cinelerra / mainprogress.h
blob140eca9eca598bbbaafd34ff982174a3c732046a
1 #ifndef MAINPROGRESS_H
2 #define MAINPROGRESS_H
4 #include "arraylist.h"
5 #include "bcprogressbox.inc"
6 #include "guicast.h"
7 #include "mainprogress.inc"
8 #include "mwindow.inc"
9 #include "mwindowgui.inc"
10 #include "bctimer.inc"
12 // Generic progress bar for the MainProgress
13 class MainProgress;
15 class MainProgressBar
17 public:
18 MainProgressBar(MWindow *mwindow, MainProgress *mainprogress);
19 ~MainProgressBar();
21 friend class MainProgress;
23 void stop_progress();
24 int is_cancelled();
25 void update_title(char *string, int default_ = 1);
26 void update_length(int64_t length);
27 int update(int64_t value);
28 void get_time(char *text);
29 double get_time();
31 // Only defined if this is a separate window;
32 BC_ProgressBox *progress_box;
33 // Only defined if this is the main progress bar
34 BC_ProgressBar *progress_bar;
35 MWindow *mwindow;
36 MainProgress *mainprogress;
37 // Title assigned by user
38 char default_title[BCTEXTLEN];
39 Timer *eta_timer;
40 // Last time eta was updated
41 int64_t last_eta;
42 int64_t length;
44 private:
45 void start();
48 // Controls all progressbars and locations
50 class MainProgress
52 public:
53 MainProgress(MWindow *mwindow, MWindowGUI *gui);
54 ~MainProgress();
56 // Start a progress sequence and return the bar.
57 // use_window - force opening of a new window if 1.
58 MainProgressBar* start_progress(char *text,
59 int64_t total_length,
60 int use_window = 0);
61 void end_progress(MainProgressBar* progress_bar);
63 ArrayList<MainProgressBar*> progress_bars;
64 MainProgressBar *mwindow_progress;
66 MWindow *mwindow;
67 MWindowGUI *gui;
68 // For mwindow progress
69 int cancelled;
73 #endif