00001 #ifndef SPECTROGRAM_H
00002 #define SPECTROGRAM_H
00003
00004
00005
00006
00007
00008
00009 #include "bchash.inc"
00010 #include "fourier.h"
00011 #include "guicast.h"
00012 #include "mutex.h"
00013 #include "pluginaclient.h"
00014 #include "vframe.inc"
00015
00016
00017
00018
00019 class Spectrogram;
00020 class SpectrogramFFT;
00021
00022
00023 class SpectrogramLevel : public BC_FPot
00024 {
00025 public:
00026 SpectrogramLevel(Spectrogram *plugin, int x, int y);
00027 int handle_event();
00028 Spectrogram *plugin;
00029 };
00030
00031
00032 class SpectrogramWindow : public BC_Window
00033 {
00034 public:
00035 SpectrogramWindow(Spectrogram *plugin, int x, int y);
00036 ~SpectrogramWindow();
00037
00038 void create_objects();
00039 int close_event();
00040 void update_gui();
00041
00042 SpectrogramLevel *level;
00043 Spectrogram *plugin;
00044 int done;
00045 BC_SubWindow *canvas;
00046 };
00047
00048
00049
00050 PLUGIN_THREAD_HEADER(Spectrogram, SpectrogramThread, SpectrogramWindow)
00051
00052
00053
00054 class SpectrogramFFT : public CrossfadeFFT
00055 {
00056 public:
00057 SpectrogramFFT(Spectrogram *plugin);
00058 ~SpectrogramFFT();
00059
00060 int signal_process();
00061 int read_samples(int64_t output_sample,
00062 int samples,
00063 double *buffer);
00064
00065 Spectrogram *plugin;
00066 };
00067
00068
00069 class SpectrogramConfig
00070 {
00071 public:
00072 SpectrogramConfig();
00073 double level;
00074 };
00075
00076
00077 class Spectrogram : public PluginAClient
00078 {
00079 public:
00080 Spectrogram(PluginServer *server);
00081 ~Spectrogram();
00082
00083 VFrame* new_picon();
00084 char* plugin_title();
00085 int is_realtime();
00086 int process_buffer(int64_t size,
00087 double *buffer,
00088 int64_t start_position,
00089 int sample_rate);
00090 int show_gui();
00091 void raise_window();
00092 int set_string();
00093 void load_configuration();
00094 int load_defaults();
00095 int save_defaults();
00096 void read_data(KeyFrame *keyframe);
00097 void save_data(KeyFrame *keyframe);
00098 void update_gui();
00099 void render_gui(void *data, int size);
00100
00101 void reset();
00102
00103 int done;
00104
00105 int need_reconfigure;
00106 BC_Hash *defaults;
00107 SpectrogramConfig config;
00108 SpectrogramThread *thread;
00109 SpectrogramFFT *fft;
00110 float *data;
00111 int total_windows;
00112 };
00113
00114
00115 #endif