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

@@ -1,14 +1,29 @@
namespace Nonemm.Session;
/// The order stacked calls come off, which is what N1MM's digital window calls
/// its call stacking modes.
public enum StackOrder
{
/// Multipliers first, then the order they arrived in.
MultipliersFirst,
/// The order they arrived in.
FirstIn,
/// Newest first.
LastIn,
/// Nothing is stacked.
Disabled,
}
/// The calls waiting to be worked while running. A station calling CQ hears
/// more than one answer, and this holds the ones it has not got to yet, so the
/// operator takes them one at a time instead of asking each to call again.
/// N1MM's single-operator call stacking.
///
/// A call that would bring a multiplier goes to the front and the rest to the
/// back, which is the order N1MM uses on CW and phone. N1MM's digital window
/// offers plain first-in-first-out and last-in-first-out as well; there is no
/// digital window here, so every mode gets that one order.
/// The order calls come off is `Order`: multipliers first is what N1MM uses on
/// CW and phone, and the digital window offers the other three.
public sealed class CallStack
{
/// N1MM stacks nothing shorter than this.
@@ -16,6 +31,10 @@ public sealed class CallStack
private readonly List<string> calls = [];
/// How calls come off. The digital window sets this from its call stacking
/// menu; everything else leaves it alone.
public StackOrder Order { get; set; } = StackOrder.MultipliersFirst;
/// The calls in the order they come off, so the front is next.
public IReadOnlyList<string> Calls => calls;
@@ -27,16 +46,22 @@ public sealed class CallStack
public string Top => calls.Count > 0 ? calls[0] : "";
/// Puts a call on the stack. A call already there is moved rather than
/// repeated, and a multiplier goes to the front.
/// repeated, and where it goes is up to `Order`.
public void Add(string call, bool isMultiplier)
{
string wanted = call.Trim().ToUpperInvariant();
if (wanted.Length < ShortestCall)
if (wanted.Length < ShortestCall || Order == StackOrder.Disabled)
{
return;
}
Remove(wanted);
if (isMultiplier)
bool toFront = Order switch
{
StackOrder.LastIn => true,
StackOrder.MultipliersFirst => isMultiplier,
_ => false,
};
if (toFront)
{
calls.Insert(0, wanted);
}