summaryrefslogtreecommitdiff
path: root/DecoderIpc.hpp
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /DecoderIpc.hpp
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'DecoderIpc.hpp')
-rw-r--r--DecoderIpc.hpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/DecoderIpc.hpp b/DecoderIpc.hpp
new file mode 100644
index 00000000..775ec26c
--- /dev/null
+++ b/DecoderIpc.hpp
@@ -0,0 +1,52 @@
+#ifndef DECODER_IPC_HPP
+#define DECODER_IPC_HPP
+
+#include <QByteArray>
+#include <QtGlobal>
+
+#include <array>
+
+#include "commons.h"
+
+namespace DecoderIpc
+{
+ // FT8 reads the complete 15-second buffer even when decoding starts earlier.
+ constexpr std::size_t Ft8SampleCount {15 * RX_SAMPLE_RATE};
+
+ struct Ft8MtdPayload
+ {
+ std::array<short, Ft8SampleCount> samples {};
+ decoder_params_t params {};
+ };
+
+ struct Completion
+ {
+ qint32 synchronized;
+ qint32 decoded;
+ qint32 average;
+ qint32 generation;
+ };
+
+ qint32 nextGeneration (qint32 current);
+ bool hasUsableSize (qint64 size);
+ bool hasShutdownControlSize (qint64 size);
+ qint32 state (shared_dec_data_t const& shared);
+ qint32 generation (shared_dec_data_t const& shared);
+ qint32 progress (shared_dec_data_t const& shared);
+ qint32 protocolVersion (shared_dec_data_t const& shared);
+ void initialize (shared_dec_data_t& shared);
+ void shutdown (shared_dec_data_t& shared);
+ void shutdown (decoder_ipc_control_t& control);
+ void shutdownControl (void * control);
+ bool publish (shared_dec_data_t& shared, dec_data_t const& payload,
+ bool copySamples, qint32 generation);
+ bool publishFt8Mtd (shared_dec_data_t& shared,
+ Ft8MtdPayload const& payload, qint32 generation);
+ bool claim (shared_dec_data_t& shared, qint32& generation);
+ bool finish (shared_dec_data_t& shared, qint32 generation);
+ bool consume (shared_dec_data_t& shared, qint32 generation);
+ bool parseStart (QByteArray line, qint32 * generation);
+ bool parseCompletion (QByteArray line, Completion * completion);
+}
+
+#endif