summaryrefslogtreecommitdiff
path: root/map65/soundin.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2022-08-08 23:08:17 +0200
committerChristoph Berg <myon@debian.org>2022-08-08 23:08:17 +0200
commit43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (patch)
treefac973fdc7378510849f4d749cd311176c023ebb /map65/soundin.cpp
parentd47341d71ff3df889c1180eb7bfb4fc0272eb26b (diff)
New upstream version 2.6.0~rc2+repackupstream/2.6.0_rc2+repack
Diffstat (limited to 'map65/soundin.cpp')
-rwxr-xr-xmap65/soundin.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/map65/soundin.cpp b/map65/soundin.cpp
index 0e50f293..46433d4e 100755
--- a/map65/soundin.cpp
+++ b/map65/soundin.cpp
@@ -1,4 +1,5 @@
#include "soundin.h"
+#include <math.h>
#ifdef Q_OS_WIN32
#include <windows.h>
@@ -53,9 +54,9 @@ typedef struct
{
int kin; //Parameters sent to/from the portaudio callback function
int nrx;
+ int dB;
bool bzero;
bool iqswap;
- bool b10db;
} paUserData;
//--------------------------------------------------------------- a2dCallback
@@ -91,8 +92,7 @@ extern "C" int a2dCallback( const void *inputBuffer, void *outputBuffer,
nbytes=udata->nrx*8*framesToProcess; //Bytes per frame
memcpy(d4,inputBuffer,nbytes); //Copy all samples to d4
- fac=32767.0;
- if(udata->b10db) fac=103618.35;
+ fac=32767.0 * pow(10.0,0.05*udata->dB);
if(udata->nrx==2) {
for(i=0; i<4*int(framesToProcess); i++) { //Negate odd-numbered frames
@@ -185,7 +185,7 @@ void SoundInThread::run() //SoundInThread::run()
udata.bzero=false; //Flag to request reset of kin
udata.nrx=m_nrx; //Number of polarizations
udata.iqswap=m_IQswap;
- udata.b10db=m_10db;
+ udata.dB=m_dB;
auto device_info = Pa_GetDeviceInfo (m_nDevIn);
@@ -251,7 +251,7 @@ void SoundInThread::run() //SoundInThread::run()
}
k=udata.kin;
udata.iqswap=m_IQswap;
- udata.b10db=m_10db;
+ udata.dB=m_dB;
if(m_monitoring) {
if(m_bForceCenterFreq) {
datcom_.fcenter=m_dForceCenterFreq;
@@ -281,9 +281,9 @@ void SoundInThread::setSwapIQ(bool b)
m_IQswap=b;
}
-void SoundInThread::set10db(bool b)
+void SoundInThread::setScale(qint32 n)
{
- m_10db=b;
+ m_dB=n;
}
void SoundInThread::setPort(int n) //setPort()
{