remove whitespace at eol
[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         int size;
50 };
51
52
53 class TimeStretchRTScale : public BC_TumbleTextBox
54 {
55 public:
56         TimeStretchRTScale(TimeStretchRTWindow *window,
57                 TimeStretchRT *plugin,
58                 int x,
59                 int y);
60         int handle_event();
61         TimeStretchRT *plugin;
62 };
63
64
65 class TimeStretchRTSize : public BC_TumbleTextBox
66 {
67 public:
68         TimeStretchRTSize(TimeStretchRTWindow *window, TimeStretchRT *plugin, int x, int y);
69
70         int handle_event();
71
72         TimeStretchRT *plugin;
73 };
74
75 class TimeStretchRTWindow : public PluginClientWindow
76 {
77 public:
78         TimeStretchRTWindow(TimeStretchRT *plugin);
79         ~TimeStretchRTWindow();
80         void create_objects();
81
82         TimeStretchRT *plugin;
83         TimeStretchRTScale *scale;
84         TimeStretchRTSize *size;
85 };
86
87
88
89
90 class TimeStretchRT : public PluginAClient
91 {
92 public:
93         TimeStretchRT(PluginServer *server);
94         ~TimeStretchRT();
95
96         PLUGIN_CLASS_MEMBERS(TimeStretchRTConfig)
97
98         void save_data(KeyFrame *keyframe);
99         void read_data(KeyFrame *keyframe);
100         void update_gui();
101         int is_realtime();
102         int is_synthesis();
103         int process_buffer(int64_t size,
104                 Samples *buffer,
105                 int64_t start_position,
106                 int sample_rate);
107
108         TimeStretchEngine *engine;
109         int64_t source_start;
110         int64_t dest_start;
111         int need_reconfigure;
112 };
113
114
115 #endif
116