Network-Music  0.1
An audible representation of network traffic
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
tone.h
Go to the documentation of this file.
1 #ifndef TONE_H
2 #define TONE_H
3 
4 #include <QAudioDeviceInfo>
5 #include <QAudioOutput>
6 #include "generator.h"
7 
8 class tone : public QAudioOutput
9 {
10  Q_OBJECT
11 
12 public:
13  tone(int volumePercent, int frequency, QObject *parent);
14  ~tone();
15 
16  void Play();
17  void Pause();
18  void SetFrequency(qreal value);
19  void SetGenerator(Generator* gen);
20  QAudioFormat GetFormat();
22 
23 protected:
24  QAudioDeviceInfo m_device;
25  //Generator *m_generator;
26  QAudioOutput *m_audioOutput;
27  QIODevice *m_output; // not owned
28  QAudioFormat m_format;
29 
30  QByteArray m_buffer;
31  //QThread* thread;
32 
33 public slots:
34  void OnVolumeChanged(int value);
35  void Process();
36 
37  void DoResumeAudio();
38  void DoPauseAudio();
39  void DoStartPlaying();
40 
41 };
42 
43 #endif // TONE_H