merged hv7 mod
[goodguy/history.git] / cinelerra-5.1 / plugins / timestretchrt / timestretchrt.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2011 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 RESAMPLERT_H
23 #define RESAMPLERT_H
24
25
26 #include "guicast.h"
27 #include "pluginaclient.h"
28 #include "resample.h"
29 #include "../timestretch/timestretchengine.inc"
30
31
32
33 class TimeStretchRT;
34 class TimeStretchRTWindow;
35
36 class TimeStretchRTConfig
37 {
38 public:
39         TimeStretchRTConfig();
40         void boundaries();
41         int equivalent(TimeStretchRTConfig &src);
42         void copy_from(TimeStretchRTConfig &src);
43         void interpolate(TimeStretchRTConfig &prev,
44                 TimeStretchRTConfig &next,
45                 int64_t prev_frame,
46                 int64_t next_frame,
47                 int64_t current_frame);
48 //      double scale;
49         double num;
50         double denom;
51         int size;
52 };
53
54
55 class TimeStretchRTScale : public BC_TumbleTextBox
56 {
57 public:
58         TimeStretchRTScale(TimeStretchRTWindow *window,
59                 TimeStretchRT *plugin,
60                 int x,
61                 int y,
62                 double *value);
63         int handle_event();
64         TimeStretchRT *plugin;
65         double *value;
66 };
67
68
69 class TimeStretchRTSize : public BC_TumbleTextBox
70 {
71 public:
72         TimeStretchRTSize(TimeStretchRTWindow *window, TimeStretchRT *plugin, int x, int y);
73
74         int handle_event();
75
76         TimeStretchRT *plugin;
77 };
78
79 class TimeStretchRTWindow : public PluginClientWindow
80 {
81 public:
82         TimeStretchRTWindow(TimeStretchRT *plugin);
83         ~TimeStretchRTWindow();
84         void create_objects();
85
86         TimeStretchRT *plugin;
87         TimeStretchRTScale *num;
88         TimeStretchRTScale *denom;
89         TimeStretchRTSize *size;
90 };
91
92
93
94
95 class TimeStretchRT : public PluginAClient
96 {
97 public:
98         TimeStretchRT(PluginServer *server);
99         ~TimeStretchRT();
100
101         PLUGIN_CLASS_MEMBERS(TimeStretchRTConfig)
102
103         void save_data(KeyFrame *keyframe);
104         void read_data(KeyFrame *keyframe);
105         void update_gui();
106         int is_realtime();
107         int is_synthesis();
108         int process_buffer(int64_t size,
109                 Samples *buffer,
110                 int64_t start_position,
111                 int sample_rate);
112
113         TimeStretchEngine *engine;
114         int64_t source_start;
115         int64_t dest_start;
116         int need_reconfigure;
117 };
118
119
120 #endif
121