r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / plugins / timestretch / timestretch.h
blob8b9d949b22a024e6b4de4daada10a9da7b777841
1 #ifndef TIMESTRETCH_H
2 #define TIMESTRETCH_H
4 #include "bchash.inc"
5 #include "fourier.h"
6 #include "guicast.h"
7 #include "mainprogress.inc"
8 #include "pluginaclient.h"
9 #include "resample.inc"
10 #include "timestretchengine.inc"
11 #include "vframe.inc"
16 class TimeStretch;
17 class TimeStretchWindow;
18 class TimeStretchConfig;
22 class TimeStretchScale : public BC_FPot
24 public:
25 TimeStretchScale(TimeStretch *plugin, int x, int y);
26 int handle_event();
27 TimeStretch *plugin;
30 class TimeStretchWindow : public BC_Window
32 public:
33 TimeStretchWindow(TimeStretch *plugin, int x, int y);
34 void create_objects();
35 void update();
36 int close_event();
37 TimeStretchScale *scale;
38 TimeStretch *plugin;
41 PLUGIN_THREAD_HEADER(TimeStretch, TimeStretchThread, TimeStretchWindow)
44 class TimeStretchConfig
46 public:
47 TimeStretchConfig();
50 int equivalent(TimeStretchConfig &that);
51 void copy_from(TimeStretchConfig &that);
52 void interpolate(TimeStretchConfig &prev,
53 TimeStretchConfig &next,
54 int64_t prev_frame,
55 int64_t next_frame,
56 int64_t current_frame);
59 double scale;
63 class PitchEngine : public CrossfadeFFT
65 public:
66 PitchEngine(TimeStretch *plugin);
67 ~PitchEngine();
70 int read_samples(int64_t output_sample,
71 int samples,
72 double *buffer);
73 int signal_process_oversample(int reset);
75 TimeStretch *plugin;
76 double *temp;
77 double *input_buffer;
78 int input_size;
79 int input_allocated;
80 int64_t current_input_sample;
81 int64_t current_output_sample;
83 double *last_phase;
84 double *new_freq;
85 double *new_magn;
86 double *sum_phase;
87 double *anal_freq;
88 double *anal_magn;
93 class TimeStretch : public PluginAClient
95 public:
96 TimeStretch(PluginServer *server);
97 ~TimeStretch();
100 VFrame* new_picon();
101 char* plugin_title();
102 int is_realtime();
103 int get_parameters();
104 void read_data(KeyFrame *keyframe);
105 void save_data(KeyFrame *keyframe);
107 int process_buffer(int64_t size,
108 double *buffer,
109 int64_t start_position,
110 int sample_rate);
113 int show_gui();
114 void raise_window();
115 int set_string();
118 int load_configuration();
119 int load_defaults();
120 int save_defaults();
122 void update_gui();
126 PitchEngine *pitch;
127 Resample *resample;
128 double *temp;
129 int temp_allocated;
130 double *input;
131 int input_allocated;
133 TimeStretchEngine *stretch;
135 BC_Hash *defaults;
136 TimeStretchConfig config;
137 TimeStretchThread *thread;
142 #endif