28 #ifndef CW_GENERATOR_HDR 29 #define CW_GENERATOR_HDR 86 void appendToOut(
const float * v,
unsigned int vlen);
float * inter_char_space
prototype space between characters
The Baseclass for all SoDa objects, and useful commonly used classes.
unsigned int words_per_minute
unsigned int env_buf_len
the length of an envelope buffer
unsigned int bufs_per_sec
number of envelope buffers required per second.
bool in_digraph
if true, we're sending a two-character (no inter-char space) sequence (like _AR)
unsigned int cur_buf_len
how much of the buffer is unfilled?
float * dah
prototype dah buffer
unsigned int first_iws_len
number of samples in prototype space between words
void flushBuffer()
push the current buffer out to the transmitter, filling it with zeros
bool last_was_space
if true, next interword space should be a little short
float * inter_word_space
prototype space between words
unsigned int getCWSpeed()
tell us what the current CW speed is
void setCWSpeed(unsigned int wpm)
set the speed of the cw stream in words per minute
float * dit
prototype dit buffer
double sample_rate
we need to know how long a sample is (in time)
float * rising_edge
a gentle shape for the leading edge of a pulse
bool sendChar(char c)
encode a character into the envelope buffer
void initMorseMap()
setup the mapping from ascii character to morse sequence
DatMBox * env_stream
this is the stream we send envelope buffers into.
unsigned int ics_len
number of samples in prototype space between characters
unsigned int dit_len
number of samples in prototype dit
SoDaBuf * getFreeSoDaBuf()
get an envelope that we can fill in
float * falling_edge
a gentle shape for the trailing edge of a pulse
void clearBuffer()
empty the current envelope, don't send it along to the TX unit
unsigned int edge_sample_count
edges are 'pre-built' this is the length of an edge, in samples
SoDaBuf * cur_buf
the current envelope to be filled in
unsigned int dah_len
number of samples in prototype dah
bool readyForMore()
check envelope stream to see if we have less than 1 second's worth of stuff enqueued ...
A text to morse envelope converter.
void appendToOut(const float *v, unsigned int vlen)
add a buffer of envelope pieces to the outgoing envelope buffer
unsigned int cur_buf_idx
where are we in the buffer?
CWGenerator(DatMBox *cw_env_stream, double _samp_rate, unsigned int _env_buf_len)
Constructor.
static std::map< char, std::string > morse_map
map from ascii character to dits-and-dahs
unsigned int iws_len
if space is repeated, number of samples in prototype space between words