add clip_icon svgs, tweak edl frame_align, fixes for plugin_sets in move_group, fix...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainprogress.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef MAINPROGRESS_H
23 #define MAINPROGRESS_H
24
25 #include "arraylist.h"
26 #include "bcprogressbox.inc"
27 #include "guicast.h"
28 #include "mainprogress.inc"
29 #include "mwindow.inc"
30 #include "mwindowgui.inc"
31 #include "bctimer.inc"
32
33 // Generic progress bar for the MainProgress
34 class MainProgress;
35
36 class MainProgressBar
37 {
38 public:
39         MainProgressBar(MWindow *mwindow, MainProgress *mainprogress);
40         ~MainProgressBar();
41
42         friend class MainProgress;
43
44         void stop_progress();
45         int is_cancelled();
46         void update_title(char *string, int default_ = 1);
47         void update_length(int64_t length);
48         int update(int64_t value);
49         void get_time(char *text);
50         double get_time();
51
52 // Only defined if this is a separate window;
53         BC_ProgressBox *progress_box;
54 // Only defined if this is the main progress bar
55         BC_ProgressBar *progress_bar;
56         MWindow *mwindow;
57         MainProgress *mainprogress;
58 // Title assigned by user
59         char default_title[BCTEXTLEN];
60         Timer *eta_timer;
61 // Last time eta was updated
62         int64_t last_eta;
63         int64_t length;
64
65 private:
66         void start();
67 };
68
69 // Controls all progressbars and locations
70
71 class MainProgress
72 {
73 public:
74         MainProgress(MWindow *mwindow, MWindowGUI *gui);
75         ~MainProgress();
76
77 // Start a progress sequence and return the bar.
78 // use_window - force opening of a new window if 1.
79         MainProgressBar* start_progress(char *text,
80                 int64_t total_length,
81                 int use_window = 0);
82         void end_progress(MainProgressBar* progress_bar);
83
84         ArrayList<MainProgressBar*> progress_bars;
85         MainProgressBar *mwindow_progress;
86
87         MWindow *mwindow;
88         MWindowGUI *gui;
89 // For mwindow progress
90         int cancelled;
91 };
92
93
94 #endif