|
wiRedPanda
Logic Circuit Simulator
|
#include <ToneGenerator.h>
Public Member Functions | |
| qint64 | bytesAvailable () const override |
| Reports available data so QAudioSink knows to pull from this device. | |
| double | frequency () const |
| Returns the current frequency in Hz. | |
| bool | isSequential () const override |
| This is a sequential (non-seekable) device. | |
| void | setFrequency (double hz) |
| Sets the tone frequency in Hz. | |
| bool | start () |
| Starts the device for reading. | |
| ToneGenerator (QObject *parent=nullptr) | |
Static Public Member Functions | |
| static QAudioFormat | format () |
| Returns the QAudioFormat matching this generator's output. | |
Protected Member Functions | |
| qint64 | readData (char *data, qint64 maxSize) override |
| Fills data with maxSize bytes of PCM sine-wave samples. | |
| qint64 | writeData (const char *, qint64) override |
| Writing is not supported. | |
Generates a continuous sine wave at a configurable frequency.
Intended for use with QAudioSink. The device produces 16-bit mono PCM samples at 44100 Hz with no loop boundary, so playback is seamless.
Definition at line 19 of file ToneGenerator.h.
|
inlineexplicit |
Definition at line 24 of file ToneGenerator.h.
|
inlineoverride |
Reports available data so QAudioSink knows to pull from this device.
Definition at line 49 of file ToneGenerator.h.
|
inlinestatic |
Returns the QAudioFormat matching this generator's output.
Definition at line 30 of file ToneGenerator.h.
Referenced by Buzzer::Buzzer().
|
inline |
Returns the current frequency in Hz.
Definition at line 43 of file ToneGenerator.h.
|
inlineoverride |
This is a sequential (non-seekable) device.
Definition at line 46 of file ToneGenerator.h.
|
inlineoverrideprotected |
Fills data with maxSize bytes of PCM sine-wave samples.
Definition at line 60 of file ToneGenerator.h.
|
inline |
Sets the tone frequency in Hz.
Definition at line 40 of file ToneGenerator.h.
|
inline |
Starts the device for reading.
Definition at line 52 of file ToneGenerator.h.
|
inlineoverrideprotected |
Writing is not supported.
Definition at line 85 of file ToneGenerator.h.