summaryrefslogtreecommitdiff
path: root/JttyReplay.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
committerChristoph Berg <myon@debian.org>2026-09-26 23:24:03 +0200
commit059831534c7e884f0a607ed86b582fd00d821731 (patch)
tree76bcb67a78f8aa2654fd34c2ad801a62136b0170 /JttyReplay.hpp
parentd83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff)
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
Diffstat (limited to 'JttyReplay.hpp')
-rw-r--r--JttyReplay.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/JttyReplay.hpp b/JttyReplay.hpp
new file mode 100644
index 00000000..5a95ece2
--- /dev/null
+++ b/JttyReplay.hpp
@@ -0,0 +1,26 @@
+#ifndef JTTY_REPLAY_HPP
+#define JTTY_REPLAY_HPP
+
+#include "DecDataMutex.hpp"
+#include <QMutexLocker>
+
+inline int snapshotJttyFrames (int const& liveFrames)
+{
+ QMutexLocker lock {&dec_data_mutex ()};
+ return liveFrames;
+}
+
+// Shared traversal used by manual replay and waterfall-picked replay.
+// stopAfterFrame returns true for EOM or the picked replay's stop position.
+// Snapshot once: newly arriving audio belongs to later live processing.
+template<typename StopAfterFrame>
+void replayJttyFrames (int const& liveFrames, StopAfterFrame stopAfterFrame)
+{
+ int const end = snapshotJttyFrames (liveFrames);
+ for (int k = 3456; k < end; k += 3456)
+ {
+ if (stopAfterFrame (k)) break;
+ }
+}
+
+#endif