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( shadowPen, clrShadow);
91 theTheme.SetPenColour( clippedPen, clrClipped);
92 theTheme.SetPenColour( muteClippedPen, clrMuteClipped);
93 theTheme.SetPenColour( blankSelectedPen,clrBlankSelected);
94
95 theTheme.SetPenColour( selsamplePen, clrSelSample);
96 theTheme.SetPenColour( muteRmsPen, clrMuteRms);
97
98 theTheme.SetPenColour( beatSepearatorPen, clrBeatSeparatorPen );
99 theTheme.SetPenColour( barSepearatorPen, clrBarSeparatorPen );
100 theTheme.SetBrushColour( beatStrongBrush, clrBeatFillStrongBrush );
101 theTheme.SetBrushColour( beatWeakBrush, clrBeatFillWeakBrush );
102 theTheme.SetBrushColour( beatStrongSelBrush, clrBeatFillStrongSelBrush );
103 theTheme.SetBrushColour( beatWeakSelBrush, clrBeatFillWeakSelBrush );
104
105 switch( iColorIndex %4 )
106 {
107 default:
108 case 0:
109 theTheme.SetPenColour( samplePen, clrSample);
110 theTheme.SetPenColour( rmsPen, clrRms);
111 break;
112 case 1: // RED
113 theTheme.SetPenColour( samplePen, clrSample2);
114 theTheme.SetPenColour( rmsPen, clrRms2);
115 break;
116 case 2: // GREEN
117 theTheme.SetPenColour( samplePen, clrSample3);
118 theTheme.SetPenColour( rmsPen, clrRms3);
119 break;
120 case 3: //BLACK
121 theTheme.SetPenColour( samplePen, clrSample4);
122 theTheme.SetPenColour( rmsPen, clrRms4);
123 break;
124
125 }
126}
127
129{
130 if( id == ShowClippingPrefsID())
131 mShowClipping = gPrefs->Read(wxT("/GUI/ShowClipping"), mShowClipping);
133 mbShowTrackNameInTrack = gPrefs->ReadBool(wxT("/GUI/ShowTrackNameInWaveform"), false);
134}
135
137{
140
143
144 SetColours(0);
145}
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 ShowTrackNameInWaveformPrefsID()
Definition: GUIPrefs.cpp:231
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:110
wxBrush blankBrush
Definition: TrackArtist.h:82
wxPen odProgressDonePen
Definition: TrackArtist.h:99
wxPen rmsPen
Definition: TrackArtist.h:94
wxPen unselectedPen
Definition: TrackArtist.h:91
float mdBrange
Definition: TrackArtist.h:77
wxPen muteSamplePen
Definition: TrackArtist.h:97
wxBrush sampleBrush
Definition: TrackArtist.h:85
bool mbShowTrackNameInTrack
Definition: TrackArtist.h:80
wxBrush beatWeakBrush
Definition: TrackArtist.h:108
wxPen muteClippedPen
Definition: TrackArtist.h:102
wxBrush selectedBrush
Definition: TrackArtist.h:84
wxBrush beatStrongSelBrush
Definition: TrackArtist.h:109
wxPen selectedPen
Definition: TrackArtist.h:92
wxBrush beatStrongBrush
Definition: TrackArtist.h:107
wxPen samplePen
Definition: TrackArtist.h:93
wxPen barSepearatorPen
Definition: TrackArtist.h:106
wxPen odProgressNotYetPen
Definition: TrackArtist.h:98
wxPen clippedPen
Definition: TrackArtist.h:101
wxBrush selsampleBrush
Definition: TrackArtist.h:86
wxPen shadowPen
Definition: TrackArtist.h:100
TrackArtist(TrackPanel *parent_)
Definition: TrackArtist.cpp:53
wxPen blankPen
Definition: TrackArtist.h:90
wxPen muteRmsPen
Definition: TrackArtist.h:95
bool mShowClipping
Definition: TrackArtist.h:78
void SetColours(int iColorIndex)
Definition: TrackArtist.cpp:74
int mSampleDisplay
Definition: TrackArtist.h:79
wxBrush dragsampleBrush
Definition: TrackArtist.h:87
wxPen selsamplePen
Definition: TrackArtist.h:96
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:69
wxBrush unselectedBrush
Definition: TrackArtist.h:83
wxBrush blankSelectedBrush
Definition: TrackArtist.h:89
void UpdateSelectedPrefs(int id) override
wxPen beatSepearatorPen
Definition: TrackArtist.h:105
void UpdatePrefs() override
wxPen blankSelectedPen
Definition: TrackArtist.h:103
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:63
static WaveChannelViewConstants::SampleDisplay SampleViewChoice()
bool ReadBool(const wxString &key, bool defaultValue) const
virtual bool Read(const wxString &key, bool *value) const =0