16#ifndef XYSERIESIODEVICE_H
17#define XYSERIESIODEVICE_H
19#include <QtCharts/QChartGlobal>
20#include <QtCore/QIODevice>
21#include <QtCore/QPointF>
22#include <QtCore/QVector>
71 qint64
readData(
char *data, qint64 maxlen)
override;
74 qint64
writeData(
const char * , qint64 )
override {
return 0; }
qint64 writeData(const char *, qint64) override
Placeholder for write operations; always returns 0.
Definition xyseriesiodevice.h:74
qint64 getCurrentWavIndex() const
Returns the current sample index in WavFile mode.
Definition xyseriesiodevice.h:98
PlayMode m_currentMode
Definition xyseriesiodevice.h:101
PlayMode getPlayMode() const
Returns the current playback mode.
Definition xyseriesiodevice.h:92
XYSeriesIODevice(const XYSeriesIODevice &)=delete
Deleted copy constructor to prevent accidental duplication of the audio stream.
void setPlayMode(PlayMode mode)
Toggles between the available playback engines.
Definition xyseriesiodevice.cpp:108
float getCurrentPhase() const
Returns the current oscillator phase [0, tableSize].
Definition xyseriesiodevice.h:95
qint64 readData(char *data, qint64 maxlen) override
Core audio callback used by the Qt Audio engine.
Definition xyseriesiodevice.cpp:56
qint64 m_wavIndex
Definition xyseriesiodevice.h:104
bool isSequential() const override
Indicates that this is a continuous audio stream.
Definition xyseriesiodevice.h:77
virtual ~XYSeriesIODevice()=default
Virtual destructor. Explicitly defaulted to ensure safe polymorphic deletion of derived classes.
XYSeriesIODevice & operator=(const XYSeriesIODevice &)=delete
Deleted assignment operator to enforce unique ownership of the I/O state.
std::vector< float > m_table
Definition xyseriesiodevice.h:102
float m_phase
Definition xyseriesiodevice.h:103
const float m_sampleRate
Definition xyseriesiodevice.h:106
XYSeriesIODevice(QObject *parent=nullptr)
Constructs the I/O device.
Definition xyseriesiodevice.cpp:21
void updateTable(const std::vector< float > &data)
Loads new PCM data into the internal lookup table.
Definition xyseriesiodevice.cpp:31
void setFrequency(float hz)
Sets the fundamental frequency for the Waveform synthesis mode.
Definition xyseriesiodevice.cpp:41
PlayMode
Operational states for the audio engine.
Definition xyseriesiodevice.h:83
@ WavFile
Definition xyseriesiodevice.h:85
@ Waveform
Definition xyseriesiodevice.h:84
float m_increment
Definition xyseriesiodevice.h:105