Audacity 3.2.0
Classes | Functions | Variables
anonymous_namespace{TrackArt.cpp} Namespace Reference

Classes

struct  BeatsGridlinePainter
 

Functions

wxRect GetAffordanceTitleRect (const wxRect &rect)
 
wxString GetTruncatedTitle (wxDC &dc, const wxString &title, const wxRect &affordanceRect)
 
wxRect GetClipAffordanceRect (wxDC &dc, const wxRect &clipRect, std::optional< wxRect > &clippedClipRect)
 
wxRect GetClipTruncatedTitleRect (wxDC &dc, const wxRect &affordanceRect, const wxString &title)
 
const AudacityProjectGetProject (const Track &track)
 

Variables

constexpr double minSubdivisionWidth = 12.0
 

Function Documentation

◆ GetAffordanceTitleRect()

wxRect anonymous_namespace{TrackArt.cpp}::GetAffordanceTitleRect ( const wxRect &  rect)

Definition at line 45 of file TrackArt.cpp.

46 {
47 constexpr int FrameThickness{ 1 };
48 return wxRect(
49 rect.GetLeft() + TrackArt::ClipFrameRadius,
50 rect.GetTop() + ClipSelectionStrokeSize + FrameThickness,
51 rect.GetWidth() - TrackArt::ClipFrameRadius * 2,
52 rect.GetHeight() - ClipSelectionStrokeSize - FrameThickness);
53 }
static constexpr int ClipSelectionStrokeSize
Definition: TrackArt.cpp:38
static constexpr int ClipFrameRadius
Definition: TrackArt.h:24

References TrackArt::ClipFrameRadius, and ClipSelectionStrokeSize.

Referenced by GetClipAffordanceRect().

Here is the caller graph for this function:

◆ GetClipAffordanceRect()

wxRect anonymous_namespace{TrackArt.cpp}::GetClipAffordanceRect ( wxDC &  dc,
const wxRect &  clipRect,
std::optional< wxRect > &  clippedClipRect 
)

Definition at line 209 of file TrackArt.cpp.

211{
212 wxRect tmp;
213 const auto hasClipRect = dc.GetClippingBox(tmp);
214 if (hasClipRect)
215 clippedClipRect = tmp;
216 return hasClipRect ?
217 // avoid drawing text outside the clipping rectangle if possible
218 GetAffordanceTitleRect(clipRect.Intersect(*clippedClipRect)) :
219 GetAffordanceTitleRect(clipRect);
220}
wxRect GetAffordanceTitleRect(const wxRect &rect)
Definition: TrackArt.cpp:45

References GetAffordanceTitleRect().

Referenced by TrackArt::DrawClipAffordance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClipTruncatedTitleRect()

wxRect anonymous_namespace{TrackArt.cpp}::GetClipTruncatedTitleRect ( wxDC &  dc,
const wxRect &  affordanceRect,
const wxString &  title 
)

Definition at line 277 of file TrackArt.cpp.

279{
280 const auto alignLeft =
281 wxTheApp->GetLayoutDirection() == wxLayout_LeftToRight;
282 const auto width = dc.GetTextExtent(title).GetWidth();
283 const auto left =
284 alignLeft ? affordanceRect.GetLeft() : affordanceRect.GetRight() - width;
285 return { left, affordanceRect.GetTop(), width, affordanceRect.GetHeight() };
286}
static const auto title

References title.

Referenced by TrackArt::DrawClipTitle().

Here is the caller graph for this function:

◆ GetProject()

const AudacityProject & anonymous_namespace{TrackArt.cpp}::GetProject ( const Track track)

Definition at line 479 of file TrackArt.cpp.

480{
481 // Track is expected to have owner
482 assert(track.GetOwner());
483 // TrackList is expected to have owner
484 assert(track.GetOwner()->GetOwner());
485
486 return *track.GetOwner()->GetOwner();
487}
std::shared_ptr< TrackList > GetOwner() const
Definition: Track.h:230

References Track::GetOwner().

Referenced by TrackArt::DrawBackgroundWithSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTruncatedTitle()

wxString anonymous_namespace{TrackArt.cpp}::GetTruncatedTitle ( wxDC &  dc,
const wxString &  title,
const wxRect &  affordanceRect 
)

Definition at line 56 of file TrackArt.cpp.

57{
58 if (affordanceRect.IsEmpty() || title.empty())
59 return wxEmptyString;
60 return TrackArt::TruncateText(dc, title, affordanceRect.GetWidth());
61}
AUDACITY_DLL_API wxString TruncateText(wxDC &dc, const wxString &text, const int maxWidth)
Definition: TrackArt.cpp:173

References title, and TrackArt::TruncateText().

Referenced by TrackArt::DrawClipTitle().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ minSubdivisionWidth

constexpr double anonymous_namespace{TrackArt.cpp}::minSubdivisionWidth = 12.0
constexpr