Add the digital interface, running MMTTY under Wine

MMTTY and 2Tone have no socket or pipe interface: N1MM hosts XMMT.ocx and
exchanges window messages with the engine. A Linux process cannot load that
control, so bridge/nonemm-mmtty-bridge.exe hosts it under Wine and passes
lines over its standard input and output. docs/digital-bridge.md states the
protocol and what the control needs.

The window is N1MM's: receive pane with coloured callsigns, grab list, call
stacking, twenty-four macro buttons and the engine controls. One left click
copies what is under it — a callsign to the callsign box, anything else to the
exchange box the contest keeps for that kind of value.

Config > Digital registers XMMT.ocx in the Wine prefix on its own, making the
prefix first if it is not there. The engine, the bridge and the control start
at the copies shipped beside the program.

The bridge reads the control's own events. OnTranslateMessage carries only the
messages the control has no event for, so nothing was ever decoded through it.

hamlib's data mode names read as digital modes now, and a mode typed into the
callsign box changes mode the way a frequency changes band, so a station with
no radio can reach RTTY at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-31 21:35:45 +00:00
parent 76b57cee1d
commit c8de74e24a
70 changed files with 4560 additions and 27 deletions

View File

@@ -46,6 +46,45 @@ public static class Messages
F12 Wipe,
""";
/// The digital window's twenty-four buttons. N1MM keeps its own set in its
/// admin database, which is not a file this program reads, so these are
/// written from N1MM's published digital macro list: `{TX}` starts the
/// transmission, `{RX}` ends it, and the text macros are the ones every
/// other message uses.
public const string DefaultDigital =
"""
# The digital window's macro buttons, three rows of eight.
CQ,{TX}CQ CQ DE {MYCALL} {MYCALL} CQ K{ENTER}{RX}
Exch,{TX}{CALL} DE {MYCALL} {SENTRST} {EXCH} {SENTRST} {EXCH} K{ENTER}{RX}
TU,{TX}{CALL} TU DE {MYCALL} QRZ{ENTER}{RX}{LOG}
MyCall,{TX}{MYCALL} {MYCALL} K{ENTER}{RX}
HisCall,{TX}{CALL} DE {MYCALL} K{ENTER}{RX}
QSO B4,{TX}{CALL} QSO B4 QRZ DE {MYCALL}{ENTER}{RX}
Agn?,{TX}AGN AGN DE {MYCALL} K{ENTER}{RX}
Nr?,{TX}NR? NR? DE {MYCALL} K{ENTER}{RX}
Call?,{TX}CALL? CALL? DE {MYCALL} K{ENTER}{RX}
RST?,{TX}RST? RST? DE {MYCALL} K{ENTER}{RX}
QRZ,{TX}QRZ DE {MYCALL} {MYCALL} K{ENTER}{RX}
5NN,{TX}{SENTRST} {SENTRST} K{ENTER}{RX}
Test,{TX}RYRYRYRYRYRYRYRY{ENTER}{RX}
Grab,{TX}{CALL} DE {MYCALL} K{ENTER}{RX}
Wipe,{WIPE}
Log,{LOG}
Run,{RUN}
S&&P,{S&P}
Stack,{STACKANOTHER}
Pop,{LOGTHENPOP}
Spot,{SPOTME}
73,{TX}73 GL DE {MYCALL}{ENTER}{RX}
QRL?,{TX}QRL? DE {MYCALL}{ENTER}{RX}
Stop,{STOPTX}
""";
/// The stored digital macros, or the built-in ones while the operator has
/// not written their own.
public static DigitalMacros Digital(string stored) =>
DigitalMacros.Parse(stored.Trim().Length > 0 ? stored : DefaultDigital);
public static string DefaultFor(ModeCategory mode) =>
mode == ModeCategory.Phone ? DefaultPhone : DefaultCw;