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 Channel;
14class Track;
16class wxBrush;
17class wxDC;
18class wxRect;
19class wxString;
20#include <wx/types.h>
21
22namespace TrackArt {
23
24 static constexpr int ClipFrameRadius{ 6 };
25
26 //Draws clip affordance and title string, if not empty.
27 //Returns affordance's rectangle.
28 AUDACITY_DLL_API
29 wxRect DrawClipAffordance(
30 wxDC& dc, const wxRect& clipRect, bool highlight = false,
31 bool selected = false);
32
33 AUDACITY_DLL_API
34 bool
35 DrawClipTitle(wxDC& dc, const wxRect& affordanceRect, const wxString& title);
36
37 AUDACITY_DLL_API
38 void DrawClipEdges(wxDC& dc, const wxRect& clipRect, bool selected = false);
39
40 //Used to draw clip boundaries without contents/details when it's not
41 //sensible to show them
42 AUDACITY_DLL_API
43 void DrawClipFolded(wxDC& dc, const wxRect& rect);
44
45 // Helper: draws the "sync-locked" watermark tiled to a rectangle
46 AUDACITY_DLL_API
48 TrackPanelDrawingContext &context, const wxRect &rect );
49
50 //TODO: refactor
53 AUDACITY_DLL_API
55 const wxRect &rect, const Channel &channel,
56 const wxBrush &selBrush, const wxBrush &unselBrush,
57 bool useSelection = true, bool useBeatsAlternateColor = false);
58
59 AUDACITY_DLL_API
61 const wxRect& rect, const Track* track);
62
63 AUDACITY_DLL_API
65 const wxRect & rect );
66
67 AUDACITY_DLL_API
68 wxString TruncateText(wxDC& dc, const wxString& text, const int maxWidth);
69
70 AUDACITY_DLL_API
71 void DrawSnapLines(wxDC *dc, wxInt64 snap0, wxInt64 snap1);
72}
73
74extern AUDACITY_DLL_API int GetWaveYPos(float value, float min, float max,
75 int height, bool dB, bool outer, float dBr,
76 bool clip);
77extern float FromDB(float value, double dBRange);
78extern AUDACITY_DLL_API float ValueOfPixel(int yy, int height, bool offset,
79 bool dB, double dBRange, float zoomMin, float zoomMax);
80
81#endif
static const wxPoint2DDouble outer[]
Definition: ASlider.cpp:401
int min(int a, int b)
static const auto title
float FromDB(float value, double dBRange)
Definition: TrackArt.cpp:113
AUDACITY_DLL_API float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArt.cpp:122
AUDACITY_DLL_API int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
Definition: TrackArt.cpp:66
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Channel &channel, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true, bool useBeatsAlternateColor=false)
Helper: draws background with selection rect.
Definition: TrackArt.cpp:648
AUDACITY_DLL_API void DrawSyncLockTiles(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArt.cpp:365
AUDACITY_DLL_API bool DrawClipTitle(wxDC &dc, const wxRect &affordanceRect, const wxString &title)
Definition: TrackArt.cpp:289
AUDACITY_DLL_API wxString TruncateText(wxDC &dc, const wxString &text, const int maxWidth)
Definition: TrackArt.cpp:173
AUDACITY_DLL_API void DrawClipFolded(wxDC &dc, const wxRect &rect)
Definition: TrackArt.cpp:346
AUDACITY_DLL_API void DrawClipEdges(wxDC &dc, const wxRect &clipRect, bool selected=false)
Definition: TrackArt.cpp:309
AUDACITY_DLL_API void DrawSnapLines(wxDC *dc, wxInt64 snap0, wxInt64 snap1)
Definition: TrackArt.cpp:775
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArt.cpp:756
AUDACITY_DLL_API void DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArt.cpp:143
AUDACITY_DLL_API wxRect DrawClipAffordance(wxDC &dc, const wxRect &clipRect, bool highlight=false, bool selected=false)
Definition: TrackArt.cpp:223
static constexpr int ClipFrameRadius
Definition: TrackArt.h:24