2022-05-22 21:55:22 -06:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define MAX_KEYER_QUEUE 5
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
PADDLE_DIT = 0,
|
2022-05-28 15:18:28 -06:00
|
|
|
PADDLE_DAH = 1,
|
2022-05-22 21:55:22 -06:00
|
|
|
} Paddle;
|
|
|
|
|
|
|
|
class Keyer {
|
|
|
|
public:
|
2024-10-20 17:34:41 -06:00
|
|
|
virtual char *Name() = 0;
|
|
|
|
virtual void Reset() = 0;
|
|
|
|
virtual void SetDitDuration(unsigned int d) = 0;
|
|
|
|
virtual void Key(Paddle key, bool pressed) = 0;
|
|
|
|
|
|
|
|
// Tick updates internal state,
|
|
|
|
// and returns whether the keyer is transmitting at time now.
|
|
|
|
virtual bool Tick(unsigned long now) = 0;
|
2022-05-22 21:55:22 -06:00
|
|
|
};
|
|
|
|
|
2024-10-20 17:34:41 -06:00
|
|
|
Keyer *GetKeyerByNumber(int n);
|