Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / spectrogram / spectrogram.h
index 0a103cf6422be7e546bcf9bcf7da65906f3b2714..6d1b927c0f3e3b019b081f558dadb98ff689bdaa 100644 (file)
@@ -239,33 +239,18 @@ public:
        int history_size;
 };
 
        int history_size;
 };
 
-// Header for data buffer
-typedef struct
-{
-       int window_size;
-// Total windows in this buffer
-       int total_windows;
-// Samples per fragment
-       int window_fragment;
-// Samplerate
-       int sample_rate;
-// Linearized user level
-       float level;
-// Nothing goes after this
-// 1st sample in each window is the max
-       float samples[1];
-} data_header_t;
-
-class SpectrogramFrame
+class SpectrogramFrame : public PluginClientFrame
 {
 public:
        SpectrogramFrame(int data_size);
        ~SpectrogramFrame();
 
 {
 public:
        SpectrogramFrame(int data_size);
        ~SpectrogramFrame();
 
-       int data_size;
        float *data;
        float *data;
-// Draw immediately
-       int force;
+       int data_size;
+       int window_size;
+       int sample_rate;
+// Linearized user level
+       float level;
 };
 
 class Spectrogram : public PluginAClient
 };
 
 class Spectrogram : public PluginAClient
@@ -283,16 +268,17 @@ public:
        void read_data(KeyFrame *keyframe);
        void save_data(KeyFrame *keyframe);
        void update_gui();
        void read_data(KeyFrame *keyframe);
        void save_data(KeyFrame *keyframe);
        void update_gui();
-       void render_gui(void *data, int size);
        void render_stop();
        void render_stop();
+       void fix_gui_frame(SpectrogramFrame *frame);
 
        void reset();
 
        int done;
        int need_reconfigure;
 
        void reset();
 
        int done;
        int need_reconfigure;
+       int64_t last_position;
        FFT *fft;
 // Data buffer for frequency & magnitude
        FFT *fft;
 // Data buffer for frequency & magnitude
-       unsigned char *data;
+//     unsigned char *data;
 // Accumulate data for windowing
        Samples *audio_buffer;
 // Total samples in the buffer
 // Accumulate data for windowing
        Samples *audio_buffer;
 // Total samples in the buffer
@@ -302,21 +288,19 @@ public:
 // Temporaries for the FFT
        double *freq_real;
        double *freq_imag;
 // Temporaries for the FFT
        double *freq_real;
        double *freq_imag;
-// Total windows sent to current GUI
-       int total_windows;
 // Starting sample in audio_buffer.
        int64_t audio_buffer_start;
 // Total floats allocated in data buffer
        int allocated_data;
 // Accumulates canvas pixels until the next update_gui
 // Starting sample in audio_buffer.
        int64_t audio_buffer_start;
 // Total floats allocated in data buffer
        int allocated_data;
 // Accumulates canvas pixels until the next update_gui
-       ArrayList<SpectrogramFrame*> frame_buffer;
-// History for vertical mode
+//     ArrayList<SpectrogramFrame*> frame_buffer;
+// Layers for vertical mode
 // Probing data for horizontal mode
        ArrayList<SpectrogramFrame*> frame_history;
 // Header from last data buffer
 // Probing data for horizontal mode
        ArrayList<SpectrogramFrame*> frame_history;
 // Header from last data buffer
-       data_header_t header;
+//     data_header_t header;
 // Time of last GUI update
 // Time of last GUI update
-       Timer *timer;
+//     Timer *timer;
 // Window dimensions
        int w, h;
 };
 // Window dimensions
        int w, h;
 };