20#include "../../../ui/EnvelopeHandle.h"
21#include "../../../ui/TimeShiftHandle.h"
24#include "../../../../EnvelopeEditor.h"
25#include "../../../../ProjectSettings.h"
28#include "../../../../TrackArt.h"
29#include "../../../../TrackArtist.h"
30#include "../../../../TrackPanelDrawingContext.h"
31#include "../../../../TrackPanelMouseEvent.h"
35#include "../../../../WaveTrackLocation.h"
36#include "../../../../prefs/WaveformSettings.h"
40#include <wx/graphics.h>
45 {
wxT(
"Waveform"),
XXO(
"Wa&veform") }
58 std::static_pointer_cast< WaveTrack >( view.FindTrack() );
61 st, pProject, currentTool, bMultiTool, pTrack);
62 auto &results = pair.second;
75 results.push_back(result);
77 view.mTimeShiftHandle, st.
state, st.
rect, pTrack )))
80 results.push_back(result);
84 results.push_back(result);
87 switch ( currentTool ) {
93 viewInfo.PositionToTime(st.
state.m_x, st.
rect.GetX());
94 auto envelope = pTrack->GetEnvelopeAtTime(time);
96 view.mEnvelopeHandle, envelope,
97 std::dynamic_pointer_cast<const Channel>(pTrack),
103 view.mSampleHandle, st.
state, pTrack );
110 results.push_back(result);
114 return std::move( results );
121#ifdef EXPERIMENTAL_HALF_WAVE
123 gPrefs->
Read(
wxT(
"/GUI/CollapseToHalfWave"), &bHalfWave,
false);
129 cache.SetDisplayBounds( -0.01f, 1.0f );
132 cache.SetDisplayBounds( -1.0f, 1.0f );
146 return std::make_shared<WaveformVRulerControls>(shared_from_this());
153 int leftOffset,
const wxRect &rect,
155 float zoomMin,
float zoomMax,
156 int zeroLevelYCoordinate,
157 bool dB,
float dBRange,
158 double t0,
double t1,
159 bool bIsSyncLockSelected,
160 bool highlightEnvelope)
162 auto &dc = context.
dc;
164 const auto &zoomInfo = *artist->pZoomInfo;
176 int halfHeight = wxMax(h / 2, 1);
177 int maxtop, lmaxtop = 0;
178 int mintop, lmintop = 0;
179 int maxbot, lmaxbot = 0;
180 int minbot, lminbot = 0;
181 bool sel, lsel =
false;
185 const auto &blankBrush = artist->blankBrush;
186 const auto &selectedBrush = artist->selectedBrush;
187 const auto &unselectedBrush = artist->unselectedBrush;
189 dc.SetPen(*wxTRANSPARENT_PEN);
190 dc.SetBrush(blankBrush);
191 dc.DrawRectangle(rect);
194 int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
196 double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
197 for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
198 nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
204 h, dB,
true, dBRange,
true);
206 h, dB,
false, dBRange,
true);
209 h, dB,
false, dBRange,
true);
211 h, dB,
true, dBRange,
true);
217 const auto drawEnvelope = artist->drawEnvelope;
218 if (!drawEnvelope || maxbot > mintop) {
223 sel = (t0 <= time && nextTime < t1);
224 sel = sel || (xx == selectedX);
226 sel = sel && !bIsSyncLockSelected;
228 if (lmaxtop == maxtop &&
236 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
240 if (lmaxbot < lmintop - 1) {
241 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
242 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
245 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
248 if (highlightEnvelope && lmaxbot < lmintop - 1) {
250 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
261 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
264 if (lmaxbot < lmintop - 1) {
265 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
266 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
269 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
271 if (highlightEnvelope && lmaxbot < lmintop - 1) {
273 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
277 if (bIsSyncLockSelected && t0 < t1) {
278 const int begin = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
279 const int end = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
286 if (zeroLevelYCoordinate >= rect.GetTop() &&
287 zeroLevelYCoordinate <= rect.GetBottom()) {
288 dc.SetPen(*wxBLACK_PEN);
290 rect.x + rect.width - 1, zeroLevelYCoordinate);
299 : rect(x, y, w, h), averageZoom(zoom), inFisheye(i)
304 (std::vector<WavePortion> &portions,
const wxRect &rect,
const ZoomInfo &zoomInfo,
312 const auto intervals = zoomInfo.
FindIntervals(rect.width, rect.x);
313 ZoomInfo::Intervals::const_iterator it = intervals.begin(),
end = intervals.end(), prev;
314 wxASSERT(it !=
end && it->position == rect.x);
315 const int rightmost = rect.x + rect.width;
316 for (
int left = rect.x; left < rightmost;) {
317 while (it !=
end && it->position <= left)
321 const int right = std::max(left, (
int)(it->position));
322 const int width = right - left;
326 prev->averageZoom, prev->inFisheye)
334 float zoomMin,
float zoomMax,
335 bool dB,
float dBRange,
336 const float *
min,
const float *max,
const float *rms,
339 auto &dc = context.
dc;
343 int lasth1 = std::numeric_limits<int>::max();
353 const auto bShowClipping = artist->mShowClipping;
355 clipped.
reinit(
size_t(rect.width) );
358 long pixAnimOffset = (long)fabs((
double)(wxDateTime::Now().GetTicks() * -10)) +
359 wxDateTime::Now().GetMillisecond() / 100;
361 const auto ms = wxDateTime::Now().GetMillisecond();
362 const auto ticks = (long)fabs((
double)(wxDateTime::Now().GetTicks() * -10));
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]) {
423 const auto &muteRmsPen = artist->muteRmsPen;
424 const auto &rmsPen = artist->rmsPen;
426 dc.SetPen(muted ? muteRmsPen : rmsPen);
427 for (
int x0 = 0; x0 < rect.width; ++x0) {
428 int xx = rect.x + x0;
429 if (r1[x0] != r2[x0]) {
430 AColor::Line(dc, xx, rect.y + r2[x0], xx, rect.y + r1[x0]);
436 const auto &muteClippedPen = artist->muteClippedPen;
437 const auto &clippedPen = artist->clippedPen;
439 dc.SetPen(muted ? muteClippedPen : clippedPen);
440 while (--clipcnt >= 0) {
441 int xx = clipped[clipcnt];
448 int leftOffset,
const wxRect &rect,
449 float zoomMin,
float zoomMax,
450 bool dB,
float dBRange,
452 bool showPoints,
bool muted,
456 auto &dc = context.
dc;
458 const auto &zoomInfo = *artist->pZoomInfo;
462 const double t0 = std::max(0.0, zoomInfo.PositionToTime(0, -leftOffset) - toffset);
468 const double t1 = zoomInfo.PositionToTime(rect.width - 1, -leftOffset) - toffset;
473 auto slen =
std::min(snSamples - s0, s1 - s0 + 1).as_size_t();
478 Floats buffer{ size_t(slen) };
488 const auto bShowClipping = artist->mShowClipping;
490 clipped.
reinit(
size_t(slen) );
492 const auto &muteSamplePen = artist->muteSamplePen;
493 const auto &samplePen = artist->samplePen;
494 auto &pen = highlight ?
AColor::uglyPen : muted ? muteSamplePen : samplePen;
497 for (
decltype(slen) s = 0; s < slen; s++) {
498 const double time = toffset + (s + s0).as_double() / rate;
501 (
int)(zoomInfo.TimeToPosition(time, -leftOffset))));
506 const double tt = buffer[s] * value;
509 clipped[clipcnt++] = xx;
514 rect.height, dB,
true, dBRange,
false)));
520 const auto bigPoints = artist->bigPoints;
521 const int tickSize = bigPoints ? 4 : 3;
524 pr.height = tickSize;
526 const auto &dragsampleBrush = artist->dragsampleBrush;
527 const auto &sampleBrush = artist->sampleBrush;
528 auto &brush = highlight
530 : bigPoints ? dragsampleBrush : sampleBrush;
531 dc.SetBrush( brush );
532 for (
decltype(slen) s = 0; s < slen; s++) {
533 if (ypos[s] >= 0 && ypos[s] < rect.height) {
534 pr.x = rect.x + xpos[s] - tickSize/2;
535 pr.y = rect.y + ypos[s] - tickSize/2;
541 const auto sampleDisplay = artist->mSampleDisplay;
546 int yZero =
GetWaveYPos(0.0, zoomMin, zoomMax, rect.height, dB,
true, dBRange,
false);
547 yZero = rect.y + std::max(-1,
std::min(rect.height, yZero));
548 for (
decltype(slen) s = 0; s < slen; s++) {
550 rect.x + xpos[s], rect.y + ypos[s],
551 rect.x + xpos[s], yZero);
556 for (
decltype(slen) s = 0; s < slen - 1; s++) {
558 rect.x + xpos[s], rect.y + ypos[s],
559 rect.x + xpos[s + 1], rect.y + ypos[s + 1]);
565 const auto &muteClippedPen = artist->muteClippedPen;
566 const auto &clippedPen = artist->clippedPen;
567 dc.SetPen(muted ? muteClippedPen : clippedPen);
568 while (--clipcnt >= 0) {
569 auto s = clipped[clipcnt];
570 AColor::Line(dc, rect.x + s, rect.y, rect.x + s, rect.y + rect.height);
577 const wxRect &rect,
int x0,
int y0,
int cy,
bool top )
579 auto &dc = context.
dc;
581 int xx = rect.x + x0;
582 int yy = rect.y + cy;
589 else if (y0 > rect.height) {
605 const wxRect &rect,
const double env[],
606 float zoomMin,
float zoomMax,
607 bool dB,
float dBRange,
bool highlight)
609 auto &dc = context.
dc;
616 for (
int x0 = 0; x0 < rect.width; ++x0) {
617 int cenvTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
618 h, dB,
true, dBRange,
true);
620 int cenvBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
621 h, dB,
true, dBRange,
true);
623 int envTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
624 h, dB,
true, dBRange,
false);
626 int envBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
627 h, dB,
true, dBRange,
false);
630 if (cenvBot - cenvTop < 9) {
631 int value = (int)((zoomMax / (zoomMax - zoomMin)) * h);
636 DrawEnvLine( context, rect, x0, envTop, cenvTop,
true );
637 DrawEnvLine( context, rect, x0, envBot, cenvBot,
false );
646 const wxRect &rect,
bool dB,
bool muted,
bool selected)
649 auto &dc = context.
dc;
651 const auto &selectedRegion = *artist->pSelectedRegion;
652 const auto &zoomInfo = *artist->pZoomInfo;
656 bool highlightEnvelope =
false;
657#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
659 highlightEnvelope = target && target->
GetEnvelope() == &envelope;
672 const wxRect &hiddenMid =
params.hiddenMid;
675 if (hiddenMid.width <= 0) {
679 const double &t0 =
params.t0;
681 const double &trackRectT0 =
params.trackRectT0;
682 const double &averagePixelsPerSecond =
params.averagePixelsPerSecond;
685 double leftOffset =
params.leftOffset;
686 const wxRect &mid =
params.mid;
689 const float dBRange =
settings.dBRange;
691 dc.SetPen(*wxTRANSPARENT_PEN);
693 artist->SetColours( iColorIndex );
697 float zoomMin, zoomMax;
699 cache.GetDisplayBounds(zoomMin, zoomMax);
701 std::vector<double> vEnv(mid.width);
702 double *
const env = &vEnv[0];
709 env, mid.width, leftOffset, zoomInfo);
725 cache.ZeroLevelYCoordinate(mid),
735 std::vector<WavePortion> portions;
737 const unsigned nPortions = portions.size();
740 const double threshold1 = 0.5 *
sampleRate / stretchRatio;
742 const double threshold2 = 3 *
sampleRate / stretchRatio;
747 bool showIndividualSamples =
false;
748 for (
unsigned ii = 0; !showIndividualSamples && ii < nPortions; ++ii) {
750 showIndividualSamples =
754 if (!showIndividualSamples) {
765 if (!clipCache.GetWaveDisplay(clip,
766 display, t0, averagePixelsPerSecond))
773 for (
unsigned ii = 0; ii < nPortions; ++ii) {
775 const bool showIndividualSamples = portion.
averageZoom > threshold1;
776 const bool showPoints = portion.
averageZoom > threshold2;
777 wxRect& rectPortion = portion.
rect;
778 rectPortion.Intersect(mid);
779 wxASSERT(rectPortion.width >= 0);
781 float *useMin = 0, *useMax = 0, *useRms = 0;
783 int skipped = 0, skippedLeft = 0, skippedRight = 0;
785 if (!showIndividualSamples) {
790 for (; jj < rectPortion.width; ++jj) {
792 zoomInfo.PositionToTime(jj, -leftOffset) - playStartTime;
799 if (sample >= numSamples)
801 fisheyeDisplay.
where[jj - skippedLeft] = sample;
804 skippedRight = rectPortion.width - jj;
805 skipped = skippedRight + skippedLeft;
806 rectPortion.width -= skipped;
810 fisheyeDisplay.
where[jj - skippedLeft] =
811 1 + fisheyeDisplay.
where[jj - skippedLeft - 1];
812 fisheyeDisplay.
width -= skipped;
814 if (rectPortion.width > 0)
815 if (!clipCache.GetWaveDisplay(clip,
816 fisheyeDisplay, t0, -1.0))
818 useMin = fisheyeDisplay.
min;
819 useMax = fisheyeDisplay.
max;
820 useRms = fisheyeDisplay.
rms;
824 const int pos = leftOffset -
params.hiddenLeftOffset;
825 useMin = display.
min + pos;
826 useMax = display.
max + pos;
827 useRms = display.
rms + pos;
830 leftOffset += skippedLeft;
832 if (rectPortion.width > 0) {
833 if (!showIndividualSamples) {
834 std::vector<double> vEnv2(rectPortion.width);
835 double *
const env2 = &vEnv2[0];
842 env2, rectPortion.width, leftOffset, zoomInfo);
847 useMin, useMax, useRms, muted);
850 bool highlight =
false;
851#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
853 highlight = target && target->
FindChannel().get() == &track;
856 context, leftOffset, rectPortion, zoomMin, zoomMax,
857 dB, dBRange, clip, showPoints, muted, highlight);
861 leftOffset += rectPortion.width + skippedRight;
864 const auto drawEnvelope = artist->drawEnvelope;
867 context, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope);
869 context, mid, dB, dBRange, zoomMin, zoomMax,
true, rect.x - mid.x);
874 if (trackRectT0 == 0.0 && playStartTime < 0.0)
886 bool rightwards,
bool highlight )
888 auto &dc = context.
dc;
890 const int border = 3;
893 const int barSpacing = 4;
894 const int barWidth = 3;
898 if (rect.height <= ((taper+border + barSpacing) * 2)) {
901 if (rect.width <= (width * 2 + border * 3)) {
906 int leftTaper = rightwards ? 0 : 6;
907 int rightTaper = rightwards ? 6 : 0;
909 int xLeft = rightwards ? (rect.x + border - 2)
910 : (rect.x + rect.width + 1 - (border + width));
911 int yTop = rect.y + border;
912 int yBot = rect.y + rect.height - border - 1;
915 AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
916 AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
917 AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
920 AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
921 AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
922 AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
924 int firstBar = yTop + taper + taper / 2;
925 int nBars = (yBot - yTop - taper * 3) / barSpacing + 1;
926 xLeft += (width - barWidth + 1) / 2;
931 for (i = 0;i < nBars; i++) {
932 yy = firstBar + barSpacing * i;
936 for(i = 0;i < nBars; i++){
937 yy = firstBar + barSpacing * i + 1;
952 auto &dc = context.
dc;
955 bool highlight =
false;
956 bool gripHit =
false;
957#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
960 highlight = target && target->GetTrack().get() == &track;
965 const auto &blankSelectedBrush = artist->blankSelectedBrush;
966 const auto &blankBrush = artist->blankBrush;
968 context, rect, &track, blankSelectedBrush, blankBrush );
972 assert(channel == 0);
973 channel = (track.
IsLeader() ? 0 : 1);
977 assert(pLeader->IsLeader());
979 for (
const auto pInterval :
980 static_cast<const WaveTrack*
>(pLeader)->GetChannel(channel)->Intervals()
983 dB, muted, (&pInterval->GetClip() == selectedClip));
987 const auto drawSliders = artist->drawSliders;
998 auto &dc = context.
dc;
1000 const auto wt = std::static_pointer_cast<const WaveTrack>(
1001 FindTrack()->SubstitutePendingChangedTrack());
1004 const auto hasSolo = artist->hasSolo;
1005 bool muted = (hasSolo || wt->GetMute()) &&
1008#if defined(__WXMAC__)
1009 wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
1010 dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE);
1014 wxASSERT(waveChannelView.use_count());
1016 auto selectedClip = waveChannelView->GetSelectedClip().lock();
1019#if defined(__WXMAC__)
1020 dc.GetGraphicsContext()->SetAntialiasMode(aamode);
1028 return std::make_shared<WaveformView>( view );
1038#include "../../../../widgets/PopupMenuTable.h"
1041#include "../../../../RefreshCode.h"
1078 return XXO(
"Instrument %i").Format( colorIndex+1 );
1086 const auto &track = *
static_cast<WaveTrack*
>(pData->pTrack);
1087 auto &
project = pData->project;
1090 menu.Check(
id,
id == me.IdOfWaveColor( track.GetWaveColorIndex() ) );
1091 menu.Enable(
id, !unsafe );
1095 std::call_once(
flag, [
this]{
1097 OnInstrument1ID = hostTable.ReserveId();
1098 OnInstrument2ID = hostTable.ReserveId();
1099 OnInstrument3ID = hostTable.ReserveId();
1100 OnInstrument4ID = hostTable.ReserveId();
1116{
return OnInstrument1ID + WaveColor;}
1122 int id =
event.GetId();
1130 pTrack->SetWaveColorIndex(newWaveColor);
1135 XO(
"WaveColor Change"));
1144 {
"SubViews/Extra" },
1145 std::make_unique<PopupMenuSection>(
"WaveColor",
1147 PopupMenuTable::Adapt<WaveTrackPopupMenuTable>(
1151 const auto displays = view.GetDisplays();
1152 bool hasWaveform = (displays.end() != std::find(
1153 displays.begin(), displays.end(),
1155 WaveChannelViewConstants::Waveform, {} }
std::shared_ptr< UIHandle > UIHandlePtr
EffectDistortionSettings params
XXO("&Cut/Copy/Paste Toolbar")
audacity::BasicSettings * gPrefs
int GetWaveYPos(float value, float min, float max, int height, bool dB, bool outer, float dBr, bool clip)
static Settings & settings()
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...
virtual void DoSetMinimized(bool isMinimized)
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
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.
size_t GetChannelIndex() const
std::shared_ptr< Track > FindTrack()
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)
Envelope * GetEnvelope() const
static UIHandlePtr HitAnywhere(std::weak_ptr< EnvelopeHandle > &holder, Envelope *envelope, std::weak_ptr< const Channel > wChannel, bool timeTrack)
Piecewise linear or piecewise exponential function from double to double.
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< const Channel > FindChannel() const override
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 &)
bool GetSelected() const
Selectedness is always the same for all channels of a group.
TrackList * GetHolder() const
TrackIter< Track > Find(Track *pTrack)
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
Holds a msgid for the translation catalog; may also bind format arguments.
static ViewInfo & Get(AudacityProject &project)
double GetStretchRatio() const override
double GetPlayStartTime() const override
sampleCount GetVisibleSampleCount() const override
int GetRate() const override
int GetColourIndex() const
const WaveClip & GetClip() const
sampleCount TimeToSamples(double time) const override
bool GetSamples(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const
const Envelope & GetEnvelope() const
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< WaveChannelView > GetWaveChannelView() const
static void DrawBoldBoundaries(TrackPanelDrawingContext &context, const WaveTrack &track, const wxRect &rect)
static bool ClipDetailsVisible(const ClipTimes &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
static WaveChannelView & Get(WaveChannel &channel)
This allows multiple clips to be a part of one WaveTrack.
A Track that contains audio waveform data.
bool IsLeader() const override
double SnapToSample(double t) const
Intervals FindIntervals(int64 width, int64 origin=0) const
virtual bool Read(const wxString &key, bool *value) const =0
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< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
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)
constexpr auto sampleRate
AuthorizationHandler handler
static wxRect GetClipRect(const ClipTimes &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect, bool *outShowSamples=nullptr)