Audacity  3.0.3
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 
14 class wxMouseEvent;
15 class wxRect;
16 class Envelope;
18 class ZoomInfo;
19 
20 // A class that holds state for the duration of dragging
21 // of an envelope point.
22 class AUDACITY_DLL_API EnvelopeEditor
23 {
24 public:
25  static void DrawPoints(
26  const Envelope &env,
27  TrackPanelDrawingContext &context,
28  const wxRect & r,
29  bool dB, double dBRange,
30  float zoomMin, float zoomMax, bool mirrored);
31 
32  EnvelopeEditor(Envelope &envelope, bool mirrored);
33  ~EnvelopeEditor();
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 
41 private:
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 
50 private:
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;
68  int mButton;
69  bool mDirty;
70 };
71 
72 
73 #endif
EnvelopeEditor::mButton
int mButton
Definition: EnvelopeEditor.h:68
ZoomInfo
Definition: ZoomInfo.h:47
TrackPanelDrawingContext
Definition: TrackPanelDrawingContext.h:22
Envelope
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:71
EnvelopeEditor::mEnvelope
Envelope & mEnvelope
Definition: EnvelopeEditor.h:58
EnvelopeEditor::mDirty
bool mDirty
Definition: EnvelopeEditor.h:69
EnvelopeEditor::mUpper
bool mUpper
Definition: EnvelopeEditor.h:67
EnvelopeEditor::mMirrored
const bool mMirrored
Definition: EnvelopeEditor.h:59
EnvelopeEditor::mContourOffset
int mContourOffset
Number of pixels contour is from the true envelope.
Definition: EnvelopeEditor.h:62
ValueOfPixel
float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArtist.cpp:192
EnvelopeEditor
Definition: EnvelopeEditor.h:23