2015-01-04 17:11:20 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "wx/glcanvas.h"
|
|
|
|
#include "wx/timer.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <queue>
|
|
|
|
|
|
|
|
#include "InteractiveCanvas.h"
|
|
|
|
#include "TuningContext.h"
|
|
|
|
#include "MouseTracker.h"
|
|
|
|
|
|
|
|
#include "fftw3.h"
|
|
|
|
#include "Timer.h"
|
|
|
|
|
|
|
|
class TuningCanvas: public InteractiveCanvas {
|
|
|
|
public:
|
2015-03-28 00:59:04 -04:00
|
|
|
enum ActiveState {
|
2015-04-22 22:54:48 -04:00
|
|
|
TUNING_HOVER_NONE, TUNING_HOVER_FREQ, TUNING_HOVER_BW, TUNING_HOVER_PPM, TUNING_HOVER_CENTER
|
2015-03-26 20:12:54 -04:00
|
|
|
};
|
2015-01-04 17:11:20 -05:00
|
|
|
TuningCanvas(wxWindow *parent, int *attribList = NULL);
|
|
|
|
~TuningCanvas();
|
|
|
|
|
|
|
|
void setHelpTip(std::string tip);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnIdle(wxIdleEvent &event);
|
|
|
|
|
|
|
|
void OnMouseMoved(wxMouseEvent& event);
|
|
|
|
void OnMouseDown(wxMouseEvent& event);
|
|
|
|
void OnMouseWheelMoved(wxMouseEvent& event);
|
|
|
|
void OnMouseReleased(wxMouseEvent& event);
|
|
|
|
void OnMouseEnterWindow(wxMouseEvent& event);
|
|
|
|
void OnMouseLeftWindow(wxMouseEvent& event);
|
2015-04-22 22:54:48 -04:00
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
|
|
|
void OnKeyUp(wxKeyEvent& event);
|
2015-05-10 21:43:03 -04:00
|
|
|
void OnMouseRightDown(wxMouseEvent& event);
|
|
|
|
void OnMouseRightReleased(wxMouseEvent& event);
|
2015-04-22 22:54:48 -04:00
|
|
|
|
2015-03-28 00:59:04 -04:00
|
|
|
void StepTuner(ActiveState state, int factor, bool up = true);
|
2015-01-04 17:11:20 -05:00
|
|
|
|
|
|
|
TuningContext *glContext;
|
|
|
|
|
|
|
|
std::string helpTip;
|
2015-01-04 19:32:51 -05:00
|
|
|
float dragAccum;
|
2015-01-07 20:23:15 -05:00
|
|
|
float uxDown;
|
2015-03-28 00:59:04 -04:00
|
|
|
ActiveState hoverState;
|
|
|
|
ActiveState downState;
|
2015-03-26 20:12:54 -04:00
|
|
|
int hoverIndex;
|
2015-03-28 00:59:04 -04:00
|
|
|
int downIndex;
|
2015-03-28 01:11:33 -04:00
|
|
|
bool dragging;
|
2015-03-26 20:12:54 -04:00
|
|
|
|
|
|
|
float freqDP;
|
|
|
|
float freqW;
|
|
|
|
|
|
|
|
float bwDP;
|
|
|
|
float bwW;
|
|
|
|
|
|
|
|
float centerDP;
|
|
|
|
float centerW;
|
2015-03-26 22:45:52 -04:00
|
|
|
|
|
|
|
bool top;
|
|
|
|
bool bottom;
|
|
|
|
|
2015-04-22 22:54:48 -04:00
|
|
|
int currentPPM;
|
|
|
|
int lastPPM;
|
|
|
|
|
2015-01-04 17:11:20 -05:00
|
|
|
//
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
|
|
|
};
|
|
|
|
|