1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00
sdrangel/wdsp/sender.cpp

84 lines
2.2 KiB
C++
Raw Normal View History

2024-06-16 05:31:13 -04:00
/* sender.c
This file is part of a program that implements a Software-Defined Radio.
Copyright (C) 2013 Warren Pratt, NR0V
Copyright (C) 2024 Edouard Griffiths, F4EXB Adapted to SDRangel
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The author can be reached by email at
warren@wpratt.com
*/
#include "comm.hpp"
#include "sender.hpp"
2024-06-24 04:20:14 -04:00
#include "bufferprobe.hpp"
2024-06-16 05:31:13 -04:00
namespace WDSP {
2024-07-24 17:30:41 -04:00
SENDER::SENDER(int _run, int _flag, int _mode, int _size, float* _in) :
run(_run),
flag(_flag),
mode(_mode),
size(_size),
2024-08-03 05:05:12 -04:00
in(_in),
spectrumProbe(nullptr)
2024-06-16 05:31:13 -04:00
{
}
2024-07-24 17:30:41 -04:00
void SENDER::flush()
2024-06-16 05:31:13 -04:00
{
2024-08-03 05:05:12 -04:00
// There is no internal data to be reset
2024-06-16 05:31:13 -04:00
}
2024-07-24 17:30:41 -04:00
void SENDER::execute()
2024-06-16 05:31:13 -04:00
{
2024-08-03 05:05:12 -04:00
if (run && flag && (mode == 0) && spectrumProbe) {
spectrumProbe->proceed(in, size);
2024-06-16 05:31:13 -04:00
}
}
2024-07-24 17:30:41 -04:00
void SENDER::setBuffers(float* _in)
2024-06-16 05:31:13 -04:00
{
2024-07-24 17:30:41 -04:00
in = _in;
2024-06-16 05:31:13 -04:00
}
2024-07-24 17:30:41 -04:00
void SENDER::setSamplerate(int)
2024-06-16 05:31:13 -04:00
{
2024-07-24 17:30:41 -04:00
flush();
2024-06-16 05:31:13 -04:00
}
2024-07-24 17:30:41 -04:00
void SENDER::setSize(int _size)
2024-06-16 05:31:13 -04:00
{
2024-07-24 17:30:41 -04:00
size = _size;
2024-06-16 05:31:13 -04:00
}
/********************************************************************************************************
* *
2024-07-24 17:30:41 -04:00
* Public Properties *
2024-06-16 05:31:13 -04:00
* *
********************************************************************************************************/
2024-07-24 17:30:41 -04:00
void SENDER::SetSpectrum(int _flag, BufferProbe *_spectrumProbe)
2024-06-16 05:31:13 -04:00
{
2024-07-24 17:30:41 -04:00
flag = _flag;
spectrumProbe = _spectrumProbe;
2024-06-16 05:31:13 -04:00
}
} // namespace WDSP