JS8Call-Improved master
Loading...
Searching...
No Matches
Detector Class Reference
Inheritance diagram for Detector:
Collaboration diagram for Detector:

Public Member Functions

 Detector (unsigned frameRate, unsigned periodLengthInSeconds, QObject *parent=nullptr)
 Construct a Detector.
unsigned period () const
QMutex * getMutex ()
void setTRPeriod (unsigned p)
unsigned secondInPeriod () const
 Return how many seconds into the current period we are.
void clear ()
 Clear the detector buffer.
bool reset () override
 Reset the detector state.
void resetBufferContent ()
 Reset the buffer content to zero.
void resetBufferPosition ()
 Reset the buffer position based on current time.
Q_SIGNAL void framesWritten (qint64) const
Q_SLOT void setBlockSize (unsigned)
 Set the block size for FFT processing.
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
qint64 writeData (char const *, qint64) override
 Write data to the detector buffer.
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

Public Types inherited from AudioDevice
enum  Channel { Mono , Left , Right , Both }
 Audio channel selection used by the device. More...
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.

Constructor & Destructor Documentation

◆ Detector()

Detector::Detector ( unsigned frameRate,
unsigned periodLengthInSeconds,
QObject * parent = nullptr )

Construct a Detector.

Construct a new Detector object.

Parameters
frameRateInput sampling rate (Hz).
periodLengthInSecondsPeriod length (seconds) used to size buffers.
parentOptional parent QObject.
frameRate
periodLengthInSeconds
parent
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ clear()

void Detector::clear ( )

Clear the detector buffer.

Clear buffered samples and reset buffer position.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ framesWritten()

Q_SIGNAL void Detector::framesWritten ( qint64 ) const

Emitted when writeData has appended frames into the internal buffer.

Here is the caller graph for this function:

◆ getMutex()

QMutex * Detector::getMutex ( )
inline

Return pointer to the internal mutex protecting buffer operations.

◆ period()

unsigned Detector::period ( ) const
inline

Return configured period length in seconds.

◆ readData()

qint64 Detector::readData ( char * ,
qint64  )
inlineoverrideprotected

We are a sink; readData is unused.

◆ reset()

bool Detector::reset ( )
override

Reset the detector state.

Reset device state and buffers.

Returns
true
false
Here is the call graph for this function:

◆ resetBufferContent()

void Detector::resetBufferContent ( )

Reset the buffer content to zero.

Reset buffer contents to their initial state.

Here is the caller graph for this function:

◆ resetBufferPosition()

void Detector::resetBufferPosition ( )

Reset the buffer position based on current time.

Reset buffer write position to the beginning.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secondInPeriod()

unsigned Detector::secondInPeriod ( ) const

Return how many seconds into the current period we are.

Get the current second in the period.

Returns
unsigned
Here is the caller graph for this function:

◆ setBlockSize()

void Detector::setBlockSize ( unsigned n)

Set the block size for FFT processing.

Set the internal block size used when aggregating frames.

Parameters
n
Here is the caller graph for this function:

◆ setTRPeriod()

void Detector::setTRPeriod ( unsigned p)
inline

Set the transmit/receive period used for timing adjustments.

◆ writeData()

qint64 Detector::writeData ( char const * data,
qint64 maxSize )
overrideprotected

Write data to the detector buffer.

Write input PCM bytes into the internal buffer.

Parameters
data
maxSize
Returns
qint64
Here is the call graph for this function:

The documentation for this class was generated from the following files: