| 1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 |
/********************************************************************** |
| 3 |
|
| 4 |
Audacity: A Digital Audio Editor |
| 5 |
|
| 6 |
ClipParameters.h |
| 7 |
|
| 8 |
Matthieu Hodgkinson split from class WaveChannelView.h |
| 9 |
|
| 10 |
**********************************************************************/ |
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <wx/gdicmn.h> |
| 14 |
|
| 15 |
class ZoomInfo; |
| 16 |
class ClipTimes; |
| 17 |
|
| 18 |
struct AUDACITY_DLL_API ClipParameters |
| 19 |
{ |
| 20 |
// Do a bunch of calculations common to waveform and spectrum drawing. |
| 21 |
ClipParameters( |
| 22 |
const ClipTimes& clip, const wxRect& rect, const ZoomInfo& zoomInfo); |
| 23 |
|
| 24 |
const double trackRectT0; // absolute time of left edge of track |
| 25 |
|
| 26 |
// Lower and upper visible time boundaries (relative to clip). If completely |
| 27 |
// off-screen, `t0 == t1`. |
| 28 |
double t0; |
| 29 |
double t1; |
| 30 |
|
| 31 |
const double averagePixelsPerSecond; |
| 32 |
const bool showIndividualSamples; |
| 33 |
|
| 34 |
wxRect hiddenMid; |
| 35 |
int hiddenLeftOffset; |
| 36 |
|
| 37 |
wxRect mid; |
| 38 |
int leftOffset; |
| 39 |
|
| 40 |
// returns a clip rectangle restricted by viewRect, |
| 41 |
// and with clipOffsetX - clip horizontal origin offset within view rect |
| 42 |
static wxRect GetClipRect( |
| 43 |
const ClipTimes& clip, const ZoomInfo& zoomInfo, const wxRect& viewRect, |
| 44 |
bool* outShowSamples = nullptr); |
| 45 |
}; |