spek

Acoustic spectrum analyser https://github.com/alexkay/spek spek.cc
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

spek-spectrogram.h (1084B)


      1 #pragma once
      2 
      3 #include <memory>
      4 
      5 #include <wx/wx.h>
      6 
      7 #include "spek-palette.h"
      8 #include "spek-pipeline.h"
      9 
     10 class Audio;
     11 class FFT;
     12 class SpekHaveSampleEvent;
     13 struct spek_pipeline;
     14 
     15 class SpekSpectrogram : public wxWindow
     16 {
     17 public:
     18     SpekSpectrogram(wxFrame *parent);
     19     ~SpekSpectrogram();
     20     void open(const wxString& path);
     21     void save(const wxString& path);
     22 
     23 private:
     24     void on_char(wxKeyEvent& evt);
     25     void on_paint(wxPaintEvent& evt);
     26     void on_size(wxSizeEvent& evt);
     27     void on_have_sample(SpekHaveSampleEvent& evt);
     28     void render(wxDC& dc);
     29 
     30     void start();
     31     void stop();
     32 
     33     void create_palette();
     34 
     35     std::unique_ptr<Audio> audio;
     36     std::unique_ptr<FFT> fft;
     37     spek_pipeline *pipeline;
     38     int streams;
     39     int stream;
     40     int channels;
     41     int channel;
     42     enum window_function window_function;
     43     wxString path;
     44     wxString desc;
     45     double duration;
     46     int sample_rate;
     47     enum palette palette;
     48     wxImage palette_image;
     49     wxImage image;
     50     int prev_width;
     51     int fft_bits;
     52     int urange;
     53     int lrange;
     54 
     55     DECLARE_EVENT_TABLE()
     56 };