no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / reframert / reframert.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2016 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 REFRAMERT_H
23 #define REFRAMERT_H
24
25
26 #include "bcdisplayinfo.h"
27 #include "clip.h"
28 #include "bchash.h"
29 #include "filexml.h"
30 #include "guicast.h"
31 #include "language.h"
32 #include "pluginvclient.h"
33 #include "theme.h"
34 #include "transportque.h"
35
36
37 class ReframeRT;
38 class ReframeRTWindow;
39 class ReframeRTReset;
40
41 class ReframeRTConfig
42 {
43 public:
44         ReframeRTConfig();
45         void boundaries();
46         int equivalent(ReframeRTConfig &src);
47         void reset();
48         void copy_from(ReframeRTConfig &src);
49         void interpolate(ReframeRTConfig &prev,
50                 ReframeRTConfig &next,
51                 int64_t prev_frame,
52                 int64_t next_frame,
53                 int64_t current_frame);
54 // was scale
55         double num;
56         double denom;
57         int stretch;
58         int interp;
59         int optic_flow;
60 };
61
62
63 class ReframeRTNum : public BC_TumbleTextBox
64 {
65 public:
66         ReframeRTNum(ReframeRT *plugin,
67                 ReframeRTWindow *gui,
68                 int x,
69                 int y);
70         int handle_event();
71         ReframeRT *plugin;
72 };
73
74 class ReframeRTDenom : public BC_TumbleTextBox
75 {
76 public:
77         ReframeRTDenom(ReframeRT *plugin,
78                 ReframeRTWindow *gui,
79                 int x,
80                 int y);
81         int handle_event();
82         ReframeRT *plugin;
83 };
84
85 class ReframeRTStretch : public BC_Radial
86 {
87 public:
88         ReframeRTStretch(ReframeRT *plugin,
89                 ReframeRTWindow *gui,
90                 int x,
91                 int y);
92         int handle_event();
93         ReframeRT *plugin;
94         ReframeRTWindow *gui;
95 };
96
97 class ReframeRTDownsample : public BC_Radial
98 {
99 public:
100         ReframeRTDownsample(ReframeRT *plugin,
101                 ReframeRTWindow *gui,
102                 int x,
103                 int y);
104         int handle_event();
105         ReframeRT *plugin;
106         ReframeRTWindow *gui;
107 };
108
109 class ReframeRTInterpolate : public BC_CheckBox
110 {
111 public:
112         ReframeRTInterpolate(ReframeRT *plugin,
113                 ReframeRTWindow *gui,
114                 int x,
115                 int y);
116         int handle_event();
117         ReframeRT *plugin;
118         ReframeRTWindow *gui;
119 };
120
121 class ReframeRTReset : public BC_GenericButton
122 {
123 public:
124         ReframeRTReset(ReframeRT *plugin, ReframeRTWindow *gui, int x, int y);
125         ~ReframeRTReset();
126         int handle_event();
127         ReframeRT *plugin;
128         ReframeRTWindow *gui;
129 };
130
131 class ReframeRTWindow : public PluginClientWindow
132 {
133 public:
134         ReframeRTWindow(ReframeRT *plugin);
135         ~ReframeRTWindow();
136         void create_objects();
137         void update();
138         ReframeRT *plugin;
139         ReframeRTNum *num;
140         ReframeRTDenom *denom;
141         ReframeRTStretch *stretch;
142         ReframeRTDownsample *downsample;
143         ReframeRTInterpolate *interpolate;
144         ReframeRTReset *reset;
145 };
146
147
148 class ReframeRT : public PluginVClient
149 {
150 public:
151         ReframeRT(PluginServer *server);
152         ~ReframeRT();
153
154         PLUGIN_CLASS_MEMBERS(ReframeRTConfig)
155
156         void save_data(KeyFrame *keyframe);
157         void read_data(KeyFrame *keyframe);
158         void update_gui();
159         int is_realtime();
160         int is_synthesis();
161         int process_buffer(VFrame *frame,
162                 int64_t start_position,
163                 double frame_rate);
164 };
165
166 #endif