4 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef RESOURCEPIXMAP_H
23 #define RESOURCEPIXMAP_H
25 #include "bctimer.inc"
29 #include "mwindow.inc"
30 #include "trackcanvas.inc"
33 // Can't use garbage collection for GUI elements because they need to
34 // lock the window for deletion.
35 class ResourcePixmap : public BC_Pixmap
38 ResourcePixmap(MWindow *mwindow, MWindowGUI *gui, Edit *edit,
39 int pane_number, int w, int h);
42 void resize(int w, int h);
43 void update_settings(Edit *edit,
44 int64_t edit_x, int64_t edit_w,
45 int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h);
46 void draw_data(TrackCanvas *canvas,
47 Edit *edit, int64_t edit_x, int64_t edit_w,
48 int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h,
49 int mode, int indexes_only);
50 int calculate_center_pixel(Track *track);
51 void draw_audio_resource(TrackCanvas *canvas,
52 Edit *edit, int x, int w);
53 void draw_video_resource(TrackCanvas *canvas,
54 Edit *edit, int64_t edit_x, int64_t edit_w,
55 int64_t pixmap_x, int64_t pixmap_w,
56 int refresh_x, int refresh_w,
58 void draw_audio_source(TrackCanvas *canvas,
59 Edit *edit, int x, int w);
60 void draw_subttl_resource(TrackCanvas *canvas,
61 Edit *edit, int x, int w);
62 // Called by ResourceThread to update pixmap
63 void draw_wave(TrackCanvas *canvas,
64 int x, double high, double low);
65 VFrame *change_title_color(VFrame *title_bg, int color);
66 VFrame *change_picon_alpha(VFrame *picon_frame, int alpha);
67 void draw_title(TrackCanvas *canvas,
68 Edit *edit, int64_t edit_x, int64_t edit_w,
69 int64_t pixmap_x, int64_t pixmap_w);
71 // Change to hourglass if timer expired
78 // Visible in entire track canvas
84 int64_t edit_x, pixmap_x, pixmap_w, pixmap_h;
87 double source_framerate, project_framerate;
88 int64_t source_samplerate, project_samplerate;
90 // Timer to cause an hourglass to appear