Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
waveform_channel.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <QObject>
7#include <QVector>
8#include <QtQmlIntegration>
9
10namespace zrythm::gui::qquick
11{
12
19class WaveformChannel : public QObject
20{
21 Q_OBJECT
22 Q_PROPERTY (QVector<float> minValues READ minValues CONSTANT)
23 Q_PROPERTY (QVector<float> maxValues READ maxValues CONSTANT)
24 Q_PROPERTY (int pixelWidth READ pixelWidth CONSTANT)
25 QML_ELEMENT
26 QML_UNCREATABLE ("")
27
28public:
37 QVector<float> minValues,
38 QVector<float> maxValues,
39 int pixelWidth,
40 QObject * parent = nullptr);
41 ~WaveformChannel () override;
42
47 const QVector<float> &minValues () const { return min_values_; }
48
53 const QVector<float> &maxValues () const { return max_values_; }
54
59 int pixelWidth () const { return pixel_width_; }
60
61private:
63 QVector<float> min_values_;
64
66 QVector<float> max_values_;
67
69 int pixel_width_;
70};
71
72} // namespace zrythm::gui
int pixelWidth() const
Get the pixel width used for generation.
const QVector< float > & minValues() const
Get the minimum sample values for each pixel.
const QVector< float > & maxValues() const
Get the maximum sample values for each pixel.
WaveformChannel(QVector< float > minValues, QVector< float > maxValues, int pixelWidth, QObject *parent=nullptr)
Construct a WaveformChannel.