SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Protected Attributes | List of all members
ThreadedBasebandSampleSource Class Reference

#include <threadedbasebandsamplesource.h>

Inherits QObject.

+ Collaboration diagram for ThreadedBasebandSampleSource:

Public Member Functions

 ThreadedBasebandSampleSource (BasebandSampleSource *sampleSource, QObject *parent=0)
 
 ~ThreadedBasebandSampleSource ()
 
const BasebandSampleSourcegetSource () const
 
void start ()
 this thread start() More...
 
void stop ()
 this thread exit() and wait() More...
 
bool handleSourceMessage (const Message &cmd)
 Send message to source synchronously. More...
 
void pull (Sample &sample)
 Pull one sample from source. More...
 
void pullAudio (int nbSamples)
 
void feed (SampleSourceFifo *sampleFifo, int nbSamples)
 
SampleSourceFifogetSampleSourceFifo ()
 
void setDeviceSampleSourceFifo (SampleSourceFifo *deviceSampleFifo)
 
QString getSampleSourceObjectName () const
 

Protected Attributes

QThread * m_thread
 The thead object. More...
 
BasebandSampleSourcem_basebandSampleSource
 

Detailed Description

This class is a wrapper for BasebandSampleSource that runs the BasebandSampleSource object in its own thread

Definition at line 34 of file threadedbasebandsamplesource.h.

Constructor & Destructor Documentation

◆ ThreadedBasebandSampleSource()

ThreadedBasebandSampleSource::ThreadedBasebandSampleSource ( BasebandSampleSource sampleSource,
QObject *  parent = 0 
)

Definition at line 24 of file threadedbasebandsamplesource.cpp.

References m_basebandSampleSource, and m_thread.

24  :
25  m_basebandSampleSource(sampleSource)
26 {
27  QString name = "ThreadedBasebandSampleSource(" + m_basebandSampleSource->objectName() + ")";
28  setObjectName(name);
29 
30  qDebug() << "ThreadedBasebandSampleSource::ThreadedBasebandSampleSource: " << name;
31 
32  m_thread = new QThread(parent);
33  m_basebandSampleSource->moveToThread(m_thread);
34 
35  qDebug() << "ThreadedBasebandSampleSource::ThreadedBasebandSampleSource: thread: " << thread() << " m_thread: " << m_thread;
36 }
BasebandSampleSource * m_basebandSampleSource
QThread * m_thread
The thead object.

◆ ~ThreadedBasebandSampleSource()

ThreadedBasebandSampleSource::~ThreadedBasebandSampleSource ( )

Definition at line 38 of file threadedbasebandsamplesource.cpp.

References m_thread, and stop().

39 {
40  if (m_thread->isRunning()) {
41  stop();
42  }
43 
44  delete m_thread;
45 }
void stop()
this thread exit() and wait()
QThread * m_thread
The thead object.
+ Here is the call graph for this function:

Member Function Documentation

◆ feed()

void ThreadedBasebandSampleSource::feed ( SampleSourceFifo sampleFifo,
int  nbSamples 
)

direct feeding of sample source FIFO

Definition at line 67 of file threadedbasebandsamplesource.cpp.

References BasebandSampleSource::feed(), and m_basebandSampleSource.

69 {
70  m_basebandSampleSource->feed(sampleFifo, nbSamples);
71 }
BasebandSampleSource * m_basebandSampleSource
void feed(SampleSourceFifo *sampleFifo, int nbSamples)
+ Here is the call graph for this function:

◆ getSampleSourceFifo()

SampleSourceFifo& ThreadedBasebandSampleSource::getSampleSourceFifo ( )
inline

Definition at line 54 of file threadedbasebandsamplesource.h.

BasebandSampleSource * m_basebandSampleSource
SampleSourceFifo & getSampleSourceFifo()

◆ getSampleSourceObjectName()

QString ThreadedBasebandSampleSource::getSampleSourceObjectName ( ) const

Definition at line 78 of file threadedbasebandsamplesource.cpp.

References m_basebandSampleSource.

79 {
80  return m_basebandSampleSource->objectName();
81 }
BasebandSampleSource * m_basebandSampleSource

◆ getSource()

const BasebandSampleSource* ThreadedBasebandSampleSource::getSource ( ) const
inline

Definition at line 41 of file threadedbasebandsamplesource.h.

41 { return m_basebandSampleSource; }
BasebandSampleSource * m_basebandSampleSource

◆ handleSourceMessage()

bool ThreadedBasebandSampleSource::handleSourceMessage ( const Message cmd)

Send message to source synchronously.

Definition at line 73 of file threadedbasebandsamplesource.cpp.

References BasebandSampleSource::handleMessage(), and m_basebandSampleSource.

Referenced by DSPDeviceSinkEngine::handleSynchronousMessages(), and DSPDeviceMIMOEngine::handleSynchronousMessages().

74 {
76 }
BasebandSampleSource * m_basebandSampleSource
virtual bool handleMessage(const Message &cmd)=0
Processing of a message. Returns true if message has actually been processed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pull()

void ThreadedBasebandSampleSource::pull ( Sample sample)

Pull one sample from source.

Definition at line 62 of file threadedbasebandsamplesource.cpp.

References m_basebandSampleSource, and BasebandSampleSource::pull().

63 {
65 }
BasebandSampleSource * m_basebandSampleSource
virtual void pull(Sample &sample)=0
+ Here is the call graph for this function:

◆ pullAudio()

void ThreadedBasebandSampleSource::pullAudio ( int  nbSamples)
inline

Definition at line 48 of file threadedbasebandsamplesource.h.

BasebandSampleSource * m_basebandSampleSource
virtual void pullAudio(int nbSamples)

◆ setDeviceSampleSourceFifo()

void ThreadedBasebandSampleSource::setDeviceSampleSourceFifo ( SampleSourceFifo deviceSampleFifo)
inline

Definition at line 55 of file threadedbasebandsamplesource.h.

BasebandSampleSource * m_basebandSampleSource
void setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo)

◆ start()

void ThreadedBasebandSampleSource::start ( )

this thread start()

Definition at line 47 of file threadedbasebandsamplesource.cpp.

References m_basebandSampleSource, m_thread, and BasebandSampleSource::start().

Referenced by DSPDeviceSinkEngine::handleSynchronousMessages(), and DSPDeviceMIMOEngine::handleSynchronousMessages().

48 {
49  qDebug() << "ThreadedBasebandSampleSource::start";
50  m_thread->start();
52 }
BasebandSampleSource * m_basebandSampleSource
virtual void start()=0
QThread * m_thread
The thead object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void ThreadedBasebandSampleSource::stop ( )

this thread exit() and wait()

Definition at line 54 of file threadedbasebandsamplesource.cpp.

References m_basebandSampleSource, m_thread, and BasebandSampleSource::stop().

Referenced by DSPDeviceSinkEngine::handleSynchronousMessages(), DSPDeviceMIMOEngine::handleSynchronousMessages(), and ~ThreadedBasebandSampleSource().

55 {
56  qDebug() << "ThreadedBasebandSampleSource::stop";
58  m_thread->exit();
59  m_thread->wait();
60 }
BasebandSampleSource * m_basebandSampleSource
virtual void stop()=0
QThread * m_thread
The thead object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_basebandSampleSource

BasebandSampleSource* ThreadedBasebandSampleSource::m_basebandSampleSource
protected

◆ m_thread

QThread* ThreadedBasebandSampleSource::m_thread
protected

The thead object.

Definition at line 60 of file threadedbasebandsamplesource.h.

Referenced by start(), stop(), ThreadedBasebandSampleSource(), and ~ThreadedBasebandSampleSource().


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