|
JS8Call-Improved master
|
Audio device which synthesizes JS8 waveform samples for TX. More...
#include <Modulator.h>


Public Types | |
| enum class | State { Synchronizing , Active , Idle } |
| Public Types inherited from AudioDevice | |
| enum | Channel { Mono , Left , Right , Both } |
| Audio channel selection used by the device. More... | |
Public Member Functions | |
| Modulator (QObject *parent=nullptr) | |
| Construct a modulator instance. | |
| bool | isIdle () const |
| Whether the device is currently idle. | |
| void | close () override |
| Close the device and stop generating samples. | |
| Q_SLOT void | setAudioFrequency (double const audioFrequency) |
| Set the base audio frequency used for modulation. | |
| Q_SLOT void | start (double audioFrequency, int submode, double tx_delay, SoundOutput *stream, Channel channel) |
| Start transmission with the given parameters. | |
| Q_SLOT void | stop (bool quick=false) |
| Stop transmission. | |
| Q_SLOT void | tune (bool state=true) |
| Enter or leave tuning state. | |
| Public Member Functions inherited from AudioDevice | |
| bool | initialize (OpenMode mode, Channel channel) |
| Initialize the device for the specified open mode and channel. | |
| bool | isSequential () const override |
| Whether this device exposes a sequential data stream. | |
| size_t | bytesPerFrame () const |
| Number of bytes per audio frame for the current channel setting. | |
| Channel | channel () const |
| Get the current channel selection used by this device. | |
Protected Member Functions | |
| qint64 | readData (char *, qint64) override |
| Read data from the modulator. | |
| qint64 | writeData (char const *, qint64) override |
| qint64 | bytesAvailable () const override |
| Bytes available hint for QAudioSink; ensures Active state. | |
| Protected Member Functions inherited from AudioDevice | |
| AudioDevice (QObject *parent=nullptr) | |
| void | store (char const *source, size_t numFrames, qint16 *dest) |
| Copy interleaved source samples into the destination buffer. | |
| qint16 * | load (qint16 const sample, qint16 *dest) |
| Expand a sample value into the output buffer for the active channel. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from AudioDevice | |
| static char const * | toString (Channel c) |
| static Channel | fromString (QString const &str) |
| Convert a channel label into an AudioDevice channel value. | |
Audio device which synthesizes JS8 waveform samples for TX.
The Modulator implements a QIODevice audio source that produces PCM samples encoding an outgoing message. Output may be muted while keeping timing intact to allow resuming without disrupting the transmission schedule. The device is intended to run in a worker thread and is not generally safe to call from arbitrary threads.
|
inlineexplicit |
Construct a modulator instance.
| parent | Optional parent QObject. |
|
inlineoverrideprotected |
Bytes available hint for QAudioSink; ensures Active state.
Qt audio backends require that a source report a minimum number of bytes available in order to transition the sink into the Active state and begin pulling data. Different Qt releases/platforms changed this behavior; to remain compatible we provide a conservative bytes-available hint here.
|
override |
Close the device and stop generating samples.
Close the modulator.

|
inline |
Whether the device is currently idle.
This accessor is thread-safe and can be queried from other threads.

|
overrideprotected |
Read data from the modulator.
| data | |
| maxSize |

|
inline |
Set the base audio frequency used for modulation.
| audioFrequency | Frequency in Hz. |
Not thread-safe by itself; use Qt signals to invoke from other threads.

| void Modulator::start | ( | double | audioFrequency, |
| int | submode, | ||
| double | tx_delay, | ||
| SoundOutput * | stream, | ||
| Channel | channel ) |
Start transmission with the given parameters.
Start the modulation process.
| frequency | |
| submode | |
| txDelay | |
| stream | |
| channel |


| void Modulator::stop | ( | bool | quick = false | ) |
Stop transmission.
Stop the modulation process.
| quick | If true, perform a quick stop. |
| quickClose |


| void Modulator::tune | ( | bool | state = true | ) |
Enter or leave tuning state.
Set tuning mode.
| tuning |

