kwave  18.07.70
NormalizePlugin.h
Go to the documentation of this file.
1 /***************************************************************************
2  NormalizePlugin.h - plugin for level normalizing
3  -------------------
4  begin : Fri May 01 2009
5  copyright : (C) 2009 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7 
8  original algorithms : (C) 1999-2005 Chris Vaill <chrisvaill at gmail>
9  taken from "normalize-0.7.7"
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  ***************************************************************************/
20 
21 #ifndef NORMALIZE_PLUGIN_H
22 #define NORMALIZE_PLUGIN_H
23 
24 #include "config.h"
25 
26 #include <QString>
27 #include <QStringList>
28 #include <QVector>
29 
30 #include "libkwave/Plugin.h"
31 #include "libkwave/Sample.h"
32 #include "libkwave/SampleArray.h"
33 
34 namespace Kwave
35 {
36  class MultiTrackReader;
37  class SampleReader;
38 
44  {
45  Q_OBJECT
46 
47  public:
48 
54  NormalizePlugin(QObject *parent, const QVariantList &args);
55 
57  virtual ~NormalizePlugin() Q_DECL_OVERRIDE;
58 
63  virtual void run(QStringList params) Q_DECL_OVERRIDE;
64 
65  private:
66  typedef struct {
67  QVector<double> fifo;
68  unsigned int wp;
69  unsigned int n;
70  double sum;
71  double max;
72  } Average;
73 
77  double getMaxPower(Kwave::MultiTrackReader &source);
78 
88  unsigned int window_size);
89 
90  };
91 }
92 
93 #endif /* NORMALIZE_PLUGIN_H */
94 
95 //***************************************************************************
96 //***************************************************************************
Definition: App.h:33
void getMaxPowerOfTrack(Kwave::SampleReader *reader, Kwave::NormalizePlugin::Average *average, unsigned int window_size)
virtual ~NormalizePlugin() Q_DECL_OVERRIDE
virtual void run(QStringList params) Q_DECL_OVERRIDE
double getMaxPower(Kwave::MultiTrackReader &source)
NormalizePlugin(QObject *parent, const QVariantList &args)