Audacity 3.2.0
WavePaintParameters.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 WavePaintParameters.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13#include "graphics/Color.h"
14
15class Envelope;
16
18struct WAVE_TRACK_PAINT_API ColorPair final
19{
24
25 friend WAVE_TRACK_PAINT_API bool
26 operator==(const ColorPair& lhs, const ColorPair& rhs) noexcept;
27 friend WAVE_TRACK_PAINT_API bool
28 operator!=(const ColorPair& lhs, const ColorPair& rhs) noexcept;
29};
30
32struct WAVE_TRACK_PAINT_API WavePaintParameters final
33{
35 const Envelope* AttachedEnvelope { nullptr };
36
38 int Height { 0 };
39
40
42 double Min { -1.0 };
44 double Max { 1.0 };
45
47 double DBRange { 60.0 };
49 bool DBScale { false };
50
52 bool ShowClipping { false };
53
55 bool ShowRMS { false };
56
60
69
71 WavePaintParameters& SetDisplayParameters(int height, double zoomMin, double zoomMax, bool showClipping) noexcept;
73 WavePaintParameters& SetDBParameters(double dbRange, bool dbScale) noexcept;
75 WavePaintParameters& SetBlankColor(graphics::Color color) noexcept;
77 WavePaintParameters& SetZeroLineColor(graphics::Color color) noexcept;
79 WavePaintParameters& SetBackgroundColors(
80 graphics::Color normal, graphics::Color selected) noexcept;
83 SetSampleColors(graphics::Color normal, graphics::Color selected) noexcept;
86 SetRMSColors(graphics::Color normal, graphics::Color selected) noexcept;
89 SetClippingColors(graphics::Color normal, graphics::Color selected) noexcept;
91 WavePaintParameters& SetEnvelope(const Envelope& envelope) noexcept;
93 WavePaintParameters& ResetEnvelope() noexcept;
95 WavePaintParameters& SetShowRMS(bool showRMS) noexcept;
96
97 friend WAVE_TRACK_PAINT_API bool operator==(
98 const WavePaintParameters& lhs,
99 const WavePaintParameters& rhs) noexcept;
100
101 friend WAVE_TRACK_PAINT_API bool operator!=(
102 const WavePaintParameters& lhs,
103 const WavePaintParameters& rhs) noexcept;
104};
bool operator==(const WaveTrackLocation &a, const WaveTrackLocation &b)
bool operator!=(const WaveTrackLocation &a, const WaveTrackLocation &b)
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
Pair of colors for waveform painting.
graphics::Color Normal
Color for the normal state.
graphics::Color Selected
Color for the selected state.
Parameters for the waveform painting.
graphics::Color BlankColor
Color outside the waveform area.
ColorPair RMSColors
Color of the (-rms, +rms) line.
graphics::Color ZeroLineColor
ColorPair SampleColors
Color of the (min, max) line.
ColorPair ClippingColors
Color for the columns where clipping has occurred.
ColorPair BackgroundColors
Waveform background color.
Class for storing color in 32-bit format.
Definition: Color.h:29