Audacity 3.2.0
EnvelopeEditor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 EnvelopeEditor.h
6
7 Paul Licameli split this from Envelope.h
8
9**********************************************************************/
10
11#ifndef __AUDACITY_ENVELOPE_EDITOR__
12#define __AUDACITY_ENVELOPE_EDITOR__
13
14class wxMouseEvent;
15class wxRect;
16class Envelope;
18class ZoomInfo;
19
20// A class that holds state for the duration of dragging
21// of an envelope point.
22class AUDACITY_DLL_API EnvelopeEditor
23{
24public:
25 static void DrawPoints(
26 const Envelope &env,
28 const wxRect & r,
29 bool dB, double dBRange,
30 float zoomMin, float zoomMax, bool mirrored, int origin = 0);
31
32 EnvelopeEditor(Envelope &envelope, bool mirrored);
34
35 // Event Handlers
36 // Each of these returns true if the envelope needs to be redrawn
37 bool MouseEvent(const wxMouseEvent & event, wxRect & r,
38 const ZoomInfo &zoomInfo, bool dB, double dBRange,
39 float zoomMin = -1.0, float zoomMax = 1.0);
40
41private:
42 bool HandleMouseButtonDown(const wxMouseEvent & event, wxRect & r,
43 const ZoomInfo &zoomInfo, bool dB, double dBRange,
44 float zoomMin = -1.0, float zoomMax = 1.0);
45 bool HandleDragging(const wxMouseEvent & event, wxRect & r,
46 const ZoomInfo &zoomInfo, bool dB, double dBRange,
47 float zoomMin = -1.0, float zoomMax = 1.0, float eMin = 0., float eMax = 2.);
48 bool HandleMouseButtonUp();
49
50private:
51 float ValueOfPixel(int y, int height, bool upper,
52 bool dB, double dBRange,
53 float zoomMin, float zoomMax);
54 void MoveDragPoint(const wxMouseEvent & event, wxRect & r,
55 const ZoomInfo &zoomInfo, bool dB, double dBRange,
56 float zoomMin, float zoomMax);
57
59 const bool mMirrored;
60
63
64 // double mInitialVal;
65
66 // int mInitialY;
67 bool mUpper;
69 bool mDirty;
70};
71
72
73#endif
float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArt.cpp:122
Envelope & mEnvelope
const bool mMirrored
int mContourOffset
Number of pixels contour is from the true envelope.
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72