kwave  18.07.70
WindowFunction.h
Go to the documentation of this file.
1 /***************************************************************************
2  WindowFunction.h - Windows functions for signal processing
3  -------------------
4  begin : Feb 05 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <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 WINDOW_FUNCTION_H
19 #define WINDOW_FUNCTION_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QVector>
25 
26 #include "libkwave/TypesMap.h"
27 
28 class QString;
29 
30 namespace Kwave
31 {
32 
34  typedef enum {
41 
47  class Q_DECL_EXPORT WindowFunction
48  {
49  public:
54  explicit WindowFunction(window_function_t type);
55 
57  virtual ~WindowFunction();
58 
64  QVector<double> points(unsigned int len) const;
65 
71  static window_function_t findFromIndex(unsigned int index) {
72  return m_types_map.findFromData(index);
73  }
74 
80  static window_function_t findFromName(const QString &name) {
81  return m_types_map.findFromName(name);
82  }
83 
88  static unsigned int index(window_function_t type)
89  {
90  return m_types_map.data(type);
91  }
92 
97  static const QString name(window_function_t type)
98  {
99  return m_types_map.name(type);
100  }
101 
108  static QString description(window_function_t type,
109  bool localized)
110  {
111  return m_types_map.description(type, localized);
112  }
113 
115  static unsigned int count() {
116  return m_types_map.count();
117  }
118 
123  public Kwave::TypesMap<window_function_t,unsigned int>
124  {
125  public:
128  :Kwave::TypesMap<window_function_t, unsigned int>()
129  {
130  fill();
131  }
132 
134  virtual void fill() Q_DECL_OVERRIDE;
135  };
136 
137  private:
138 
141 
144  };
145 
146  //***************************************************************************
148  {
149  return (f = (f == WINDOW_FUNC_TRIANGULAR) ?
151  }
152 
153 }
154 
155 #endif /* WINDOW_FUNCTION_H */
156 
157 //***************************************************************************
158 //***************************************************************************
static InitializedTypesMap m_types_map
static QString description(window_function_t type, bool localized)
static unsigned int index(window_function_t type)
Definition: App.h:33
window_function_t
static window_function_t findFromIndex(unsigned int index)
window_function_t m_type
const char name[16]
Definition: memcpy.c:510
static window_function_t findFromName(const QString &name)
static unsigned int count()
static FileProperty operator++(FileProperty &prop)
Definition: FileInfo.h:104
static const QString name(window_function_t type)