QDriverStation
The free, cross-platform FRC Driver Station
beeper.h
1 /*
2  * This code is based on the answer provided at:
3  * http://stackoverflow.com/questions/10110905/simple-wave-generator-with-sdl-in-c
4  */
5 
6 #ifndef _QDS_BEEPER_H
7 #define _QDS_BEEPER_H
8 
9 #include <QObject>
10 
14 class Beeper : public QObject {
15  Q_OBJECT
16 
17  public:
18  explicit Beeper();
19  ~Beeper();
20 
21  void generateSamples (qint16* stream, int length);
22 
23  public slots:
24  void setEnabled (bool enabled);
25  void beep (qreal frequency, int duration);
26 
27  private:
28  bool m_enabled;
29  double m_angle;
30 };
31 
32 #endif
~Beeper()
Definition: beeper.cpp:87
Uses SDL to generate telephone-like sound tones on the fly.
Definition: beeper.h:14
Beeper()
Definition: beeper.cpp:61
void setEnabled(bool enabled)
Definition: beeper.cpp:125
void beep(qreal frequency, int duration)
Definition: beeper.cpp:133