swift
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 
10 #include "sound/swiftsoundexport.h"
11 
12 namespace swift::sound::sample_provider
13 {
16  {
17  Q_OBJECT
18 
19  public:
21  CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent = nullptr);
22 
24  virtual 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
double getGainRatio() const
Gain ratio, value a amplitude need to be multiplied with.
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.