!7 sclass VoiceOutput > DynTextArea { S voice; transient JComboBox cbAnswerMode; void start { if (empty(voice)) setField(voice := first(cereprocVoices())); } JComponent visualize() { bindComboBoxToLiveValue_debug.set(true); JComponent ta = super.visualize(); enableWordWrapForTextArea(textArea); jPreemptEnterKey(textArea, rThread sayIt); ret centerAndSouthWithMargins(ta, centerAndSouthWithMargin( centerAndEastWithMarginInbetween(withLabel("Voice:", jLiveValueComboBox(cereprocVoices(), dm_fieldLiveValue('voice))), jbutton("Say", rThread sayIt)), jrightAlignedLine(jlabel("AI should answer:"), jComboBoxOnTrimmedFileContents(ll("Always", "Sometimes", "Never"), ai_answerModeFile(), "Sometimes answer")))); } void say(S s) { { temp enter(); setText(s); } sayIt(); } void sayIt { S s = trim(getText()); if (empty(s) || empty(voice)) ret; if (isCereprocVoice(voice)) cereproc(voice, s); else print("Missing voice: " + voice); } void clear() { setText(""); } }