kwave  18.07.70
RateConverter.h
Go to the documentation of this file.
1 /***************************************************************************
2  RateConverter.h - single channel sample rate converter
3  -------------------
4  begin : Sat Jul 11 2009
5  copyright : (C) 2009 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef RATE_CONVERTER_H
19 #define RATE_CONVERTER_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QObject>
25 #include <QVarLengthArray>
26 #include <QVariant>
27 
28 #include <samplerate.h>
29 
30 #include "libkwave/SampleArray.h"
31 #include "libkwave/SampleSource.h"
32 
33 namespace Kwave
34 {
35 
36  class Q_DECL_EXPORT RateConverter: public Kwave::SampleSource
37  {
38  Q_OBJECT
39  public:
40 
42  RateConverter();
43 
45  virtual ~RateConverter() Q_DECL_OVERRIDE;
46 
48  virtual void goOn() Q_DECL_OVERRIDE;
49 
50  signals:
51 
53  void output(Kwave::SampleArray data);
54 
55  public slots:
56 
58  void input(Kwave::SampleArray data);
59 
63  void setRatio(const QVariant r);
64 
65  private:
66 
68  double m_ratio;
69 
71  SRC_STATE *m_converter;
72 
74  QVarLengthArray<float, 65536> m_converter_in;
75 
77  QVarLengthArray<float, 65536> m_converter_out;
78 
79  };
80 }
81 
82 #endif /* RATE_CONVERTER_H */
83 
84 //***************************************************************************
85 //***************************************************************************
Definition: App.h:33
SRC_STATE * m_converter
Definition: RateConverter.h:71
QVarLengthArray< float, 65536 > m_converter_out
Definition: RateConverter.h:77
QVarLengthArray< float, 65536 > m_converter_in
Definition: RateConverter.h:74