21#include "../../../ui/EnvelopeHandle.h"
22#include "../../../ui/TimeShiftHandle.h"
25#include "../../../../EnvelopeEditor.h"
27#include "../../../../ProjectSettings.h"
30#include "../../../../TrackArt.h"
31#include "../../../../TrackArtist.h"
32#include "../../../../TrackPanelDrawingContext.h"
33#include "../../../../TrackPanelMouseEvent.h"
39#include "../../../../WaveTrackLocation.h"
40#include "../../../../prefs/WaveformSettings.h"
44#include <wx/graphics.h>
47#include <wx/dcmemory.h>
59 {
wxT(
"Waveform"),
XXO(
"Wa&veform") }
71 const auto pChannel = view.FindChannel<
WaveChannel>();
74 st, pProject, currentTool, bMultiTool, pChannel);
75 auto &results = pair.second;
88 results.push_back(result);
91 pChannel->GetTrack().SharedPointer())))
94 results.push_back(result);
98 results.push_back(result);
101 switch ( currentTool ) {
107 viewInfo.PositionToTime(st.
state.m_x, st.
rect.GetX());
108 const auto envelope =
111 view.mEnvelopeHandle, envelope,
112 std::dynamic_pointer_cast<const Channel>(pChannel),
118 view.mSampleHandle, st.
state, pChannel);
125 results.push_back(result);
129 return std::move( results );
137 gPrefs->
Read(
wxT(
"/GUI/CollapseToHalfWave"), &bHalfWave,
false);
138 if (wt && bHalfWave) {
142 cache.SetDisplayBounds( -0.01f, 1.0f );
145 cache.SetDisplayBounds( -1.0f, 1.0f );
158 return std::make_shared<WaveformVRulerControls>(shared_from_this());
167 const auto c = pen.GetColour();
173 const auto c = brush.GetColour();
180 uint8_t*
Allocate(
size_t width,
size_t height)
override
182 mImage =
wxImage(width, height,
false);
183 mBitmap = wxBitmap();
184 return mImage.GetData();
189 if(!mBitmap.IsOk() && mImage.IsOk())
190 mBitmap = wxBitmap(mImage);
196 return mImage.GetWidth();
201 return mImage.GetHeight();
223 const auto changed = mChanged.exchange(
false);
224 if (&clip != mWaveClip || changed)
225 mChannelCaches.clear();
229 if (mChannelCaches.size() == nChannels)
234 mChannelCaches.reserve(nChannels);
236 for (
auto channelIndex = 0; channelIndex < nChannels; ++channelIndex)
238 auto dataCache = std::make_shared<WaveDataCache>(clip, channelIndex);
240 auto bitmapCache = std::make_unique<WaveBitmapCache>(
242 [] {
return std::make_unique<WaveBitmapCacheElementWX>(); });
244 mChannelCaches.push_back(
245 { std::move(dataCache), std::move(bitmapCache) });
253 for (
auto& channelCache : mChannelCaches)
254 channelCache.BitmapCache->SetSelection(zoomInfo, t0, t1, selected);
259 const ZoomInfo& zoomInfo,
const wxRect& targetRect,
int leftOffset,
260 double from,
double to)
262 auto& channelCache = mChannelCaches[channelIndex];
264 channelCache.BitmapCache->SetPaintParameters(
params);
266 auto range = channelCache.BitmapCache->PerformLookup(zoomInfo, from, to);
268 auto left = targetRect.x + leftOffset;
269 auto height = targetRect.height;
271 const auto top = targetRect.y;
274 for (
auto it = range.begin(); it != range.end(); ++it)
276 const auto elementLeftOffset = it.GetLeftOffset();
277 const auto elementRightOffset = it.GetRightOffset();
280 elementLeftOffset - elementRightOffset;
283 memdc.SelectObject(bitmap);
285 wxPoint(left, targetRect.y), wxSize(width, it->Height()), &memdc,
286 wxPoint(elementLeftOffset, 0));
296 mChanged.store(
true);
303 mChanged.store(
true);
308 for (
auto& channelCache : mChannelCaches)
310 channelCache.DataCache->Invalidate();
311 channelCache.BitmapCache->Invalidate();
315 std::unique_ptr<WaveClipListener>
Clone()
const override
317 return std::make_unique<WaveformPainter>();
330 std::atomic<bool> mChanged =
false;
335 int leftOffset,
double t0,
double t1,
336 const wxRect & rect,
float zoomMin,
float zoomMax,
bool dB,
float dBRange,
339 auto& clip = channelInterval.
GetClip();
343 const ZoomInfo zoomInfo(0.0, artist->pZoomInfo->GetZoom());
347 const auto trimLeft = clip.GetTrimLeft();
348 const auto sequenceStartTime = clip.GetSequenceStartTime();
354 rect.GetHeight(), zoomMin, zoomMax, artist->mShowClipping)
359 ColorFromWXPen(muted ? artist->muteSamplePen : artist->samplePen),
360 ColorFromWXPen(muted ? artist->muteSamplePen : artist->samplePen))
368 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen),
369 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen))
372 clipPainter.SetSelection(
373 zoomInfo, artist->pSelectedRegion->t0() - sequenceStartTime,
374 artist->pSelectedRegion->t1() - sequenceStartTime,
378 channelIndex, context.
dc, paintParameters, zoomInfo, rect, leftOffset,
379 t0 + trimLeft, t1 + trimLeft);
385 int leftOffset,
const wxRect &rect,
387 float zoomMin,
float zoomMax,
388 int zeroLevelYCoordinate,
389 bool dB,
float dBRange,
390 double t0,
double t1,
391 bool bIsSyncLockSelected,
392 bool highlightEnvelope)
394 auto &dc = context.
dc;
396 const auto &zoomInfo = *artist->pZoomInfo;
408 int halfHeight = wxMax(h / 2, 1);
409 int maxtop, lmaxtop = 0;
410 int mintop, lmintop = 0;
411 int maxbot, lmaxbot = 0;
412 int minbot, lminbot = 0;
413 bool sel, lsel =
false;
417 const auto &blankBrush = artist->blankBrush;
418 const auto &selectedBrush = artist->selectedBrush;
419 const auto &unselectedBrush = artist->unselectedBrush;
420 const auto &envelopeBackgroundBrush = artist->envelopeBackgroundBrush;
422 dc.SetPen(*wxTRANSPARENT_PEN);
423 dc.SetBrush(envelopeBackgroundBrush);
424 dc.DrawRectangle(rect);
427 int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
429 double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
430 for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
431 nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
437 h, dB,
true, dBRange,
true);
439 h, dB,
false, dBRange,
true);
442 h, dB,
false, dBRange,
true);
444 h, dB,
true, dBRange,
true);
450 const auto drawEnvelope = artist->drawEnvelope;
451 if (!drawEnvelope || maxbot > mintop) {
456 sel = (t0 <= time && nextTime < t1);
457 sel = sel || (xx == selectedX);
459 sel = sel && !bIsSyncLockSelected;
461 if (lmaxtop == maxtop &&
469 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
473 if (lmaxbot < lmintop - 1) {
474 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
475 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
478 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
481 if (highlightEnvelope && lmaxbot < lmintop - 1) {
483 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
494 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
497 if (lmaxbot < lmintop - 1) {
498 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
499 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
502 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
504 if (highlightEnvelope && lmaxbot < lmintop - 1) {
506 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
510 if (bIsSyncLockSelected && t0 < t1) {
511 const int begin = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
512 const int end = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
519 if (zeroLevelYCoordinate >= rect.GetTop() &&
520 zeroLevelYCoordinate <= rect.GetBottom()) {
521 dc.SetPen(*wxBLACK_PEN);
523 rect.x + rect.width - 1, zeroLevelYCoordinate);
532 : rect(x, y, w, h), averageZoom(zoom), inFisheye(i)
537 (std::vector<WavePortion> &portions,
const wxRect &rect,
const ZoomInfo &zoomInfo,
545 const auto intervals = zoomInfo.
FindIntervals(rect.width, rect.x);
546 ZoomInfo::Intervals::const_iterator it = intervals.begin(),
end = intervals.end(), prev;
547 wxASSERT(it !=
end && it->position == rect.x);
548 const int rightmost = rect.x + rect.width;
549 for (
int left = rect.x; left < rightmost;) {
550 while (it !=
end && it->position <= left)
554 const int right = std::max(left, (
int)(it->position));
555 const int width = right - left;
559 prev->averageZoom, prev->inFisheye)
566 int leftOffset,
const wxRect &rect,
567 float zoomMin,
float zoomMax,
568 bool dB,
float dBRange,
570 bool showPoints,
bool muted,
574 auto &dc = context.
dc;
576 const auto &zoomInfo = *artist->pZoomInfo;
580 const double t0 = std::max(0.0, zoomInfo.PositionToTime(0, -leftOffset) - toffset);
586 const double t1 = zoomInfo.PositionToTime(rect.width - 1, -leftOffset) - toffset;
591 auto slen =
std::min(snSamples - s0, s1 - s0 + 1).as_size_t();
596 Floats buffer{ size_t(slen) };
606 const auto bShowClipping = artist->mShowClipping;
608 clipped.
reinit(
size_t(slen) );
610 const auto &muteSamplePen = artist->muteSamplePen;
611 const auto &samplePen = artist->samplePen;
612 auto &pen = highlight ?
AColor::uglyPen : muted ? muteSamplePen : samplePen;
615 for (
decltype(slen) s = 0; s < slen; s++) {
616 const double time = toffset + (s + s0).as_double() / rate;
619 (
int)(zoomInfo.TimeToPosition(time, -leftOffset))));
624 const double tt = buffer[s] * value;
627 clipped[clipcnt++] = xx;
632 rect.height, dB,
true, dBRange,
false)));
638 const auto bigPoints = artist->bigPoints;
639 const int tickSize = bigPoints ? 4 : 3;
642 pr.height = tickSize;
644 const auto &dragsampleBrush = artist->dragsampleBrush;
645 const auto &sampleBrush = artist->sampleBrush;
646 auto &brush = highlight
648 : bigPoints ? dragsampleBrush : sampleBrush;
649 dc.SetBrush( brush );
650 for (
decltype(slen) s = 0; s < slen; s++) {
651 if (ypos[s] >= 0 && ypos[s] < rect.height) {
652 pr.x = rect.x + xpos[s] - tickSize/2;
653 pr.y = rect.y + ypos[s] - tickSize/2;
659 const auto sampleDisplay = artist->mSampleDisplay;
664 int yZero =
GetWaveYPos(0.0, zoomMin, zoomMax, rect.height, dB,
true, dBRange,
false);
665 yZero = rect.y + std::max(-1,
std::min(rect.height, yZero));
666 for (
decltype(slen) s = 0; s < slen; s++) {
668 rect.x + xpos[s], rect.y + ypos[s],
669 rect.x + xpos[s], yZero);
674 for (
decltype(slen) s = 0; s < slen - 1; s++) {
676 rect.x + xpos[s], rect.y + ypos[s],
677 rect.x + xpos[s + 1], rect.y + ypos[s + 1]);
683 const auto &muteClippedPen = artist->muteClippedPen;
684 const auto &clippedPen = artist->clippedPen;
685 dc.SetPen(muted ? muteClippedPen : clippedPen);
686 while (--clipcnt >= 0) {
687 auto s = clipped[clipcnt];
688 AColor::Line(dc, rect.x + s, rect.y, rect.x + s, rect.y + rect.height);
695 const wxRect &rect,
int x0,
int y0,
int cy,
bool top )
697 auto &dc = context.
dc;
699 int xx = rect.x + x0;
700 int yy = rect.y + cy;
707 else if (y0 > rect.height) {
723 const wxRect &rect,
const double env[],
724 float zoomMin,
float zoomMax,
725 bool dB,
float dBRange,
bool highlight)
727 auto &dc = context.
dc;
734 for (
int x0 = 0; x0 < rect.width; ++x0) {
735 int cenvTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
736 h, dB,
true, dBRange,
true);
738 int cenvBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
739 h, dB,
true, dBRange,
true);
741 int envTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
742 h, dB,
true, dBRange,
false);
744 int envBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
745 h, dB,
true, dBRange,
false);
748 if (cenvBot - cenvTop < 9) {
749 int value = (int)((zoomMax / (zoomMax - zoomMin)) * h);
754 DrawEnvLine( context, rect, x0, envTop, cenvTop,
true );
755 DrawEnvLine( context, rect, x0, envBot, cenvBot,
false );
764 const wxRect &rect,
bool dB,
bool muted,
bool selected)
767 auto &dc = context.
dc;
769 const auto &selectedRegion = *artist->pSelectedRegion;
770 const auto &zoomInfo = *artist->pZoomInfo;
774 bool highlightEnvelope =
false;
775#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
777 highlightEnvelope = target && target->
GetEnvelope() == &envelope;
790 const wxRect &hiddenMid =
params.hiddenMid;
793 if (hiddenMid.width <= 0) {
797 const double &t0 =
params.t0;
798 const double &t1 =
params.t1;
800 const double &trackRectT0 =
params.trackRectT0;
801 const double &averagePixelsPerSecond =
params.averagePixelsPerSecond;
804 double leftOffset =
params.leftOffset;
805 const wxRect &mid =
params.mid;
808 const float dBRange =
settings.dBRange;
810 dc.SetPen(*wxTRANSPARENT_PEN);
812 artist->SetColours( iColorIndex );
816 float zoomMin, zoomMax;
818 cache.GetDisplayBounds(zoomMin, zoomMax);
820 std::vector<double> vEnv(mid.width);
821 double *
const env = &vEnv[0];
828 env, mid.width, leftOffset, zoomInfo);
835 const auto &track = channel.
GetTrack();
838 tt1 = track.SnapToSample(selectedRegion.t1());
845 cache.ZeroLevelYCoordinate(mid),
848 !track.GetSelected(), highlightEnvelope);
852 const double threshold1 = 0.5 *
sampleRate / stretchRatio;
854 const double threshold2 = 3 *
sampleRate / stretchRatio;
856 bool highlight =
false;
857#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
859 highlight = target && target->FindChannel().get() == &track;
862 const bool showIndividualSamples = zoomInfo.GetZoom() > threshold1;
863 const bool showPoints = zoomInfo.GetZoom() > threshold2;
865 if(!showIndividualSamples)
868 context, channel.
GetTrack(), clip, leftOffset, t0, t1,
869 rect, zoomMin, zoomMax, dB, dBRange, muted);
873 std::vector<WavePortion> portions;
875 auto offset = leftOffset;
876 for(
const auto& portion : portions)
878 assert(!portion.inFisheye && portion.averageZoom > threshold1);
879 if(portion.inFisheye || portion.averageZoom <= threshold1)
882 wxRect rectPortion = portion.rect;
883 rectPortion.Intersect(mid);
885 context, offset, rectPortion, zoomMin, zoomMax, dB, dBRange, clip,
886 showPoints, muted, highlight);
887 offset += rectPortion.width;
892 const auto drawEnvelope = artist->drawEnvelope;
895 context, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope);
897 context, mid, dB, dBRange, zoomMin, zoomMax,
true, rect.x - mid.x);
902 if (trackRectT0 == 0.0 && playStartTime < 0.0)
914 bool rightwards,
bool highlight )
916 auto &dc = context.
dc;
918 const int border = 3;
921 const int barSpacing = 4;
922 const int barWidth = 3;
926 if (rect.height <= ((taper+border + barSpacing) * 2)) {
929 if (rect.width <= (width * 2 + border * 3)) {
934 int leftTaper = rightwards ? 0 : 6;
935 int rightTaper = rightwards ? 6 : 0;
937 int xLeft = rightwards ? (rect.x + border - 2)
938 : (rect.x + rect.width + 1 - (border + width));
939 int yTop = rect.y + border;
940 int yBot = rect.y + rect.height - border - 1;
943 AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
944 AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
945 AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
948 AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
949 AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
950 AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
952 int firstBar = yTop + taper + taper / 2;
953 int nBars = (yBot - yTop - taper * 3) / barSpacing + 1;
954 xLeft += (width - barWidth + 1) / 2;
959 for (i = 0;i < nBars; i++) {
960 yy = firstBar + barSpacing * i;
964 for(i = 0;i < nBars; i++){
965 yy = firstBar + barSpacing * i + 1;
980 auto &dc = context.
dc;
983 bool highlight =
false;
984 bool gripHit =
false;
985#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
988 highlight = target && target->FindTrack().get() ==
994 const auto &blankSelectedBrush = artist->blankSelectedBrush;
995 const auto &blankBrush = artist->blankBrush;
997 context, rect, channel, blankSelectedBrush, blankBrush );
999 for (
const auto &pInterval : channel.
Intervals()) {
1000 bool selected = selectedClip &&
1001 selectedClip == &pInterval->GetClip();
1006 const auto drawSliders = artist->drawSliders;
1018 const auto &pendingTracks = *artist->pPendingTracks;
1019 auto &dc = context.
dc;
1025 pendingTracks.SubstitutePendingChangedChannel(*pChannel));
1027 const auto hasSolo = artist->hasSolo;
1028 bool muted = (hasSolo || wc.GetTrack().GetMute()) &&
1031#if defined(__WXMAC__)
1032 wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
1033 dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE);
1037 wxASSERT(waveChannelView.use_count());
1039 auto selectedClip = waveChannelView->GetSelectedClip();
1040 DoDraw(context, wc, selectedClip.get(), rect, muted);
1042#if defined(__WXMAC__)
1043 dc.GetGraphicsContext()->SetAntialiasMode(aamode);
1051 return std::make_shared<WaveformView>( view );
1061#include "../../../../widgets/PopupMenuTable.h"
1064#include "../../../../RefreshCode.h"
1101 return XXO(
"Instrument %i").Format( colorIndex+1 );
1109 const auto &track =
static_cast<WaveTrack&
>(pData->track);
1110 auto &
project = pData->project;
1113 menu.Check(
id,
id == me.IdOfWaveColor(
1115 menu.Enable(
id, !unsafe );
1119 std::call_once(
flag, [
this]{
1121 OnInstrument1ID = hostTable.ReserveId();
1122 OnInstrument2ID = hostTable.ReserveId();
1123 OnInstrument3ID = hostTable.ReserveId();
1124 OnInstrument4ID = hostTable.ReserveId();
1140{
return OnInstrument1ID + WaveColor;}
1146 int id =
event.GetId();
1159 XO(
"WaveColor Change"));
1168 {
"SubViews/Extra" },
1169 std::make_unique<PopupMenuSection>(
"WaveColor",
1171 PopupMenuTable::Adapt<WaveTrackPopupMenuTable>(
1175 const auto displays = view.GetDisplays();
1176 bool hasWaveform = (displays.end() != std::find(
1177 displays.begin(), displays.end(),
1179 WaveChannelViewConstants::Waveform, {} }
1191 return std::make_unique<WaveformPainter>();
1196 return const_cast< WaveClip&
>( clip )
1197 .Attachments::Get<WaveformPainter>(
sKeyW).EnsureClip(clip);
std::shared_ptr< UIHandle > UIHandlePtr
EffectDistortionSettings params
XXO("&Cut/Copy/Paste Toolbar")
BoolSetting & ShowRMSPref()
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...
ChannelGroup & GetChannelGroup()
Channel object's lifetime is assumed to be nested in its Track's.
virtual void DoSetMinimized(bool isMinimized)
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
auto FindChannel() -> std::shared_ptr< Subtype >
May return null.
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 WaveChannelHitTest(std::weak_ptr< EnvelopeHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveChannel > &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.
static constexpr uint32_t CacheElementWidth
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< WaveChannel > &pChannel)
static UIHandlePtr HitTest(std::weak_ptr< SampleHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< WaveChannel > &pChannel)
static bool IsSelectedOrSyncLockSelected(const Track &track)
static UIHandlePtr HitTest(std::weak_ptr< TimeShiftHandle > &holder, const wxMouseState &state, const wxRect &rect, const std::shared_ptr< Track > &pTrack)
static TrackArtist * Get(TrackPanelDrawingContext &)
Abstract base class for an object holding data associated with points on a time axis.
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)
An element, that contains a rasterized bitmap matching the WaveDataCacheElement.
IteratorRange< IntervalIterator< WaveClipChannel > > Intervals()
std::shared_ptr< WaveChannel > FindWaveChannel()
static void DrawBoldBoundaries(TrackPanelDrawingContext &context, const WaveChannel &channel, const wxRect &rect)
std::pair< bool, std::vector< UIHandlePtr > > DoDetailedHitTest(const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool, const std::shared_ptr< WaveChannel > &wt)
std::weak_ptr< WaveChannelView > GetWaveChannelView() const
static bool ClipDetailsVisible(const ClipTimes &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
static WaveChannelView & GetFirst(WaveTrack &wt)
Get the view of the first channel.
sampleCount GetVisibleSampleCount() const override
size_t GetChannelIndex() const
int GetRate() const override
double GetPlayStartTime() const override
double GetStretchRatio() const override
bool GetSamples(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const
This allows multiple clips to be a part of one WaveTrack.
size_t NChannels() const override
How many Sequences the clip contains.
A Track that contains audio waveform data.
bool GetSolo() const override
May vary asynchronously.
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.
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 DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Channel &channel, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true, bool useBeatsAlternateColor=false)
Helper: draws background with selection rect.
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 DrawNegativeOffsetTrackArrows(TrackPanelDrawingContext &context, const wxRect &rect)
WAVE_TRACK_API Envelope * GetEnvelopeAtTime(WaveChannel &channel, double time)
constexpr auto sampleRate
AuthorizationHandler handler
const char * end(const char *str) noexcept
const char * begin(const char *str) noexcept
static wxRect GetClipRect(const ClipTimes &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect, bool *outShowSamples=nullptr)
int GetColorIndex() const
static WaveColorAttachment & Get(WaveClip &clip)
Parameters for the waveform painting.
WavePaintParameters & SetBlankColor(graphics::Color color) noexcept
Sets the blank color.
WavePaintParameters & SetShowRMS(bool showRMS) noexcept
Sets the ShowRMS flag.
WavePaintParameters & SetBackgroundColors(graphics::Color normal, graphics::Color selected) noexcept
Sets the background colors.
WavePaintParameters & SetDBParameters(double dbRange, bool dbScale) noexcept
Sets the dB scale parameters.
WavePaintParameters & SetClippingColors(graphics::Color normal, graphics::Color selected) noexcept
Sets the clipping colors.
WavePaintParameters & SetSampleColors(graphics::Color normal, graphics::Color selected) noexcept
Sets the sample colors.
WavePaintParameters & SetDisplayParameters(int height, double zoomMin, double zoomMax, bool showClipping) noexcept
Sets the basic painting parameters.
WavePaintParameters & SetEnvelope(const Envelope &envelope) noexcept
Sets volume envelope.
WavePaintParameters & SetRMSColors(graphics::Color normal, graphics::Color selected) noexcept
Sets the RMS colors.
Class for storing color in 32-bit format.