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
54 : parent( parent_ )
55{
57 mShowClipping = false;
58 mSampleDisplay = 1;// Stem plots by default.
59
60 SetColours(0);
61
63}
64
66{
67}
68
70{
71 return static_cast< TrackArtist* >( context.pUserData );
72}
73
74void TrackArtist::SetColours( int iColorIndex)
75{
82 theTheme.SetBrushColour( blankSelectedBrush, clrBlankSelected);
83
84 theTheme.SetPenColour( blankPen, clrBlank);
85 theTheme.SetPenColour( unselectedPen, clrUnselected);
86 theTheme.SetPenColour( selectedPen, clrSelected);
87 theTheme.SetPenColour( muteSamplePen, clrMuteSample);
88 theTheme.SetPenColour( odProgressDonePen, clrProgressDone);
89 theTheme.SetPenColour( odProgressNotYetPen, clrProgressNotYet);
90 theTheme.SetPenColour( clippedPen, clrClipped);
91 theTheme.SetPenColour( muteClippedPen, clrMuteClipped);
92 theTheme.SetPenColour( blankSelectedPen,clrBlankSelected);
93
94 theTheme.SetPenColour( selsamplePen, clrSelSample);
95 theTheme.SetPenColour( muteRmsPen, clrMuteRms);
96
97 theTheme.SetPenColour( beatSepearatorPen, clrBeatSeparatorPen );
98 theTheme.SetPenColour( barSepearatorPen, clrBarSeparatorPen );
99 theTheme.SetBrushColour( beatStrongBrush, clrBeatFillStrongBrush );
100 theTheme.SetBrushColour( beatWeakBrush, clrBeatFillWeakBrush );
101 theTheme.SetBrushColour( beatStrongSelBrush, clrBeatFillStrongSelBrush );
102 theTheme.SetBrushColour( beatWeakSelBrush, clrBeatFillWeakSelBrush );
103
104 switch( iColorIndex %4 )
105 {
106 default:
107 case 0:
108 theTheme.SetPenColour( samplePen, clrSample);
109 theTheme.SetPenColour( rmsPen, clrRms);
110 break;
111 case 1: // RED
112 theTheme.SetPenColour( samplePen, clrSample2);
113 theTheme.SetPenColour( rmsPen, clrRms2);
114 break;
115 case 2: // GREEN
116 theTheme.SetPenColour( samplePen, clrSample3);
117 theTheme.SetPenColour( rmsPen, clrRms3);
118 break;
119 case 3: //BLACK
120 theTheme.SetPenColour( samplePen, clrSample4);
121 theTheme.SetPenColour( rmsPen, clrRms4);
122 break;
123
124 }
125}
126
128{
129 if( id == ShowClippingPrefsID())
130 mShowClipping = gPrefs->Read(wxT("/GUI/ShowClipping"), mShowClipping);
131}
132
134{
137
139
140 SetColours(0);
141}
wxT("CloseDown"))
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
Definition: Decibels.cpp:12
int ShowClippingPrefsID()
Definition: GUIPrefs.cpp:225
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
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 beatWeakSelBrush
Definition: TrackArtist.h:100
wxBrush blankBrush
Definition: TrackArtist.h:73
wxPen odProgressDonePen
Definition: TrackArtist.h:90
wxPen rmsPen
Definition: TrackArtist.h:85
wxPen unselectedPen
Definition: TrackArtist.h:82
float mdBrange
Definition: TrackArtist.h:69
wxPen muteSamplePen
Definition: TrackArtist.h:88
wxBrush sampleBrush
Definition: TrackArtist.h:76
wxBrush beatWeakBrush
Definition: TrackArtist.h:98
wxPen muteClippedPen
Definition: TrackArtist.h:92
wxBrush selectedBrush
Definition: TrackArtist.h:75
wxBrush beatStrongSelBrush
Definition: TrackArtist.h:99
wxPen selectedPen
Definition: TrackArtist.h:83
wxBrush beatStrongBrush
Definition: TrackArtist.h:97
wxPen samplePen
Definition: TrackArtist.h:84
wxPen barSepearatorPen
Definition: TrackArtist.h:96
wxPen odProgressNotYetPen
Definition: TrackArtist.h:89
wxPen clippedPen
Definition: TrackArtist.h:91
wxBrush selsampleBrush
Definition: TrackArtist.h:77
TrackArtist(TrackPanel *parent_)
Definition: TrackArtist.cpp:53
wxPen blankPen
Definition: TrackArtist.h:81
wxPen muteRmsPen
Definition: TrackArtist.h:86
bool mShowClipping
Definition: TrackArtist.h:70
void SetColours(int iColorIndex)
Definition: TrackArtist.cpp:74
int mSampleDisplay
Definition: TrackArtist.h:71
wxBrush dragsampleBrush
Definition: TrackArtist.h:78
wxPen selsamplePen
Definition: TrackArtist.h:87
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:69
wxBrush unselectedBrush
Definition: TrackArtist.h:74
wxBrush blankSelectedBrush
Definition: TrackArtist.h:80
void UpdateSelectedPrefs(int id) override
wxPen beatSepearatorPen
Definition: TrackArtist.h:95
void UpdatePrefs() override
wxPen blankSelectedPen
Definition: TrackArtist.h:93
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:63
static WaveChannelViewConstants::SampleDisplay SampleViewChoice()
virtual bool Read(const wxString &key, bool *value) const =0