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"
45#include <wx/graphics.h>
49#include <wx/dcmemory.h>
61 {
wxT(
"Waveform"),
XXO(
"Wa&veform") }
73 const auto pChannel = view.FindChannel<
WaveChannel>();
76 st, pProject, currentTool, bMultiTool, pChannel);
77 auto &results = pair.second;
90 results.push_back(result);
93 pChannel->GetTrack().SharedPointer())))
96 results.push_back(result);
100 results.push_back(result);
103 switch ( currentTool ) {
109 viewInfo.PositionToTime(st.
state.m_x, st.
rect.GetX());
110 const auto envelope =
113 view.mEnvelopeHandle, envelope,
114 std::dynamic_pointer_cast<const Channel>(pChannel),
120 view.mSampleHandle, st.
state, pChannel);
127 results.push_back(result);
131 return std::move( results );
139 gPrefs->
Read(
wxT(
"/GUI/CollapseToHalfWave"), &bHalfWave,
false);
140 if (wt && bHalfWave) {
144 cache.SetDisplayBounds( -0.01f, 1.0f );
147 cache.SetDisplayBounds( -1.0f, 1.0f );
160 return std::make_shared<WaveformVRulerControls>(shared_from_this());
169 const auto c = pen.GetColour();
175 const auto c = brush.GetColour();
182 uint8_t*
Allocate(
size_t width,
size_t height)
override
184 mImage =
wxImage(width, height,
false);
185 mBitmap = wxBitmap();
186 return mImage.GetData();
191 if(!mBitmap.IsOk() && mImage.IsOk())
192 mBitmap = wxBitmap(mImage);
198 return mImage.GetWidth();
203 return mImage.GetHeight();
225 const auto changed = mChanged.exchange(
false);
226 if (&clip != mWaveClip || changed)
227 mChannelCaches.clear();
231 if (mChannelCaches.size() == nChannels)
236 mChannelCaches.reserve(nChannels);
238 for (
auto channelIndex = 0; channelIndex < nChannels; ++channelIndex)
240 auto dataCache = std::make_shared<WaveDataCache>(clip, channelIndex);
242 auto bitmapCache = std::make_unique<WaveBitmapCache>(
244 [] {
return std::make_unique<WaveBitmapCacheElementWX>(); });
246 mChannelCaches.push_back(
247 { std::move(dataCache), std::move(bitmapCache) });
255 for (
auto& channelCache : mChannelCaches)
256 channelCache.BitmapCache->SetSelection(zoomInfo, t0, t1, selected);
261 const ZoomInfo& zoomInfo,
const wxRect& targetRect,
int leftOffset,
262 double from,
double to)
264 auto& channelCache = mChannelCaches[channelIndex];
266 channelCache.BitmapCache->SetPaintParameters(
params);
268 auto range = channelCache.BitmapCache->PerformLookup(zoomInfo, from, to);
270 auto left = targetRect.x + leftOffset;
271 auto height = targetRect.height;
273 const auto top = targetRect.y;
276 for (
auto it = range.begin(); it != range.end(); ++it)
278 const auto elementLeftOffset = it.GetLeftOffset();
279 const auto elementRightOffset = it.GetRightOffset();
282 elementLeftOffset - elementRightOffset;
285 memdc.SelectObject(bitmap);
287 wxPoint(left, targetRect.y), wxSize(width, it->Height()), &memdc,
288 wxPoint(elementLeftOffset, 0));
298 mChanged.store(
true);
305 mChanged.store(
true);
310 for (
auto& channelCache : mChannelCaches)
312 channelCache.DataCache->Invalidate();
313 channelCache.BitmapCache->Invalidate();
317 std::unique_ptr<WaveClipListener>
Clone()
const override
319 return std::make_unique<WaveformPainter>();
332 std::atomic<bool> mChanged =
false;
337 int leftOffset,
double t0,
double t1,
338 const wxRect & rect,
float zoomMin,
float zoomMax,
bool dB,
float dBRange,
341 auto& clip = channelInterval.
GetClip();
345 const ZoomInfo zoomInfo(0.0, artist->pZoomInfo->GetZoom());
349 const auto trimLeft = clip.GetTrimLeft();
350 const auto sequenceStartTime = clip.GetSequenceStartTime();
362 ColorFromWXPen(muted ? artist->muteSamplePen : artist->samplePen),
363 ColorFromWXPen(muted ? artist->muteSamplePen : artist->samplePen))
371 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen),
372 ColorFromWXPen(muted ? artist->muteClippedPen : artist->clippedPen))
375 clipPainter.SetSelection(
376 zoomInfo, artist->pSelectedRegion->t0() - sequenceStartTime,
377 artist->pSelectedRegion->t1() - sequenceStartTime,
381 channelIndex, context.
dc, paintParameters, zoomInfo, rect, leftOffset,
382 t0 + trimLeft, t1 + trimLeft);
388 int leftOffset,
const wxRect &rect,
390 float zoomMin,
float zoomMax,
391 int zeroLevelYCoordinate,
392 bool dB,
float dBRange,
393 double t0,
double t1,
394 bool bIsSyncLockSelected,
395 bool highlightEnvelope)
397 auto &dc = context.
dc;
399 const auto &zoomInfo = *artist->pZoomInfo;
411 int halfHeight = wxMax(h / 2, 1);
412 int maxtop, lmaxtop = 0;
413 int mintop, lmintop = 0;
414 int maxbot, lmaxbot = 0;
415 int minbot, lminbot = 0;
416 bool sel, lsel =
false;
420 const auto &blankBrush = artist->blankBrush;
421 const auto &selectedBrush = artist->selectedBrush;
422 const auto &unselectedBrush = artist->unselectedBrush;
423 const auto &envelopeBackgroundBrush = artist->envelopeBackgroundBrush;
425 dc.SetPen(*wxTRANSPARENT_PEN);
426 dc.SetBrush(envelopeBackgroundBrush);
427 dc.DrawRectangle(rect);
430 int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
432 double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
433 for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
434 nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
440 h, dB,
true, dBRange,
true);
442 h, dB,
false, dBRange,
true);
445 h, dB,
false, dBRange,
true);
447 h, dB,
true, dBRange,
true);
453 const auto drawEnvelope = artist->drawEnvelope;
454 if (!drawEnvelope || maxbot > mintop) {
459 sel = (t0 <= time && nextTime < t1);
460 sel = sel || (xx == selectedX);
462 sel = sel && !bIsSyncLockSelected;
464 if (lmaxtop == maxtop &&
472 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
476 if (lmaxbot < lmintop - 1) {
477 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
478 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
481 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
484 if (highlightEnvelope && lmaxbot < lmintop - 1) {
486 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
497 dc.SetBrush(lsel ? selectedBrush : unselectedBrush);
500 if (lmaxbot < lmintop - 1) {
501 dc.DrawRectangle(l, rect.y + lmaxtop, w, lmaxbot - lmaxtop);
502 dc.DrawRectangle(l, rect.y + lmintop, w, lminbot - lmintop);
505 dc.DrawRectangle(l, rect.y + lmaxtop, w, lminbot - lmaxtop);
507 if (highlightEnvelope && lmaxbot < lmintop - 1) {
509 dc.DrawRectangle(l, rect.y + lmaxbot, w, lmintop - lmaxbot);
513 if (bIsSyncLockSelected && t0 < t1) {
514 const int begin = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t0, -leftOffset))));
515 const int end = std::max(0,
std::min(rect.width, (
int)(zoomInfo.TimeToPosition(t1, -leftOffset))));
522 if (zeroLevelYCoordinate >= rect.GetTop() &&
523 zeroLevelYCoordinate <= rect.GetBottom()) {
524 dc.SetPen(*wxBLACK_PEN);
526 rect.x + rect.width - 1, zeroLevelYCoordinate);
535 : rect(x, y, w, h), averageZoom(zoom), inFisheye(i)
540 (std::vector<WavePortion> &portions,
const wxRect &rect,
const ZoomInfo &zoomInfo,
548 const auto intervals = zoomInfo.
FindIntervals(rect.width, rect.x);
549 ZoomInfo::Intervals::const_iterator it = intervals.begin(),
end = intervals.end(), prev;
550 wxASSERT(it !=
end && it->position == rect.x);
551 const int rightmost = rect.x + rect.width;
552 for (
int left = rect.x; left < rightmost;) {
553 while (it !=
end && it->position <= left)
557 const int right = std::max(left, (
int)(it->position));
558 const int width = right - left;
562 prev->averageZoom, prev->inFisheye)
569 int leftOffset,
const wxRect &rect,
570 float zoomMin,
float zoomMax,
571 bool dB,
float dBRange,
573 bool showPoints,
bool muted,
577 auto &dc = context.
dc;
579 const auto &zoomInfo = *artist->pZoomInfo;
583 const double t0 = std::max(0.0, zoomInfo.PositionToTime(0, -leftOffset) - toffset);
589 const double t1 = zoomInfo.PositionToTime(rect.width - 1, -leftOffset) - toffset;
594 auto slen =
std::min(snSamples - s0, s1 - s0 + 1).as_size_t();
599 Floats buffer{ size_t(slen) };
611 clipped.
reinit(
size_t(slen) );
613 const auto &muteSamplePen = artist->muteSamplePen;
614 const auto &samplePen = artist->samplePen;
615 auto &pen = highlight ?
AColor::uglyPen : muted ? muteSamplePen : samplePen;
618 for (
decltype(slen) s = 0; s < slen; s++) {
619 const double time = toffset + (s + s0).as_double() / rate;
622 (
int)(zoomInfo.TimeToPosition(time, -leftOffset))));
627 const double tt = buffer[s] * value;
630 clipped[clipcnt++] = xx;
635 rect.height, dB,
true, dBRange,
false)));
641 const auto bigPoints = artist->bigPoints;
642 const int tickSize = bigPoints ? 4 : 3;
645 pr.height = tickSize;
647 const auto &dragsampleBrush = artist->dragsampleBrush;
648 const auto &sampleBrush = artist->sampleBrush;
649 auto &brush = highlight
651 : bigPoints ? dragsampleBrush : sampleBrush;
652 dc.SetBrush( brush );
653 for (
decltype(slen) s = 0; s < slen; s++) {
654 if (ypos[s] >= 0 && ypos[s] < rect.height) {
655 pr.x = rect.x + xpos[s] - tickSize/2;
656 pr.y = rect.y + ypos[s] - tickSize/2;
662 const auto sampleDisplay = artist->mSampleDisplay;
667 int yZero =
GetWaveYPos(0.0, zoomMin, zoomMax, rect.height, dB,
true, dBRange,
false);
668 yZero = rect.y + std::max(-1,
std::min(rect.height, yZero));
669 for (
decltype(slen) s = 0; s < slen; s++) {
671 rect.x + xpos[s], rect.y + ypos[s],
672 rect.x + xpos[s], yZero);
677 for (
decltype(slen) s = 0; s < slen - 1; s++) {
679 rect.x + xpos[s], rect.y + ypos[s],
680 rect.x + xpos[s + 1], rect.y + ypos[s + 1]);
686 const auto &muteClippedPen = artist->muteClippedPen;
687 const auto &clippedPen = artist->clippedPen;
688 dc.SetPen(muted ? muteClippedPen : clippedPen);
689 while (--clipcnt >= 0) {
690 auto s = clipped[clipcnt];
691 AColor::Line(dc, rect.x + s, rect.y, rect.x + s, rect.y + rect.height);
698 const wxRect &rect,
int x0,
int y0,
int cy,
bool top )
700 auto &dc = context.
dc;
702 int xx = rect.x + x0;
703 int yy = rect.y + cy;
710 else if (y0 > rect.height) {
726 const wxRect &rect,
const double env[],
727 float zoomMin,
float zoomMax,
728 bool dB,
float dBRange,
bool highlight)
730 auto &dc = context.
dc;
737 for (
int x0 = 0; x0 < rect.width; ++x0) {
738 int cenvTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
739 h, dB,
true, dBRange,
true);
741 int cenvBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
742 h, dB,
true, dBRange,
true);
744 int envTop =
GetWaveYPos(env[x0], zoomMin, zoomMax,
745 h, dB,
true, dBRange,
false);
747 int envBot =
GetWaveYPos(-env[x0], zoomMin, zoomMax,
748 h, dB,
true, dBRange,
false);
751 if (cenvBot - cenvTop < 9) {
752 int value = (int)((zoomMax / (zoomMax - zoomMin)) * h);
757 DrawEnvLine( context, rect, x0, envTop, cenvTop,
true );
758 DrawEnvLine( context, rect, x0, envBot, cenvBot,
false );
767 const wxRect &rect,
bool dB,
bool muted,
bool selected)
770 auto &dc = context.
dc;
772 const auto &selectedRegion = *artist->pSelectedRegion;
773 const auto &zoomInfo = *artist->pZoomInfo;
777 bool highlightEnvelope =
false;
778#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
780 highlightEnvelope = target && target->
GetEnvelope() == &envelope;
793 const wxRect &hiddenMid =
params.hiddenMid;
796 if (hiddenMid.width <= 0) {
800 const double &t0 =
params.t0;
801 const double &t1 =
params.t1;
803 const double &trackRectT0 =
params.trackRectT0;
804 const double &averagePixelsPerSecond =
params.averagePixelsPerSecond;
807 double leftOffset =
params.leftOffset;
808 const wxRect &mid =
params.mid;
811 const float dBRange =
settings.dBRange;
813 dc.SetPen(*wxTRANSPARENT_PEN);
815 artist->SetColours( iColorIndex );
819 float zoomMin, zoomMax;
821 cache.GetDisplayBounds(zoomMin, zoomMax);
823 std::vector<double> vEnv(mid.width);
824 double *
const env = &vEnv[0];
831 env, mid.width, leftOffset, zoomInfo);
838 const auto &track = channel.
GetTrack();
841 tt1 = track.SnapToSample(selectedRegion.t1());
848 cache.ZeroLevelYCoordinate(mid),
851 !track.GetSelected(), highlightEnvelope);
855 const double threshold1 = 0.5 *
sampleRate / stretchRatio;
857 const double threshold2 = 3 *
sampleRate / stretchRatio;
859 bool highlight =
false;
860#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
862 highlight = target && target->FindChannel().get() == &track;
865 const bool showIndividualSamples = zoomInfo.GetZoom() > threshold1;
866 const bool showPoints = zoomInfo.GetZoom() > threshold2;
868 if(!showIndividualSamples)
871 context, channel.
GetTrack(), clip, leftOffset, t0, t1,
872 rect, zoomMin, zoomMax, dB, dBRange, muted);
876 std::vector<WavePortion> portions;
878 auto offset = leftOffset;
879 for(
const auto& portion : portions)
881 assert(!portion.inFisheye && portion.averageZoom > threshold1);
882 if(portion.inFisheye || portion.averageZoom <= threshold1)
885 wxRect rectPortion = portion.rect;
886 rectPortion.Intersect(mid);
888 context, offset, rectPortion, zoomMin, zoomMax, dB, dBRange, clip,
889 showPoints, muted, highlight);
890 offset += rectPortion.width;
895 const auto drawEnvelope = artist->drawEnvelope;
898 context, mid, env, zoomMin, zoomMax, dB, dBRange, highlightEnvelope);
900 context, mid, dB, dBRange, zoomMin, zoomMax,
true, rect.x - mid.x);
905 if (trackRectT0 == 0.0 && playStartTime < 0.0)
917 bool rightwards,
bool highlight )
919 auto &dc = context.
dc;
921 const int border = 3;
924 const int barSpacing = 4;
925 const int barWidth = 3;
929 if (rect.height <= ((taper+border + barSpacing) * 2)) {
932 if (rect.width <= (width * 2 + border * 3)) {
937 int leftTaper = rightwards ? 0 : 6;
938 int rightTaper = rightwards ? 6 : 0;
940 int xLeft = rightwards ? (rect.x + border - 2)
941 : (rect.x + rect.width + 1 - (border + width));
942 int yTop = rect.y + border;
943 int yBot = rect.y + rect.height - border - 1;
946 AColor::Line(dc, xLeft, yBot - leftTaper, xLeft, yTop + leftTaper);
947 AColor::Line(dc, xLeft, yTop + leftTaper, xLeft + xFlat, yTop);
948 AColor::Line(dc, xLeft + xFlat, yTop, xLeft + width, yTop + rightTaper);
951 AColor::Line(dc, xLeft + width, yTop + rightTaper, xLeft + width, yBot - rightTaper);
952 AColor::Line(dc, xLeft + width, yBot - rightTaper, xLeft + width-xFlat, yBot);
953 AColor::Line(dc, xLeft + width - xFlat, yBot, xLeft, yBot - leftTaper);
955 int firstBar = yTop + taper + taper / 2;
956 int nBars = (yBot - yTop - taper * 3) / barSpacing + 1;
957 xLeft += (width - barWidth + 1) / 2;
962 for (i = 0;i < nBars; i++) {
963 yy = firstBar + barSpacing * i;
967 for(i = 0;i < nBars; i++){
968 yy = firstBar + barSpacing * i + 1;
983 auto &dc = context.
dc;
986 bool highlight =
false;
987 bool gripHit =
false;
988#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
991 highlight = target && target->FindTrack().get() ==
997 const auto &blankSelectedBrush = artist->blankSelectedBrush;
998 const auto &blankBrush = artist->blankBrush;
1000 context, rect, channel, blankSelectedBrush, blankBrush );
1002 for (
const auto &pInterval : channel.
Intervals()) {
1003 bool selected = selectedClip &&
1004 selectedClip == &pInterval->GetClip();
1009 const auto drawSliders = artist->drawSliders;
1021 const auto &pendingTracks = *artist->pPendingTracks;
1022 auto &dc = context.
dc;
1028 pendingTracks.SubstitutePendingChangedChannel(*pChannel));
1030 const auto hasSolo = artist->hasSolo;
1031 bool muted = (hasSolo || wc.GetTrack().GetMute()) &&
1034#if defined(__WXMAC__)
1035 wxAntialiasMode aamode = dc.GetGraphicsContext()->GetAntialiasMode();
1036 dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE);
1040 wxASSERT(waveChannelView.use_count());
1042 auto selectedClip = waveChannelView->GetSelectedClip();
1043 DoDraw(context, wc, selectedClip.get(), rect, muted);
1045#if defined(__WXMAC__)
1046 dc.GetGraphicsContext()->SetAntialiasMode(aamode);
1054 return std::make_shared<WaveformView>( view );
1064#include "../../../../widgets/PopupMenuTable.h"
1067#include "../../../../RefreshCode.h"
1104 return XXO(
"Instrument %i").Format( colorIndex+1 );
1112 const auto &track =
static_cast<WaveTrack&
>(pData->track);
1113 auto &
project = pData->project;
1116 menu.Check(
id,
id == me.IdOfWaveColor(
1118 menu.Enable(
id, !unsafe );
1122 std::call_once(
flag, [
this]{
1124 OnInstrument1ID = hostTable.ReserveId();
1125 OnInstrument2ID = hostTable.ReserveId();
1126 OnInstrument3ID = hostTable.ReserveId();
1127 OnInstrument4ID = hostTable.ReserveId();
1143{
return OnInstrument1ID + WaveColor;}
1149 int id =
event.GetId();
1162 XO(
"WaveColor Change"));
1171 {
"SubViews/Extra" },
1172 std::make_unique<PopupMenuSection>(
"WaveColor",
1174 PopupMenuTable::Adapt<WaveTrackPopupMenuTable>(
1178 const auto displays = view.GetDisplays();
1179 bool hasWaveform = (displays.end() != std::find(
1180 displays.begin(), displays.end(),
1182 WaveChannelViewConstants::Waveform, {} }
1194 return std::make_unique<WaveformPainter>();
1199 return const_cast< WaveClip&
>( clip )
1200 .Attachments::Get<WaveformPainter>(
sKeyW).EnsureClip(clip);
std::shared_ptr< UIHandle > UIHandlePtr
EffectDistortionSettings params
XXO("&Cut/Copy/Paste Toolbar")
BoolSetting & ShowRMSPref()
BoolSetting & ShowClippingPref()
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)
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
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
constexpr Color Black
Opaque black color constant.
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 & SetZeroLineColor(graphics::Color color) noexcept
Sets the horizontal zero line color.
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.