Merge remote-tracking branch 'origin/audio-enhance' into sequence

audioplugins
Elliott Liggett 2021-06-14 20:01:26 -07:00
commit 85a07881d6
16 zmienionych plików z 1527 dodań i 1085 usunięć

Wyświetl plik

@ -113,7 +113,7 @@ int main(int argc, char *argv[])
// Set the logging file before doing anything else.
m_logFile.reset(new QFile(logFilename));
// Open the file logging
m_logFile.data()->open(QFile::Append | QFile::Text);
m_logFile.data()->open(QFile::WriteOnly | QFile::Truncate | QFile::Text);
// Set handler
qInstallMessageHandler(messageHandler);

@ -1 +0,0 @@
Subproject commit ae5d6d59e82ef40300a4dece7897499685f87184

Wyświetl plik

@ -125,7 +125,7 @@ void pttyHandler::receiveDataFromRigToPtty(const QByteArray& data)
printHex(data,false,true);
}
if (isConnected && (unsigned char)data.mid(fePos)[2] != (unsigned char)0xE1 && (unsigned char)data.mid(fePos)[3] != (unsigned char)0xE1)
if (isConnected && (unsigned char)data[fePos+2] != 0xE1 && (unsigned char)data[fePos+3] != 0xE1)
{
// send to the pseudo port as well
// index 2 is dest, 0xE1 is wfview, 0xE0 is assumed to be the other device.

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,339 @@
/* Copyright (C) 2007-2008 Jean-Marc Valin
* Copyright (C) 2008 Thorvald Natvig
* Copyright (C) 2011 Texas Instruments
* author Jyri Sarha
*/
/**
@file resample_neon.h
@brief Resampler functions (NEON version)
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef FIXED_POINT
#if defined(__aarch64__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm ("fmov s0, %w[a]\n"
"sqxtn h0, s0\n"
"sxtl v0.4s, v0.4h\n"
"fmov %w[ret], s0\n"
: [ret] "=r" (ret)
: [a] "r" (a)
: "v0" );
return ret;
}
#elif defined(__thumb2__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm ("ssat %[ret], #16, %[a]"
: [ret] "=r" (ret)
: [a] "r" (a)
: );
return ret;
}
#else
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm ("vmov.s32 d0[0], %[a]\n"
"vqmovn.s32 d0, q0\n"
"vmov.s16 %[ret], d0[0]\n"
: [ret] "=r" (ret)
: [a] "r" (a)
: "q0");
return ret;
}
#endif
#undef WORD2INT
#define WORD2INT(x) (saturate_32bit_to_16bit(x))
#define OVERRIDE_INNER_PRODUCT_SINGLE
/* Only works when len % 4 == 0 and len >= 4 */
#if defined(__aarch64__)
static inline int32_t inner_product_single(const int16_t *a, const int16_t *b, unsigned int len)
{
int32_t ret;
uint32_t remainder = len % 16;
len = len - remainder;
asm volatile (" cmp %w[len], #0\n"
" b.ne 1f\n"
" ld1 {v16.4h}, [%[b]], #8\n"
" ld1 {v20.4h}, [%[a]], #8\n"
" subs %w[remainder], %w[remainder], #4\n"
" smull v0.4s, v16.4h, v20.4h\n"
" b.ne 4f\n"
" b 5f\n"
"1:"
" ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [%[b]], #32\n"
" ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [%[a]], #32\n"
" subs %w[len], %w[len], #16\n"
" smull v0.4s, v16.4h, v20.4h\n"
" smlal v0.4s, v17.4h, v21.4h\n"
" smlal v0.4s, v18.4h, v22.4h\n"
" smlal v0.4s, v19.4h, v23.4h\n"
" b.eq 3f\n"
"2:"
" ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [%[b]], #32\n"
" ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [%[a]], #32\n"
" subs %w[len], %w[len], #16\n"
" smlal v0.4s, v16.4h, v20.4h\n"
" smlal v0.4s, v17.4h, v21.4h\n"
" smlal v0.4s, v18.4h, v22.4h\n"
" smlal v0.4s, v19.4h, v23.4h\n"
" b.ne 2b\n"
"3:"
" cmp %w[remainder], #0\n"
" b.eq 5f\n"
"4:"
" ld1 {v18.4h}, [%[b]], #8\n"
" ld1 {v22.4h}, [%[a]], #8\n"
" subs %w[remainder], %w[remainder], #4\n"
" smlal v0.4s, v18.4h, v22.4h\n"
" b.ne 4b\n"
"5:"
" saddlv d0, v0.4s\n"
" sqxtn s0, d0\n"
" sqrshrn h0, s0, #15\n"
" sxtl v0.4s, v0.4h\n"
" fmov %w[ret], s0\n"
: [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+r" (len), [remainder] "+r" (remainder)
:
: "cc", "v0",
"v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23");
return ret;
}
#else
static inline int32_t inner_product_single(const int16_t *a, const int16_t *b, unsigned int len)
{
int32_t ret;
uint32_t remainder = len % 16;
len = len - remainder;
asm volatile (" cmp %[len], #0\n"
" bne 1f\n"
" vld1.16 {d16}, [%[b]]!\n"
" vld1.16 {d20}, [%[a]]!\n"
" subs %[remainder], %[remainder], #4\n"
" vmull.s16 q0, d16, d20\n"
" beq 5f\n"
" b 4f\n"
"1:"
" vld1.16 {d16, d17, d18, d19}, [%[b]]!\n"
" vld1.16 {d20, d21, d22, d23}, [%[a]]!\n"
" subs %[len], %[len], #16\n"
" vmull.s16 q0, d16, d20\n"
" vmlal.s16 q0, d17, d21\n"
" vmlal.s16 q0, d18, d22\n"
" vmlal.s16 q0, d19, d23\n"
" beq 3f\n"
"2:"
" vld1.16 {d16, d17, d18, d19}, [%[b]]!\n"
" vld1.16 {d20, d21, d22, d23}, [%[a]]!\n"
" subs %[len], %[len], #16\n"
" vmlal.s16 q0, d16, d20\n"
" vmlal.s16 q0, d17, d21\n"
" vmlal.s16 q0, d18, d22\n"
" vmlal.s16 q0, d19, d23\n"
" bne 2b\n"
"3:"
" cmp %[remainder], #0\n"
" beq 5f\n"
"4:"
" vld1.16 {d16}, [%[b]]!\n"
" vld1.16 {d20}, [%[a]]!\n"
" subs %[remainder], %[remainder], #4\n"
" vmlal.s16 q0, d16, d20\n"
" bne 4b\n"
"5:"
" vaddl.s32 q0, d0, d1\n"
" vadd.s64 d0, d0, d1\n"
" vqmovn.s64 d0, q0\n"
" vqrshrn.s32 d0, q0, #15\n"
" vmov.s16 %[ret], d0[0]\n"
: [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+r" (len), [remainder] "+r" (remainder)
:
: "cc", "q0",
"d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23");
return ret;
}
#endif // !defined(__aarch64__)
#elif defined(FLOATING_POINT)
#if defined(__aarch64__)
static inline int32_t saturate_float_to_16bit(float a) {
int32_t ret;
asm ("fcvtas s1, %s[a]\n"
"sqxtn h1, s1\n"
"sxtl v1.4s, v1.4h\n"
"fmov %w[ret], s1\n"
: [ret] "=r" (ret)
: [a] "w" (a)
: "v1");
return ret;
}
#else
static inline int32_t saturate_float_to_16bit(float a) {
int32_t ret;
asm ("vmov.f32 d0[0], %[a]\n"
"vcvt.s32.f32 d0, d0, #15\n"
"vqrshrn.s32 d0, q0, #15\n"
"vmov.s16 %[ret], d0[0]\n"
: [ret] "=r" (ret)
: [a] "r" (a)
: "q0");
return ret;
}
#endif
#undef WORD2INT
#define WORD2INT(x) (saturate_float_to_16bit(x))
#define OVERRIDE_INNER_PRODUCT_SINGLE
/* Only works when len % 4 == 0 and len >= 4 */
#if defined(__aarch64__)
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
{
float ret;
uint32_t remainder = len % 16;
len = len - remainder;
asm volatile (" cmp %w[len], #0\n"
" b.ne 1f\n"
" ld1 {v16.4s}, [%[b]], #16\n"
" ld1 {v20.4s}, [%[a]], #16\n"
" subs %w[remainder], %w[remainder], #4\n"
" fmul v1.4s, v16.4s, v20.4s\n"
" b.ne 4f\n"
" b 5f\n"
"1:"
" ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[b]], #64\n"
" ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [%[a]], #64\n"
" subs %w[len], %w[len], #16\n"
" fmul v1.4s, v16.4s, v20.4s\n"
" fmul v2.4s, v17.4s, v21.4s\n"
" fmul v3.4s, v18.4s, v22.4s\n"
" fmul v4.4s, v19.4s, v23.4s\n"
" b.eq 3f\n"
"2:"
" ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[b]], #64\n"
" ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [%[a]], #64\n"
" subs %w[len], %w[len], #16\n"
" fmla v1.4s, v16.4s, v20.4s\n"
" fmla v2.4s, v17.4s, v21.4s\n"
" fmla v3.4s, v18.4s, v22.4s\n"
" fmla v4.4s, v19.4s, v23.4s\n"
" b.ne 2b\n"
"3:"
" fadd v16.4s, v1.4s, v2.4s\n"
" fadd v17.4s, v3.4s, v4.4s\n"
" cmp %w[remainder], #0\n"
" fadd v1.4s, v16.4s, v17.4s\n"
" b.eq 5f\n"
"4:"
" ld1 {v18.4s}, [%[b]], #16\n"
" ld1 {v22.4s}, [%[a]], #16\n"
" subs %w[remainder], %w[remainder], #4\n"
" fmla v1.4s, v18.4s, v22.4s\n"
" b.ne 4b\n"
"5:"
" faddp v1.4s, v1.4s, v1.4s\n"
" faddp %[ret].4s, v1.4s, v1.4s\n"
: [ret] "=w" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+r" (len), [remainder] "+r" (remainder)
:
: "cc", "v1", "v2", "v3", "v4",
"v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23");
return ret;
}
#else
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
{
float ret;
uint32_t remainder = len % 16;
len = len - remainder;
asm volatile (" cmp %[len], #0\n"
" bne 1f\n"
" vld1.32 {q4}, [%[b]]!\n"
" vld1.32 {q8}, [%[a]]!\n"
" subs %[remainder], %[remainder], #4\n"
" vmul.f32 q0, q4, q8\n"
" bne 4f\n"
" b 5f\n"
"1:"
" vld1.32 {q4, q5}, [%[b]]!\n"
" vld1.32 {q8, q9}, [%[a]]!\n"
" vld1.32 {q6, q7}, [%[b]]!\n"
" vld1.32 {q10, q11}, [%[a]]!\n"
" subs %[len], %[len], #16\n"
" vmul.f32 q0, q4, q8\n"
" vmul.f32 q1, q5, q9\n"
" vmul.f32 q2, q6, q10\n"
" vmul.f32 q3, q7, q11\n"
" beq 3f\n"
"2:"
" vld1.32 {q4, q5}, [%[b]]!\n"
" vld1.32 {q8, q9}, [%[a]]!\n"
" vld1.32 {q6, q7}, [%[b]]!\n"
" vld1.32 {q10, q11}, [%[a]]!\n"
" subs %[len], %[len], #16\n"
" vmla.f32 q0, q4, q8\n"
" vmla.f32 q1, q5, q9\n"
" vmla.f32 q2, q6, q10\n"
" vmla.f32 q3, q7, q11\n"
" bne 2b\n"
"3:"
" vadd.f32 q4, q0, q1\n"
" vadd.f32 q5, q2, q3\n"
" cmp %[remainder], #0\n"
" vadd.f32 q0, q4, q5\n"
" beq 5f\n"
"4:"
" vld1.32 {q6}, [%[b]]!\n"
" vld1.32 {q10}, [%[a]]!\n"
" subs %[remainder], %[remainder], #4\n"
" vmla.f32 q0, q6, q10\n"
" bne 4b\n"
"5:"
" vadd.f32 d0, d0, d1\n"
" vpadd.f32 d0, d0, d0\n"
" vmov.f32 %[ret], d0[0]\n"
: [ret] "=r" (ret), [a] "+r" (a), [b] "+r" (b),
[len] "+l" (len), [remainder] "+l" (remainder)
:
: "cc", "q0", "q1", "q2", "q3",
"q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11");
return ret;
}
#endif // defined(__aarch64__)
#endif

Wyświetl plik

@ -2,127 +2,127 @@
* Copyright (C) 2008 Thorvald Natvig
*/
/**
@file resample_sse.h
@brief Resampler functions (SSE version)
@file resample_sse.h
@brief Resampler functions (SSE version)
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <xmmintrin.h>
#define OVERRIDE_INNER_PRODUCT_SINGLE
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
static inline float inner_product_single(const float* a, const float* b, unsigned int len)
{
unsigned int i;
float ret;
__m128 sum = _mm_setzero_ps();
for (i=0;i<len;i+=8)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a+i+4), _mm_loadu_ps(b+i+4)));
}
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
_mm_store_ss(&ret, sum);
return ret;
int i;
float ret;
__m128 sum = _mm_setzero_ps();
for (i = 0; i < len; i += 8)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i), _mm_loadu_ps(b + i)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_loadu_ps(a + i + 4), _mm_loadu_ps(b + i + 4)));
}
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
_mm_store_ss(&ret, sum);
return ret;
}
#define OVERRIDE_INTERPOLATE_PRODUCT_SINGLE
static inline float interpolate_product_single(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
unsigned int i;
float ret;
__m128 sum = _mm_setzero_ps();
__m128 f = _mm_loadu_ps(frac);
for(i=0;i<len;i+=2)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a+i+1), _mm_loadu_ps(b+(i+1)*oversample)));
}
sum = _mm_mul_ps(f, sum);
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
_mm_store_ss(&ret, sum);
return ret;
static inline float interpolate_product_single(const float* a, const float* b, unsigned int len, const spx_uint32_t oversample, float* frac) {
int i;
float ret;
__m128 sum = _mm_setzero_ps();
__m128 f = _mm_loadu_ps(frac);
for (i = 0; i < len; i += 2)
{
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a + i), _mm_loadu_ps(b + i * oversample)));
sum = _mm_add_ps(sum, _mm_mul_ps(_mm_load1_ps(a + i + 1), _mm_loadu_ps(b + (i + 1) * oversample)));
}
sum = _mm_mul_ps(f, sum);
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
_mm_store_ss(&ret, sum);
return ret;
}
#ifdef __SSE2__
#ifdef USE_SSE2
#include <emmintrin.h>
#define OVERRIDE_INNER_PRODUCT_DOUBLE
static inline double inner_product_double(const float *a, const float *b, unsigned int len)
static inline double inner_product_double(const float* a, const float* b, unsigned int len)
{
unsigned int i;
double ret;
__m128d sum = _mm_setzero_pd();
__m128 t;
for (i=0;i<len;i+=8)
{
t = _mm_mul_ps(_mm_loadu_ps(a+i), _mm_loadu_ps(b+i));
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
int i;
double ret;
__m128d sum = _mm_setzero_pd();
__m128 t;
for (i = 0; i < len; i += 8)
{
t = _mm_mul_ps(_mm_loadu_ps(a + i), _mm_loadu_ps(b + i));
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
t = _mm_mul_ps(_mm_loadu_ps(a+i+4), _mm_loadu_ps(b+i+4));
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
}
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
_mm_store_sd(&ret, sum);
return ret;
t = _mm_mul_ps(_mm_loadu_ps(a + i + 4), _mm_loadu_ps(b + i + 4));
sum = _mm_add_pd(sum, _mm_cvtps_pd(t));
sum = _mm_add_pd(sum, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
}
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
_mm_store_sd(&ret, sum);
return ret;
}
#define OVERRIDE_INTERPOLATE_PRODUCT_DOUBLE
static inline double interpolate_product_double(const float *a, const float *b, unsigned int len, const spx_uint32_t oversample, float *frac) {
unsigned int i;
double ret;
__m128d sum;
__m128d sum1 = _mm_setzero_pd();
__m128d sum2 = _mm_setzero_pd();
__m128 f = _mm_loadu_ps(frac);
__m128d f1 = _mm_cvtps_pd(f);
__m128d f2 = _mm_cvtps_pd(_mm_movehl_ps(f,f));
__m128 t;
for(i=0;i<len;i+=2)
{
t = _mm_mul_ps(_mm_load1_ps(a+i), _mm_loadu_ps(b+i*oversample));
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
static inline double interpolate_product_double(const float* a, const float* b, unsigned int len, const spx_uint32_t oversample, float* frac) {
int i;
double ret;
__m128d sum;
__m128d sum1 = _mm_setzero_pd();
__m128d sum2 = _mm_setzero_pd();
__m128 f = _mm_loadu_ps(frac);
__m128d f1 = _mm_cvtps_pd(f);
__m128d f2 = _mm_cvtps_pd(_mm_movehl_ps(f, f));
__m128 t;
for (i = 0; i < len; i += 2)
{
t = _mm_mul_ps(_mm_load1_ps(a + i), _mm_loadu_ps(b + i * oversample));
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
t = _mm_mul_ps(_mm_load1_ps(a+i+1), _mm_loadu_ps(b+(i+1)*oversample));
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
}
sum1 = _mm_mul_pd(f1, sum1);
sum2 = _mm_mul_pd(f2, sum2);
sum = _mm_add_pd(sum1, sum2);
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
_mm_store_sd(&ret, sum);
return ret;
t = _mm_mul_ps(_mm_load1_ps(a + i + 1), _mm_loadu_ps(b + (i + 1) * oversample));
sum1 = _mm_add_pd(sum1, _mm_cvtps_pd(t));
sum2 = _mm_add_pd(sum2, _mm_cvtps_pd(_mm_movehl_ps(t, t)));
}
sum1 = _mm_mul_pd(f1, sum1);
sum2 = _mm_mul_pd(f2, sum2);
sum = _mm_add_pd(sum1, sum2);
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
_mm_store_sd(&ret, sum);
return ret;
}
#endif
#endif

Wyświetl plik

@ -191,7 +191,11 @@ void udpHandler::dataReceived()
else {
tempLatency = QString("<span style = \"color:red\">%1 ms</span>").arg(audio->audioLatency,3);
}
emit haveNetworkStatus(QString("<pre>rx latency: %1 ms / rtt: %2 ms / loss: %3/%4</pre>").arg(tempLatency).arg(latency, 3).arg(totallost,3).arg(totalsent,3));
QString txString="";
if (txSetup.codec == 0) {
txString = "(no tx)";
}
emit haveNetworkStatus(QString("<pre>%1 rx latency: %2 ms / rtt: %3 ms / loss: %4/%5</pre>").arg(txString).arg(tempLatency).arg(latency, 3).arg(totallost, 3).arg(totalsent, 3));
}
break;
}

Wyświetl plik

@ -57,6 +57,10 @@ void udpServer::init()
udpAudio = new QUdpSocket(this);
udpAudio->bind(config.audioPort);
QUdpSocket::connect(udpAudio, &QUdpSocket::readyRead, this, &udpServer::audioReceived);
wdTimer = new QTimer();
connect(wdTimer, &QTimer::timeout, this, &udpServer::watchdog);
wdTimer->start(500);
}
udpServer::~udpServer()
@ -76,10 +80,6 @@ udpServer::~udpServer()
client->pingTimer->stop();
delete client->pingTimer;
}
if (client->wdTimer != Q_NULLPTR) {
client->wdTimer->stop();
delete client->wdTimer;
}
if (client->retransmitTimer != Q_NULLPTR) {
client->retransmitTimer->stop();
@ -193,6 +193,7 @@ void udpServer::controlReceived()
current = new CLIENT();
current->type = "Control";
current->connected = true;
current->isAuthenticated = false;
current->isStreaming = false;
current->timeConnected = QDateTime::currentDateTime();
current->ipAddress = datagram.senderAddress();
@ -212,10 +213,6 @@ void udpServer::controlReceived()
connect(current->idleTimer, &QTimer::timeout, this, std::bind(&udpServer::sendControl, this, current, (quint8)0x00, (quint16)0x00));
current->idleTimer->start(100);
current->wdTimer = new QTimer();
connect(current->wdTimer, &QTimer::timeout, this, std::bind(&udpServer::watchdog, this, current));
//current->wdTimer->start(1000);
current->retransmitTimer = new QTimer();
connect(current->retransmitTimer, &QTimer::timeout, this, std::bind(&udpServer::sendRetransmitRequest, this, current));
current->retransmitTimer->start(RETRANSMIT_PERIOD);
@ -241,8 +238,15 @@ void udpServer::controlReceived()
{
qInfo(logUdpServer()) << current->ipAddress.toString() << ": Received 'disconnect' request";
sendControl(current, 0x00, in->seq);
//current->wdTimer->stop(); // Keep watchdog running to delete stale connection.
if (current->audioClient != Q_NULLPTR) {
deleteConnection(&audioClients, current->audioClient);
}
if (current->civClient != Q_NULLPTR) {
deleteConnection(&civClients, current->civClient);
}
deleteConnection(&controlClients, current);
return;
}
break;
}
@ -308,21 +312,18 @@ void udpServer::controlReceived()
{
login_packet_t in = (login_packet_t)r.constData();
qInfo(logUdpServer()) << current->ipAddress.toString() << ": Received 'login'";
bool userOk = false;
foreach(SERVERUSER user, config.users)
{
QByteArray usercomp;
passcode(user.username, usercomp);
QByteArray passcomp;
passcode(user.password, passcomp);
if (!strcmp(in->username, usercomp.constData()) && !strcmp(in->password, passcomp.constData()))
if (!strcmp(in->username, usercomp.constData()) && (!strcmp(in->password, user.password.toUtf8()) || !strcmp(in->password, passcomp.constData())))
{
userOk = true;
current->isAuthenticated = true;
current->user = user;
break;
}
}
// Generate login response
current->rxSeq = in->seq;
@ -331,7 +332,7 @@ void udpServer::controlReceived()
current->tokenRx = in->tokrequest;
current->tokenTx = (quint8)rand() | (quint8)rand() << 8 | (quint8)rand() << 16 | (quint8)rand() << 24;
if (userOk) {
if (current->isAuthenticated) {
qInfo(logUdpServer()) << current->ipAddress.toString() << ": User " << current->user.username << " login OK";
sendLoginResponse(current, true);
}
@ -423,8 +424,11 @@ void udpServer::controlReceived()
break;
}
}
commonReceived(&controlClients, current, r);
// Connection "may" have been deleted so check before calling common function.
if (current != Q_NULLPTR) {
commonReceived(&controlClients, current, r);
}
}
}
@ -450,12 +454,25 @@ void udpServer::civReceived()
{
current = client;
}
}
}
if (current == Q_NULLPTR)
{
current = new CLIENT();
foreach(CLIENT* client, controlClients)
{
if (client != Q_NULLPTR)
{
if (client->ipAddress == datagram.senderAddress() && client->isAuthenticated && client->civClient == Q_NULLPTR)
{
current->controlClient = client;
client->civClient = current;
}
}
}
current->type = "CIV";
current->civId = 0;
current->connected = true;
@ -475,10 +492,6 @@ void udpServer::civReceived()
connect(current->idleTimer, &QTimer::timeout, this, std::bind(&udpServer::sendControl, this, current, 0x00, (quint16)0x00));
//current->idleTimer->start(100); // Start idleTimer after receiving iamready.
current->wdTimer = new QTimer();
connect(current->wdTimer, &QTimer::timeout, this, std::bind(&udpServer::watchdog, this, current));
//current->wdTimer->start(1000);
current->retransmitTimer = new QTimer();
connect(current->retransmitTimer, &QTimer::timeout, this, std::bind(&udpServer::sendRetransmitRequest, this, current));
current->retransmitTimer->start(RETRANSMIT_PERIOD);
@ -490,6 +503,11 @@ void udpServer::civReceived()
}
if (current->controlClient == Q_NULLPTR || !current->controlClient->isAuthenticated)
{
return;
}
switch (r.length())
{
/* case (CONTROL_SIZE):
@ -535,16 +553,16 @@ void udpServer::civReceived()
// Strip all '0xFE' command preambles first:
int lastFE = r.lastIndexOf((char)0xfe);
//qInfo(logUdpServer()) << "Got:" << r.mid(lastFE);
if (current->civId == 0 && r.length() > lastFE + 2 && (quint8)r[lastFE + 2] > (quint8)0xdf && (quint8)r[lastFE + 2] < (quint8)0xef) {
if (current->civId == 0 && r.length() > lastFE + 2 && (quint8)r[lastFE+2] != 0xE1 && (quint8)r[lastFE + 2] > (quint8)0xdf && (quint8)r[lastFE + 2] < (quint8)0xef) {
// This is (should be) the remotes CIV id.
current->civId = (quint8)r[lastFE + 2];
qInfo(logUdpServer()) << current->ipAddress.toString() << ": Detected remote CI-V:" << hex << current->civId;
}
else if (current->civId != 0 && r.length() > lastFE + 2 && (quint8)r[lastFE + 2] != current->civId)
else if (current->civId != 0 && r.length() > lastFE + 2 && (quint8)r[lastFE+2] != 0xE1 && (quint8)r[lastFE + 2] != current->civId)
{
current->civId = (quint8)r[lastFE + 2];
qDebug(logUdpServer()) << current->ipAddress.toString() << ": Detected different remote CI-V:" << hex << current->civId; qInfo(logUdpServer()) << current->ipAddress.toString() << ": Detected different remote CI-V:" << hex << current->civId;
} else if (r.length() > lastFE+2) {
} else if (r.length() > lastFE+2 && (quint8)r[lastFE+2] != 0xE1) {
qDebug(logUdpServer()) << current->ipAddress.toString() << ": Detected invalid remote CI-V:" << hex << (quint8)r[lastFE+2];
}
@ -591,6 +609,17 @@ void udpServer::audioReceived()
if (current == Q_NULLPTR)
{
current = new CLIENT();
foreach(CLIENT* client, controlClients)
{
if (client != Q_NULLPTR)
{
if (client->ipAddress == datagram.senderAddress() && client->isAuthenticated && client->audioClient == Q_NULLPTR)
{
current->controlClient = client;
client->audioClient = current;
}
}
}
current->type = "Audio";
current->connected = true;
current->timeConnected = QDateTime::currentDateTime();
@ -605,10 +634,6 @@ void udpServer::audioReceived()
connect(current->pingTimer, &QTimer::timeout, this, std::bind(&udpServer::sendPing, this, &audioClients, current, (quint16)0x00, false));
current->pingTimer->start(100);
current->wdTimer = new QTimer();
connect(current->wdTimer, &QTimer::timeout, this, std::bind(&udpServer::watchdog, this, current));
//current->wdTimer->start(1000);
current->retransmitTimer = new QTimer();
connect(current->retransmitTimer, &QTimer::timeout, this, std::bind(&udpServer::sendRetransmitRequest, this, current));
current->retransmitTimer->start(RETRANSMIT_PERIOD);
@ -877,7 +902,8 @@ void udpServer::sendControl(CLIENT* c, quint8 type, quint16 seq)
void udpServer::sendPing(QList<CLIENT*>* l, CLIENT* c, quint16 seq, bool reply)
{
// Also use to detect "stale" connections
Q_UNUSED(l);
/*
QDateTime now = QDateTime::currentDateTime();
if (c->lastHeard.secsTo(now) > STALE_CONNECTION)
@ -887,6 +913,7 @@ void udpServer::sendPing(QList<CLIENT*>* l, CLIENT* c, quint16 seq, bool reply)
return;
}
*/
//qInfo(logUdpServer()) << c->ipAddress.toString() << ": Sending Ping";
@ -945,8 +972,6 @@ void udpServer::sendLoginResponse(CLIENT* c, bool allowed)
c->pingTimer->stop();
if (c->retransmitTimer != Q_NULLPTR)
c->retransmitTimer->stop();
if (c->wdTimer != Q_NULLPTR)
c->wdTimer->stop();
}
else {
strcpy(p.connection, "WFVIEW");
@ -1190,11 +1215,56 @@ void udpServer::sendTokenResponse(CLIENT* c, quint8 type)
#define PURGE_SECONDS 60
void udpServer::watchdog(CLIENT* c)
void udpServer::watchdog()
{
Q_UNUSED(c);
// Do something!
QDateTime now = QDateTime::currentDateTime();
foreach(CLIENT * client, audioClients)
{
if (client != Q_NULLPTR)
{
if (client->lastHeard.secsTo(now) > STALE_CONNECTION)
{
qInfo(logUdpServer()) << client->ipAddress.toString() << "(" << client->type << "): Deleting stale connection ";
deleteConnection(&audioClients, client);
}
}
else {
qInfo(logUdpServer()) << "Current client is NULL!";
}
}
foreach(CLIENT* client, civClients)
{
if (client != Q_NULLPTR)
{
if (client->lastHeard.secsTo(now) > STALE_CONNECTION)
{
qInfo(logUdpServer()) << client->ipAddress.toString() << "(" << client->type << "): Deleting stale connection ";
deleteConnection(&civClients, client);
}
}
else {
qInfo(logUdpServer()) << "Current client is NULL!";
}
}
foreach(CLIENT* client, controlClients)
{
if (client != Q_NULLPTR)
{
if (client->lastHeard.secsTo(now) > STALE_CONNECTION)
{
qInfo(logUdpServer()) << client->ipAddress.toString() << "(" << client->type << "): Deleting stale connection ";
deleteConnection(&controlClients, client);
}
}
else {
qInfo(logUdpServer()) << "Current client is NULL!";
}
}
emit haveNetworkStatus(QString("<pre>Server connections: Control:%1 CI-V:%2 Audio:%3</pre>").arg(controlClients.size()).arg(civClients.size()).arg(audioClients.size()));
}
void udpServer::sendStatus(CLIENT* c)
@ -1255,7 +1325,7 @@ void udpServer::dataForServer(QByteArray d)
int lastFE = d.lastIndexOf((quint8)0xfe);
if (client != Q_NULLPTR && client->connected && d.length() > lastFE + 2 &&
((quint8)d[lastFE + 1] == client->civId || (quint8)d[lastFE + 2] == client->civId ||
(quint8)d[lastFE + 1] == 0x00 || (quint8)d[lastFE + 2]==0x00)) {
(quint8)d[lastFE + 1] == 0x00 || (quint8)d[lastFE + 2]==0x00 || (quint8)d[lastFE + 1] == 0xE1 || (quint8)d[lastFE + 2] == 0xE1)) {
data_packet p;
memset(p.packet, 0x0, sizeof(p)); // We can't be sure it is initialized with 0x00!
p.len = (quint16)d.length() + sizeof(p);
@ -1476,7 +1546,7 @@ void udpServer::sendRetransmitRequest(CLIENT* c)
void udpServer::deleteConnection(QList<CLIENT*>* l, CLIENT* c)
{
qInfo(logUdpServer()) << "Deleting connection to: " << c->ipAddress.toString() << ":" << QString::number(c->port);
qInfo(logUdpServer()) << "Deleting" << c->type << "connection to: " << c->ipAddress.toString() << ":" << QString::number(c->port);
if (c->idleTimer != Q_NULLPTR) {
c->idleTimer->stop();
delete c->idleTimer;
@ -1485,10 +1555,6 @@ void udpServer::deleteConnection(QList<CLIENT*>* l, CLIENT* c)
c->pingTimer->stop();
delete c->pingTimer;
}
if (c->wdTimer != Q_NULLPTR) {
c->wdTimer->stop();
delete c->wdTimer;
}
if (c->retransmitTimer != Q_NULLPTR) {
c->retransmitTimer->stop();

Wyświetl plik

@ -51,6 +51,7 @@ public slots:
signals:
void haveDataFromServer(QByteArray);
void haveAudioData(audioPacket data);
void haveNetworkStatus(QString);
void setupTxAudio(audioSetup);
void setupRxAudio(audioSetup);
@ -93,7 +94,6 @@ private:
QTimer* pingTimer;
QTimer* idleTimer;
QTimer* wdTimer;
QTimer* retransmitTimer;
// Only used for audio.
@ -115,6 +115,10 @@ private:
quint16 seqPrefix;
quint8 civId;
bool isAuthenticated;
CLIENT* controlClient = Q_NULLPTR;
CLIENT* civClient = Q_NULLPTR;
CLIENT* audioClient = Q_NULLPTR;
};
void controlReceived();
@ -130,7 +134,7 @@ private:
void sendTokenResponse(CLIENT* c,quint8 type);
void sendStatus(CLIENT* c);
void sendRetransmitRequest(CLIENT* c);
void watchdog(CLIENT* c);
void watchdog();
void sendRxAudio();
void deleteConnection(QList<CLIENT*> *l, CLIENT* c);
@ -173,6 +177,7 @@ private:
quint8 txCodec = 0;
QHostAddress hasTxAudio;
QTimer* wdTimer;
};

Wyświetl plik

@ -2,11 +2,15 @@
#include "ui_udpserversetup.h"
#include "logcategories.h"
extern void passcode(QString in,QByteArray& out);
udpServerSetup::udpServerSetup(QWidget* parent) :
QDialog(parent),
ui(new Ui::udpServerSetup)
{
ui->setupUi(this);
addUserLine("", "", 0); // Create a blank row if we never receive config.
// Get any stored config information from the main form.
SERVERCONFIG config;
emit serverConfig(config,false); // Just send blank server config.
@ -29,43 +33,22 @@ void udpServerSetup::receiveServerConfig(SERVERCONFIG conf)
int row = 0;
for (int i = 0; i < ui->usersTable->rowCount(); i++)
{
ui->usersTable->removeRow(i);
}
foreach (SERVERUSER user, conf.users)
{
if (user.username != "" && user.password != "")
{
if (ui->usersTable->rowCount() <= row) {
ui->usersTable->insertRow(ui->usersTable->rowCount());
}
ui->usersTable->setItem(row, 0, new QTableWidgetItem(user.username));
ui->usersTable->setItem(row, 1, new QTableWidgetItem(user.password));
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
comboBox->setCurrentIndex(user.userType);
ui->usersTable->setCellWidget(row, 2, comboBox);
addUserLine(user.username, user.password, user.userType);
row++;
}
}
// Delete any rows no longer needed
int count=0;
for (count = row; count <= ui->usersTable->rowCount(); count++)
{
if (count == conf.users.count()) {
ui->usersTable->insertRow(ui->usersTable->rowCount());
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
ui->usersTable->setCellWidget(count, 2, comboBox);
}
else if (count > conf.users.count()) {
ui->usersTable->removeRow(count);
}
}
if (count == 0) {
ui->usersTable->insertRow(ui->usersTable->rowCount());
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
ui->usersTable->setCellWidget(count, 2, comboBox);
if (row == 0) {
addUserLine("", "", 0);
}
}
@ -83,11 +66,12 @@ void udpServerSetup::accept()
for (int row = 0; row < ui->usersTable->model()->rowCount(); row++)
{
if (ui->usersTable->item(row, 0) != NULL && ui->usersTable->item(row, 1) != NULL)
if (ui->usersTable->item(row, 0) != NULL)
{
SERVERUSER user;
user.username = ui->usersTable->item(row, 0)->text();
user.password = ui->usersTable->item(row, 1)->text();
QLineEdit* password = (QLineEdit*)ui->usersTable->cellWidget(row, 1);
user.password = password->text();
QComboBox* comboBox = (QComboBox*)ui->usersTable->cellWidget(row, 2);
user.userType = comboBox->currentIndex();
config.users.append(user);
@ -106,13 +90,38 @@ void udpServerSetup::accept()
void udpServerSetup::on_usersTable_cellClicked(int row, int col)
{
qInfo() << "Clicked on " << row << "," << col;
if (row == ui->usersTable->model()->rowCount() - 1 && ui->usersTable->item(row, 0) != NULL && ui->usersTable->item(row, 1) != NULL) {
ui->usersTable->insertRow(ui->usersTable->rowCount());
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
userTypes.append(comboBox);
ui->usersTable->setCellWidget(ui->usersTable->rowCount() - 1, 2, comboBox);
if (row == ui->usersTable->model()->rowCount() - 1 && ui->usersTable->item(row, 0) != NULL) {
addUserLine("", "", 0);
}
}
}
void udpServerSetup::onPasswordChanged()
{
int row = sender()->property("row").toInt();
QLineEdit* password = (QLineEdit*)ui->usersTable->cellWidget(row, 1);
QByteArray pass;
passcode(password->text(), pass);
password->setText(pass);
qInfo() << "password row" << row << "changed";
}
void udpServerSetup::addUserLine(const QString& user, const QString& pass, const int& type)
{
ui->usersTable->insertRow(ui->usersTable->rowCount());
ui->usersTable->setItem(ui->usersTable->rowCount() - 1, 0, new QTableWidgetItem(user));
ui->usersTable->setItem(ui->usersTable->rowCount() - 1, 1, new QTableWidgetItem());
ui->usersTable->setItem(ui->usersTable->rowCount() - 1, 2, new QTableWidgetItem());
QLineEdit* password = new QLineEdit();
password->setProperty("row", (int)ui->usersTable->rowCount() - 1);
password->setEchoMode(QLineEdit::PasswordEchoOnEdit);
password->setText(pass);
connect(password, SIGNAL(editingFinished()), this, SLOT(onPasswordChanged()));
ui->usersTable->setCellWidget(ui->usersTable->rowCount() - 1, 1, password);
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
comboBox->setCurrentIndex(type);
ui->usersTable->setCellWidget(ui->usersTable->rowCount() - 1, 2, comboBox);
}

Wyświetl plik

@ -42,6 +42,7 @@ public:
private slots:
void on_usersTable_cellClicked(int row, int col);
void onPasswordChanged();
public slots:
void receiveServerConfig(SERVERCONFIG conf);
@ -53,6 +54,7 @@ private:
Ui::udpServerSetup* ui;
void accept();
QList<QComboBox*> userTypes;
void addUserLine(const QString &user, const QString &pass, const int &type);
};
#endif // UDPSERVER_H

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>440</width>
<height>351</height>
<height>361</height>
</rect>
</property>
<property name="sizePolicy">

Wyświetl plik

@ -79,6 +79,11 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
}
amTransmitting = false;
connect(ui->txPowerSlider, &QSlider::sliderMoved,
[&](int value) {
QToolTip::showText(QCursor::pos(), QString("%1").arg(value*100/255), nullptr);
});
}
wfmain::~wfmain()
@ -754,6 +759,9 @@ void wfmain::setServerToPrefs()
connect(this, SIGNAL(initServer()), udp, SLOT(init()));
connect(serverThread, SIGNAL(finished()), udp, SLOT(deleteLater()));
if (!prefs.enableLAN && udp != Q_NULLPTR) {
connect(udp, SIGNAL(haveNetworkStatus(QString)), this, SLOT(receiveStatusUpdate(QString)));
}
serverThread->start();
@ -1053,6 +1061,7 @@ void wfmain::setDefPrefs()
udpDefPrefs.username = QString("");
udpDefPrefs.password = QString("");
udpDefPrefs.clientName = QHostInfo::localHostName();
}
void wfmain::loadSettings()
@ -1129,11 +1138,15 @@ void wfmain::loadSettings()
}
prefs.serialPortBaud = (quint32) settings->value("SerialPortBaud", defPrefs.serialPortBaud).toInt();
ui->baudRateCombo->blockSignals(true);
ui->baudRateCombo->setCurrentIndex( ui->baudRateCombo->findData(prefs.serialPortBaud) );
ui->baudRateCombo->blockSignals(false);
if (prefs.serialPortBaud > 0)
{
serverConfig.baudRate = prefs.serialPortBaud;
}
prefs.virtualSerialPort = settings->value("VirtualSerialPort", defPrefs.virtualSerialPort).toString();
int vspIndex = ui->vspCombo->findText(prefs.virtualSerialPort);
if (vspIndex != -1) {
@ -1282,7 +1295,6 @@ void wfmain::loadSettings()
settings->endGroup();
settings->beginGroup("Server");
serverConfig.enabled = settings->value("ServerEnabled", false).toBool();
serverConfig.controlPort = settings->value("ServerControlPort", 50001).toInt();
serverConfig.civPort = settings->value("ServerCivPort", 50002).toInt();
@ -4582,6 +4594,7 @@ void wfmain::on_baudRateCombo_activated(int index)
if(ok)
{
prefs.serialPortBaud = baud;
serverConfig.baudRate = baud;
showStatusBarText(QString("Changed baud rate to %1 bps. Press Save Settings to retain.").arg(baud));
}
(void)index;

Wyświetl plik

@ -31,7 +31,10 @@ linux:QMAKE_LFLAGS += -O2 -s
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
# These defines are used for the resampler
equals(QT_ARCH, i386): DEFINES += USE_SSE
equals(QT_ARCH, arm): DEFINES += USE_NEON
DEFINES += OUTSIDE_SPEEX
DEFINES += RANDOM_PREFIX=wf
@ -97,11 +100,13 @@ CONFIG(debug, release|debug) {
linux:LIBS += -L./ -l$$QCPLIB
macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp rtaudio/RTAudio.cpp
!linux:HEADERS += ../qcustomplot/qcustomplot.h rtaudio/RTAUdio.h
#win32:SOURCES += rtaudio/RTAudio.cpp
#win32:HEADERS += rtaudio/RTAUdio.h
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp
!linux:HEADERS += ../qcustomplot/qcustomplot.h
!linux:INCLUDEPATH += ../qcustomplot
INCLUDEPATH += opus-tools/src
INCLUDEPATH += resampler
!linux:INCLUDEPATH += rtaudio
SOURCES += main.cpp\
@ -120,7 +125,7 @@ SOURCES += main.cpp\
meter.cpp \
qledlabel.cpp \
pttyhandler.cpp \
opus-tools/src/resample.c \
resampler/resample.c \
repeatersetup.cpp \
rigctld.cpp \
ring/ring.cpp
@ -141,9 +146,9 @@ HEADERS += wfmain.h \
meter.h \
qledlabel.h \
pttyhandler.h \
opus-tools/src/speex_resampler.h \
opus-tools/src/arch.h \
opus-tools/src/resample_sse.h \
resampler/speex_resampler.h \
resampler/arch.h \
resampler/resample_sse.h \
repeatersetup.h \
repeaterattributes.h \
rigctld.h \

Wyświetl plik

@ -48,7 +48,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;..\qcustomplot;opus-tools\src;rtaudio;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;..\qcustomplot;resampler;rtaudio;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
@ -57,7 +57,7 @@
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>release\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;RTAUDIO;__WINDOWS_WASAPI__;GITSHORT="9a0ea32";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="ea09e1f";HOST="wfview.org";UNAME="build";QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -67,13 +67,12 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.6.11-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\wfview.exe</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
@ -85,12 +84,12 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;RTAUDIO;__WINDOWS_WASAPI__;GITSHORT=\"9a0ea32\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"ea09e1f\";HOST=\"wfview.org\";UNAME=\"build\";QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;..\qcustomplot;opus-tools\src;rtaudio;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;..\qcustomplot;resampler;rtaudio;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
@ -99,7 +98,7 @@
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>debug\</ObjectFileName>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;RTAUDIO;__WINDOWS_WASAPI__;GITSHORT="9a0ea32";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="ea09e1f";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
@ -108,7 +107,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
<Link>
<AdditionalDependencies>shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.6.11-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -124,11 +123,10 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;RTAUDIO;__WINDOWS_WASAPI__;GITSHORT=\"9a0ea32\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"ea09e1f\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="rtaudio\RTAudio.cpp" />
<ClCompile Include="audiohandler.cpp" />
<ClCompile Include="calibrationwindow.cpp" />
<ClCompile Include="commhandler.cpp" />
@ -140,7 +138,7 @@
<ClCompile Include="..\qcustomplot\qcustomplot.cpp" />
<ClCompile Include="qledlabel.cpp" />
<ClCompile Include="repeatersetup.cpp" />
<ClCompile Include="opus-tools\src\resample.c" />
<ClCompile Include="resampler\resample.c" />
<ClCompile Include="rigcommander.cpp" />
<ClCompile Include="rigctld.cpp" />
<ClCompile Include="rigidentities.cpp" />
@ -152,8 +150,7 @@
<ClCompile Include="wfmain.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="rtaudio\RTAUdio.h" />
<ClInclude Include="opus-tools\src\arch.h" />
<ClInclude Include="resampler\arch.h" />
<QtMoc Include="audiohandler.h">
@ -238,7 +235,7 @@
</QtMoc>
<ClInclude Include="opus-tools\src\resample_sse.h" />
<ClInclude Include="resampler\resample_sse.h" />
<QtMoc Include="rigcommander.h">
@ -271,7 +268,7 @@
</QtMoc>
<ClInclude Include="opus-tools\src\speex_resampler.h" />
<ClInclude Include="resampler\speex_resampler.h" />
<QtMoc Include="udphandler.h">

Wyświetl plik

@ -57,9 +57,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="rtaudio\RTAudio.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="audiohandler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -93,7 +90,7 @@
<ClCompile Include="repeatersetup.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="opus-tools\src\resample.c">
<ClCompile Include="resampler\resample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rigcommander.cpp">
@ -125,10 +122,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="rtaudio\RTAUdio.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="opus-tools\src\arch.h">
<ClInclude Include="resampler\arch.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="audiohandler.h">
@ -167,7 +161,7 @@
<QtMoc Include="repeatersetup.h">
<Filter>Header Files</Filter>
</QtMoc>
<ClInclude Include="opus-tools\src\resample_sse.h">
<ClInclude Include="resampler\resample_sse.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="rigcommander.h">
@ -185,7 +179,7 @@
<QtMoc Include="satellitesetup.h">
<Filter>Header Files</Filter>
</QtMoc>
<ClInclude Include="opus-tools\src\speex_resampler.h">
<ClInclude Include="resampler\speex_resampler.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="udphandler.h">