no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bctumble.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 BCTUMBLE_H
23 #define BCTUMBLE_H
24
25 #include "bcsubwindow.h"
26
27 #define TUMBLER_VERT 0
28 #define TUMBLER_HORZ 1
29
30 class BC_Tumbler : public BC_SubWindow
31 {
32 public:
33         BC_Tumbler(int x, int y, VFrame **data = 0, int orient=TUMBLER_VERT);
34         virtual ~BC_Tumbler();
35
36         virtual int handle_up_event() { return 0; };
37         virtual int handle_down_event() { return 0; };
38         int repeat_event(int64_t repeat_id);
39         static int calculate_w(VFrame **data = 0);
40         static int calculate_h(VFrame **data = 0);
41
42         int initialize();
43         int set_images(VFrame **data);
44         int cursor_enter_event();
45         int cursor_leave_event();
46         int button_press_event();
47         int button_release_event();
48         int cursor_motion_event();
49         int update_bitmaps(VFrame **data);
50         int reposition_window(int x, int y, int w=-1, int h=-1); // w & h don't do anything, except to inherit BC_Subwindow::(reposition_window)
51         virtual void set_boundaries(int64_t min, int64_t max) {};
52         virtual void set_boundaries(float min, float max) {};
53         virtual void set_increment(float value) {};
54         virtual void set_log_floatincrement(int value) {};
55
56 private:
57         int draw_face(int flush = 1);
58
59         BC_Pixmap *images[4];
60         int status;
61         int orient;
62         int64_t repeat_count;
63         VFrame **data;
64 };
65
66 class BC_ITumbler : public BC_Tumbler
67 {
68 public:
69         BC_ITumbler(BC_TextBox *textbox, int64_t min, int64_t max, int x, int y);
70         virtual ~BC_ITumbler();
71
72         int handle_up_event();
73         int handle_down_event();
74         void set_increment(float value);
75         void set_boundaries(int64_t min, int64_t max);
76
77         int64_t min, max;
78         int64_t increment;
79         BC_TextBox *textbox;
80 };
81
82 class BC_FTumbler : public BC_Tumbler
83 {
84 public:
85         BC_FTumbler(BC_TextBox *textbox, float min, float max, int x, int y);
86         virtual ~BC_FTumbler();
87
88         int handle_up_event();
89         int handle_down_event();
90         void set_boundaries(float min, float max);
91         void set_increment(float value);
92         void set_log_floatincrement(int value);
93
94         float min, max;
95         float increment;
96         int log_floatincrement;
97         BC_TextBox *textbox;
98 };
99
100 #endif