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 "sound/dsp/SimpleComp.h"
14 #include "sound/swiftsoundexport.h"
15 
16 namespace swift::sound::sample_provider
17 {
20  {
21  Q_OBJECT
22 
23  public:
25  CSimpleCompressorEffect(ISampleProvider *source, QObject *parent = nullptr);
26 
28  virtual int readSamples(QVector<float> &samples, qint64 count) override;
29 
31  void setEnabled(bool enabled);
32 
34  void setMakeUpGain(double gain);
35 
37  void setChannels(int channels);
38 
39  private:
40  QTimer *m_timer = nullptr;
41  ISampleProvider *m_sourceStream = nullptr;
42  bool m_enabled = true;
43  int m_channels = 1;
44  chunkware_simple::SimpleComp m_simpleCompressor;
45  };
46 } // namespace swift::sound::sample_provider
47 
48 #endif // SWIFT_SOUND_SAMPLEPROVIDER_SIMPLECOMPRESSOREFFECT_H
simple compressor
Definition: SimpleComp.h:41
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.