swift
Loading...
Searching...
No Matches
volumesampleprovider.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_SOUND_SAMPLEPROVIDER_VOLUMESAMPLEPROVIDER_H
7#define SWIFT_SOUND_SAMPLEPROVIDER_VOLUMESAMPLEPROVIDER_H
8
11
12namespace swift::sound::sample_provider
13{
16 {
18
19 public:
21 CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent = nullptr);
22
24 int readSamples(QVector<float> &samples, qint64 count) override;
25
30 double getGainRatio() const { return m_gainRatio; }
31 bool setGainRatio(double gainRatio);
33 // those used to be the original function names
34 // double volume() const { return m_volume; }
35 // bool setVolume(double volume);
36
37 private:
38 ISampleProvider *m_sourceProvider = nullptr;
39 double m_gainRatio = 1.0;
40 };
41} // namespace swift::sound::sample_provider
42
43#endif // SWIFT_SOUND_SAMPLEPROVIDER_VOLUMESAMPLEPROVIDER_H
int readSamples(QVector< float > &samples, qint64 count)
Read samples.
double getGainRatio() const
Gain ratio, value a amplitude need to be multiplied with.
CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent=nullptr)
Noise generator.
ISampleProvider(QObject *parent=nullptr)
Ctor.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.