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-ruler.h (720B)


      1 #pragma once
      2 
      3 #include <wx/dc.h>
      4 #include <wx/string.h>
      5 
      6 class SpekRuler
      7 {
      8 public:
      9     enum Position
     10     {
     11         TOP,
     12         RIGHT,
     13         BOTTOM,
     14         LEFT
     15     };
     16 
     17     typedef wxString (*formatter_cb)(int unit);
     18 
     19     SpekRuler(
     20         int x, int y, Position pos, wxString sample_label,
     21         int *factors, int min_units, int max_units, double spacing,
     22         double scale, double offset, formatter_cb formatter
     23     );
     24 
     25     void draw(wxDC& dc);
     26 
     27 protected:
     28     void draw_tick(wxDC& dc, int tick);
     29 
     30     int x;
     31     int y;
     32     Position pos;
     33     wxString sample_label;
     34     int *factors;
     35     int min_units;
     36     int max_units;
     37     double spacing;
     38     double scale;
     39     double offset;
     40     formatter_cb formatter;
     41 };