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>
55 {
wxT(
"Waveform"),
XXO(
"Wa&veform") }
67 const auto pChannel = view.FindChannel<
WaveChannel>();
70 st, pProject, currentTool, bMultiTool, pChannel);
71 auto &results = pair.second;
84 results.push_back(result);
87 pChannel->GetTrack().SharedPointer())))
90 results.push_back(result);
94 results.push_back(result);
97 switch ( currentTool ) {
103 viewInfo.PositionToTime(st.
state.m_x, st.
rect.GetX());
104 const auto envelope =
107 view.mEnvelopeHandle, envelope,
108 std::dynamic_pointer_cast<const Channel>(pChannel),
114 view.mSampleHandle, st.
state, pChannel);
121 results.push_back(result);
125 return std::move( results );
133 gPrefs->
Read(
wxT(
"/GUI/CollapseToHalfWave"), &bHalfWave,
false);
134 if (wt && bHalfWave) {
138 cache.SetDisplayBounds( -0.01f, 1.0f );
141 cache.SetDisplayBounds( -1.0f, 1.0f );
154 return std::make_shared<WaveformVRulerControls>(shared_from_this());
163 const auto c = pen.GetColour();
169 const auto c = brush.GetColour();
176 uint8_t*
Allocate(
size_t width,
size_t height)
override
178 mImage =
wxImage(width, height,
false);
179 mBitmap = wxBitmap();
180 return mImage.GetData();
185 if(!mBitmap.IsOk() && mImage.IsOk())
186 mBitmap = wxBitmap(mImage);
192 return mImage.GetWidth();
197 return mImage.GetHeight();
219 if (&clip != mWaveClip)
220 mChannelCaches.clear();
224 if (mChannelCaches.size() == nChannels)
229 mChannelCaches.reserve(nChannels);
231 for (
auto channelIndex = 0; channelIndex < nChannels; ++channelIndex)
233 auto dataCache = std::make_shared<WaveDataCache>(clip, channelIndex);
235 auto bitmapCache = std::make_unique<WaveBitmapCache>(
237 [] {
return std::make_unique<WaveBitmapCacheElementWX>(); },
238 dataCache->GetSampleRate());
240 mChannelCaches.push_back(
241 { std::move(dataCache), std::move(bitmapCache) });
249 for (
auto& channelCache : mChannelCaches)
250 channelCache.BitmapCache->SetSelection(zoomInfo, t0, t1, selected);
255 const ZoomInfo& zoomInfo,
const wxRect& targetRect,
int leftOffset,
256 double from,
double to)
258 auto& channelCache = mChannelCaches[channelIndex];
260 channelCache.BitmapCache->SetPaintParameters(
params);
262 auto range = channelCache.BitmapCache->PerformLookup(zoomInfo, from, to);
264 auto left = targetRect.x + leftOffset;
265 auto height = targetRect.height;
267 const auto top = targetRect.y;
270 for (
auto it = range.begin(); it != range.end(); ++it)
272 const auto elementLeftOffset = it.GetLeftOffset();
273 const auto elementRightOffset = it.GetRightOffset();
276 elementLeftOffset - elementRightOffset;
279 memdc.SelectObject(bitmap);
281 wxPoint(left, targetRect.y), wxSize(width, it->Height()), &memdc,
282 wxPoint(elementLeftOffset, 0));
292 for (
auto& channelCache : mChannelCaches)
293 channelCache.DataCache->Invalidate();
296 std::unique_ptr<WaveClipListener>
Clone()
const override
298 return std::make_unique<WaveformPainter>();
315 int leftOffset,
double t0,
double t1,
316 const wxRect & rect,
float zoomMin,
float zoomMax,
bool dB,
float dBRange,
319 auto& clip = channelInterval.
GetClip();
323 const ZoomInfo zoomInfo(0.0, artist->pZoomInfo->GetZoom());
327 const auto trimLeft = clip.GetTrimLeft();
328 const auto sequenceStartTime = clip.GetSequenceStartTime();
334 rect.GetHeight(), zoomMin, zoomMax, artist->mShowClipping)
338 ColorFromWXPen(muted ? artist->muteSamplePen : artist->samplePen),
339 ColorFromWXPen(muted ? artist->muteSamplePen : artist->selsamplePen))
347 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen),
348 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen))
351 clipPainter.SetSelection(
352 zoomInfo, artist->pSelectedRegion->t0() - sequenceStartTime,
353 artist->pSelectedRegion->t1() - sequenceStartTime,
357 channelIndex, context.
dc, paintParameters, zoomInfo, rect, leftOffset,
358 t0 + trimLeft, t1 + trimLeft);
364 int leftOffset,
const wxRect &rect,
366 float zoomMin,
float zoomMax,
367 int zeroLevelYCoordinate,
368 bool dB,
float dBRange,
369 double t0,
double t1,
370 bool bIsSyncLockSelected,
371 bool highlightEnvelope)
373 auto &dc = context.
dc;
375 const auto &zoomInfo = *artist->pZoomInfo;
387 int halfHeight = wxMax(h / 2, 1);
388 int maxtop, lmaxtop = 0;
389 int mintop, lmintop = 0;
390 int maxbot, lmaxbot = 0;
391 int minbot, lminbot = 0;
392 bool sel, lsel =
false;
396 const auto &blankBrush = artist->blankBrush;
397 const auto &selectedBrush = artist->selectedBrush;
398 const auto &unselectedBrush = artist->unselectedBrush;
400 dc.SetPen(*wxTRANSPARENT_PEN);
401 dc.SetBrush(blankBrush);
402 dc.DrawRectangle(rect);
405 int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
407 double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
408 for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
409 nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
415 h, dB,
true, dBRange,
true);
417 h, dB,
false, dBRange,
true);
420 h, dB,
false, dBRange,
true);
422 h, dB,
true, dBRange,
true);
428 const auto drawEnvelope = artist->drawEnvelope;
429 if (!drawEnvelope || maxbot > mintop) {
434 sel = (t0 <= time && nextTime < t1);
435 sel = sel || (xx == selectedX);
437 sel = sel && !bIsSyncLockSelected;
439 if (lmaxtop == maxtop &&
447 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
451 if (lmaxbot < lmintop - 1) {
452 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
453 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
456 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
459 if (highlightEnvelope && lmaxbot < lmintop - 1) {
461 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
472 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
475 if (lmaxbot < lmintop - 1) {
476 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
477 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
480 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
482 if (highlightEnvelope && lmaxbot < lmintop - 1) {
484 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
488 if (bIsSyncLockSelected && t0 < t1) {
489 const int begin = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
490 const int end = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
497 if (zeroLevelYCoordinate >= rect.GetTop() &&
498 zeroLevelYCoordinate <= rect.GetBottom()) {
499 dc.SetPen(*wxBLACK_PEN);
501 rect.x + rect.width - 1, zeroLevelYCoordinate);
510 : rect(x, y, w, h), averageZoom(zoom), inFisheye(i)
515 (std::vector<WavePortion> &portions,
const wxRect &rect,
const ZoomInfo &zoomInfo,
523 const auto intervals = zoomInfo.
FindIntervals(rect.width, rect.x);
524 ZoomInfo::Intervals::const_iterator it = intervals.begin(),
end = intervals.end(), prev;
525 wxASSERT(it !=
end && it->position == rect.x);
526 const int rightmost = rect.x + rect.width;
527 for (
int left = rect.x; left < rightmost;) {
528 while (it !=
end && it->position <= left)
532 const int right = std::max(left, (
int)(it->position));
533 const int width = right - left;
537 prev->averageZoom, prev->inFisheye)
544 int leftOffset,
const wxRect &rect,
545 float zoomMin,
float zoomMax,
546 bool dB,
float dBRange,
548 bool showPoints,
bool muted,
552 auto &dc = context.
dc;
554 const auto &zoomInfo = *artist->pZoomInfo;
558 const double t0 = std::max(0.0, zoomInfo.PositionToTime(0, -leftOffset) - toffset);
564 const double t1 = zoomInfo.PositionToTime(rect.width - 1, -leftOffset) - toffset;
569 auto slen =
std::min(snSamples - s0, s1 - s0 + 1).as_size_t();
574 Floats buffer{ size_t(slen) };
584 const auto bShowClipping = artist->mShowClipping;
586 clipped.
reinit(
size_t(slen) );
588 const auto &muteSamplePen = artist->muteSamplePen;
589 const auto &samplePen = artist->samplePen;
590 auto &pen = highlight ?
AColor::uglyPen : muted ? muteSamplePen : samplePen;
593 for (
decltype(slen) s = 0; s < slen; s++) {
594 const double time = toffset + (s + s0).as_double() / rate;
597 (
int)(zoomInfo.TimeToPosition(time, -leftOffset))));
602 const double tt = buffer[s] * value;
605 clipped[clipcnt++] = xx;
610 rect.height, dB,
true, dBRange,
false)));
616 const auto bigPoints = artist->bigPoints;
617 const int tickSize = bigPoints ? 4 : 3;
620 pr.height = tickSize;
622 const auto &dragsampleBrush = artist->dragsampleBrush;
623 const auto &sampleBrush = artist->sampleBrush;
624 auto &brush = highlight
626 : bigPoints ? dragsampleBrush : sampleBrush;
627 dc.SetBrush( brush );
628 for (
decltype(slen) s = 0; s < slen; s++) {
629 if (ypos[s] >= 0 && ypos[s] < rect.height) {
630 pr.x = rect.x + xpos[s] - tickSize/2;
631 pr.y = rect.y + ypos[s] - tickSize/2;
637 const auto sampleDisplay = artist->mSampleDisplay;
642 int yZero =
GetWaveYPos(0.0, zoomMin, zoomMax, rect.height, dB,
true, dBRange,
false);
643 yZero = rect.y + std::max(-1,
std::min(rect.height, yZero));
644 for (
decltype(slen) s = 0; s < slen; s++) {
646 rect.x + xpos[s], rect.y + ypos[s],
647 rect.x + xpos[s], yZero);
652 for (
decltype(slen) s = 0; s < slen - 1; s++) {
654 rect.x + xpos[s], rect.y + ypos[s],
655 rect.x + xpos[s + 1], rect.y + ypos[s + 1]);
661 const auto &muteClippedPen = artist->muteClippedPen;
662 const auto &clippedPen = artist->clippedPen;
663 dc.SetPen(muted ? muteClippedPen : clippedPen);
664 while (--clipcnt >= 0) {
665 auto s = clipped[clipcnt];
666 AColor::Line(dc, rect.x + s, rect.y, rect.x + s, rect.y + rect.height);
673 const wxRect &rect,
int x0,
int y0,
int cy,
bool top )
675 auto &dc = context.
dc;
677 int xx = rect.x + x0;
678 int yy = rect.y + cy;
685 else if (y0 > rect.height) {
701 const wxRect &rect,
const double env[],
702 float zoomMin,
float zoomMax,
703 bool dB,
float dBRange,
bool highlight)
705 auto &dc = context.
dc;
712 for (
int x0 = 0; x0 < rect.width; ++x0) {
713 int cenvTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
714 h, dB,
true, dBRange,
true);
716 int cenvBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
717 h, dB,
true, dBRange,
true);
719 int envTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
720 h, dB,
true, dBRange,
false);
722 int envBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
723 h, dB,
true, dBRange,
false);
726 if (cenvBot - cenvTop < 9) {
727 int value = (int)((zoomMax / (zoomMax - zoomMin)) * h);
732 DrawEnvLine( context, rect, x0, envTop, cenvTop,
true );
733 DrawEnvLine( context, rect, x0, envBot, cenvBot,
false );
742 const wxRect &rect,
bool dB,
bool muted,
bool selected)
745 auto &dc = context.
dc;
747 const auto &selectedRegion = *artist->pSelectedRegion;
748 const auto &zoomInfo = *artist->pZoomInfo;
752 bool highlightEnvelope =
false;
753#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
755 highlightEnvelope = target && target->
GetEnvelope() == &envelope;
768 const wxRect &hiddenMid =
params.hiddenMid;
771 if (hiddenMid.width <= 0) {
775 const double &t0 =
params.t0;
776 const double &t1 =
params.t1;
778 const double &trackRectT0 =
params.trackRectT0;
779 const double &averagePixelsPerSecond =
params.averagePixelsPerSecond;
782 double leftOffset =
params.leftOffset;
783 const wxRect &mid =
params.mid;
786 const float dBRange =
settings.dBRange;
788 dc.SetPen(*wxTRANSPARENT_PEN);
790 artist->SetColours( iColorIndex );
794 float zoomMin, zoomMax;
796 cache.GetDisplayBounds(zoomMin, zoomMax);
798 std::vector<double> vEnv(mid.width);
799 double *
const env = &vEnv[0];
806 env, mid.width, leftOffset, zoomInfo);
813 const auto &track = channel.
GetTrack();
816 tt1 = track.SnapToSample(selectedRegion.t1());
823 cache.ZeroLevelYCoordinate(mid),
826 !track.GetSelected(), highlightEnvelope);
830 const double threshold1 = 0.5 *
sampleRate / stretchRatio;
832 const double threshold2 = 3 *
sampleRate / stretchRatio;
834 bool highlight =
false;
835#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
837 highlight = target && target->FindChannel().get() == &track;
840 const bool showIndividualSamples = zoomInfo.GetZoom() > threshold1;
841 const bool showPoints = zoomInfo.GetZoom() > threshold2;
843 if(!showIndividualSamples)
846 context, channel.
GetTrack(), clip, leftOffset, t0, t1,
847 rect, zoomMin, zoomMax, dB, dBRange, muted);
852 context, leftOffset, rect, zoomMin, zoomMax, dB, dBRange, clip,
853 showPoints, muted, highlight);
856 const auto drawEnvelope = artist->drawEnvelope;
859 context, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope);
861 context, mid, dB, dBRange, zoomMin, zoomMax,
true, rect.x - mid.x);
866 if (trackRectT0 == 0.0 && playStartTime < 0.0)
878 bool rightwards,
bool highlight )
880 auto &dc = context.
dc;
882 const int border = 3;
885 const int barSpacing = 4;
886 const int barWidth = 3;
890 if (rect.height <= ((taper+border + barSpacing) * 2)) {
893 if (rect.width <= (width * 2 + border * 3)) {
898 int leftTaper = rightwards ? 0 : 6;
899 int rightTaper = rightwards ? 6 : 0;
901 int xLeft = rightwards ? (rect.x + border - 2)
902 : (rect.x + rect.width + 1 - (border + width));
903 int yTop = rect.y + border;
904 int yBot = rect.y + rect.height - border - 1;
907 AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
908 AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
909 AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
912 AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
913 AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
914 AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
916 int firstBar = yTop + taper + taper / 2;
917 int nBars = (yBot - yTop - taper * 3) / barSpacing + 1;
918 xLeft += (width - barWidth + 1) / 2;
923 for (i = 0;i < nBars; i++) {
924 yy = firstBar + barSpacing * i;
928 for(i = 0;i < nBars; i++){
929 yy = firstBar + barSpacing * i + 1;
944 auto &dc = context.
dc;
947 bool highlight =
false;
948 bool gripHit =
false;
949#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
952 highlight = target && target->FindTrack().get() ==
958 const auto &blankSelectedBrush = artist->blankSelectedBrush;
959 const auto &blankBrush = artist->blankBrush;
961 context, rect, channel, blankSelectedBrush, blankBrush );
963 for (
const auto &pInterval : channel.
Intervals()) {
964 bool selected = selectedClip &&
965 selectedClip == &pInterval->GetClip();
970 const auto drawSliders = artist->drawSliders;
982 const auto &pendingTracks = *artist->pPendingTracks;
983 auto &dc = context.
dc;
989 pendingTracks.SubstitutePendingChangedChannel(*pChannel));
991 const auto hasSolo = artist->hasSolo;
992 bool muted = (hasSolo || wc.GetTrack().GetMute()) &&
995#if defined(__WXMAC__)
996 wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
997 dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE);
1001 wxASSERT(waveChannelView.use_count());
1003 auto selectedClip = waveChannelView->GetSelectedClip();
1004 DoDraw(context, wc, selectedClip.get(), rect, muted);
1006#if defined(__WXMAC__)
1007 dc.GetGraphicsContext()->SetAntialiasMode(aamode);
1015 return std::make_shared<WaveformView>( view );
1025#include "../../../../widgets/PopupMenuTable.h"
1028#include "../../../../RefreshCode.h"
1065 return XXO(
"Instrument %i").Format( colorIndex+1 );
1073 const auto &track =
static_cast<WaveTrack&
>(pData->track);
1074 auto &
project = pData->project;
1077 menu.Check(
id,
id == me.IdOfWaveColor(
1079 menu.Enable(
id, !unsafe );
1083 std::call_once(
flag, [
this]{
1085 OnInstrument1ID = hostTable.ReserveId();
1086 OnInstrument2ID = hostTable.ReserveId();
1087 OnInstrument3ID = hostTable.ReserveId();
1088 OnInstrument4ID = hostTable.ReserveId();
1104{
return OnInstrument1ID + WaveColor;}
1110 int id =
event.GetId();
1123 XO(
"WaveColor Change"));
1132 {
"SubViews/Extra" },
1133 std::make_unique<PopupMenuSection>(
"WaveColor",
1135 PopupMenuTable::Adapt<WaveTrackPopupMenuTable>(
1139 const auto displays = view.GetDisplays();
1140 bool hasWaveform = (displays.end() != std::find(
1141 displays.begin(), displays.end(),
1143 WaveChannelViewConstants::Waveform, {} }
1155 return std::make_unique<WaveformPainter>();
1160 return const_cast< WaveClip&
>( clip )
1161 .Attachments::Get<WaveformPainter>(
sKeyW).EnsureClip(clip);
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...
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 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)
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Channel &channel, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
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 & 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.