-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwxHarmonicsPanel.h
45 lines (42 loc) · 1.69 KB
/
wxHarmonicsPanel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "wx/wx.h"
#include "HarmonicsCallback.h"
#define MAX_HARMONICS 128
class wxHarmonicsPanel : public wxPanel
{
public:
wxHarmonicsPanel(wxStaticText* polyphonyText, wxStaticText* peakLevelText);
~wxHarmonicsPanel() { }
wxHarmonicsPanel( wxStaticText* polyphonyText, wxStaticText* peakLevelText, wxWindow* parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
void Create( wxWindow* parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
void OnPaint( wxPaintEvent& event );
void OnClick( wxMouseEvent& event );
void OnMouseUp( wxMouseEvent& event );
void OnMouseMove( wxMouseEvent& event );
void OnRightClick( wxMouseEvent& event );
void OnRightUp( wxMouseEvent& event );
void OnMouseLeave( wxMouseEvent& event );
void OnMouseEnter( wxMouseEvent& event );
void SetHarmonicLevels( float* initialLevels, float* finalLevels );
void SetInitialHarmonics( float* initialLevels );
void SetFinalHarmonics( float* finalLevels );
bool GetInitialVisible();
void RecalculateLevels();
void Normalize(int polyphony);
void SetZoomLevel(float zoomLevel);
void SetInitialVisible(bool state);
void UpdateHarmonicSetting(wxMouseEvent& event, bool leftClick);
float* GetHarmonicLevels();
void SetHarmonicsCallback(HarmonicsCallback* callback);
DECLARE_EVENT_TABLE();
private:
HarmonicsCallback* _callback;
float _initialHarmonicLevels[MAX_HARMONICS];
float _finalHarmonicLevels[MAX_HARMONICS];
wxStaticText* _polyphonyText;
wxStaticText* _peakLevelText;
float _zoomLevel;
bool _leftDragging;
bool _rightDragging;
bool _initialVisible;
};