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

Functions

int totalTCPLines (const TCPLines &lines, bool omitLastExtra)
 
std::pair< int, int > CalcBottomItemY (const TCPLines &lines, unsigned iItem, int height)
 
void DrawToolButtonBackground (TrackPanelDrawingContext &context, const wxRect &rect, bool captured)
 

Variables

constexpr auto Padding = 2
 
const TrackInfo::TCPLine defaultCommonTrackTCPBottomLines []
 
TCPLines commonTrackTCPBottomLines { RANGE(defaultCommonTrackTCPBottomLines) }
 

Function Documentation

◆ CalcBottomItemY()

std::pair< int, int > anonymous_namespace{CommonTrackInfo.cpp}::CalcBottomItemY ( const TCPLines lines,
unsigned  iItem,
int  height 
)

Definition at line 93 of file CommonTrackInfo.cpp.

95{
96 int y = height;
97 auto pLines = lines.begin();
98 while ( pLines != lines.end() &&
99 0 == (pLines->items & iItem) ) {
100 y -= pLines->height + pLines->extraSpace;
101 ++pLines;
102 }
103 if (pLines != lines.end())
104 y -= (pLines->height + pLines->extraSpace );
105 return { y, pLines->height };
106}

Referenced by CommonTrackInfo::GetSyncLockIconRect(), and CommonTrackInfo::HideTopItem().

Here is the caller graph for this function:

◆ DrawToolButtonBackground()

void anonymous_namespace{CommonTrackInfo.cpp}::DrawToolButtonBackground ( TrackPanelDrawingContext context,
const wxRect &  rect,
bool  captured 
)

Definition at line 209 of file CommonTrackInfo.cpp.

210 {
211 const auto hovered = rect.Contains( context.lastState.GetPosition());
212 if(captured && hovered)
213 AColor::DrawFrame(context.dc, rect, theTheme.Bitmap(bmpHiliteButtonSmall), 11);
214 else if(hovered)
215 AColor::DrawFrame(context.dc, rect, theTheme.Bitmap(bmpHiliteUpButtonSmall), 11);
216 }
THEME_API Theme theTheme
Definition: Theme.cpp:82
static void DrawFrame(wxDC &dc, const wxRect &r, wxBitmap &bitmap, int mid)
Definition: AColor.cpp:329
wxBitmap & Bitmap(int iIndex)

References ThemeBase::Bitmap(), TrackPanelDrawingContext::dc, AColor::DrawFrame(), TrackPanelDrawingContext::lastState, and theTheme.

Referenced by CommonTrackInfo::CloseTitleDrawFunction().

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

◆ totalTCPLines()

int anonymous_namespace{CommonTrackInfo.cpp}::totalTCPLines ( const TCPLines lines,
bool  omitLastExtra 
)

Definition at line 66 of file CommonTrackInfo.cpp.

67{
68 int total = 0;
69 int lastExtra = 0;
70 for ( const auto line : lines ) {
71 lastExtra = line.extraSpace;
72 total += line.height + lastExtra;
73 }
74 if (omitLastExtra)
75 total -= lastExtra;
76 return total;
77}

Referenced by CommonTrackInfo::DefaultTrackHeight().

Here is the caller graph for this function:

Variable Documentation

◆ commonTrackTCPBottomLines

TCPLines anonymous_namespace{CommonTrackInfo.cpp}::commonTrackTCPBottomLines { RANGE(defaultCommonTrackTCPBottomLines) }

◆ defaultCommonTrackTCPBottomLines

const TrackInfo::TCPLine anonymous_namespace{CommonTrackInfo.cpp}::defaultCommonTrackTCPBottomLines[]
Initial value:
= {
}
@ kTrackInfoBtnSize
Definition: ViewInfo.h:98
AUDACITY_DLL_API void SyncLockDrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)

Definition at line 84 of file CommonTrackInfo.cpp.

◆ Padding

constexpr auto anonymous_namespace{CommonTrackInfo.cpp}::Padding = 2
constexpr