swift
equalizersampleprovider.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_EQUALIZERSAMPLEPROVIDER_H
7 #define SWIFT_SOUND_SAMPLEPROVIDER_EQUALIZERSAMPLEPROVIDER_H
8 
9 #include <QSharedPointer>
10 #include <QVector>
11 
12 #include "sound/dsp/biquadfilter.h"
14 #include "sound/swiftsoundexport.h"
15 
16 namespace swift::sound::sample_provider
17 {
20  {
21  VHFEmulation = 1
22  };
23 
26  {
27  Q_OBJECT
28 
29  public:
31  CEqualizerSampleProvider(ISampleProvider *sourceProvider, EqualizerPresets preset, QObject *parent = nullptr);
32 
34  virtual int readSamples(QVector<float> &samples, qint64 count) override;
35 
37  void setBypassEffects(bool value) { m_bypass = value; }
38 
41  double outputGain() const;
42  void setOutputGain(double outputGain);
44 
45  private:
46  void setupPreset(EqualizerPresets preset);
47 
48  ISampleProvider *m_sourceProvider = nullptr;
49  int m_channels = 1;
50  bool m_bypass = false;
51  double m_outputGain = 1.0;
52  QVector<dsp::BiQuadFilter> m_filters;
53  };
54 } // namespace swift::sound::sample_provider
55 
56 #endif // SWIFT_SOUND_SAMPLEPROVIDER_EQUALIZERSAMPLEPROVIDER_H
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.