Network-Music  0.1
An audible representation of network traffic
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
audiooutput.h
Go to the documentation of this file.
1 #ifndef AUDIOOUTPUT_H
2 #define AUDIOOUTPUT_H
3 
4 #include <math.h>
5 
6 #include <QAudioOutput>
7 #include <QByteArray>
8 #include <QComboBox>
9 #include <QIODevice>
10 #include <QLabel>
11 #include <QMainWindow>
12 #include <QObject>
13 #include <QPushButton>
14 #include <QSlider>
15 #include <QTimer>
16 #include <QHash>
17 #include <QStatusBar>
18 
19 #include <QSpinBox>
20 
21 
22 class PacketCapturer;
23 class tone;
24 class Generator;
25 class ToneManager;
26 class AudioGraph;
27 
28 #include <QtCharts/QChartView>
29 #include <QtCharts/QPieSeries>
30 #include <QtCharts/QPieSlice>
31 #include <QtCharts>
32 
33 #include <QtDataVisualization>
34 
35 class AudioTest : public QMainWindow
36 {
37  Q_OBJECT
38 
39 public:
40  AudioTest();
41  void Setup();
42 
43 protected:
44  void initializeWindow();
45  void initializeAudio();
46  void createAudioOutput();
47 
48  //graphical elements
49  QComboBox *m_networkDeviceBox;
50  //QComboBox *m_audioDeviceBox;
51  QLabel *m_volumeLabel;
52  QSlider *m_volumeSlider;
54 
55  QSpinBox *m_numberOfTones;
57 
58  QSpinBox *m_baseFrequency;
60 
61  QStatusBar *m_statusBar;
63 
64  QPieSeries *series;
65  QChart *chart;
66  QChartView *chartView;
67 
68  QHash<int, QPieSlice*> slices;
69 
71  QMainWindow* audioGraphWindow;
72 
73  //useless?
75 
76  //handling the tones
80 
81  //the packetcapturer, could be a singleton? probably
83 
85 
86 private:
87  void SetupGraph();
88 
89 
90 private slots:
91  void PcapButtonPressed();
92  void UpdateChart(int freq, int priority);
93 
94 signals:
95  void VolumeChanged(int);
96 
97  void SIGNAL_BEGIN_TONES();
98  void SIGNAL_BEGIN_CAPTURE();
99 };
100 
101 #endif // AUDIOOUTPUT_H