swift
simplecompressoreffect.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_SIMPLECOMPRESSOREFFECT_H
7 #define SWIFT_SOUND_SAMPLEPROVIDER_SIMPLECOMPRESSOREFFECT_H
8 
9 #include <QObject>
10 #include <QTimer>
11 
12 #include "chunkware_dsp/SimpleComp.h"
13 
15 #include "sound/swiftsoundexport.h"
16 
17 namespace swift::sound::sample_provider
18 {
21  {
22  Q_OBJECT
23 
24  public:
26  CSimpleCompressorEffect(ISampleProvider *source, QObject *parent = nullptr);
27 
29  int readSamples(QVector<float> &samples, qint64 count) override;
30 
32  void setEnabled(bool enabled);
33 
35  void setMakeUpGain(double gain);
36 
38  void setChannels(int channels);
39 
40  private:
41  QTimer *m_timer = nullptr;
42  ISampleProvider *m_sourceStream = nullptr;
43  bool m_enabled = true;
44  int m_channels = 1;
45  chunkware_simple::SimpleComp m_simpleCompressor;
46  };
47 } // namespace swift::sound::sample_provider
48 
49 #endif // SWIFT_SOUND_SAMPLEPROVIDER_SIMPLECOMPRESSOREFFECT_H
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.