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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/**********************************************************************
Audacity: A Digital Audio Editor
FreqWindow.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_FREQ_WINDOW__
#define __AUDACITY_FREQ_WINDOW__
#include <wx/brush.h>
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/gdicmn.h>
#include <wx/pen.h>
#include <wx/minifram.h>
class FreqWindow;
class TrackList;
extern FreqWindow *gFreqWindow;
void InitFreqWindow(wxWindow * parent);
class FreqWindow;
class FreqPlot:public wxWindow {
public:
FreqPlot(wxWindow * parent, wxWindowID id,
const wxPoint & pos, const wxSize & size);
void OnMouseEvent(wxMouseEvent & event);
void OnPaint(wxPaintEvent & event);
private:
FreqWindow * freqWindow;
DECLARE_EVENT_TABLE()
};
class FreqWindow:public wxFrame {
public:
FreqWindow(wxWindow * parent, wxWindowID id,
const wxString & title, const wxPoint & pos);
virtual ~ FreqWindow();
void Plot(int len, float *data, double rate);
void PlotMouseEvent(wxMouseEvent & event);
void PlotPaint(wxPaintEvent & event);
void OnPaint(wxPaintEvent & event);
void OnCloseWindow(wxCloseEvent & event);
void OnSize(wxSizeEvent & event);
void OnAlgChoice(wxCommandEvent & event);
void OnSizeChoice(wxCommandEvent & event);
void OnFuncChoice(wxCommandEvent & event);
void OnAxisChoice(wxCommandEvent & event);
void OnExport();
void Recalc();
private:
FreqPlot * mFreqPlot;
wxBrush mBackgroundBrush;
wxPen mBackgroundPen;
wxCursor *mArrowCursor;
wxCursor *mCrossCursor;
wxButton *mCloseButton;
wxButton *mExportButton;
wxChoice *mAlgChoice;
wxChoice *mSizeChoice;
wxChoice *mFuncChoice;
wxChoice *mAxisChoice;
wxRect mPlotRect;
wxRect mInfoRect;
wxRect mUpdateRect;
int mLeftMargin;
int mBottomMargin;
double mRate;
int mDataLen;
float *mData;
int mWindowSize;
float *mProcessed;
int mProcessedSize;
bool mLogAxis;
float mYMin;
float mYMax;
float mYStep;
wxBitmap *mBitmap;
int mMouseX;
int mMouseY;
float GetProcessedValue(float freq0, float freq1);
DECLARE_EVENT_TABLE()
};
#endif
|