60 auto window = wxTheApp->GetTopWindow();
65 gFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
73 gFont.SetPointSize(fontSize);
74 window->GetTextExtent(
_(
"Stereo, 999999Hz"),
75 &textWidth,
nullptr,
nullptr,
nullptr, &
gFont);
77 }
while (textWidth >= allowableWidth);
96#define RANGE(array) (array), (array) + sizeof(array)/sizeof(*(array))
103#ifdef EXPERIMENTAL_DA
130 for (
const auto line : lines ) {
131 lastExtra = line.extraSpace;
132 total += line.height + lastExtra;
145 auto pLines = lines.begin();
146 while ( pLines != lines.end() &&
147 0 == (pLines->items & iItem) ) {
148 y += pLines->height + pLines->extraSpace;
152 if ( pLines != lines.end() )
153 height = pLines->height;
154 return { y, height };
171 (
const TCPLines &lines,
unsigned iItem,
int height )
174 auto pLines = lines.begin();
175 while ( pLines != lines.end() &&
176 0 == (pLines->items & iItem) ) {
177 y -= pLines->height + pLines->extraSpace;
180 if (pLines != lines.end())
181 y -= (pLines->height + pLines->extraSpace );
182 return { y, pLines->height };
210 return subRect.y + subRect.height - allowance >= rect.y + limit;
215 const wxRect &rect,
const Track &track )
222 ( context, rect, &track, topLines, bottomLines );
227 const wxRect &rect,
const Track *pTrack,
228 const std::vector<TCPLine> &topLines,
const std::vector<TCPLine> &bottomLines )
230 auto dc = &context.
dc;
236 for (
const auto &line : topLines ) {
239 rect.width, line.height
243 line.drawFunction( context, itemRect, pTrack );
244 yy += line.height + line.extraSpace;
248 int yy = rect.height;
249 for (
const auto &line : bottomLines ) {
250 yy -= line.height + line.extraSpace;
251 if ( line.drawFunction ) {
254 rect.width, line.height
256 line.drawFunction( context, itemRect, pTrack );
267 auto dc = &context.
dc;
268 bool selected = pTrack ? pTrack->
GetSelected() :
true;
269 bool hit = target && target->
GetTrack().get() == pTrack;
270 bool captured = hit && target->
IsClicked();
271 bool down = captured && bev.Contains( context.
lastState.GetPosition());
274#ifdef EXPERIMENTAL_THEMING
278 dc->SetPen(*wxBLACK_PEN);
280 bev.Inflate( -1, -1 );
284 int ls = bev.x + ((bev.width - s) / 2);
285 int ts = bev.y + ((bev.height - s) / 2);
298 const wxRect &rect,
const Track *pTrack )
300 auto dc = &context.
dc;
301 bool selected = pTrack ? pTrack->
GetSelected() :
true;
313 bool hit = target && target->
GetTrack().get() == pTrack;
314 bool captured = hit && target->IsClicked();
315 bool down = captured && bev.Contains( context.
lastState.GetPosition());
317 pTrack ? pTrack->
GetName() :
_(
"Name");
329 int allowableWidth = rect.width - 32;
331 wxCoord textWidth, textHeight;
332 dc->GetTextExtent(titleStr, &textWidth, &textHeight);
333 while (textWidth > allowableWidth) {
334 titleStr = titleStr.Left(titleStr.length() - 1);
335 dc->GetTextExtent(titleStr, &textWidth, &textHeight);
339 #ifdef EXPERIMENTAL_THEMING
342 wxColour c = *wxBLACK;
352 dc->SetTextForeground( c );
353 dc->SetTextBackground( wxTRANSPARENT );
354 dc->DrawText(titleStr, bev.x + 2, bev.y + (bev.height - textHeight) / 2);
363 bev.GetRight() - s - 3,
364 bev.y + ((bev.height - (s / 2)) / 2),
372 const wxRect &rect,
const Track *pTrack )
374 auto dc = &context.
dc;
375 bool selected = pTrack ? pTrack->
GetSelected() :
true;
383 bool hit = target && target->
GetTrack().get() == pTrack;
384 bool captured = hit && target->IsClicked();
385 bool down = captured && bev.Contains( context.
lastState.GetPosition());
393#ifdef EXPERIMENTAL_THEMING
402 bev.x - 5 + bev.width / 2,
403 bev.y - 2 + bev.height / 2,
412 bool hit = target && target->
GetTrack().get() == pTrack;
413 bool captured = hit && target->IsClicked();
414 bool down = captured && bev.Contains( context.
lastState.GetPosition());
418#ifdef EXPERIMENTAL_THEMING
426 wxString
str =
_(
"Select");
430 dc->GetTextExtent(
str, &textWidth, &textHeight);
432 dc->SetTextForeground( c );
433 dc->SetTextBackground( wxTRANSPARENT );
434 dc->DrawText(
str, bev.x + 2 + (bev.width-textWidth)/2, bev.y + (bev.height - textHeight) / 2);
439 if (syncLockSelected)
441 wxRect syncLockIconRect = rect;
446 dc->DrawBitmap(syncLockBitmap,
447 syncLockIconRect.x + 3,
448 syncLockIconRect.y + 2,
463 dest.y = rect.y + results.first;
464 dest.height = results.second;
472 dest.x = rect.x + closeRect.width + 1;
480 dest.y = rect.y + results.first;
481 dest.height = results.second;
486 dest.x = topleft.x + 6;
493 dest.x = rect.x + space;
509 dest.y = rect.y + results.first;
510 dest.height = results.second;
516 dest.x = rect.x + space;
523 dest.x = dest.x + space + minimizeRect.width;
526 dest.width = rect.width - (space + syncLockRect.width) - (space + minimizeRect.width);
535 dest.y = rect.y + results.first;
536 dest.height = results.second;
542 dest.x = rect.x + rect.width - dest.width;
550 dest.y = rect.y + results.first;
551 dest.height = results.second;
EnumSetting< SoloBehavior > TracksBehaviorsSolo
Extends Track with notions of mute and solo setting.
TrackInfo::TCPLines TCPLines
TrackInfo::TCPLine TCPLine
static Settings & settings()
static const TCPLines & commonTrackTCPLines()
static const int TitleSoloBorderOverlap
static void Arrow(wxDC &dc, wxCoord x, wxCoord y, int width, bool down=true)
static void Bevel2(wxDC &dc, bool up, const wxRect &r, bool bSel=false, bool bHighlight=false)
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void Dark(wxDC *dc, bool selected, bool highlight=false)
std::shared_ptr< ChannelType > GetChannel(size_t iChannel)
Retrieve a channel, cast to the given type.
static ChannelView & Get(Channel &channel)
bool GetMinimized() const
virtual const TCPLines & GetTCPLines() const
static const TCPLines & StaticTCPLines()
A listener notified of changes in preferences.
static bool IsSyncLockSelected(const Track *pTrack)
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)
static TrackControls & Get(Track &track)
Abstract base class for an object holding data associated with points on a time axis.
bool GetSelected() const
Selectedness is always the same for all channels of a group.
const wxString & GetName() const
Name is always the same for all channels of a group.
AUDACITY_DLL_API void GetSliderHorizontalBounds(const wxPoint &topleft, wxRect &dest)
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)
AUDACITY_DLL_API void GetCloseBoxRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetTitleBarRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetSyncLockHorizontalBounds(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void SetTrackInfoFont(wxDC *dc)
AUDACITY_DLL_API void GetCloseBoxHorizontalBounds(const wxRect &rect, wxRect &dest)
std::vector< TCPLine > TCPLines
AUDACITY_DLL_API void GetMinimizeHorizontalBounds(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetMinimizeRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetSelectButtonRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API bool HasSoloButton()
AUDACITY_DLL_API void GetTitleBarHorizontalBounds(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetSyncLockIconRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API unsigned DefaultTrackHeight(const TCPLines &topLines)
AUDACITY_DLL_API void DrawCloseButton(TrackPanelDrawingContext &context, const wxRect &bev, const Track *pTrack, ButtonHandle *target)
AUDACITY_DLL_API void MinimizeSyncLockDrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
AUDACITY_DLL_API void DrawItems(TrackPanelDrawingContext &context, const wxRect &rect, const Track &track)
AUDACITY_DLL_API std::pair< int, int > CalcItemY(const TCPLines &lines, unsigned iItem)
AUDACITY_DLL_API void GetSelectButtonHorizontalBounds(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void CloseTitleDrawFunction(TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
AUDACITY_DLL_API unsigned MinimumTrackHeight()
const TrackInfo::TCPLine defaultCommonTrackTCPBottomLines[]
TCPLines commonTrackTCPBottomLines
int totalTCPLines(const TCPLines &lines, bool omitLastExtra)
std::pair< int, int > CalcBottomItemY(const TCPLines &lines, unsigned iItem, int height)
void UpdatePrefs() override