kwave  18.07.70
StreamObject.h
Go to the documentation of this file.
1 /*************************************************************************
2  StreamObject.h - base class with a generic sample source/sink
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 STREAM_OBJECT_H
19 #define STREAM_OBJECT_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QMutex>
25 #include <QObject>
26 
27 class QVariant;
28 
29 namespace Kwave
30 {
31 
32  class Q_DECL_EXPORT StreamObject: public QObject
33  {
34  Q_OBJECT
35  public:
41  explicit StreamObject(QObject *parent = Q_NULLPTR);
42 
44  virtual ~StreamObject();
45 
50  virtual unsigned int tracks() const { return 1; }
51 
59  virtual Kwave::StreamObject * operator [] (unsigned int track)
60  {
61  return (track == 0) ? this : Q_NULLPTR;
62  }
63 
72  virtual unsigned int tracksOfPort(const char *port) const
73  {
74  Q_UNUSED(port);
75  return tracks();
76  }
77 
84  virtual Kwave::StreamObject *port(const char *port, unsigned int track)
85  {
86  Q_UNUSED(port);
87  return (*this)[track];
88  }
89 
94  virtual unsigned int blockSize() const;
95 
102  void setAttribute(const char *attribute,
103  const QVariant &value);
104 
111  static void setInteractive(bool interactive);
112 
113  signals:
114 
119  void attributeChanged(const QVariant value);
120 
121  private:
122 
125 
127  static bool m_interactive;
128 
129  };
130 }
131 
132 #endif /* STREAM_OBJECT_H */
133 
134 //***************************************************************************
135 //***************************************************************************
virtual unsigned int tracksOfPort(const char *port) const
Definition: StreamObject.h:72
Definition: App.h:33
virtual unsigned int tracks() const
Definition: StreamObject.h:50
virtual Kwave::StreamObject * port(const char *port, unsigned int track)
Definition: StreamObject.h:84
static bool m_interactive
Definition: StreamObject.h:127