fix trace locks hang, drag handle rework-again, 12 reset btns on plugins, booby on
[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 class SwapFramesReset;
32
33 class SwapFramesConfig
34 {
35 public:
36         SwapFramesConfig();
37
38         void reset();
39         int equivalent(SwapFramesConfig &that);
40         void copy_from(SwapFramesConfig &that);
41         void interpolate(SwapFramesConfig &prev,
42                 SwapFramesConfig &next,
43                 int64_t prev_frame,
44                 int64_t next_frame,
45                 int64_t current_frame);
46         int on;
47         int swap_even;
48 };
49
50
51 class SwapFramesEven : public BC_Radial
52 {
53 public:
54         SwapFramesEven(SwapFrames *plugin,
55                 SwapFramesWindow *gui,
56                 int x,
57                 int y);
58         int handle_event();
59         SwapFrames *plugin;
60         SwapFramesWindow *gui;
61 };
62
63
64 class SwapFramesOdd : public BC_Radial
65 {
66 public:
67         SwapFramesOdd(SwapFrames *plugin,
68                 SwapFramesWindow *gui,
69                 int x,
70                 int y);
71         int handle_event();
72         SwapFrames *plugin;
73         SwapFramesWindow *gui;
74 };
75
76 class SwapFramesOn : public BC_CheckBox
77 {
78 public:
79         SwapFramesOn(SwapFrames *plugin, int x, int y);
80         int handle_event();
81         SwapFrames *plugin;
82 };
83
84 class SwapFramesReset : public BC_GenericButton
85 {
86 public:
87         SwapFramesReset(SwapFrames *plugin, SwapFramesWindow *gui, int x, int y);
88         ~SwapFramesReset();
89         int handle_event();
90         SwapFrames *plugin;
91         SwapFramesWindow *gui;
92 };
93
94
95 class SwapFramesWindow : public PluginClientWindow
96 {
97 public:
98         SwapFramesWindow(SwapFrames *plugin);
99         void create_objects();
100         void update();
101         SwapFramesOn *on;
102         SwapFramesEven *swap_even;
103         SwapFramesOdd *swap_odd;
104         SwapFrames *plugin;
105         SwapFramesReset *reset;
106 };
107
108
109 class SwapFrames : public PluginVClient
110 {
111 public:
112         SwapFrames(PluginServer *server);
113         ~SwapFrames();
114
115 // required for all realtime plugins
116         int process_buffer(VFrame *frame,
117                 int64_t start_position,
118                 double frame_rate);
119         int is_realtime();
120         void update_gui();
121         void save_data(KeyFrame *keyframe);
122         void read_data(KeyFrame *keyframe);
123
124         PLUGIN_CLASS_MEMBERS(SwapFramesConfig)
125
126
127 // Buffer out of order frames
128         VFrame *buffer;
129         int64_t buffer_position;
130         int64_t prev_frame;
131 };
132
133
134 #endif
135
136