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 switch( iColorIndex %4 )
99 {
100 default:
101 case 0:
102 theTheme.SetPenColour( samplePen, clrSample);
103 theTheme.SetPenColour( rmsPen, clrRms);
104 break;
105 case 1: // RED
106 samplePen.SetColour( wxColor( 160,10,10 ) );
107 rmsPen.SetColour( wxColor( 230,80,80 ) );
108 break;
109 case 2: // GREEN
110 samplePen.SetColour( wxColor( 35,110,35 ) );
111 rmsPen.SetColour( wxColor( 75,200,75 ) );
112 break;
113 case 3: //BLACK
114 samplePen.SetColour( wxColor( 0,0,0 ) );
115 rmsPen.SetColour( wxColor( 100,100,100 ) );
116 break;
117
118 }
119}
120
122{
123 if( id == ShowClippingPrefsID())
124 mShowClipping = gPrefs->Read(wxT("/GUI/ShowClipping"), mShowClipping);
126 mbShowTrackNameInTrack = gPrefs->ReadBool(wxT("/GUI/ShowTrackNameInWaveform"), false);
127}
128
130{
133
136
137 SetColours(0);
138}
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:295
int ShowClippingPrefsID()
Definition: GUIPrefs.cpp:289
FileConfig * gPrefs
Definition: Prefs.cpp:70
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:200
const T & GetDefault() const
Definition: Prefs.h:192
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:39
wxBrush blankBrush
Definition: TrackArtist.h:81
wxPen odProgressDonePen
Definition: TrackArtist.h:98
wxPen rmsPen
Definition: TrackArtist.h:93
wxPen unselectedPen
Definition: TrackArtist.h:90
float mdBrange
Definition: TrackArtist.h:76
wxPen muteSamplePen
Definition: TrackArtist.h:96
wxBrush sampleBrush
Definition: TrackArtist.h:84
bool mbShowTrackNameInTrack
Definition: TrackArtist.h:79
wxPen muteClippedPen
Definition: TrackArtist.h:101
wxBrush selectedBrush
Definition: TrackArtist.h:83
wxPen selectedPen
Definition: TrackArtist.h:91
wxPen samplePen
Definition: TrackArtist.h:92
wxPen odProgressNotYetPen
Definition: TrackArtist.h:97
wxPen clippedPen
Definition: TrackArtist.h:100
wxBrush selsampleBrush
Definition: TrackArtist.h:85
wxPen shadowPen
Definition: TrackArtist.h:99
TrackArtist(TrackPanel *parent_)
Definition: TrackArtist.cpp:53
wxPen blankPen
Definition: TrackArtist.h:89
wxPen muteRmsPen
Definition: TrackArtist.h:94
bool mShowClipping
Definition: TrackArtist.h:77
void SetColours(int iColorIndex)
Definition: TrackArtist.cpp:74
int mSampleDisplay
Definition: TrackArtist.h:78
wxBrush dragsampleBrush
Definition: TrackArtist.h:86
wxPen selsamplePen
Definition: TrackArtist.h:95
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:69
wxBrush unselectedBrush
Definition: TrackArtist.h:82
wxBrush blankSelectedBrush
Definition: TrackArtist.h:88
void UpdateSelectedPrefs(int id) override
void UpdatePrefs() override
wxPen blankSelectedPen
Definition: TrackArtist.h:102
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:65
static WaveTrackViewConstants::SampleDisplay SampleViewChoice()