kwave  18.07.70
RecordThread.h
Go to the documentation of this file.
1 /*************************************************************************
2  RecordThread.h - thread for lowlevel audio recording
3  -------------------
4  begin : Mon Oct 20 2003
5  copyright : (C) 2003 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 RECORD_THREAD_H
19 #define RECORD_THREAD_H
20 
21 #include "config.h"
22 
23 #include <QByteArray>
24 #include <QQueue>
25 
26 #include "libkwave/WorkerThread.h"
27 
28 namespace Kwave
29 {
30 
31  class RecordDevice;
32 
34  {
35  Q_OBJECT
36  public:
37 
39  RecordThread();
40 
42  virtual ~RecordThread() Q_DECL_OVERRIDE;
43 
45  virtual void run() Q_DECL_OVERRIDE;
46 
53 
61  int setBuffers(unsigned int count, unsigned int size);
62 
64  unsigned int remainingBuffers();
65 
67  unsigned int queuedBuffers();
68 
70  QByteArray dequeue();
71 
72  signals:
73 
78  void bufferFull();
79 
85  void stopped(int errorcode);
86 
87  private:
88 
91 
93  QQueue<QByteArray>m_empty_queue;
94 
96  QQueue<QByteArray>m_full_queue;
97 
99  unsigned int m_buffer_count;
100 
102  unsigned int m_buffer_size;
103 
104  };
105 }
106 
107 #endif /* RECORD_THREAD_H */
108 
109 //***************************************************************************
110 //***************************************************************************
unsigned int m_buffer_size
Definition: RecordThread.h:102
Definition: App.h:33
QQueue< QByteArray > m_full_queue
Definition: RecordThread.h:96
Kwave::RecordDevice * m_device
Definition: RecordThread.h:90
int setBuffers(unsigned int count, unsigned int size)
virtual ~RecordThread() Q_DECL_OVERRIDE
unsigned int m_buffer_count
Definition: RecordThread.h:99
QByteArray dequeue()
unsigned int queuedBuffers()
QQueue< QByteArray > m_empty_queue
Definition: RecordThread.h:93
void setRecordDevice(Kwave::RecordDevice *device)
void stopped(int errorcode)
virtual void run() Q_DECL_OVERRIDE
unsigned int remainingBuffers()