lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
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
33
class
QPainter;
34
35
namespace
lmms
{
36
class
SampleThumbnailCache
;
37
}
38
39
namespace
lmms::gui
{
40
44
class
LMMS_EXPORT
SampleThumbnailRenderer
45
{
46
public
:
47
struct
VisualizeParameters
48
{
50
const
SampleThumbnailCache
*
cache
;
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
lmms::SampleThumbnailCache
Holds increasingly downsampled versions of an audio waveform for efficient rendering of them.
Definition
SampleThumbnailCache.h:43
lmms::gui::SampleThumbnailRenderer
A class that can be used to render sample thumbnails.
Definition
SampleThumbnailRenderer.h:45
lmms::gui::SampleThumbnailRenderer::visualize
static void visualize(VisualizeParameters parameters, QPainter &painter)
Visualize sample thumbnails with the given parameters and painter object.
Definition
SampleThumbnailRenderer.cpp:35
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
lmms::gui::SampleThumbnailRenderer::VisualizeParameters
Definition
SampleThumbnailRenderer.h:48
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::amplification
float amplification
Determines if the waveform is drawn in reverse or not.
Definition
SampleThumbnailRenderer.h:63
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::cache
const SampleThumbnailCache * cache
< The sample thumbnail cache to use.
Definition
SampleThumbnailRenderer.h:50
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::sampleStart
double sampleStart
Where the sample ends for drawing.
Definition
SampleThumbnailRenderer.h:57
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::rect
QRectF rect
Where the sample begins for drawing.
Definition
SampleThumbnailRenderer.h:54
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::sampleEnd
double sampleEnd
The amount of amplification to apply to the waveform.
Definition
SampleThumbnailRenderer.h:60
lmms::gui::SampleThumbnailRenderer::VisualizeParameters::reversed
bool reversed
Definition
SampleThumbnailRenderer.h:66
Generated on
for lmms by
1.18.0