Audacity 3.2.0
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#include "AllThemeResources.h"
45#include "prefs/GUIPrefs.h"
46#include "SyncLock.h"
47#include "Theme.h"
49
50#include "Decibels.h"
51#include "prefs/TracksPrefs.h"
52
53namespace
54{
55 void ChangeLightness(wxPen& pen, int ialpha)
56 {
57 pen.SetColour(pen.GetColour().ChangeLightness(ialpha));
58 }
59
60 void ChangeLightness(wxBrush& brush, int ialpha)
61 {
62 brush.SetColour(brush.GetColour().ChangeLightness(ialpha));
63 }
64}
65
67 : parent( parent_ )
68{
70 mSampleDisplay = 1;// Stem plots by default.
71
72 SetColours(0);
73
75}
76
78{
79}
80
82{
83 return static_cast< TrackArtist* >( context.pUserData );
84}
85
86void TrackArtist::SetColours( int iColorIndex)
87{
94 theTheme.SetBrushColour( blankSelectedBrush, clrBlankSelected);
95 theTheme.SetBrushColour( envelopeBackgroundBrush, clrEnvelopeBackground);
98
99 theTheme.SetPenColour( blankPen, clrBlank);
100 theTheme.SetPenColour( unselectedPen, clrUnselected);
101 theTheme.SetPenColour( selectedPen, clrSelected);
102 theTheme.SetPenColour( muteSamplePen, clrMuteSample);
103 theTheme.SetPenColour( odProgressDonePen, clrProgressDone);
104 theTheme.SetPenColour( odProgressNotYetPen, clrProgressNotYet);
105 theTheme.SetPenColour( clippedPen, clrClipped);
106 theTheme.SetPenColour( muteClippedPen, clrMuteClipped);
107 theTheme.SetPenColour( blankSelectedPen,clrBlankSelected);
108
109 theTheme.SetPenColour( selsamplePen, clrSelSample);
110 theTheme.SetPenColour( muteRmsPen, clrMuteRms);
111
112 theTheme.SetPenColour( beatSepearatorPen[0], clrBeatSeparatorPen );
113 theTheme.SetPenColour( beatSepearatorPen[1], clrBeatSeparatorPen );
114 theTheme.SetPenColour( barSepearatorPen[0], clrBarSeparatorPen );
115 theTheme.SetPenColour( barSepearatorPen[1], clrBarSeparatorPen );
116 theTheme.SetBrushColour( beatStrongBrush[0], clrBeatFillStrongBrush );
117 theTheme.SetBrushColour( beatStrongBrush[1], clrBeatFillStrongBrush );
118 theTheme.SetBrushColour( beatWeakBrush[0], clrBeatFillWeakBrush );
119 theTheme.SetBrushColour( beatWeakBrush[1], clrBeatFillWeakBrush );
120 theTheme.SetBrushColour( beatStrongSelBrush[0], clrBeatFillStrongSelBrush );
121 theTheme.SetBrushColour( beatStrongSelBrush[1], clrBeatFillStrongSelBrush );
122 theTheme.SetBrushColour( beatWeakSelBrush[0], clrBeatFillWeakSelBrush );
123 theTheme.SetBrushColour( beatWeakSelBrush[1], clrBeatFillWeakSelBrush );
124
133
134 switch( iColorIndex %4 )
135 {
136 default:
137 case 0:
138 theTheme.SetPenColour( samplePen, clrSample);
139 theTheme.SetPenColour( rmsPen, clrRms);
140 break;
141 case 1: // RED
142 theTheme.SetPenColour( samplePen, clrSample2);
143 theTheme.SetPenColour( rmsPen, clrRms2);
144 break;
145 case 2: // GREEN
146 theTheme.SetPenColour( samplePen, clrSample3);
147 theTheme.SetPenColour( rmsPen, clrRms3);
148 break;
149 case 3: //BLACK
150 theTheme.SetPenColour( samplePen, clrSample4);
151 theTheme.SetPenColour( rmsPen, clrRms4);
152 break;
153
154 }
155}
156
158{
161
162 SetColours(0);
163}
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
Definition: Decibels.cpp:12
THEME_API Theme theTheme
Definition: Theme.cpp:82
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
const T & GetDefault() const
Definition: Prefs.h:199
void SetBrushColour(wxBrush &Brush, int iIndex)
void SetPenColour(wxPen &Pen, int iIndex)
This class handles the actual rendering of WaveTracks (both waveforms and spectra),...
Definition: TrackArtist.h:40
wxBrush blankBrush
Definition: TrackArtist.h:71
wxBrush envelopeBackgroundBrush
Definition: TrackArtist.h:79
wxBrush beatWeakSelBrush[2]
Definition: TrackArtist.h:101
wxPen odProgressDonePen
Definition: TrackArtist.h:91
wxPen rmsPen
Definition: TrackArtist.h:86
wxPen unselectedPen
Definition: TrackArtist.h:83
float mdBrange
Definition: TrackArtist.h:68
wxPen beatSepearatorPen[2]
Definition: TrackArtist.h:96
wxPen muteSamplePen
Definition: TrackArtist.h:89
wxBrush sampleBrush
Definition: TrackArtist.h:74
wxPen barSepearatorPen[2]
Definition: TrackArtist.h:97
wxPen muteClippedPen
Definition: TrackArtist.h:93
wxBrush selectedBrush
Definition: TrackArtist.h:73
wxBrush beatStrongBrush[2]
Definition: TrackArtist.h:98
wxPen selectedPen
Definition: TrackArtist.h:84
wxPen samplePen
Definition: TrackArtist.h:85
wxPen odProgressNotYetPen
Definition: TrackArtist.h:90
wxBrush beatWeakBrush[2]
Definition: TrackArtist.h:99
wxPen clippedPen
Definition: TrackArtist.h:92
wxBrush selsampleBrush
Definition: TrackArtist.h:75
TrackArtist(TrackPanel *parent_)
Definition: TrackArtist.cpp:66
wxPen blankPen
Definition: TrackArtist.h:82
wxPen muteRmsPen
Definition: TrackArtist.h:87
void SetColours(int iColorIndex)
Definition: TrackArtist.cpp:86
wxBrush beatStrongSelBrush[2]
Definition: TrackArtist.h:100
int mSampleDisplay
Definition: TrackArtist.h:69
wxBrush clipAffordanceBackgroundSelBrush
Definition: TrackArtist.h:81
wxBrush dragsampleBrush
Definition: TrackArtist.h:76
wxPen selsamplePen
Definition: TrackArtist.h:88
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:81
wxBrush clipAffordanceBackgroundBrush
Definition: TrackArtist.h:80
wxBrush unselectedBrush
Definition: TrackArtist.h:72
wxBrush blankSelectedBrush
Definition: TrackArtist.h:78
void UpdatePrefs() override
wxPen blankSelectedPen
Definition: TrackArtist.h:94
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:63
static WaveChannelViewConstants::SampleDisplay SampleViewChoice()
void ChangeLightness(wxBrush &brush, int ialpha)
Definition: TrackArtist.cpp:60