Audacity 3.2.0
TrackArt.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file TrackArt.h
6
7 Paul Licameli split from TrackArtist.h
8
9**********************************************************************/
10#ifndef __AUDACITY_TRACK_ART__
11#define __AUDACITY_TRACK_ART__
12
13class Track;
15class wxBrush;
16class wxDC;
17class wxRect;
18class wxString;
19
20namespace TrackArt {
21
22 static constexpr int ClipFrameRadius{ 6 };
23
24 //Draws clip affordance and title string, if not empty.
25 //Returns clip's title rectangle
26 AUDACITY_DLL_API
27 wxRect DrawClipAffordance(wxDC& dc, const wxRect& affordanceRect, const wxString& title, bool highlight = false, bool selected = false);
28
29 AUDACITY_DLL_API
30 void DrawClipEdges(wxDC& dc, const wxRect& clipRect, bool selected = false);
31
32 //Used to draw clip boundaries without contents/details when it's not
33 //sensible to show them
34 AUDACITY_DLL_API
35 void DrawClipFolded(wxDC& dc, const wxRect& rect);
36
37 // Helper: draws the "sync-locked" watermark tiled to a rectangle
38 AUDACITY_DLL_API
40 TrackPanelDrawingContext &context, const wxRect &rect );
41
42 // Helper: draws background with selection rect
43 AUDACITY_DLL_API
45 const wxRect &rect, const Track *track,
46 const wxBrush &selBrush, const wxBrush &unselBrush,
47 bool useSelection = true);
48
49 AUDACITY_DLL_API
51 const wxRect& rect, const Track* track);
52
53 AUDACITY_DLL_API
55 const wxRect & rect );
56
57 AUDACITY_DLL_API
58 wxString TruncateText(wxDC& dc, const wxString& text, const int maxWidth);
59}
60
61extern AUDACITY_DLL_API int GetWaveYPos(float value, float min, float max,
62 int height, bool dB, bool outer, float dBr,
63 bool clip);
64extern float FromDB(float value, double dBRange);
65extern AUDACITY_DLL_API float ValueOfPixel(int yy, int height, bool offset,
66 bool dB, double dBRange, float zoomMin, float zoomMax);
67
68#endif
static const wxPoint2DDouble outer[]
Definition: ASlider.cpp:395
int min(int a, int b)
static const auto title
float FromDB(float value, double dBRange)
Definition: TrackArt.cpp:96
AUDACITY_DLL_API float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArt.cpp:105
AUDACITY_DLL_API int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
Definition: TrackArt.cpp:49
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
AUDACITY_DLL_API void DrawSyncLockTiles(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArt.cpp:309
AUDACITY_DLL_API wxString TruncateText(wxDC &dc, const wxString &text, const int maxWidth)
Definition: TrackArt.cpp:156
AUDACITY_DLL_API void DrawClipFolded(wxDC &dc, const wxRect &rect)
Definition: TrackArt.cpp:290
AUDACITY_DLL_API void DrawClipEdges(wxDC &dc, const wxRect &clipRect, bool selected=false)
Definition: TrackArt.cpp:253
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
Definition: TrackArt.cpp:419
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArt.cpp:498
AUDACITY_DLL_API void DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArt.cpp:126
AUDACITY_DLL_API wxRect DrawClipAffordance(wxDC &dc, const wxRect &affordanceRect, const wxString &title, bool highlight=false, bool selected=false)
Definition: TrackArt.cpp:191
static constexpr int ClipFrameRadius
Definition: TrackArt.h:22