6b547289537365ffd25812d228f24de639effdcb
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / swapframes / swapframes.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 TEMPORALSWAP_H
23 #define TEMPORALSWAP_H
24
25
26 #include "pluginvclient.h"
27
28
29 class SwapFrames;
30 class SwapFramesWindow;
31
32 class SwapFramesConfig
33 {
34 public:
35         SwapFramesConfig();
36
37         int equivalent(SwapFramesConfig &that);
38         void copy_from(SwapFramesConfig &that);
39         void interpolate(SwapFramesConfig &prev,
40                 SwapFramesConfig &next,
41                 int64_t prev_frame,
42                 int64_t next_frame,
43                 int64_t current_frame);
44         int on;
45         int swap_even;
46 };
47
48
49 class SwapFramesEven : public BC_Radial
50 {
51 public:
52         SwapFramesEven(SwapFrames *plugin,
53                 SwapFramesWindow *gui,
54                 int x,
55                 int y);
56         int handle_event();
57         SwapFrames *plugin;
58         SwapFramesWindow *gui;
59 };
60
61
62 class SwapFramesOdd : public BC_Radial
63 {
64 public:
65         SwapFramesOdd(SwapFrames *plugin,
66                 SwapFramesWindow *gui,
67                 int x,
68                 int y);
69         int handle_event();
70         SwapFrames *plugin;
71         SwapFramesWindow *gui;
72 };
73
74 class SwapFramesOn : public BC_CheckBox
75 {
76 public:
77         SwapFramesOn(SwapFrames *plugin, int x, int y);
78         int handle_event();
79         SwapFrames *plugin;
80 };
81
82
83 class SwapFramesWindow : public PluginClientWindow
84 {
85 public:
86         SwapFramesWindow(SwapFrames *plugin);
87         void create_objects();
88         SwapFramesOn *on;
89         SwapFramesEven *swap_even;
90         SwapFramesOdd *swap_odd;
91         SwapFrames *plugin;
92 };
93
94
95 class SwapFrames : public PluginVClient
96 {
97 public:
98         SwapFrames(PluginServer *server);
99         ~SwapFrames();
100
101 // required for all realtime plugins
102         int process_buffer(VFrame *frame,
103                 int64_t start_position,
104                 double frame_rate);
105         int is_realtime();
106         void update_gui();
107         void save_data(KeyFrame *keyframe);
108         void read_data(KeyFrame *keyframe);
109
110         PLUGIN_CLASS_MEMBERS(SwapFramesConfig)
111
112
113 // Buffer out of order frames
114         VFrame *buffer;
115         int64_t buffer_position;
116         int64_t prev_frame;
117 };
118
119
120 #endif
121
122