![]() |
Audacity 3.2.0
|
#include <EnvelopeEditor.h>
Public Member Functions | |
| EnvelopeEditor (Envelope &envelope, bool mirrored) | |
| ~EnvelopeEditor () | |
| bool | MouseEvent (const wxMouseEvent &event, wxRect &r, const ZoomInfo &zoomInfo, bool dB, double dBRange, float zoomMin=-1.0, float zoomMax=1.0) |
Static Public Member Functions | |
| static void | DrawPoints (const Envelope &env, TrackPanelDrawingContext &context, const wxRect &r, bool dB, double dBRange, float zoomMin, float zoomMax, bool mirrored, int origin=0) |
Private Member Functions | |
| bool | HandleMouseButtonDown (const wxMouseEvent &event, wxRect &r, const ZoomInfo &zoomInfo, bool dB, double dBRange, float zoomMin=-1.0, float zoomMax=1.0) |
| bool | HandleDragging (const wxMouseEvent &event, wxRect &r, const ZoomInfo &zoomInfo, bool dB, double dBRange, float zoomMin=-1.0, float zoomMax=1.0, float eMin=0., float eMax=2.) |
| bool | HandleMouseButtonUp () |
| float | ValueOfPixel (int y, int height, bool upper, bool dB, double dBRange, float zoomMin, float zoomMax) |
| void | MoveDragPoint (const wxMouseEvent &event, wxRect &r, const ZoomInfo &zoomInfo, bool dB, double dBRange, float zoomMin, float zoomMax) |
Private Attributes | |
| Envelope & | mEnvelope |
| const bool | mMirrored |
| int | mContourOffset |
| Number of pixels contour is from the true envelope. More... | |
| bool | mUpper |
| int | mButton |
| bool | mDirty |
Definition at line 22 of file EnvelopeEditor.h.
| EnvelopeEditor::EnvelopeEditor | ( | Envelope & | envelope, |
| bool | mirrored | ||
| ) |
Definition at line 110 of file EnvelopeEditor.cpp.
| EnvelopeEditor::~EnvelopeEditor | ( | ) |
Definition at line 122 of file EnvelopeEditor.cpp.
|
static |
Definition at line 37 of file EnvelopeEditor.cpp.
References TrackPanelDrawingContext::dc, anonymous_namespace{EnvelopeEditor.cpp}::DrawPoint(), AColor::envelopeBrush, AColor::envelopePen, TrackArtist::Get(), Envelope::GetDragPoint(), EnvelopeHandle::GetEnvelope(), Envelope::GetNumberOfPoints(), Envelope::GetOffset(), GetWaveYPos(), TrackPanelDrawingContext::target, and AColor::uglyPen.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), and EqualizationPanel::OnPaint().
|
private |
Definition at line 293 of file EnvelopeEditor.cpp.
References Envelope::GetDragPointValid(), mDirty, mEnvelope, MoveDragPoint(), and Envelope::SetDragPointValid().
Referenced by MouseEvent().
|
private |
HandleMouseButtonDown either finds an existing control point or adds a NEW one which is then recorded as the point to drag. This is slightly complicated by there possibly being four control points for a given time value: We have an upper and lower envelope line. Also we may be showing an inner envelope (at 0.5 the range).
Definition at line 158 of file EnvelopeEditor.cpp.
References Envelope::GetNumberOfPoints(), Envelope::GetOffset(), Envelope::GetValue(), GetWaveYPos(), Envelope::InsertOrReplace(), mButton, mContourOffset, mDirty, mEnvelope, mMirrored, mUpper, ZoomInfo::PositionToTime(), Envelope::SetDragPoint(), anonymous_namespace{EnvelopeEditor.cpp}::SQR(), ZoomInfo::TimeToPosition(), and ValueOfPixel().
Referenced by MouseEvent().
|
private |
Definition at line 321 of file EnvelopeEditor.cpp.
References Envelope::ClearDragPoint(), mButton, and mEnvelope.
Referenced by MouseEvent().
| bool EnvelopeEditor::MouseEvent | ( | const wxMouseEvent & | event, |
| wxRect & | r, | ||
| const ZoomInfo & | zoomInfo, | ||
| bool | dB, | ||
| double | dBRange, | ||
| float | zoomMin = -1.0, |
||
| float | zoomMax = 1.0 |
||
| ) |
Definition at line 329 of file EnvelopeEditor.cpp.
References Envelope::GetDragPoint(), HandleDragging(), HandleMouseButtonDown(), HandleMouseButtonUp(), mButton, and mEnvelope.
|
private |
Definition at line 274 of file EnvelopeEditor.cpp.
References Envelope::GetOffset(), mEnvelope, Envelope::MoveDragPoint(), mUpper, ZoomInfo::PositionToTime(), and ValueOfPixel().
Referenced by HandleDragging().
|
private |
ValueOfPixel() converts a y position on screen to an envelope value.
| y | - y position, usually of the mouse.relative to the clip. |
| height | - height of the rectangle we are in. @upper - true if we are on the upper line, false if on lower. @dB - display mode either linear or log. @zoomMin - vertical scale, typically -1.0 @zoomMax - vertical scale, typically +1.0 |
Definition at line 138 of file EnvelopeEditor.cpp.
References Envelope::ClampValue(), mContourOffset, mEnvelope, and ValueOfPixel().
Referenced by HandleMouseButtonDown(), MoveDragPoint(), and ValueOfPixel().
|
private |
Definition at line 68 of file EnvelopeEditor.h.
Referenced by HandleMouseButtonDown(), HandleMouseButtonUp(), and MouseEvent().
|
private |
Number of pixels contour is from the true envelope.
Definition at line 62 of file EnvelopeEditor.h.
Referenced by HandleMouseButtonDown(), and ValueOfPixel().
|
private |
Definition at line 69 of file EnvelopeEditor.h.
Referenced by HandleDragging(), and HandleMouseButtonDown().
|
private |
Definition at line 58 of file EnvelopeEditor.h.
Referenced by HandleDragging(), HandleMouseButtonDown(), HandleMouseButtonUp(), MouseEvent(), MoveDragPoint(), and ValueOfPixel().
|
private |
Definition at line 59 of file EnvelopeEditor.h.
Referenced by HandleMouseButtonDown().
|
private |
Definition at line 67 of file EnvelopeEditor.h.
Referenced by HandleMouseButtonDown(), and MoveDragPoint().