Audacity 3.2.0
|
This class handles the actual rendering of WaveTracks (both waveforms and spectra), NoteTracks, LabelTracks and TimeTracks. More...
#include <TrackArtist.h>
Public Types | |
enum | : unsigned { PassTracks , PassMargins , PassBorders , PassControls , PassZooming , PassBackground , PassFocus , PassSnapping , NPasses } |
Public Member Functions | |
TrackArtist (TrackPanel *parent_) | |
~TrackArtist () | |
void | SetColours (int iColorIndex) |
void | UpdatePrefs () override |
Static Public Member Functions | |
static TrackArtist * | Get (TrackPanelDrawingContext &) |
Additional Inherited Members | |
Private Member Functions inherited from PrefsListener | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
virtual void | UpdateSelectedPrefs (int id) |
Static Private Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
This class handles the actual rendering of WaveTracks (both waveforms and spectra), NoteTracks, LabelTracks and TimeTracks.
It's actually a little harder than it looks, because for waveforms at least it needs to cache the samples that are currently on-screen.
How Audacity Redisplay Works
Roger Dannenberg
Oct 2010
In my opinion, the bitmap should contain only the waveform, note, and label images along with gray selection highlights. The track info (sliders, buttons, title, etc.), track selection highlight, cursor, and indicator should be drawn in the normal way, and clipping regions should be used to avoid excessive copying of bitmaps (say, when sliders move), or excessive redrawing of track info widgets (say, when scrolling occurs). This is a fairly tricky code change since it requires careful specification of what and where redraw should take place when any state changes. One surprising finding is that NoteTrack display is slow compared to WaveTrack display. Each note takes some time to gather attributes and select colors, and while audio draws two amplitudes per horizontal pixels, large MIDI scores can have more notes than horizontal pixels. This can make slider changes very sluggish, but this can also be a problem with many audio tracks.
Definition at line 40 of file TrackArtist.h.
anonymous enum : unsigned |
Enumerator | |
---|---|
PassTracks | |
PassMargins | |
PassBorders | |
PassControls | |
PassZooming | |
PassBackground | |
PassFocus | |
PassSnapping | |
NPasses |
Definition at line 44 of file TrackArtist.h.
TrackArtist::TrackArtist | ( | TrackPanel * | parent_ | ) |
Definition at line 66 of file TrackArtist.cpp.
References DecibelScaleCutoff, Setting< T >::GetDefault(), mdBrange, mSampleDisplay, SetColours(), and UpdatePrefs().
TrackArtist::~TrackArtist | ( | ) |
Definition at line 77 of file TrackArtist.cpp.
|
static |
Definition at line 81 of file TrackArtist.cpp.
References TrackPanelDrawingContext::pUserData.
Referenced by SpectrumView::DoDraw(), WaveformView::DoDraw(), LabelTrackView::Draw(), anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::Draw(), TrackPanelResizerCell::Draw(), NoteTrackAffordanceControls::Draw(), NoteTrackView::Draw(), NoteTrackVRulerControls::Draw(), HighlitClipButtonHandle::Draw(), SpectrumView::Draw(), WaveformView::Draw(), WaveTrackAffordanceControls::Draw(), TimeTrackView::Draw(), TrackArt::DrawBackgroundWithSelection(), WaveChannelSubView::DrawBoldBoundaries(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), TrackArt::DrawCursor(), anonymous_namespace{TimeTrackView.cpp}::DrawHorzRulerAndCurve(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteBackground(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack(), EnvelopeEditor::DrawPoints(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), anonymous_namespace{WaveformView.cpp}::DrawWaveform(), anonymous_namespace{WaveformView.cpp}::DrawWaveformBackground(), anonymous_namespace{WaveTrackControls.cpp}::PanSliderDrawFunction(), anonymous_namespace{NoteTrackControls.cpp}::VelocitySliderDrawFunction(), and anonymous_namespace{WaveTrackControls.cpp}::VolumeSliderDrawFunction().
void TrackArtist::SetColours | ( | int | iColorIndex | ) |
Definition at line 86 of file TrackArtist.cpp.
References barSepearatorPen, beatSepearatorPen, beatStrongBrush, beatStrongSelBrush, beatWeakBrush, beatWeakSelBrush, blankBrush, blankPen, blankSelectedBrush, blankSelectedPen, anonymous_namespace{TrackArtist.cpp}::ChangeLightness(), clipAffordanceBackgroundBrush, clipAffordanceBackgroundSelBrush, clippedPen, dragsampleBrush, envelopeBackgroundBrush, muteClippedPen, muteRmsPen, muteSamplePen, odProgressDonePen, odProgressNotYetPen, rmsPen, sampleBrush, samplePen, selectedBrush, selectedPen, selsampleBrush, selsamplePen, ThemeBase::SetBrushColour(), ThemeBase::SetPenColour(), theTheme, unselectedBrush, and unselectedPen.
Referenced by TrackArtist(), and UpdatePrefs().
|
overridevirtual |
Implements PrefsListener.
Definition at line 157 of file TrackArtist.cpp.
References DecibelScaleCutoff, mdBrange, mSampleDisplay, Setting< T >::Read(), TracksPrefs::SampleViewChoice(), and SetColours().
Referenced by TrackArtist().
wxPen TrackArtist::barSepearatorPen[2] |
Definition at line 97 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::beatSepearatorPen[2] |
Definition at line 96 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::beatStrongBrush[2] |
Definition at line 98 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::beatStrongSelBrush[2] |
Definition at line 100 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::beatWeakBrush[2] |
Definition at line 99 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::beatWeakSelBrush[2] |
Definition at line 101 of file TrackArtist.h.
Referenced by SetColours().
bool TrackArtist::bigPoints { false } |
Definition at line 119 of file TrackArtist.h.
wxBrush TrackArtist::blankBrush |
Definition at line 71 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::blankPen |
Definition at line 82 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::blankSelectedBrush |
Definition at line 78 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::blankSelectedPen |
Definition at line 94 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::clipAffordanceBackgroundBrush |
Definition at line 80 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::clipAffordanceBackgroundSelBrush |
Definition at line 81 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::clippedPen |
Definition at line 92 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::dragsampleBrush |
Definition at line 76 of file TrackArtist.h.
Referenced by SetColours().
bool TrackArtist::drawEnvelope { false } |
Definition at line 118 of file TrackArtist.h.
bool TrackArtist::drawSliders { false } |
Definition at line 120 of file TrackArtist.h.
wxBrush TrackArtist::envelopeBackgroundBrush |
Definition at line 79 of file TrackArtist.h.
Referenced by SetColours().
bool TrackArtist::hasSolo { false } |
Definition at line 122 of file TrackArtist.h.
float TrackArtist::mdBrange |
Definition at line 68 of file TrackArtist.h.
Referenced by TrackArtist(), and UpdatePrefs().
int TrackArtist::mSampleDisplay |
Definition at line 69 of file TrackArtist.h.
Referenced by TrackArtist(), and UpdatePrefs().
wxPen TrackArtist::muteClippedPen |
Definition at line 93 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::muteRmsPen |
Definition at line 87 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::muteSampleBrush |
Definition at line 77 of file TrackArtist.h.
wxPen TrackArtist::muteSamplePen |
Definition at line 89 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::odProgressDonePen |
Definition at line 91 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::odProgressNotYetPen |
Definition at line 90 of file TrackArtist.h.
Referenced by SetColours().
bool TrackArtist::onBrushTool { false } |
Definition at line 121 of file TrackArtist.h.
TrackPanel* TrackArtist::parent |
Definition at line 65 of file TrackArtist.h.
const PendingTracks* TrackArtist::pPendingTracks {} |
Definition at line 116 of file TrackArtist.h.
const SelectedRegion* TrackArtist::pSelectedRegion {} |
Definition at line 114 of file TrackArtist.h.
ZoomInfo* TrackArtist::pZoomInfo {} |
Definition at line 115 of file TrackArtist.h.
Referenced by EqualizationPanel::OnPaint().
wxPen TrackArtist::rmsPen |
Definition at line 86 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::sampleBrush |
Definition at line 74 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::samplePen |
Definition at line 85 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::selectedBrush |
Definition at line 73 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::selectedPen |
Definition at line 84 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::selsampleBrush |
Definition at line 75 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::selsamplePen |
Definition at line 88 of file TrackArtist.h.
Referenced by SetColours().
wxBrush TrackArtist::unselectedBrush |
Definition at line 72 of file TrackArtist.h.
Referenced by SetColours().
wxPen TrackArtist::unselectedPen |
Definition at line 83 of file TrackArtist.h.
Referenced by SetColours().