kwave  18.07.70
Mul.h
Go to the documentation of this file.
1 /***************************************************************************
2  Mul.h - multiplier
3  -------------------
4  begin : Thu Nov 01 2007
5  copyright : (C) 2007 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 MUL_H
19 #define MUL_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QMutex>
25 #include <QQueue>
26 #include <QSemaphore>
27 
28 #include "libkwave/SampleArray.h"
29 #include "libkwave/SampleSink.h"
30 #include "libkwave/SampleSource.h"
31 
32 class QVariant;
33 
34 namespace Kwave
35 {
36 
37  class Q_DECL_EXPORT Mul: public Kwave::SampleSource
38  {
39  Q_OBJECT
40  public:
42  Mul();
43 
45  virtual ~Mul() Q_DECL_OVERRIDE;
46 
48  virtual void goOn() Q_DECL_OVERRIDE;
49 
50  signals:
52  void output(Kwave::SampleArray data);
53 
54  public slots:
55 
57  void input_a(Kwave::SampleArray data);
58 
60  void input_b(Kwave::SampleArray data);
61 
63  void set_a(const QVariant &a);
64 
66  void set_b(const QVariant &b);
67 
68  private:
69 
71  virtual void multiply();
72 
73  private:
74 
76  QQueue<Kwave::SampleArray> m_queue_a;
77 
79  QQueue<Kwave::SampleArray> m_queue_b;
80 
82  QSemaphore m_sem_a;
83 
85  QSemaphore m_sem_b;
86 
89 
92 
95 
98 
101 
103  float m_value_a;
104 
106  float m_value_b;
107 
109  QMutex m_lock;
110  };
111 }
112 
113 #endif /* MUL_H */
114 
115 /***************************************************************************/
116 /***************************************************************************/
QSemaphore m_sem_a
Definition: Mul.h:82
Definition: App.h:33
Kwave::SampleArray m_b
Definition: Mul.h:91
Kwave::SampleArray m_a
Definition: Mul.h:88
bool m_b_is_const
Definition: Mul.h:100
float m_value_a
Definition: Mul.h:103
Kwave::SampleArray m_buffer_x
Definition: Mul.h:94
QSemaphore m_sem_b
Definition: Mul.h:85
float m_value_b
Definition: Mul.h:106
Definition: Mul.h:37
QMutex m_lock
Definition: Mul.h:109
QQueue< Kwave::SampleArray > m_queue_a
Definition: Mul.h:76
QQueue< Kwave::SampleArray > m_queue_b
Definition: Mul.h:79
bool m_a_is_const
Definition: Mul.h:97