20#include "../../../ui/EnvelopeHandle.h"
21#include "../../../ui/TimeShiftHandle.h"
24#include "../../../../EnvelopeEditor.h"
25#include "../../../../ProjectSettings.h"
27#include "../../../../SyncLock.h"
28#include "../../../../TrackArt.h"
29#include "../../../../TrackArtist.h"
30#include "../../../../TrackPanelDrawingContext.h"
31#include "../../../../TrackPanelMouseEvent.h"
33#include "../../../../WaveClip.h"
34#include "../../../../WaveTrack.h"
35#include "../../../../prefs/WaveformSettings.h"
39#include <wx/graphics.h>
44 { wxT(
"Waveform"),
XXO(
"Wa&veform") }
57 std::static_pointer_cast< WaveTrack >( view.FindTrack() );
60 st, pProject, currentTool, bMultiTool, pTrack);
61 auto &results = pair.second;
74 results.push_back(result);
76 view.mTimeShiftHandle, st.
state, st.
rect, pTrack )))
79 results.push_back(result);
83 results.push_back(result);
86 switch ( currentTool ) {
92 viewInfo.PositionToTime(st.
state.m_x, st.
rect.GetX());
93 auto envelope = pTrack->GetEnvelopeAtTime(time);
95 view.mEnvelopeHandle, envelope,
false);
100 view.mSampleHandle, st.
state, pTrack );
107 results.push_back(result);
111 return std::move( results );
118#ifdef EXPERIMENTAL_HALF_WAVE
120 gPrefs->Read(wxT(
"/GUI/CollapseToHalfWave"), &bHalfWave,
false);
125 wt->SetDisplayBounds( -0.01f, 1.0f );
128 wt->SetDisplayBounds( -1.0f, 1.0f );
142 return std::make_shared<WaveformVRulerControls>( shared_from_this() );
149 int leftOffset,
const wxRect &rect,
151 float zoomMin,
float zoomMax,
152 int zeroLevelYCoordinate,
153 bool dB,
float dBRange,
154 double t0,
double t1,
155 bool bIsSyncLockSelected,
156 bool highlightEnvelope)
158 auto &dc = context.
dc;
160 const auto &zoomInfo = *artist->pZoomInfo;
172 int halfHeight = wxMax(h / 2, 1);
173 int maxtop, lmaxtop = 0;
174 int mintop, lmintop = 0;
175 int maxbot, lmaxbot = 0;
176 int minbot, lminbot = 0;
177 bool sel, lsel =
false;
181 const auto &blankBrush = artist->blankBrush;
182 const auto &selectedBrush = artist->selectedBrush;
183 const auto &unselectedBrush = artist->unselectedBrush;
185 dc.SetPen(*wxTRANSPARENT_PEN);
186 dc.SetBrush(blankBrush);
187 dc.DrawRectangle(rect);
190 int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
192 double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
193 for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
194 nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
200 h, dB,
true, dBRange,
true);
202 h, dB,
false, dBRange,
true);
205 h, dB,
false, dBRange,
true);
207 h, dB,
true, dBRange,
true);
213 const auto drawEnvelope = artist->drawEnvelope;
214 if (!drawEnvelope || maxbot > mintop) {
219 sel = (t0 <= time && nextTime < t1);
220 sel = sel || (xx == selectedX);
222 sel = sel && !bIsSyncLockSelected;
224 if (lmaxtop == maxtop &&
232 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
236 if (lmaxbot < lmintop - 1) {
237 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
238 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
241 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
244 if (highlightEnvelope && lmaxbot < lmintop - 1) {
246 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
257 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
260 if (lmaxbot < lmintop - 1) {
261 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
262 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
265 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
267 if (highlightEnvelope && lmaxbot < lmintop - 1) {
269 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
273 if (bIsSyncLockSelected && t0 < t1) {
274 const int begin = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
275 const int end = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
282 if (zeroLevelYCoordinate >= rect.GetTop() &&
283 zeroLevelYCoordinate <= rect.GetBottom()) {
284 dc.SetPen(*wxBLACK_PEN);
286 rect.x + rect.width - 1, zeroLevelYCoordinate);
295 : rect(x, y, w, h), averageZoom(zoom), inFisheye(i)
300 (std::vector<WavePortion> &portions,
const wxRect &rect,
const ZoomInfo &zoomInfo,
310 ZoomInfo::Intervals::const_iterator it = intervals.begin(),
end = intervals.end(), prev;
311 wxASSERT(it !=
end && it->position == rect.x);
312 const int rightmost = rect.x + rect.width;
313 for (
int left = rect.x; left < rightmost;) {
314 while (it !=
end && it->position <= left)
318 const int right = std::max(left, (
int)(it->position));
319 const int width = right - left;
323 prev->averageZoom, prev->inFisheye)
331 float zoomMin,
float zoomMax,
332 bool dB,
float dBRange,
333 const float *
min,
const float *max,
const float *rms,
const int *bl,
336 auto &dc = context.
dc;
340 int lasth1 = std::numeric_limits<int>::max();
350 const auto bShowClipping = artist->mShowClipping;
352 clipped.
reinit(
size_t(rect.width) );
355 long pixAnimOffset = (long)fabs((
double)(wxDateTime::Now().GetTicks() * -10)) +
356 wxDateTime::Now().GetMillisecond() / 100;
358 const auto ms = wxDateTime::Now().GetMillisecond();
359 const auto ticks = (long)fabs((
double)(wxDateTime::Now().GetTicks() * -10));
361 bool drawStripes =
true;
362 bool drawWaveform =
true;
364 const auto &muteSamplePen = artist->muteSamplePen;
365 const auto &samplePen = artist->samplePen;
367 dc.SetPen(muted ? muteSamplePen : samplePen);
368 for (
int x0 = 0; x0 < rect.width; ++x0) {
369 int xx = rect.x + x0;
371 v =
min[x0] * env[x0];
372 if (clipped && bShowClipping && (v <= -
MAX_AUDIO))
374 if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
375 clipped[clipcnt++] = xx;
379 rect.height, dB,
true, dBRange,
true);
381 v = max[x0] * env[x0];
382 if (clipped && bShowClipping && (v >=
MAX_AUDIO))
384 if (clipcnt == 0 || clipped[clipcnt - 1] != xx) {
385 clipped[clipcnt++] = xx;
389 rect.height, dB,
true, dBRange,
true);
404 r1[x0] =
GetWaveYPos(-rms[x0] * env[x0], zoomMin, zoomMax,
405 rect.height, dB,
true, dBRange,
true);
406 r2[x0] =
GetWaveYPos(rms[x0] * env[x0], zoomMin, zoomMax,
407 rect.height, dB,
true, dBRange,
true);
409 if (r1[x0] > h1 - 1) {
412 if (r2[x0] < h2 + 1) {
415 if (r2[x0] > r1[x0]) {
422 dc.SetPen((bl[x0] % 2) ? muteSamplePen : samplePen);
423 for (
int yy = 0; yy < rect.height / 25 + 1; ++yy) {
427 rect.y + 25 * yy + (x0 ) % 25,
429 rect.y + 25 * yy + (x0 ) % 25 + 6);
437 dc.SetPen(samplePen);
438 triX = fabs((
double)((x0 + pixAnimOffset) % (2 * rect.height)) - rect.height) + rect.height;
439 for (
int yy = 0; yy < rect.height; ++yy) {
440 if ((yy + triX) % rect.height == 0) {
441 dc.DrawPoint(xx, rect.y + yy);
447 dc.SetPen(muted ? muteSamplePen : samplePen);
455 const auto &muteRmsPen = artist->muteRmsPen;
456 const auto &rmsPen = artist->rmsPen;
458 dc.SetPen(muted ? muteRmsPen : rmsPen);
459 for (
int x0 = 0; x0 < rect.width; ++x0) {
460 int xx = rect.x + x0;
463 else if (r1[x0] != r2[x0]) {
464 AColor::Line(dc, xx, rect.y + r2[x0], xx, rect.y + r1[x0]);
470 const auto &muteClippedPen = artist->muteClippedPen;
471 const auto &clippedPen = artist->clippedPen;
473 dc.SetPen(muted ? muteClippedPen : clippedPen);
474 while (--clipcnt >= 0) {
475 int xx = clipped[clipcnt];
482 int leftOffset,
const wxRect &rect,
483 float zoomMin,
float zoomMax,
484 bool dB,
float dBRange,
486 bool showPoints,
bool muted,
489 auto &dc = context.
dc;
491 const auto &zoomInfo = *artist->pZoomInfo;
495 const double t0 = std::max(0.0, zoomInfo.PositionToTime(0, -leftOffset) - toffset);
501 const double t1 = zoomInfo.PositionToTime(rect.width - 1, -leftOffset) - toffset;
506 auto slen =
std::min(snSamples - s0, s1 - s0 + 1).as_size_t();
511 Floats buffer{ size_t(slen) };
521 const auto bShowClipping = artist->mShowClipping;
523 clipped.
reinit(
size_t(slen) );
525 const auto &muteSamplePen = artist->muteSamplePen;
526 const auto &samplePen = artist->samplePen;
527 auto &pen = highlight ?
AColor::uglyPen : muted ? muteSamplePen : samplePen;
530 for (
decltype(slen) s = 0; s < slen; s++) {
531 const double time = toffset + (s + s0).as_double() / rate;
534 (
int)(zoomInfo.TimeToPosition(time, -leftOffset))));
540 const double tt = buffer[s] * value;
543 clipped[clipcnt++] = xx;
548 rect.height, dB,
true, dBRange,
false)));
554 const auto bigPoints = artist->bigPoints;
555 const int tickSize = bigPoints ? 4 : 3;
558 pr.height = tickSize;
560 const auto &dragsampleBrush = artist->dragsampleBrush;
561 const auto &sampleBrush = artist->sampleBrush;
562 auto &brush = highlight
564 : bigPoints ? dragsampleBrush : sampleBrush;
565 dc.SetBrush( brush );
566 for (
decltype(slen) s = 0; s < slen; s++) {
567 if (ypos[s] >= 0 && ypos[s] < rect.height) {
568 pr.x = rect.x + xpos[s] - tickSize/2;
569 pr.y = rect.y + ypos[s] - tickSize/2;
575 const auto sampleDisplay = artist->mSampleDisplay;
578 int yZero =
GetWaveYPos(0.0, zoomMin, zoomMax, rect.height, dB,
true, dBRange,
false);
579 yZero = rect.y + std::max(-1,
std::min(rect.height, yZero));
580 for (
decltype(slen) s = 0; s < slen; s++) {
582 rect.x + xpos[s], rect.y + ypos[s],
583 rect.x + xpos[s], yZero);
588 for (
decltype(slen) s = 0; s < slen - 1; s++) {
590 rect.x + xpos[s], rect.y + ypos[s],
591 rect.x + xpos[s + 1], rect.y + ypos[s + 1]);
597 const auto &muteClippedPen = artist->muteClippedPen;
598 const auto &clippedPen = artist->clippedPen;
599 dc.SetPen(muted ? muteClippedPen : clippedPen);
600 while (--clipcnt >= 0) {
601 auto s = clipped[clipcnt];
602 AColor::Line(dc, rect.x + s, rect.y, rect.x + s, rect.y + rect.height);
609 const wxRect &rect,
int x0,
int y0,
int cy,
bool top )
611 auto &dc = context.
dc;
613 int xx = rect.x + x0;
614 int yy = rect.y + cy;
621 else if (y0 > rect.height) {
637 const wxRect &rect,
const double env[],
638 float zoomMin,
float zoomMax,
639 bool dB,
float dBRange,
bool highlight)
641 auto &dc = context.
dc;
648 for (
int x0 = 0; x0 < rect.width; ++x0) {
649 int cenvTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
650 h, dB,
true, dBRange,
true);
652 int cenvBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
653 h, dB,
true, dBRange,
true);
655 int envTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
656 h, dB,
true, dBRange,
false);
658 int envBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
659 h, dB,
true, dBRange,
false);
662 if (cenvBot - cenvTop < 9) {
663 int value = (int)((zoomMax / (zoomMax - zoomMin)) * h);
668 DrawEnvLine( context, rect, x0, envTop, cenvTop,
true );
669 DrawEnvLine( context, rect, x0, envBot, cenvBot,
false );
684 auto &dc = context.
dc;
686 const auto &selectedRegion = *artist->pSelectedRegion;
687 const auto &zoomInfo = *artist->pZoomInfo;
691 bool highlightEnvelope =
false;
692#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
707 false, track, clip, rect, selectedRegion, zoomInfo };
708 const wxRect &hiddenMid =
params.hiddenMid;
711 if (hiddenMid.width <= 0) {
715 const double &t0 =
params.t0;
716 const double &tOffset =
params.tOffset;
717 const double &h =
params.h;
718 const double &tpre =
params.tpre;
719 const double &tpost =
params.tpost;
720 const double &t1 =
params.t1;
721 const double &averagePixelsPerSample =
params.averagePixelsPerSample;
722 const double &rate =
params.rate;
723 double leftOffset =
params.leftOffset;
724 const wxRect &mid =
params.mid;
728 dc.SetPen(*wxTRANSPARENT_PEN);
730 artist->SetColours( iColorIndex );
734 float zoomMin, zoomMax;
737 std::vector<double> vEnv(mid.width);
738 double *
const env = &vEnv[0];
746 env, mid.width, leftOffset, zoomInfo );
771 averagePixelsPerSample * rate;
775 std::vector<WavePortion> portions;
777 const unsigned nPortions = portions.size();
780 const double threshold1 = 0.5 * rate;
782 const double threshold2 = 3 * rate;
787 bool showIndividualSamples =
false;
788 for (
unsigned ii = 0; !showIndividualSamples && ii < nPortions; ++ii) {
790 showIndividualSamples =
794 if (!showIndividualSamples) {
805 if (!clipCache.GetWaveDisplay( *clip, display,
813 for (
unsigned ii = 0; ii < nPortions; ++ii) {
815 const bool showIndividualSamples = portion.
averageZoom > threshold1;
816 const bool showPoints = portion.
averageZoom > threshold2;
817 wxRect& rectPortion = portion.
rect;
818 rectPortion.Intersect(mid);
819 wxASSERT(rectPortion.width >= 0);
821 float *useMin = 0, *useMax = 0, *useRms = 0;
824 int skipped = 0, skippedLeft = 0, skippedRight = 0;
826 if (!showIndividualSamples) {
831 for (; jj < rectPortion.width; ++jj) {
833 zoomInfo.PositionToTime(jj, -leftOffset) - tOffset;
834 const auto sample = (
sampleCount)floor(time * rate + 0.5);
840 if (sample >= numSamples)
842 fisheyeDisplay.
where[jj - skippedLeft] = sample;
845 skippedRight = rectPortion.width - jj;
846 skipped = skippedRight + skippedLeft;
847 rectPortion.width -= skipped;
851 fisheyeDisplay.
where[jj - skippedLeft] =
852 1 + fisheyeDisplay.
where[jj - skippedLeft - 1];
853 fisheyeDisplay.
width -= skipped;
855 if (rectPortion.width > 0)
856 if (!clipCache.GetWaveDisplay( *clip,
857 fisheyeDisplay, t0, -1.0))
859 useMin = fisheyeDisplay.
min;
860 useMax = fisheyeDisplay.
max;
861 useRms = fisheyeDisplay.
rms;
862 useBl = fisheyeDisplay.
bl;
866 const int pos = leftOffset -
params.hiddenLeftOffset;
867 useMin = display.
min + pos;
868 useMax = display.
max + pos;
869 useRms = display.
rms + pos;
870 useBl = display.
bl + pos;
873 leftOffset += skippedLeft;
875 if (rectPortion.width > 0) {
876 if (!showIndividualSamples) {
877 std::vector<double> vEnv2(rectPortion.width);
878 double *
const env2 = &vEnv2[0];
886 env2, rectPortion.width, leftOffset, zoomInfo );
891 useMin, useMax, useRms, useBl, muted );
894 bool highlight =
false;
895#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
897 highlight = target && target->
GetTrack().get() == track;
900 context, leftOffset, rectPortion, zoomMin, zoomMax,
903 showPoints, muted, highlight );
907 leftOffset += rectPortion.width + skippedRight;
910 const auto drawEnvelope = artist->drawEnvelope;
913 context, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope );
915 context, mid, dB, dBRange, zoomMin, zoomMax,
true, rect.x - mid.x );
920 if (h == 0.0 && tOffset < 0.0) {
931 bool rightwards,
bool highlight )
933 auto &dc = context.
dc;
935 const int border = 3;
938 const int barSpacing = 4;
939 const int barWidth = 3;
943 if (rect.height <= ((taper+border + barSpacing) * 2)) {
946 if (rect.width <= (width * 2 + border * 3)) {
951 int leftTaper = rightwards ? 0 : 6;
952 int rightTaper = rightwards ? 6 : 0;
954 int xLeft = rightwards ? (rect.x + border - 2)
955 : (rect.x + rect.width + 1 - (border + width));
956 int yTop = rect.y + border;
957 int yBot = rect.y + rect.height - border - 1;
960 AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
961 AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
962 AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
965 AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
966 AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
967 AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
969 int firstBar = yTop + taper + taper / 2;
970 int nBars = (yBot - yTop - taper * 3) / barSpacing + 1;
971 xLeft += (width - barWidth + 1) / 2;
976 for (i = 0;i < nBars; i++) {
977 yy = firstBar + barSpacing * i;
981 for(i = 0;i < nBars; i++){
982 yy = firstBar + barSpacing * i + 1;
997 auto &dc = context.
dc;
1000 bool highlight =
false;
1001 bool gripHit =
false;
1002#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
1004 gripHit = target && target->
IsGripHit();
1005 highlight = target && target->GetTrack().get() == track;
1010 const auto &blankSelectedBrush = artist->blankSelectedBrush;
1011 const auto &blankBrush = artist->blankBrush;
1013 context, rect, track, blankSelectedBrush, blankBrush );
1015 for (
const auto& clip : track->
GetClips())
1018 dB, muted, clip.get() == selectedClip);
1022 const auto drawSliders = artist->drawSliders;
1033 auto &dc = context.
dc;
1041 channel->UpdateLocationsCache();
1043 const auto wt = std::static_pointer_cast<const WaveTrack>(
1044 FindTrack()->SubstitutePendingChangedTrack());
1047 const auto hasSolo = artist->hasSolo;
1048 bool muted = (hasSolo || wt->GetMute()) &&
1051#if defined(__WXMAC__)
1052 wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
1053 dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE);
1057 wxASSERT(waveTrackView.use_count());
1059 auto selectedClip = waveTrackView->GetSelectedClip().lock();
1060 DoDraw(context, wt.get(), selectedClip.get(), rect, muted);
1062#if defined(__WXMAC__)
1063 dc.GetGraphicsContext()->SetAntialiasMode(aamode);
1071 return std::make_shared< WaveformView >( view );
1081#include "../../../../widgets/PopupMenuTable.h"
1082#include "../../../../ProjectAudioIO.h"
1084#include "../../../../RefreshCode.h"
1121 return XXO(
"Instrument %i").Format( colorIndex+1 );
1129 const auto &track = *
static_cast<WaveTrack*
>(pData->pTrack);
1130 auto &project = pData->project;
1133 menu.Check(
id,
id == me.IdOfWaveColor( track.GetWaveColorIndex() ) );
1134 menu.Enable(
id, !unsafe );
1138 std::call_once(
flag, [
this]{
1140 OnInstrument1ID = hostTable.ReserveId();
1141 OnInstrument2ID = hostTable.ReserveId();
1142 OnInstrument3ID = hostTable.ReserveId();
1143 OnInstrument4ID = hostTable.ReserveId();
1159{
return OnInstrument1ID + WaveColor;}
1165 int id =
event.GetId();
1174 channel->SetWaveColorIndex(newWaveColor);
1179 XO(
"WaveColor Change"));
1188 {
"SubViews/Extra" },
1189 std::make_unique<PopupMenuSection>(
"WaveColor",
1191 PopupMenuTable::Computed< WaveTrackPopupMenuTable >(
1195 const auto displays = view.GetDisplays();
1196 bool hasWaveform = (displays.end() != std::find(
1197 displays.begin(), displays.end(),
std::shared_ptr< UIHandle > UIHandlePtr
EffectDistortion::Params params
int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
WaveTrackPopupMenuTable & GetWaveTrackMenuTable()
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void Light(wxDC *dc, bool selected, bool highlight=false)
static void Dark(wxDC *dc, bool selected, bool highlight=false)
void reinit(Integral count, bool initialize=false)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
std::shared_ptr< Track > FindTrack()
static void GetEnvelopeValues(const Envelope &env, double aligned_time, double sampleDur, double *buffer, int bufferLen, int leftOffset, const ZoomInfo &zoomInfo)
Get many envelope points for pixel columns at once, but don't assume uniform time per pixel.
static void DrawPoints(const Envelope &env, TrackPanelDrawingContext &context, const wxRect &r, bool dB, double dBRange, float zoomMin, float zoomMax, bool mirrored, int origin=0)
static UIHandlePtr WaveTrackHitTest(std::weak_ptr< EnvelopeHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &wt)
static UIHandlePtr HitAnywhere(std::weak_ptr< EnvelopeHandle > &holder, Envelope *envelope, bool timeTrack)
Envelope * GetEnvelope() const
double GetValue(double t, double sampleDur=0) const
Get envelope value at time t.
@ WaveformView
Time required to draw a single clip.
static Stopwatch CreateStopwatch(SectionID section) noexcept
Create a Stopwatch for the section specified.
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
static UIHandlePtr HitAnywhere(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const std::shared_ptr< WaveTrack > &pTrack)
static UIHandlePtr HitTest(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveTrack > &pTrack)
std::shared_ptr< WaveTrack > GetTrack() const
double LongSamplesToTime(sampleCount pos) const
Convert correctly between a number of samples and an (absolute) time in seconds.
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
static bool IsSelectedOrSyncLockSelected(const Track *pTrack)
static UIHandlePtr HitTest(std::weak_ptr< TimeShiftHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
static TrackArtist * Get(TrackPanelDrawingContext &)
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
virtual void DoSetMinimized(bool isMinimized)
Holds a msgid for the translation catalog; may also bind format arguments.
static ViewInfo & Get(AudacityProject &project)
This allows multiple clips to be a part of one WaveTrack.
double GetPlayStartTime() const noexcept
bool GetSamples(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const
sampleCount GetPlaySamplesCount() const
int GetColourIndex() const
A Track that contains audio waveform data.
int ZeroLevelYCoordinate(wxRect rect) const
void GetDisplayBounds(float *min, float *max) const
WaveClipHolders & GetClips()
const WaveformSettings & GetWaveformSettings() const
static void DrawBoldBoundaries(TrackPanelDrawingContext &context, const WaveTrack *track, const wxRect &rect)
std::pair< bool, std::vector< UIHandlePtr > > DoDetailedHitTest(const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool, const std::shared_ptr< WaveTrack > &wt)
std::weak_ptr< WaveTrackView > GetWaveTrackView() const
static WaveTrackView & Get(WaveTrack &track)
static bool ClipDetailsVisible(const WaveClip &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
std::vector< Interval > Intervals
void FindIntervals(double rate, Intervals &results, wxInt64 width, wxInt64 origin=0) const
Positions or offsets within audio files need a wide type.
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Namespace containing an enum 'what to do on a refresh?'.
std::unique_ptr< BaseItem > BaseItemPtr
std::unique_ptr< SharedItem > Shared(const BaseItemSharedPtr &ptr)
AUDACITY_DLL_API void DrawSyncLockTiles(TrackPanelDrawingContext &context, const wxRect &rect)
AUDACITY_DLL_API void DrawClipFolded(wxDC &dc, const wxRect &rect)
AUDACITY_DLL_API void DrawClipEdges(wxDC &dc, const wxRect &clipRect, bool selected=false)
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
AUDACITY_DLL_API void DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
static wxRect GetClipRect(const WaveClip &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect, bool *outShowSamples=nullptr)