kwave  18.07.70
PitchShiftFilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  PitchShiftFilter.h - filter for modifying the "pitch_shift"
3  -------------------
4  begin : Wed Nov 28 2007
5  copyright : (C) 2007 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7 
8  based on synth_pitch_shift_impl.cc from the aRts project
9 
10  copyright (C) 2000 Jeff Tranter <tranter@pobox.com>
11  (C) 1999 Stefan Westerfeld <stefan@space.twc.de>
12  ***************************************************************************/
13 
14 /***************************************************************************
15  * *
16  * This program is free software; you can redistribute it and/or modify *
17  * it under the terms of the GNU General Public License as published by *
18  * the Free Software Foundation; either version 2 of the License, or *
19  * (at your option) any later version. *
20  * *
21  ***************************************************************************/
22 
23 #ifndef PITCH_SHIFT_FILTER_H
24 #define PITCH_SHIFT_FILTER_H
25 
26 #include "config.h"
27 
28 #include <QObject>
29 #include <QVariant>
30 #include <QVector>
31 
32 #include "libkwave/SampleArray.h"
33 #include "libkwave/SampleSource.h"
34 
35 namespace Kwave
36 {
37 
39  {
40  Q_OBJECT
41  public:
42 
45 
47  virtual ~PitchShiftFilter() Q_DECL_OVERRIDE;
48 
50  virtual void goOn() Q_DECL_OVERRIDE;
51 
52  signals:
53 
55  void output(Kwave::SampleArray data);
56 
57  public slots:
58 
60  void input(Kwave::SampleArray data);
61 
66  void setSpeed(const QVariant speed);
67 
72  void setFrequency(const QVariant freq);
73 
74  private:
75 
77  void initFilter();
78 
79  private:
80 
83 
85  float m_speed;
86 
88  float m_frequency;
89 
90  enum { MAXDELAY = 1000000 };
91 
92  QVector<float> m_dbuffer;
93  float m_lfopos;
94  float m_b1pos;
95  float m_b2pos;
96  float m_b1inc;
97  float m_b2inc;
98  bool m_b1reset;
99  bool m_b2reset;
100  int m_dbpos;
101  };
102 }
103 
104 #endif /* PITCH_SHIFT_FILTER_H */
105 
106 //***************************************************************************
107 //***************************************************************************
Definition: App.h:33
QVector< float > m_dbuffer
virtual ~PitchShiftFilter() Q_DECL_OVERRIDE
Kwave::SampleArray m_buffer
virtual void goOn() Q_DECL_OVERRIDE
void output(Kwave::SampleArray data)
void input(Kwave::SampleArray data)
void setFrequency(const QVariant freq)
void setSpeed(const QVariant speed)