lmms
Cross-platform music production software
Loading...
Searching...
No Matches
SampleThumbnailRenderer.h
Go to the documentation of this file.
1/*
2 * SampleThumbnailRenderer.h
3 *
4 * Copyright (c) 2026 Khoi Dau <casboi86@gmail.com>
5 * Copyright (c) 2026 saker <sakertooth@gmail.com>
6 *
7 * This file is part of LMMS - https://lmms.io
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
23 *
24 */
25
26#ifndef LMMS_GUI_SAMPLE_THUMBNAIL_RENDERER_H
27#define LMMS_GUI_SAMPLE_THUMBNAIL_RENDERER_H
28
29#include <QRectF>
30
31#include "lmms_export.h"
32
33class QPainter;
34
35namespace lmms {
37}
38
39namespace lmms::gui {
40
44class LMMS_EXPORT SampleThumbnailRenderer
45{
46public:
48 {
51
54 QRectF rect;
55
57 double sampleStart = 0.f;
58
60 double sampleEnd = 1.f;
61
63 float amplification = 1.0f;
64
66 bool reversed = false;
67 };
68
70 static void visualize(VisualizeParameters parameters, QPainter& painter);
71};
72
73} // namespace lmms::gui
74
75#endif // LMMS_GUI_SAMPLE_THUMBNAIL_RENDERER_H
Holds increasingly downsampled versions of an audio waveform for efficient rendering of them.
Definition SampleThumbnailCache.h:43
A class that can be used to render sample thumbnails.
Definition SampleThumbnailRenderer.h:45
static void visualize(VisualizeParameters parameters, QPainter &painter)
Visualize sample thumbnails with the given parameters and painter object.
Definition SampleThumbnailRenderer.cpp:35
Definition AudioPortAudio.cpp:209
Definition RemotePluginBase.cpp:34
Definition SampleThumbnailRenderer.h:48
float amplification
Determines if the waveform is drawn in reverse or not.
Definition SampleThumbnailRenderer.h:63
const SampleThumbnailCache * cache
< The sample thumbnail cache to use.
Definition SampleThumbnailRenderer.h:50
double sampleStart
Where the sample ends for drawing.
Definition SampleThumbnailRenderer.h:57
QRectF rect
Where the sample begins for drawing.
Definition SampleThumbnailRenderer.h:54
double sampleEnd
The amount of amplification to apply to the waveform.
Definition SampleThumbnailRenderer.h:60
bool reversed
Definition SampleThumbnailRenderer.h:66