Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2610df41 authored by Samuel Thibault's avatar Samuel Thibault Committed by Greg Kroah-Hartman
Browse files

staging: speakup: Add pause command used on switching to graphical mode



For software speech syntheses to be able to manage concurrent audio card
access, they need to know when speakup stops emitting text to be spoken
because the console has switched to graphical mode.  This introduces a
PAUSE command to do so.

Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a67cfe39
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ void synth_buffer_add(u16 ch)
	*buff_in++ = ch;
	if (buff_in > buffer_end)
		buff_in = synth_buffer;
	/* We have written something to the speech synthesis, so we are not
	 * paused any more. */
	spk_paused = 0;
}

u16 synth_buffer_getc(void)
+7 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ short spk_punc_mask;
int spk_punc_level, spk_reading_punc;
char spk_str_caps_start[MAXVARLEN + 1] = "\0";
char spk_str_caps_stop[MAXVARLEN + 1] = "\0";
char spk_str_pause[MAXVARLEN + 1] = "\0";
bool spk_paused = 0;
const struct st_bits_data spk_punc_info[] = {
	{"none", "", 0},
	{"some", "/$%&@", SOME},
@@ -1782,6 +1784,11 @@ static void speakup_con_update(struct vc_data *vc)
		/* Speakup output, discard */
		return;
	speakup_date(vc);
	if (vc->vc_mode == KD_GRAPHICS && !spk_paused && spk_str_pause[0])
	{
		synth_printf("%s", spk_str_pause);
		spk_paused = 1;
	}
	spin_unlock_irqrestore(&speakup_info.spinlock, flags);
}

+2 −1
Original line number Diff line number Diff line
@@ -94,7 +94,8 @@ extern struct spk_synth *synth;
extern char spk_pitch_buff[];
extern u_char *spk_our_keys[];
extern short spk_punc_masks[];
extern char spk_str_caps_start[], spk_str_caps_stop[];
extern char spk_str_caps_start[], spk_str_caps_stop[], spk_str_pause[];
extern bool spk_paused;
extern const struct st_bits_data spk_punc_info[];
extern u_char spk_key_buf[600];
extern char *spk_characters[];
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
static struct var_t vars[] = {
	{ CAPS_START, .u.s = {"CAPS_START\n" } },
	{ CAPS_STOP, .u.s = {"CAPS_STOP\n" } },
	{ PAUSE, .u.s = {"PAUSE\n"} },
	{ RATE, .u.n = {"RATE %d\n", 8, 1, 16, 0, 0, NULL } },
	{ PITCH, .u.n = {"PITCH %d\n", 8, 0, 16, 0, 0, NULL } },
	{ VOL, .u.n = {"VOL %d\n", 8, 0, 16, 0, 0, NULL } },
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ static int misc_registered;
static struct var_t vars[] = {
	{ CAPS_START, .u.s = {"\x01+3p" } },
	{ CAPS_STOP, .u.s = {"\x01-3p" } },
	{ PAUSE, .u.n = {"\x01P" } },
	{ RATE, .u.n = {"\x01%ds", 2, 0, 9, 0, 0, NULL } },
	{ PITCH, .u.n = {"\x01%dp", 5, 0, 9, 0, 0, NULL } },
	{ VOL, .u.n = {"\x01%dv", 5, 0, 9, 0, 0, NULL } },
@@ -154,7 +155,7 @@ static char *get_initstring(void)
	var = synth_soft.vars;
	while (var->var_id != MAXVARS) {
		if (var->var_id != CAPS_START && var->var_id != CAPS_STOP &&
		    var->var_id != DIRECT)
		    var->var_id != PAUSE && var->var_id != DIRECT)
			cp = cp + sprintf(cp, var->u.n.synth_fmt,
					  var->u.n.value);
		var++;
Loading