using Nonemm.Core; using Nonemm.Session; namespace Nonemm.App; /// The function key messages, held as the text of an N1MM `.mc` file so the /// same file works in either program. The macro names are N1MM's too. public static class Messages { /// What an operator gets before touching anything. Twelve lines, so the /// same messages are sent running and searching until the operator writes /// the second twelve. public const string DefaultCw = """ # CW function keys. The first twelve lines are F1 to F12 while running; # add twelve more for the keys while searching. F1 CQ,CQ TEST {MYCALL} {MYCALL} F2 Exch,{SENTRST} {EXCH} F3 TU,TU {MYCALL} F4 MyCall,{MYCALL} F5 HisCall,! F6 QSO B4,QSO B4 F7 ?,? F8 Agn,AGN F9 Nr?,NR? F10 Call?,CALL? F11 Spot, F12 Wipe, """; /// Phone messages name a recording to play; the text is what would be said. public const string DefaultPhone = """ # Phone function keys. F1 CQ,CQ CONTEST {MYCALL} F2 Exch,{EXCH} F3 TU,THANK YOU {MYCALL} F4 MyCall,{MYCALL} F5 HisCall,! F6 QSO B4,QSO BEFORE F7 ?,PLEASE REPEAT F8 Agn,AGAIN F9 Nr?,NUMBER PLEASE F10 Call?,YOUR CALL PLEASE F11 Spot, F12 Wipe, """; public static string DefaultFor(ModeCategory mode) => mode == ModeCategory.Phone ? DefaultPhone : DefaultCw; /// The stored file for that mode, or the built-in one while the operator /// has not written their own. public static MessageFile For(ModeCategory mode, string cw, string phone) { string stored = mode == ModeCategory.Phone ? phone : cw; return MessageFile.Parse(stored.Trim().Length > 0 ? stored : DefaultFor(mode)); } }