mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 12:27:51 +02:00
Added basic RDS support, no error correction yet
This commit is contained in:
189
core/src/dsp/clock_recovery/fd.h
Normal file
189
core/src/dsp/clock_recovery/fd.h
Normal file
@ -0,0 +1,189 @@
|
||||
#pragma once
|
||||
#include "../processor.h"
|
||||
#include "../loop/phase_control_loop.h"
|
||||
#include "../taps/windowed_sinc.h"
|
||||
#include "../multirate/polyphase_bank.h"
|
||||
#include "../math/step.h"
|
||||
|
||||
namespace dsp::clock_recovery {
|
||||
class FD : public Processor<float, float> {
|
||||
using base_type = Processor<float, float> ;
|
||||
public:
|
||||
FD() {}
|
||||
|
||||
FD(stream<float>* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) { init(in, omega, omegaGain, muGain, omegaRelLimit, interpPhaseCount, interpTapCount); }
|
||||
|
||||
~FD() {
|
||||
if (!base_type::_block_init) { return; }
|
||||
base_type::stop();
|
||||
dsp::multirate::freePolyphaseBank(interpBank);
|
||||
buffer::free(buffer);
|
||||
}
|
||||
|
||||
void init(stream<float>* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) {
|
||||
_omega = omega;
|
||||
_omegaGain = omegaGain;
|
||||
_muGain = muGain;
|
||||
_omegaRelLimit = omegaRelLimit;
|
||||
_interpPhaseCount = interpPhaseCount;
|
||||
_interpTapCount = interpTapCount;
|
||||
|
||||
pcl.init(_muGain, _omegaGain, 0.0, 0.0, 1.0, _omega, _omega * (1.0 - omegaRelLimit), _omega * (1.0 + omegaRelLimit));
|
||||
generateInterpTaps();
|
||||
buffer = buffer::alloc<float>(STREAM_BUFFER_SIZE + _interpTapCount);
|
||||
bufStart = &buffer[_interpTapCount - 1];
|
||||
|
||||
base_type::init(in);
|
||||
}
|
||||
|
||||
void setOmega(double omega) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
_omega = omega;
|
||||
offset = 0;
|
||||
pcl.phase = 0.0f;
|
||||
pcl.freq = _omega;
|
||||
pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit));
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
void setOmegaGain(double omegaGain) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_omegaGain = omegaGain;
|
||||
pcl.setCoefficients(_muGain, _omegaGain);
|
||||
}
|
||||
|
||||
void setMuGain(double muGain) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_muGain = muGain;
|
||||
pcl.setCoefficients(_muGain, _omegaGain);
|
||||
}
|
||||
|
||||
void setOmegaRelLimit(double omegaRelLimit) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_omegaRelLimit = omegaRelLimit;
|
||||
pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit));
|
||||
}
|
||||
|
||||
void setInterpParams(int interpPhaseCount, int interpTapCount) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
_interpPhaseCount = interpPhaseCount;
|
||||
_interpTapCount = interpTapCount;
|
||||
dsp::multirate::freePolyphaseBank(interpBank);
|
||||
buffer::free(buffer);
|
||||
generateInterpTaps();
|
||||
buffer = buffer::alloc<float>(STREAM_BUFFER_SIZE + _interpTapCount);
|
||||
bufStart = &buffer[_interpTapCount - 1];
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
offset = 0;
|
||||
pcl.phase = 0.0f;
|
||||
pcl.freq = _omega;
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
inline int process(int count, const float* in, float* out) {
|
||||
// Copy data to work buffer
|
||||
memcpy(bufStart, in, count * sizeof(float));
|
||||
|
||||
// Process all samples
|
||||
int outCount = 0;
|
||||
while (offset < count) {
|
||||
float error;
|
||||
float outVal;
|
||||
float dfdt;
|
||||
|
||||
// Calculate new output value
|
||||
int phase = std::clamp<int>(floorf(pcl.phase * (float)_interpPhaseCount), 0, _interpPhaseCount - 1);
|
||||
volk_32f_x2_dot_prod_32f(&outVal, &buffer[offset], interpBank.phases[phase], _interpTapCount);
|
||||
out[outCount++] = outVal;
|
||||
|
||||
// Calculate derivative of the signal
|
||||
if (phase == 0) {
|
||||
float fT1;
|
||||
volk_32f_x2_dot_prod_32f(&fT1, &buffer[offset], interpBank.phases[phase+1], _interpTapCount);
|
||||
dfdt = fT1 - outVal;
|
||||
}
|
||||
else if (phase == _interpPhaseCount - 1) {
|
||||
float fT_1;
|
||||
volk_32f_x2_dot_prod_32f(&fT_1, &buffer[offset], interpBank.phases[phase-1], _interpTapCount);
|
||||
dfdt = outVal - fT_1;
|
||||
}
|
||||
else {
|
||||
float fT_1;
|
||||
float fT1;
|
||||
volk_32f_x2_dot_prod_32f(&fT_1, &buffer[offset], interpBank.phases[phase-1], _interpTapCount);
|
||||
volk_32f_x2_dot_prod_32f(&fT1, &buffer[offset], interpBank.phases[phase+1], _interpTapCount);
|
||||
dfdt = (fT1 - fT_1) * 0.5f;
|
||||
}
|
||||
|
||||
// Calculate error
|
||||
error = dfdt * math::step(outVal);
|
||||
|
||||
// Clamp symbol phase error
|
||||
if (error > 1.0f) { error = 1.0f; }
|
||||
if (error < -1.0f) { error = -1.0f; }
|
||||
|
||||
// Advance symbol offset and phase
|
||||
pcl.advance(error);
|
||||
float delta = floorf(pcl.phase);
|
||||
offset += delta;
|
||||
pcl.phase -= delta;
|
||||
}
|
||||
offset -= count;
|
||||
|
||||
// Update delay buffer
|
||||
memmove(buffer, &buffer[count], (_interpTapCount - 1) * sizeof(float));
|
||||
|
||||
return outCount;
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
|
||||
// Swap if some data was generated
|
||||
base_type::_in->flush();
|
||||
if (outCount) {
|
||||
if (!base_type::out.swap(outCount)) { return -1; }
|
||||
}
|
||||
return outCount;
|
||||
}
|
||||
|
||||
loop::PhaseControlLoop<float, false> pcl;
|
||||
|
||||
protected:
|
||||
void generateInterpTaps() {
|
||||
double bw = 0.5 / (double)_interpPhaseCount;
|
||||
dsp::tap<float> lp = dsp::taps::windowedSinc<float>(_interpPhaseCount * _interpTapCount, dsp::math::freqToOmega(bw, 1.0), dsp::window::nuttall, _interpPhaseCount);
|
||||
interpBank = dsp::multirate::buildPolyphaseBank<float>(_interpPhaseCount, lp);
|
||||
taps::free(lp);
|
||||
}
|
||||
|
||||
dsp::multirate::PolyphaseBank<float> interpBank;
|
||||
|
||||
double _omega;
|
||||
double _omegaGain;
|
||||
double _muGain;
|
||||
double _omegaRelLimit;
|
||||
int _interpPhaseCount;
|
||||
int _interpTapCount;
|
||||
|
||||
int offset = 0;
|
||||
float* buffer;
|
||||
float* bufStart;
|
||||
};
|
||||
}
|
@ -178,7 +178,7 @@ namespace dsp::clock_recovery {
|
||||
}
|
||||
|
||||
dsp::multirate::PolyphaseBank<float> interpBank;
|
||||
loop::PhaseControlLoop<double, false> pcl;
|
||||
loop::PhaseControlLoop<float, false> pcl;
|
||||
|
||||
double _omega;
|
||||
double _omegaGain;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "../math/multiply.h"
|
||||
#include "../math/add.h"
|
||||
#include "../math/subtract.h"
|
||||
#include "../multirate/rational_resampler.h"
|
||||
|
||||
namespace dsp::demod {
|
||||
class BroadcastFM : public Processor<complex_t, stereo_t> {
|
||||
@ -19,7 +20,7 @@ namespace dsp::demod {
|
||||
public:
|
||||
BroadcastFM() {}
|
||||
|
||||
BroadcastFM(stream<complex_t>* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) { init(in, deviation, samplerate, stereo, lowPass); }
|
||||
BroadcastFM(stream<complex_t>* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true, bool rdsOut = false) { init(in, deviation, samplerate, stereo, lowPass); }
|
||||
|
||||
~BroadcastFM() {
|
||||
if (!base_type::_block_init) { return; }
|
||||
@ -31,11 +32,12 @@ namespace dsp::demod {
|
||||
taps::free(audioFirTaps);
|
||||
}
|
||||
|
||||
virtual void init(stream<complex_t>* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) {
|
||||
virtual void init(stream<complex_t>* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true, bool rdsOut = false) {
|
||||
_deviation = deviation;
|
||||
_samplerate = samplerate;
|
||||
_stereo = stereo;
|
||||
_lowPass = lowPass;
|
||||
_rdsOut = rdsOut;
|
||||
|
||||
demod.init(NULL, _deviation, _samplerate);
|
||||
pilotFirTaps = taps::bandPass<complex_t>(18750.0, 19250.0, 3000.0, _samplerate, true);
|
||||
@ -47,6 +49,7 @@ namespace dsp::demod {
|
||||
audioFirTaps = taps::lowPass(15000.0, 4000.0, _samplerate);
|
||||
alFir.init(NULL, audioFirTaps);
|
||||
arFir.init(NULL, audioFirTaps);
|
||||
rdsResamp.init(NULL, samplerate, 5000.0);
|
||||
|
||||
lmr = buffer::alloc<float>(STREAM_BUFFER_SIZE);
|
||||
l = buffer::alloc<float>(STREAM_BUFFER_SIZE);
|
||||
@ -56,6 +59,7 @@ namespace dsp::demod {
|
||||
lmrDelay.out.free();
|
||||
arFir.out.free();
|
||||
alFir.out.free();
|
||||
rdsResamp.out.free();
|
||||
|
||||
base_type::init(in);
|
||||
}
|
||||
@ -88,6 +92,8 @@ namespace dsp::demod {
|
||||
alFir.setTaps(audioFirTaps);
|
||||
arFir.setTaps(audioFirTaps);
|
||||
|
||||
rdsResamp.setInSamplerate(samplerate);
|
||||
|
||||
reset();
|
||||
base_type::tempStart();
|
||||
}
|
||||
@ -110,6 +116,15 @@ namespace dsp::demod {
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
void setRDSOut(bool rdsOut) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
_rdsOut = rdsOut;
|
||||
reset();
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
@ -124,7 +139,7 @@ namespace dsp::demod {
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
inline int process(int count, complex_t* in, stereo_t* out) {
|
||||
inline int process(int count, complex_t* in, stereo_t* out, int& rdsOutCount, float* rdsout = NULL) {
|
||||
// Demodulate
|
||||
demod.process(count, in, demod.out.writeBuf);
|
||||
if (_stereo) {
|
||||
@ -139,10 +154,19 @@ namespace dsp::demod {
|
||||
lprDelay.process(count, demod.out.writeBuf, demod.out.writeBuf);
|
||||
lmrDelay.process(count, rtoc.out.writeBuf, rtoc.out.writeBuf);
|
||||
|
||||
// Double and conjugate PLL output to down convert the L-R signal
|
||||
math::Multiply<dsp::complex_t>::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf);
|
||||
// conjugate PLL output to down convert twice the L-R signal
|
||||
math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf);
|
||||
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf);
|
||||
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf);
|
||||
|
||||
// Do RDS demod
|
||||
if (_rdsOut) {
|
||||
// Since the PLL output is no longer needed after this, use it as the output
|
||||
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf);
|
||||
convert::ComplexToReal::process(count, pilotPLL.out.writeBuf, rdsout);
|
||||
volk_32f_s32f_multiply_32f(rdsout, rdsout, 100.0, count);
|
||||
rdsOutCount = rdsResamp.process(count, rdsout, rdsout);
|
||||
}
|
||||
|
||||
// Convert output back to real for further processing
|
||||
convert::ComplexToReal::process(count, rtoc.out.writeBuf, lmr);
|
||||
@ -180,18 +204,25 @@ namespace dsp::demod {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
int rdsOutCount = 0;
|
||||
process(count, base_type::_in->readBuf, base_type::out.writeBuf, rdsOutCount, rdsOut.writeBuf);
|
||||
|
||||
base_type::_in->flush();
|
||||
if (!base_type::out.swap(count)) { return -1; }
|
||||
if (rdsOutCount && _rdsOut) {
|
||||
if (!rdsOut.swap(rdsOutCount)) { return -1; }
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
stream<float> rdsOut;
|
||||
|
||||
protected:
|
||||
double _deviation;
|
||||
double _samplerate;
|
||||
bool _stereo;
|
||||
bool _lowPass = true;
|
||||
bool _lowPass;
|
||||
bool _rdsOut;
|
||||
|
||||
Quadrature demod;
|
||||
tap<complex_t> pilotFirTaps;
|
||||
@ -203,6 +234,7 @@ namespace dsp::demod {
|
||||
tap<float> audioFirTaps;
|
||||
filter::FIR<float, float> arFir;
|
||||
filter::FIR<float, float> alFir;
|
||||
multirate::RationalResampler<float> rdsResamp;
|
||||
|
||||
float* lmr;
|
||||
float* l;
|
||||
|
31
core/src/dsp/digital/binary_slicer.h
Normal file
31
core/src/dsp/digital/binary_slicer.h
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "../processor.h"
|
||||
|
||||
namespace dsp::digital {
|
||||
class BinarySlicer : public Processor<float, uint8_t> {
|
||||
using base_type = Processor<float, uint8_t>;
|
||||
public:
|
||||
BinarySlicer() {}
|
||||
|
||||
BinarySlicer(stream<float> *in) { base_type::init(in); }
|
||||
|
||||
static inline int process(int count, const float* in, uint8_t* out) {
|
||||
// TODO: Switch to volk
|
||||
for (int i = 0; i < count; i++) {
|
||||
out[i] = in[i] > 0.0f;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
|
||||
base_type::_in->flush();
|
||||
if (!base_type::out.swap(count)) { return -1; }
|
||||
return count;
|
||||
}
|
||||
};
|
||||
}
|
64
core/src/dsp/digital/differentia_decoder.h
Normal file
64
core/src/dsp/digital/differentia_decoder.h
Normal file
@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
#include "../processor.h"
|
||||
|
||||
namespace dsp::digital {
|
||||
class DifferentialDecoder : public Processor<uint8_t, uint8_t> {
|
||||
using base_type = Processor<uint8_t, uint8_t>;
|
||||
public:
|
||||
DifferentialDecoder() {}
|
||||
|
||||
DifferentialDecoder(stream<uint8_t> *in) { base_type::init(in); }
|
||||
|
||||
void init(stream<uint8_t> *in, uint8_t modulus, uint8_t initSym = 0) {
|
||||
_modulus = modulus;
|
||||
_initSym = initSym;
|
||||
|
||||
last = _initSym;
|
||||
|
||||
base_type::init(in);
|
||||
}
|
||||
|
||||
void setModulus(uint8_t modulus) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_modulus = modulus;
|
||||
}
|
||||
|
||||
void setInitSym(uint8_t initSym) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_initSym = initSym;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
last = _initSym;
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
inline int process(int count, const uint8_t* in, uint8_t* out) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
out[i] = (in[i] - last) % _modulus;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
|
||||
base_type::_in->flush();
|
||||
if (!base_type::out.swap(count)) { return -1; }
|
||||
return count;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint8_t last;
|
||||
uint8_t _initSym;
|
||||
uint8_t _modulus;
|
||||
};
|
||||
}
|
65
core/src/dsp/digital/differential_decoder.h
Normal file
65
core/src/dsp/digital/differential_decoder.h
Normal file
@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
#include "../processor.h"
|
||||
|
||||
namespace dsp::digital {
|
||||
class DifferentialDecoder : public Processor<uint8_t, uint8_t> {
|
||||
using base_type = Processor<uint8_t, uint8_t>;
|
||||
public:
|
||||
DifferentialDecoder() {}
|
||||
|
||||
DifferentialDecoder(stream<uint8_t> *in) { base_type::init(in); }
|
||||
|
||||
void init(stream<uint8_t> *in, uint8_t modulus, uint8_t initSym = 0) {
|
||||
_modulus = modulus;
|
||||
_initSym = initSym;
|
||||
|
||||
last = _initSym;
|
||||
|
||||
base_type::init(in);
|
||||
}
|
||||
|
||||
void setModulus(uint8_t modulus) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_modulus = modulus;
|
||||
}
|
||||
|
||||
void setInitSym(uint8_t initSym) {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
_initSym = initSym;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
last = _initSym;
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
inline int process(int count, const uint8_t* in, uint8_t* out) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
out[i] = (in[i] - last + _modulus) % _modulus;
|
||||
last = in[i];
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
|
||||
base_type::_in->flush();
|
||||
if (!base_type::out.swap(count)) { return -1; }
|
||||
return count;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint8_t last;
|
||||
uint8_t _initSym;
|
||||
uint8_t _modulus;
|
||||
};
|
||||
}
|
47
core/src/dsp/digital/manchester_decoder.h
Normal file
47
core/src/dsp/digital/manchester_decoder.h
Normal file
@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
#include "../processor.h"
|
||||
|
||||
namespace dsp::digital {
|
||||
class ManchesterDecoder : public Processor<uint8_t, uint8_t> {
|
||||
using base_type = Processor<uint8_t, uint8_t>;
|
||||
public:
|
||||
ManchesterDecoder() {}
|
||||
|
||||
ManchesterDecoder(stream<uint8_t> *in) { base_type::init(in); }
|
||||
|
||||
void reset() {
|
||||
assert(base_type::_block_init);
|
||||
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
|
||||
base_type::tempStop();
|
||||
offset = 0;
|
||||
base_type::tempStart();
|
||||
}
|
||||
|
||||
inline int process(int count, const uint8_t* in, uint8_t* out) {
|
||||
// TODO: NOT THIS BULLSHIT
|
||||
int outCount = 0;
|
||||
for (; offset < count; offset += 2) {
|
||||
out[outCount++] = in[offset];
|
||||
}
|
||||
offset -= count;
|
||||
return outCount;
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf);
|
||||
|
||||
// Swap if some data was generated
|
||||
base_type::_in->flush();
|
||||
if (outCount) {
|
||||
if (!base_type::out.swap(outCount)) { return -1; }
|
||||
}
|
||||
return outCount;
|
||||
}
|
||||
|
||||
protected:
|
||||
int offset = 0;
|
||||
};
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
#include <module.h>
|
||||
|
||||
namespace style {
|
||||
extern ImFont* baseFont;
|
||||
extern ImFont* bigFont;
|
||||
extern ImFont* hugeFont;
|
||||
|
||||
extern float uiScale;
|
||||
SDRPP_EXPORT ImFont* baseFont;
|
||||
SDRPP_EXPORT ImFont* bigFont;
|
||||
SDRPP_EXPORT ImFont* hugeFont;
|
||||
SDRPP_EXPORT float uiScale;
|
||||
|
||||
bool setDefaultStyle(std::string resDir);
|
||||
bool loadFonts(std::string resDir);
|
||||
|
Reference in New Issue
Block a user