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, bool highlight = false, bool selected = false);
28
29 AUDACITY_DLL_API
30 bool DrawClipTitle(wxDC& dc, const wxRect& titleRect, const wxString& title);
31
32 AUDACITY_DLL_API
33 void DrawClipEdges(wxDC& dc, const wxRect& clipRect, bool selected = false);
34
35 //Used to draw clip boundaries without contents/details when it's not
36 //sensible to show them
37 AUDACITY_DLL_API
38 void DrawClipFolded(wxDC& dc, const wxRect& rect);
39
40 // Helper: draws the "sync-locked" watermark tiled to a rectangle
41 AUDACITY_DLL_API
43 TrackPanelDrawingContext &context, const wxRect &rect );
44
45 // Helper: draws background with selection rect
46 AUDACITY_DLL_API
48 const wxRect &rect, const Track *track,
49 const wxBrush &selBrush, const wxBrush &unselBrush,
50 bool useSelection = true);
51
52 AUDACITY_DLL_API
54 const wxRect& rect, const Track* track);
55
56 AUDACITY_DLL_API
58 const wxRect & rect );
59
60 AUDACITY_DLL_API
61 wxString TruncateText(wxDC& dc, const wxString& text, const int maxWidth);
62}
63
64extern AUDACITY_DLL_API int GetWaveYPos(float value, float min, float max,
65 int height, bool dB, bool outer, float dBr,
66 bool clip);
67extern float FromDB(float value, double dBRange);
68extern AUDACITY_DLL_API float ValueOfPixel(int yy, int height, bool offset,
69 bool dB, double dBRange, float zoomMin, float zoomMax);
70
71#endif
static const wxPoint2DDouble outer[]
Definition: ASlider.cpp:397
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:315
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:296
AUDACITY_DLL_API void DrawClipEdges(wxDC &dc, const wxRect &clipRect, bool selected=false)
Definition: TrackArt.cpp:259
AUDACITY_DLL_API wxRect DrawClipAffordance(wxDC &dc, const wxRect &affordanceRect, bool highlight=false, bool selected=false)
Definition: TrackArt.cpp:191
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:425
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArt.cpp:504
AUDACITY_DLL_API void DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArt.cpp:126
static constexpr int ClipFrameRadius
Definition: TrackArt.h:22
AUDACITY_DLL_API bool DrawClipTitle(wxDC &dc, const wxRect &titleRect, const wxString &title)
Definition: TrackArt.cpp:242