Audacity  3.0.3
TrackArtist.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  TrackArtist.cpp
6 
7  Dominic Mazzoni
8 
9 
10 *******************************************************************//*******************************************************************/
40 
41 
42 #include "TrackArtist.h"
43 
44 
45 
46 #include "AColor.h"
47 #include "AllThemeResources.h"
48 #include "prefs/GUIPrefs.h"
49 #include "Theme.h"
50 #include "Track.h"
52 #include "ViewInfo.h"
53 
54 #include "Decibels.h"
55 #include "prefs/TracksPrefs.h"
56 
57 #include <wx/app.h>
58 #include <wx/dc.h>
59 
60 //Thickness of the clip frame outline, shown when clip is dragged
61 static constexpr int ClipSelectionStrokeSize{ 1 };//px
62 
64  : parent( parent_ )
65 {
67  mShowClipping = false;
68  mSampleDisplay = 1;// Stem plots by default.
69 
70  SetColours(0);
71 
72  UpdatePrefs();
73 }
74 
76 {
77 }
78 
80 {
81  return static_cast< TrackArtist* >( context.pUserData );
82 }
83 
84 void TrackArtist::SetColours( int iColorIndex)
85 {
86  theTheme.SetBrushColour( blankBrush, clrBlank );
87  theTheme.SetBrushColour( unselectedBrush, clrUnselected);
88  theTheme.SetBrushColour( selectedBrush, clrSelected);
89  theTheme.SetBrushColour( sampleBrush, clrSample);
90  theTheme.SetBrushColour( selsampleBrush, clrSelSample);
91  theTheme.SetBrushColour( dragsampleBrush, clrDragSample);
92  theTheme.SetBrushColour( blankSelectedBrush, clrBlankSelected);
93 
94  theTheme.SetPenColour( blankPen, clrBlank);
95  theTheme.SetPenColour( unselectedPen, clrUnselected);
96  theTheme.SetPenColour( selectedPen, clrSelected);
97  theTheme.SetPenColour( muteSamplePen, clrMuteSample);
98  theTheme.SetPenColour( odProgressDonePen, clrProgressDone);
99  theTheme.SetPenColour( odProgressNotYetPen, clrProgressNotYet);
100  theTheme.SetPenColour( shadowPen, clrShadow);
101  theTheme.SetPenColour( clippedPen, clrClipped);
102  theTheme.SetPenColour( muteClippedPen, clrMuteClipped);
103  theTheme.SetPenColour( blankSelectedPen,clrBlankSelected);
104 
105  theTheme.SetPenColour( selsamplePen, clrSelSample);
106  theTheme.SetPenColour( muteRmsPen, clrMuteRms);
107 
108  switch( iColorIndex %4 )
109  {
110  default:
111  case 0:
112  theTheme.SetPenColour( samplePen, clrSample);
113  theTheme.SetPenColour( rmsPen, clrRms);
114  break;
115  case 1: // RED
116  samplePen.SetColour( wxColor( 160,10,10 ) );
117  rmsPen.SetColour( wxColor( 230,80,80 ) );
118  break;
119  case 2: // GREEN
120  samplePen.SetColour( wxColor( 35,110,35 ) );
121  rmsPen.SetColour( wxColor( 75,200,75 ) );
122  break;
123  case 3: //BLACK
124  samplePen.SetColour( wxColor( 0,0,0 ) );
125  rmsPen.SetColour( wxColor( 100,100,100 ) );
126  break;
127 
128  }
129 }
130 
136 int GetWaveYPos(float value, float min, float max,
137  int height, bool dB, bool outer,
138  float dBr, bool clip)
139 {
140  if (dB) {
141  if (height == 0) {
142  return 0;
143  }
144 
145  float sign = (value >= 0 ? 1 : -1);
146 
147  if (value != 0.) {
148  float db = LINEAR_TO_DB(fabs(value));
149  value = (db + dBr) / dBr;
150  if (!outer) {
151  value -= 0.5;
152  }
153  if (value < 0.0) {
154  value = 0.0;
155  }
156  value *= sign;
157  }
158  }
159  else {
160  if (!outer) {
161  if (value >= 0.0) {
162  value -= 0.5;
163  }
164  else {
165  value += 0.5;
166  }
167  }
168  }
169 
170  if (clip) {
171  if (value < min) {
172  value = min;
173  }
174  if (value > max) {
175  value = max;
176  }
177  }
178 
179  value = (max - value) / (max - min);
180  return (int) (value * (height - 1) + 0.5);
181 }
182 
183 float FromDB(float value, double dBRange)
184 {
185  if (value == 0)
186  return 0;
187 
188  double sign = (value >= 0 ? 1 : -1);
189  return DB_TO_LINEAR((fabs(value) * dBRange) - dBRange) * sign;
190 }
191 
192 float ValueOfPixel(int yy, int height, bool offset,
193  bool dB, double dBRange, float zoomMin, float zoomMax)
194 {
195  wxASSERT(height > 0);
196  // Map 0 to max and height - 1 (not height) to min
197  float v =
198  height == 1 ? (zoomMin + zoomMax) / 2 :
199  zoomMax - (yy / (float)(height - 1)) * (zoomMax - zoomMin);
200  if (offset) {
201  if (v > 0.0)
202  v += .5;
203  else
204  v -= .5;
205  }
206 
207  if (dB)
208  v = FromDB(v, dBRange);
209 
210  return v;
211 }
212 
214  TrackPanelDrawingContext &context, const wxRect &rect )
215 {
216  auto &dc = context.dc;
217 
218  // Draws two black arrows on the left side of the track to
219  // indicate the user that the track has been time-shifted
220  // to the left beyond t=0.0.
221 
222  dc.SetPen(*wxBLACK_PEN);
223  AColor::Line(dc,
224  rect.x + 2, rect.y + 6,
225  rect.x + 8, rect.y + 6);
226  AColor::Line(dc,
227  rect.x + 2, rect.y + 6,
228  rect.x + 6, rect.y + 2);
229  AColor::Line(dc,
230  rect.x + 2, rect.y + 6,
231  rect.x + 6, rect.y + 10);
232  AColor::Line(dc,
233  rect.x + 2, rect.y + rect.height - 8,
234  rect.x + 8, rect.y + rect.height - 8);
235  AColor::Line(dc,
236  rect.x + 2, rect.y + rect.height - 8,
237  rect.x + 6, rect.y + rect.height - 4);
238  AColor::Line(dc,
239  rect.x + 2, rect.y + rect.height - 8,
240  rect.x + 6, rect.y + rect.height - 12);
241 }
242 
243 wxString TrackArt::TruncateText(wxDC& dc, const wxString& text, const int maxWidth)
244 {
245  static const wxString ellipsis = "\u2026";
246 
247  if (dc.GetTextExtent(text).GetWidth() <= maxWidth)
248  return text;
249 
250  auto left = 0;
251  //no need to check text + '...'
252  auto right = static_cast<int>(text.Length() - 2);
253 
254  while (left <= right)
255  {
256  auto middle = (left + right) / 2;
257  auto str = text.SubString(0, middle).Trim() + ellipsis;
258  auto strWidth = dc.GetTextExtent(str).GetWidth();
259  if (strWidth < maxWidth)
260  //if left == right (== middle), then exit loop
261  //with right equals to the last knwon index for which
262  //strWidth < maxWidth
263  left = middle + 1;
264  else if (strWidth > maxWidth)
265  //if right == left (== middle), then exit loop with
266  //right equals to (left - 1), which is the last known
267  //index for which (strWidth < maxWidth) or -1
268  right = middle - 1;
269  else
270  return str;
271  }
272  if (right >= 0)
273  return text.SubString(0, right).Trim() + ellipsis;
274 
275  return wxEmptyString;
276 }
277 
278 
279 #ifdef USE_MIDI
280 #endif // USE_MIDI
281 
282 
284 {
285  if( id == ShowClippingPrefsID())
286  mShowClipping = gPrefs->Read(wxT("/GUI/ShowClipping"), mShowClipping);
287  if( id == ShowTrackNameInWaveformPrefsID())
288  mbShowTrackNameInTrack = gPrefs->ReadBool(wxT("/GUI/ShowTrackNameInWaveform"), false);
289 }
290 
292 {
295 
298 
299  SetColours(0);
300 }
301 
302 void TrackArt::DrawClipAffordance(wxDC& dc, const wxRect& rect, const wxString& title, bool highlight, bool selected)
303 {
304  if (selected)
305  {
306  wxRect strokeRect{
307  rect.x - ClipSelectionStrokeSize,
308  rect.y,
309  rect.width + ClipSelectionStrokeSize * 2,
310  rect.height + ClipFrameRadius };
311  dc.SetBrush(*wxTRANSPARENT_BRUSH);
312  AColor::UseThemeColour(&dc, clrClipAffordanceStroke, clrClipAffordanceStroke);
313  dc.DrawRoundedRectangle(strokeRect, ClipFrameRadius);
314  }
315 
316  AColor::UseThemeColour(&dc, highlight ? clrClipAffordanceActiveBrush : clrClipAffordanceInactiveBrush, clrClipAffordanceOutlinePen);
317  dc.DrawRoundedRectangle(wxRect(rect.x, rect.y + ClipSelectionStrokeSize, rect.width, rect.height + ClipFrameRadius), ClipFrameRadius);
318 
319  if (!title.empty())
320  {
321  auto titleRect = TrackArt::GetAffordanceTitleRect(rect);
322 
323  auto truncatedTitle = TrackArt::TruncateText(dc, title, titleRect.GetWidth());
324  if (!truncatedTitle.empty())
325  {
326  auto hAlign = wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ? wxALIGN_RIGHT : wxALIGN_LEFT;
327  dc.DrawLabel(truncatedTitle, titleRect, hAlign | wxALIGN_CENTER_VERTICAL);
328  }
329  }
330 }
331 
332 AUDACITY_DLL_API wxRect TrackArt::GetAffordanceTitleRect(const wxRect& rect)
333 {
334  constexpr int FrameThickness{ 1 };
335  return wxRect(
336  rect.GetLeft() + ClipFrameRadius,
337  rect.GetTop() + ClipSelectionStrokeSize + FrameThickness,
338  rect.GetWidth() - ClipFrameRadius * 2,
339  rect.GetHeight() - ClipSelectionStrokeSize - FrameThickness);
340 }
341 
342 void TrackArt::DrawClipEdges(wxDC& dc, const wxRect& clipRect, bool selected)
343 {
344  dc.SetBrush(*wxTRANSPARENT_BRUSH);
345  {
346  AColor::UseThemeColour(&dc, -1, clrClipAffordanceOutlinePen);
347  AColor::Line(dc,
348  clipRect.GetLeft(), clipRect.GetTop(),
349  clipRect.GetLeft(), clipRect.GetBottom());
350  AColor::Line(dc,
351  clipRect.GetRight(), clipRect.GetTop(),
352  clipRect.GetRight(), clipRect.GetBottom());
353  }
354  if(selected)
355  {
356  if constexpr (ClipSelectionStrokeSize == 1)
357  {
358  AColor::UseThemeColour(&dc, -1, clrClipAffordanceStroke);
359  AColor::Line(dc,
360  clipRect.GetLeft() - ClipSelectionStrokeSize, clipRect.GetTop(),
361  clipRect.GetLeft() - ClipSelectionStrokeSize, clipRect.GetBottom());
362  AColor::Line(dc,
363  clipRect.GetRight() + ClipSelectionStrokeSize, clipRect.GetTop(),
364  clipRect.GetRight() + ClipSelectionStrokeSize, clipRect.GetBottom());
365  }
366  else if constexpr (ClipSelectionStrokeSize > 1)
367  {
368  AColor::UseThemeColour(&dc, clrClipAffordanceStroke, clrClipAffordanceStroke);
369  dc.DrawRectangle(wxRect(
370  clipRect.GetLeft() - ClipSelectionStrokeSize, clipRect.GetTop(),
371  ClipSelectionStrokeSize, clipRect.GetHeight()));
372  dc.DrawRectangle(wxRect(
373  clipRect.GetRight() + 1, clipRect.GetTop(),
374  ClipSelectionStrokeSize, clipRect.GetHeight()));
375  }
376  }
377 }
378 
379 // Draws the sync-lock bitmap, tiled; always draws stationary relative to the DC
380 //
381 // AWD: now that the tiles don't link together, we're drawing a tilted grid, at
382 // two steps down for every one across. This creates a pattern that repeats in
383 // 5-step by 5-step boxes. Because we're only drawing in 5/25 possible positions
384 // we have a grid spacing somewhat smaller than the image dimensions. Thus we
385 // achieve lower density than with a square grid and eliminate edge cases where
386 // no tiles are displayed.
387 //
388 // The pattern draws in tiles at (0,0), (2,1), (4,2), (1,3), and (3,4) in each
389 // 5x5 box.
390 //
391 // There may be a better way to do this, or a more appealing pattern.
393  TrackPanelDrawingContext &context, const wxRect &rect )
394 {
395  const auto dc = &context.dc;
396 
397  wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockSelTile));
398 
399  // Grid spacing is a bit smaller than actual image size
400  int gridW = syncLockBitmap.GetWidth() - 6;
401  int gridH = syncLockBitmap.GetHeight() - 8;
402 
403  // Horizontal position within the grid, modulo its period
404  int blockX = (rect.x / gridW) % 5;
405 
406  // Amount to offset drawing of first column
407  int xOffset = rect.x % gridW;
408  if (xOffset < 0) xOffset += gridW;
409 
410  // Check if we're missing an extra column to the left (this can happen
411  // because the tiles are bigger than the grid spacing)
412  bool extraCol = false;
413  if (syncLockBitmap.GetWidth() - gridW > xOffset) {
414  extraCol = true;
415  xOffset += gridW;
416  blockX = (blockX - 1) % 5;
417  }
418  // Make sure blockX is non-negative
419  if (blockX < 0) blockX += 5;
420 
421  int xx = 0;
422  while (xx < rect.width) {
423  int width = syncLockBitmap.GetWidth() - xOffset;
424  if (xx + width > rect.width)
425  width = rect.width - xx;
426 
427  //
428  // Draw each row in this column
429  //
430 
431  // Vertical position in the grid, modulo its period
432  int blockY = (rect.y / gridH) % 5;
433 
434  // Amount to offset drawing of first row
435  int yOffset = rect.y % gridH;
436  if (yOffset < 0) yOffset += gridH;
437 
438  // Check if we're missing an extra row on top (this can happen because
439  // the tiles are bigger than the grid spacing)
440  bool extraRow = false;
441  if (syncLockBitmap.GetHeight() - gridH > yOffset) {
442  extraRow = true;
443  yOffset += gridH;
444  blockY = (blockY - 1) % 5;
445  }
446  // Make sure blockY is non-negative
447  if (blockY < 0) blockY += 5;
448 
449  int yy = 0;
450  while (yy < rect.height)
451  {
452  int height = syncLockBitmap.GetHeight() - yOffset;
453  if (yy + height > rect.height)
454  height = rect.height - yy;
455 
456  // AWD: draw blocks according to our pattern
457  if ((blockX == 0 && blockY == 0) || (blockX == 2 && blockY == 1) ||
458  (blockX == 4 && blockY == 2) || (blockX == 1 && blockY == 3) ||
459  (blockX == 3 && blockY == 4))
460  {
461 
462  // Do we need to get a sub-bitmap?
463  if (width != syncLockBitmap.GetWidth() || height != syncLockBitmap.GetHeight()) {
464  wxBitmap subSyncLockBitmap =
465  syncLockBitmap.GetSubBitmap(wxRect(xOffset, yOffset, width, height));
466  dc->DrawBitmap(subSyncLockBitmap, rect.x + xx, rect.y + yy, true);
467  }
468  else {
469  dc->DrawBitmap(syncLockBitmap, rect.x + xx, rect.y + yy, true);
470  }
471  }
472 
473  // Updates for next row
474  if (extraRow) {
475  // Second offset row, still at y = 0; no more extra rows
476  yOffset -= gridH;
477  extraRow = false;
478  }
479  else {
480  // Move on in y, no more offset rows
481  yy += gridH - yOffset;
482  yOffset = 0;
483  }
484  blockY = (blockY + 1) % 5;
485  }
486 
487  // Updates for next column
488  if (extraCol) {
489  // Second offset column, still at x = 0; no more extra columns
490  xOffset -= gridW;
491  extraCol = false;
492  }
493  else {
494  // Move on in x, no more offset rows
495  xx += gridW - xOffset;
496  xOffset = 0;
497  }
498  blockX = (blockX + 1) % 5;
499  }
500 }
501 
503  TrackPanelDrawingContext &context, const wxRect &rect,
504  const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush,
505  bool useSelection)
506 {
507  const auto dc = &context.dc;
508  const auto artist = TrackArtist::Get( context );
509  const auto &selectedRegion = *artist->pSelectedRegion;
510  const auto &zoomInfo = *artist->pZoomInfo;
511 
512  //MM: Draw background. We should optimize that a bit more.
513  const double sel0 = useSelection ? selectedRegion.t0() : 0.0;
514  const double sel1 = useSelection ? selectedRegion.t1() : 0.0;
515 
516  dc->SetPen(*wxTRANSPARENT_PEN);
517  if (track->GetSelected() || track->IsSyncLockSelected())
518  {
519  // Rectangles before, within, after the selection
520  wxRect before = rect;
521  wxRect within = rect;
522  wxRect after = rect;
523 
524  before.width = (int)(zoomInfo.TimeToPosition(sel0) );
525  if (before.GetRight() > rect.GetRight()) {
526  before.width = rect.width;
527  }
528 
529  if (before.width > 0) {
530  dc->SetBrush(unselBrush);
531  dc->DrawRectangle(before);
532 
533  within.x = 1 + before.GetRight();
534  }
535  within.width = rect.x + (int)(zoomInfo.TimeToPosition(sel1) ) - within.x -1;
536 
537  if (within.GetRight() > rect.GetRight()) {
538  within.width = 1 + rect.GetRight() - within.x;
539  }
540 
541  // Bug 2389 - Selection can disappear
542  // This handles case where no waveform is visible.
543  if (within.width < 1)
544  {
545  within.width = 1;
546  }
547 
548  if (within.width > 0) {
549  if (track->GetSelected()) {
550  dc->SetBrush(selBrush);
551  dc->DrawRectangle(within);
552  }
553  else {
554  // Per condition above, track must be sync-lock selected
555  dc->SetBrush(unselBrush);
556  dc->DrawRectangle(within);
557  DrawSyncLockTiles( context, within );
558  }
559 
560  after.x = 1 + within.GetRight();
561  }
562  else {
563  // `within` not drawn; start where it would have gone
564  after.x = within.x;
565  }
566 
567  after.width = 1 + rect.GetRight() - after.x;
568  if (after.width > 0) {
569  dc->SetBrush(unselBrush);
570  dc->DrawRectangle(after);
571  }
572  }
573  else
574  {
575  // Track not selected; just draw background
576  dc->SetBrush(unselBrush);
577  dc->DrawRectangle(rect);
578  }
579 }
580 
582  const wxRect& rect, const Track* track)
583 {
584  const auto dc = &context.dc;
585  const auto artist = TrackArtist::Get(context);
586  const auto& selectedRegion = *artist->pSelectedRegion;
587 
588  if (selectedRegion.isPoint())
589  {
590  const auto& zoomInfo = *artist->pZoomInfo;
591  auto x = static_cast<int>(zoomInfo.TimeToPosition(selectedRegion.t0(), rect.x));
592  if (x >= rect.GetLeft() && x <= rect.GetRight())
593  {
595  AColor::Line(*dc, x, rect.GetTop(), x, rect.GetBottom());
596  }
597  }
598 }
599 
ShowClippingPrefsID
int ShowClippingPrefsID()
Definition: GUIPrefs.cpp:277
TrackArtist::UpdateSelectedPrefs
void UpdateSelectedPrefs(int id) override
Definition: TrackArtist.cpp:283
AColor::UseThemeColour
static void UseThemeColour(wxDC *dc, int iBrush, int iPen=-1, int alpha=255)
Definition: AColor.cpp:283
TrackArtist::clippedPen
wxPen clippedPen
Definition: TrackArtist.h:137
TrackArtist::~TrackArtist
~TrackArtist()
Definition: TrackArtist.cpp:75
AColor::CursorColor
static void CursorColor(wxDC *dc)
Definition: AColor.cpp:374
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
outer
static const wxPoint2DDouble outer[]
Definition: ASlider.cpp:395
TrackArtist::mdBrange
float mdBrange
Definition: TrackArtist.h:113
TrackArtist.h
TrackArtist::muteClippedPen
wxPen muteClippedPen
Definition: TrackArtist.h:138
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
AllThemeResources.h
TrackArt::ClipFrameRadius
static constexpr int ClipFrameRadius
Definition: TrackArtist.h:41
TrackArtist::odProgressNotYetPen
wxPen odProgressNotYetPen
Definition: TrackArtist.h:134
TrackPanelDrawingContext
Definition: TrackPanelDrawingContext.h:22
TracksPrefs.h
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:112
TrackArtist::UpdatePrefs
void UpdatePrefs() override
Definition: TrackArtist.cpp:291
TrackArtist::selectedPen
wxPen selectedPen
Definition: TrackArtist.h:128
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
ShowTrackNameInWaveformPrefsID
int ShowTrackNameInWaveformPrefsID()
Definition: GUIPrefs.cpp:283
FromDB
float FromDB(float value, double dBRange)
Definition: TrackArtist.cpp:183
TrackArtist
This class handles the actual rendering of WaveTracks (both waveforms and spectra),...
Definition: TrackArtist.h:76
TrackPanel
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:67
TrackArtist::rmsPen
wxPen rmsPen
Definition: TrackArtist.h:130
Track::IsSyncLockSelected
bool IsSyncLockSelected() const
Definition: Track.cpp:254
TrackArtist::muteRmsPen
wxPen muteRmsPen
Definition: TrackArtist.h:131
TrackArt::GetAffordanceTitleRect
AUDACITY_DLL_API wxRect GetAffordanceTitleRect(const wxRect &affordanceRect)
Definition: TrackArtist.cpp:332
Setting::Read
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:128
TrackArt::DrawSyncLockTiles
AUDACITY_DLL_API void DrawSyncLockTiles(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArtist.cpp:392
TrackArtist::unselectedBrush
wxBrush unselectedBrush
Definition: TrackArtist.h:119
TrackArt::DrawClipAffordance
AUDACITY_DLL_API void DrawClipAffordance(wxDC &dc, const wxRect &affordanceRect, const wxString &title, bool highlight=false, bool selected=false)
Definition: TrackArtist.cpp:302
TrackArtist::Get
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:79
TrackArtist::mShowClipping
bool mShowClipping
Definition: TrackArtist.h:114
ClipSelectionStrokeSize
static constexpr int ClipSelectionStrokeSize
Definition: TrackArtist.cpp:61
TrackArt::DrawNegativeOffsetTrackArrows
AUDACITY_DLL_API void DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
Definition: TrackArtist.cpp:213
TrackArtist::dragsampleBrush
wxBrush dragsampleBrush
Definition: TrackArtist.h:123
TrackArtist::blankSelectedBrush
wxBrush blankSelectedBrush
Definition: TrackArtist.h:125
Theme.h
TrackArtist::shadowPen
wxPen shadowPen
Definition: TrackArtist.h:136
ThemeBase::SetBrushColour
void SetBrushColour(wxBrush &Brush, int iIndex)
Definition: Theme.cpp:1204
ThemeBase::Image
wxImage & Image(int iIndex)
Definition: Theme.cpp:1223
Setting::GetDefault
const T & GetDefault() const
Definition: Prefs.h:120
Decibels.h
TrackArtist::sampleBrush
wxBrush sampleBrush
Definition: TrackArtist.h:121
TrackArtist::blankBrush
wxBrush blankBrush
Definition: TrackArtist.h:118
TrackArtist::selsampleBrush
wxBrush selsampleBrush
Definition: TrackArtist.h:122
ViewInfo.h
DecibelScaleCutoff
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
Definition: Decibels.cpp:12
Track::GetSelected
bool GetSelected() const
Definition: Track.h:431
TrackArt::DrawCursor
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArtist.cpp:581
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
TrackArt::TruncateText
AUDACITY_DLL_API wxString TruncateText(wxDC &dc, const wxString &text, const int maxWidth)
Definition: TrackArtist.cpp:243
TrackPanelDrawingContext.h
TrackArtist::blankSelectedPen
wxPen blankSelectedPen
Definition: TrackArtist.h:139
TrackArtist::mbShowTrackNameInTrack
bool mbShowTrackNameInTrack
Definition: TrackArtist.h:116
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
TrackPanelDrawingContext::pUserData
void * pUserData
Definition: TrackPanelDrawingContext.h:27
TrackArt::DrawBackgroundWithSelection
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
Definition: TrackArtist.cpp:502
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
TrackArtist::mSampleDisplay
int mSampleDisplay
Definition: TrackArtist.h:115
TrackArtist::SetColours
void SetColours(int iColorIndex)
Definition: TrackArtist.cpp:84
GUIPrefs.h
TracksPrefs::SampleViewChoice
static WaveTrackViewConstants::SampleDisplay SampleViewChoice()
Definition: TracksPrefs.cpp:196
TrackArt::DrawClipEdges
AUDACITY_DLL_API void DrawClipEdges(wxDC &dc, const wxRect &clipRect, bool selected=false)
Definition: TrackArtist.cpp:342
GetWaveYPos
int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
Definition: TrackArtist.cpp:136
TrackArtist::TrackArtist
TrackArtist(TrackPanel *parent_)
Definition: TrackArtist.cpp:63
LINEAR_TO_DB
#define LINEAR_TO_DB(x)
Definition: MemoryX.h:631
Track.h
declares abstract base class Track, TrackList, and iterators over TrackList
TrackArtist::selectedBrush
wxBrush selectedBrush
Definition: TrackArtist.h:120
TrackArtist::blankPen
wxPen blankPen
Definition: TrackArtist.h:126
TrackArtist::muteSamplePen
wxPen muteSamplePen
Definition: TrackArtist.h:133
ValueOfPixel
float ValueOfPixel(int yy, int height, bool offset, bool dB, double dBRange, float zoomMin, float zoomMax)
Definition: TrackArtist.cpp:192
theTheme
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:203
TrackArtist::selsamplePen
wxPen selsamplePen
Definition: TrackArtist.h:132
TrackArtist::samplePen
wxPen samplePen
Definition: TrackArtist.h:129
AColor.h
within
bool within(A a, B b, DIST d)
Definition: TrackPanel.cpp:163
ThemeBase::SetPenColour
void SetPenColour(wxPen &Pen, int iIndex)
Definition: Theme.cpp:1210
TrackArtist::unselectedPen
wxPen unselectedPen
Definition: TrackArtist.h:127
TrackArtist::odProgressDonePen
wxPen odProgressDonePen
Definition: TrackArtist.h:135