libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
ltcdecoder.h
Go to the documentation of this file.
1
8#pragma once
9
12#include <promeki/core/list.h>
13#include <promeki/proav/audio.h>
14#include <vtc/ltc_audio.h>
15
17
38 public:
47
50
56
58 ~LtcDecoder() = default;
59
60 LtcDecoder(const LtcDecoder &) = delete;
61 LtcDecoder &operator=(const LtcDecoder &) = delete;
62 LtcDecoder(LtcDecoder &&) = default;
63 LtcDecoder &operator=(LtcDecoder &&) = default;
64
69 int sampleRate() const { return _decoder.sample_rate; }
70
77
82 void setFuzz(int fuzz);
83
90 DecodedList decode(const int8_t *samples, size_t count);
91
101
107 void reset();
108
109 private:
110 VtcLTCDecoder _decoder;
111 DecodedList _results;
112
113 static void decoderCallback(const VtcTimecode *tc,
114 int64_t sampleStart, int64_t sampleLength, void *userData);
115};
116
Object to hold some number of audio samples.
Definition audio.h:35
Dynamic array container wrapping std::vector.
Definition list.h:40
Decodes LTC (Linear Timecode) audio samples into timecode values.
Definition ltcdecoder.h:37
void setThresholds(int8_t lower, int8_t upper)
Sets the hysteresis thresholds for edge detection.
DecodedList decode(const int8_t *samples, size_t count)
Feeds raw int8_t audio samples to the decoder.
DecodedList decode(const Audio &audio)
Feeds an Audio object to the decoder.
void reset()
Clears the decoder state.
int sampleRate() const
Returns the configured sample rate.
Definition ltcdecoder.h:69
void setFuzz(int fuzz)
Sets the timing tolerance in samples.
~LtcDecoder()=default
Destructor.
LtcDecoder(int sampleRate)
Constructs an LTC decoder.
Class for holding and manipulating timecode.
Definition timecode.h:45
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19
Result of decoding a single LTC frame.
Definition ltcdecoder.h:42
int64_t sampleLength
Number of samples in this frame.
Definition ltcdecoder.h:45
Timecode timecode
The decoded timecode value.
Definition ltcdecoder.h:43
int64_t sampleStart
Sample position where this frame began.
Definition ltcdecoder.h:44