![]() |
Deluge Firmware 1.3.0
Build date: 2026.11.28
|
Classes | |
| struct | PendingLoad |
| A Cluster that findPeaksPerCol() enqueued and is waiting on. More... | |
Public Member Functions | |
| bool | renderFullScreen (Sample *sample, uint64_t xScroll, uint64_t xZoom, RGB thisImage[][kDisplayWidth+kSideBarWidth], WaveformRenderData *data, SampleRecorder *recorder=nullptr, std::optional< RGB > rgb=std::nullopt, bool reversed=false, int32_t xEnd=kDisplayWidth) |
| bool | renderAsSingleRow (Sample *sample, int64_t xScroll, uint64_t xZoom, RGB *thisImage, WaveformRenderData *data, SampleRecorder *recorder, RGB rgb, bool reversed, int32_t xStart, int32_t xEnd) |
| Renders a Sample's waveform as one row of brightness, as song row view shows it. | |
| void | renderOneCol (Sample *sample, int32_t xDisplay, RGB thisImage[][kDisplayWidth+kSideBarWidth], WaveformRenderData *data, bool reversed=false, std::optional< RGB > rgb=std::nullopt) |
| void | renderOneColForCollapseAnimation (int32_t xDisplay, int32_t xDisplayOutput, int32_t maxPeakFromZero, int32_t progress, RGB thisImage[][kDisplayWidth+kSideBarWidth], WaveformRenderData *data, std::optional< RGB > rgb, bool reversed, int32_t valueCentrePoint, int32_t valueSpan) |
| void | renderOneColForCollapseAnimationZoomedOut (int32_t xDisplayWaveformLeftEdge, int32_t xDisplayWaveformRightEdge, int32_t xDisplayOutput, int32_t maxPeakFromZero, int32_t progress, RGB thisImage[][kDisplayWidth+kSideBarWidth], WaveformRenderData *data, std::optional< RGB > rgb, bool reversed, int32_t valueCentrePoint, int32_t valueSpan) |
| bool | findPeaksPerCol (Sample *sample, int64_t xScroll, uint64_t xZoom, WaveformRenderData *data, SampleRecorder *recorder=nullptr, int32_t xStart=0, int32_t xEnd=kDisplayWidth, bool wait_for_card=true) |
Fills in data's per-column min/max peaks for any columns in [xStart, xEnd) not already cached. | |
| void | releaseFinishedLoads () |
| Lets go of enqueued Clusters that have finished loading, or that never will because they're unloadable. | |
| void | releaseAllLoads () |
| Lets go of every enqueued Cluster and its Sample, loaded or not. | |
Public Attributes | |
| int8_t | collapseAnimationToWhichRow |
Private Member Functions | |
| void | holdUntilLoaded (Sample *sample, Cluster *cluster) |
| Takes over the caller's reason on an enqueued Cluster until it has loaded. | |
| int32_t | getColBrightnessForSingleRow (int32_t xDisplay, int32_t maxPeakFromZero, WaveformRenderData *data) |
| void | getColBarPositions (int32_t xDisplay, WaveformRenderData *data, int32_t *min24, int32_t *max24, int32_t valueCentrePoint, int32_t valueSpan) |
| void | drawColBar (int32_t xDisplay, int32_t min24, int32_t max24, RGB thisImage[][kDisplayWidth+kSideBarWidth], int32_t brightness=128, std::optional< RGB > rgb=std::nullopt) |
| void | renderOneColForCollapseAnimationInterpolation (int32_t xDisplayOutput, int32_t min24, int32_t max24, int32_t singleSquareBrightness, int32_t progress, RGB thisImage[][kDisplayWidth+kSideBarWidth], std::optional< RGB > rgb) |
Static Private Member Functions | |
| static void | release (const PendingLoad &load) |
Removes the reasons load holds. Doesn't remove it from pending_loads_. | |
Private Attributes | |
| etl::vector< PendingLoad, kMaxPendingLoads > | pending_loads_ |
Static Private Attributes | |
| static constexpr size_t | kMaxPendingLoads = 16 |
| Most Clusters we'll wait on at once. | |
| bool WaveformRenderer::findPeaksPerCol | ( | Sample * | sample, |
| int64_t | xScroll, | ||
| uint64_t | xZoom, | ||
| WaveformRenderData * | data, | ||
| SampleRecorder * | recorder = nullptr, | ||
| int32_t | xStart = 0, | ||
| int32_t | xEnd = kDisplayWidth, | ||
| bool | wait_for_card = true ) |
Fills in data's per-column min/max peaks for any columns in [xStart, xEnd) not already cached.
Cached columns are kept across calls while the waveform length stays the same. A whole-column scroll slides them across, and only the newly exposed columns are worked out. Any other scroll or zoom carries over what it can with remapColumns().
| sample | The Sample to read. |
| xScroll | Sample position of the left edge of column 0. |
| xZoom | Samples per column. |
| data | Per-column cache to fill in. Set its xScroll to -1 to force everything to be worked out again. |
| recorder | The SampleRecorder still writing sample, if any. Its captured length is used. |
| xStart | First column to fill in. |
| xEnd | Column after the last one to fill in. |
| wait_for_card | Whether to read Clusters that aren't in memory from the card now. If false, they're enqueued instead, and their columns left un-investigated or as placeholders. Must be true while recorder is set: the reason held on sample while waiting would break SampleRecorder::abort(). |
Takes over the caller's reason on an enqueued Cluster until it has loaded.
If it's already held, or there's no room, the caller's reason is removed instead, so cluster may no longer exist afterwards.
| void WaveformRenderer::releaseAllLoads | ( | ) |
| void WaveformRenderer::releaseFinishedLoads | ( | ) |
Lets go of enqueued Clusters that have finished loading, or that never will because they're unloadable.
Cheap. findPeaksPerCol() calls it, and AudioFileManager::slowRoutine() does too, so Clusters are let go of even once nothing is rendering waveforms.
| bool WaveformRenderer::renderAsSingleRow | ( | Sample * | sample, |
| int64_t | xScroll, | ||
| uint64_t | xZoom, | ||
| RGB * | thisImage, | ||
| WaveformRenderData * | data, | ||
| SampleRecorder * | recorder, | ||
| RGB | rgb, | ||
| bool | reversed, | ||
| int32_t | xStart, | ||
| int32_t | xEnd ) |
Renders a Sample's waveform as one row of brightness, as song row view shows it.
Doesn't wait on the SD card unless recorder is set: Clusters not in memory are enqueued, and until they've loaded their columns draw the estimate carried over from before the last zoom or scroll, or black if there isn't one. Everything that is available is always drawn.
|
staticconstexprprivate |
Most Clusters we'll wait on at once.
Keeps a long scroll from flooding the loading queue ahead of playback. Columns that don't fit are retried on a later render.