remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / cinelerra / resourcepixmap.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 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 RESOURCEPIXMAP_H
23 #define RESOURCEPIXMAP_H
24
25 #include "bctimer.inc"
26 #include "edit.inc"
27 #include "guicast.h"
28 #include "mwindow.inc"
29 #include "trackcanvas.inc"
30
31
32 // Can't use garbage collection for GUI elements because they need to
33 // lock the window for deletion.
34 class ResourcePixmap : public BC_Pixmap
35 {
36 public:
37         ResourcePixmap(MWindow *mwindow,
38                 MWindowGUI *gui,
39                 Edit *edit,
40                 int pane_number,
41                 int w,
42                 int h);
43         ~ResourcePixmap();
44
45         void resize(int w, int h);
46         void draw_data(TrackCanvas *canvas,
47                 Edit *edit,
48                 int64_t edit_x,
49                 int64_t edit_w,
50                 int64_t pixmap_x,
51                 int64_t pixmap_w,
52                 int64_t pixmap_h,
53                 int mode,
54                 int indexes_only);
55         void draw_audio_resource(TrackCanvas *canvas,
56                 Edit *edit,
57                 int x,
58                 int w);
59         void draw_video_resource(TrackCanvas *canvas,
60                 Edit *edit,
61                 int64_t edit_x,
62                 int64_t edit_w,
63                 int64_t pixmap_x,
64                 int64_t pixmap_w,
65                 int refresh_x,
66                 int refresh_w,
67                 int mode);
68         void draw_audio_source(TrackCanvas *canvas,
69                 Edit *edit,
70                 int x,
71                 int w);
72         void draw_subttl_resource(TrackCanvas *canvas,
73                 Edit *edit,
74                 int x,
75                 int w);
76 // Called by ResourceThread to update pixmap
77         void draw_wave(TrackCanvas *canvas,
78                 int x,
79                 double high,
80                 double low);
81         void draw_title(TrackCanvas *canvas,
82                 Edit *edit,
83                 int64_t edit_x,
84                 int64_t edit_w,
85                 int64_t pixmap_x,
86                 int64_t pixmap_w);
87         void reset();
88 // Change to hourglass if timer expired
89         void test_timer();
90
91         void dump();
92
93         MWindow *mwindow;
94         MWindowGUI *gui;
95 // Visible in entire track canvas
96         int visible;
97 // Section drawn
98         int64_t edit_id;
99         int pane_number;
100         int64_t edit_x, pixmap_x, pixmap_w, pixmap_h;
101         int64_t zoom_sample, zoom_track, zoom_y;
102         int64_t startsource;
103         double source_framerate, project_framerate;
104         int64_t source_samplerate, project_samplerate;
105         int data_type;
106 // Timer to cause an hourglass to appear
107         Timer *timer;
108 };
109
110 #endif