Example #1
0
void structOTMultiEditor :: v_draw () {
	OTMulti grammar = (OTMulti) data;
	static MelderString buffer { 0 };
	double rowHeight = 0.25, tableauHeight = 2 * rowHeight;
	Graphics_clearWs (g);
	HyperPage_listItem (this, U"\t\t      %%ranking value\t      %disharmony\t      %plasticity");
	for (long icons = 1; icons <= grammar -> numberOfConstraints; icons ++) {
		OTConstraint constraint = & grammar -> constraints [grammar -> index [icons]];
		MelderString_copy (& buffer, U"\t", ( icons == selectedConstraint ? U"♠︎ " : U"   " ), U"@@", icons,
			U"|", constraint -> name, U"@\t      ", Melder_fixed (constraint -> ranking, 3),
			U"\t      ", Melder_fixed (constraint -> disharmony, 3),
			U"\t      ", Melder_fixed (constraint -> plasticity, 6)
		);
		HyperPage_listItem (this, buffer.string);
	}
	Graphics_setAtSignIsLink (g, FALSE);
	drawTableau_grammar = grammar;
	for (long icand = 1; icand <= grammar -> numberOfCandidates; icand ++) {
		if (OTMulti_candidateMatches (grammar, icand, form1, form2)) {
			tableauHeight += rowHeight;
		}
	}
	drawTableau_form1 = form1;
	drawTableau_form2 = form2;
	drawTableau_constraintsAreDrawnVertically = d_constraintsAreDrawnVertically;
	HyperPage_picture (this, 20, tableauHeight, drawTableau);
	Graphics_setAtSignIsLink (g, TRUE);
}
Example #2
0
static void monitor_off (Minimizer me) {
	Melder_monitor (1.1, NULL);
	if (my gmonitor) {
		Graphics_clearWs (my gmonitor); // DON'T forget (my gmonitor)
		my gmonitor = NULL;
	}
}
Example #3
0
static void gui_drawingarea_cb_expose (I, GuiDrawingAreaExposeEvent event) {
	iam (HyperPage);
	(void) event;
	if (my g == NULL) return;   // Could be the case in the very beginning.
	Graphics_clearWs (my g);
	initScreen (me);
	my v_draw ();
	if (my entryHint && my entryPosition) {
		Melder_free (my entryHint);
		my top = 5.0 * (PAGE_HEIGHT - my entryPosition);
		if (my top < 0) my top = 0;
		Graphics_clearWs (my g);
		initScreen (me);
		my v_draw ();
		updateVerticalScrollBar (me);
	}
}
static int playCallback (Artword_Speaker_Sound_PlayInfo me, int /* phase */, double /* tmin */, double /* tmax */, double t) {
	static autoArt art;
	if (! art) art = Art_create ();
	Artword_intoArt (my artword, art.get(), t);
	Graphics_clearWs (my graphics);
	Art_Speaker_draw (art.get(), my speaker, my graphics);
	return 1;
}
Example #5
0
void Picture_erase (Picture me) {
	Graphics_clearRecording (my graphics.get());
	Graphics_clearWs (my graphics.get());
	if (my drawingArea) {
		drawMarkers (me);
		drawSelection (me, 1);
	}
}
Example #6
0
static void gui_drawingarea_cb_expose (I, GuiDrawingAreaExposeEvent event) {
	iam (ArtwordEditor);
	(void) event;
	if (my graphics == NULL) return;
	Artword artword = (Artword) my data;
	Graphics_clearWs (my graphics);
	Artword_draw (artword, my graphics, my feature, TRUE);
}
Example #7
0
static int playCallback (void *playClosure, int /* phase */, double /* tmin */, double /* tmax */, double t) {
	struct playInfo *me = (struct playInfo *) playClosure;
	static Art art;
	if (! art) art = Art_create ();
	Artword_intoArt (my artword, art, t);
	Graphics_clearWs (my graphics);
	Art_Speaker_draw (art, my speaker, my graphics);
	return 1;
}
Example #8
0
static void gui_cb_verticalScroll (I, GuiScrollBarEvent	event) {
	iam (HyperPage);
	double value = event -> scrollBar -> f_getValue ();
	if (value != my top) {
		my top = value;
		Graphics_clearWs (my g);
		initScreen (me);
		my v_draw ();   // do not wait for expose event
		updateVerticalScrollBar (me);
	}
}
Example #9
0
static void gui_cb_scrollVertical (TableEditor me, GuiScrollBarEvent event) {
	int value = GuiScrollBar_getValue (event -> scrollBar);
	if (value != my topRow) {
		my topRow = value;
		#if cocoa || gtk || win
			Graphics_updateWs (my graphics.get());   // wait for expose event
		#else
			Graphics_clearWs (my graphics.get());
			my v_draw ();   // do not wait for expose event
		#endif
	}
}
Example #10
0
static void gui_cb_scrollHorizontal (TableEditor me, GuiScrollBarEvent event) {
	int value = GuiScrollBar_getValue (event -> scrollBar);
	if (value != my leftColumn) {
		my leftColumn = value;
		#if cocoa || gtk || motif
			Graphics_updateWs (my graphics.get());   // wait for expose event
		#else
			Graphics_clearWs (my graphics.get());
			my v_draw ();   // do not wait for expose event
		#endif
	}
}
Example #11
0
static void menu_cb_pageDown (EDITOR_ARGS) {
	EDITOR_IAM (HyperPage);
	if (! my verticalScrollBar) return;
	int value = my verticalScrollBar -> f_getValue () + 24;
	if (value > (int) (PAGE_HEIGHT * 5) - 25) value = (int) (PAGE_HEIGHT * 5) - 25;
	if (value != my top) {
		my top = value;
		Graphics_clearWs (my g);
		initScreen (me);
		my v_draw ();   // do not wait for expose event
		updateVerticalScrollBar (me);
	}
}
Example #12
0
void structOTGrammarEditor :: v_draw () {
	OTGrammar ot = (OTGrammar) data;
	static char32 text [1000];
	Graphics_clearWs (g);
	if (ot -> decisionStrategy == kOTGrammar_decisionStrategy_EXPONENTIAL_HG ||
		ot -> decisionStrategy == kOTGrammar_decisionStrategy_EXPONENTIAL_MAXIMUM_ENTROPY)
	{
		HyperPage_listItem (this, U"\t\t      %%ranking value\t      %disharmony\t      %plasticity\t   %%e^^disharmony");
	} else {
		HyperPage_listItem (this, U"\t\t      %%ranking value\t      %disharmony\t      %plasticity");
	}
	for (long icons = 1; icons <= ot -> numberOfConstraints; icons ++) {
		OTGrammarConstraint constraint = & ot -> constraints [ot -> index [icons]];
		if (ot -> decisionStrategy == kOTGrammar_decisionStrategy_EXPONENTIAL_HG ||
			ot -> decisionStrategy == kOTGrammar_decisionStrategy_EXPONENTIAL_MAXIMUM_ENTROPY)
		{
			Melder_sprint (text,1000,
				U"\t", icons == selected ? U"♠︎ " : U"   ",
				U"@@", icons,
				U"|", constraint -> name,
				U"@\t      ", Melder_fixed (constraint -> ranking, 3),
				U"\t      ", Melder_fixed (constraint -> disharmony, 3),
				U"\t      ", Melder_fixed (constraint -> plasticity, 6),
				U"\t ", Melder_float (Melder_half (exp (constraint -> disharmony))));
		} else {
			Melder_sprint (text,1000,
				U"\t", icons == selected ? U"♠︎ " : U"   ",
				U"@@", icons,
				U"|", constraint -> name,
				U"@\t      ", Melder_fixed (constraint -> ranking, 3),
				U"\t      ", Melder_fixed (constraint -> disharmony, 3),
				U"\t      ", Melder_fixed (constraint -> plasticity, 6));
		}
		HyperPage_listItem (this, text);
	}
	Graphics_setAtSignIsLink (g, FALSE);
	for (long itab = 1; itab <= ot -> numberOfTableaus; itab ++) {
		OTGrammarTableau tableau = & ot -> tableaus [itab];
		double rowHeight = 0.25;
		double tableauHeight = rowHeight * (tableau -> numberOfCandidates + 2);
		drawTableau_ot = ot;
		drawTableau_input = tableau -> input;
		drawTableau_constraintsAreDrawnVertically = d_constraintsAreDrawnVertically;
		HyperPage_picture (this, 20, tableauHeight, drawTableau);
	}
	Graphics_setAtSignIsLink (g, TRUE);
}
Example #13
0
void ButtonEditor::draw () {
    Graphics_clearWs (_g);
    switch (_show) {
    case 1:
        for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
            praat_Command cmd = praat_getMenuCommand (i);
            if (wcsequ (cmd -> window, L"Objects"))
                drawMenuCommand (praat_getMenuCommand (i), i);
        }
        break;
    case 2:
        for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
            praat_Command cmd = praat_getMenuCommand (i);
            if (wcsequ (cmd -> window, L"Picture"))
                drawMenuCommand (praat_getMenuCommand (i), i);
        }
        break;
    case 3:
        for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
            praat_Command cmd = praat_getMenuCommand (i);
            if (! wcsequ (cmd -> window, L"Objects") && ! wcsequ (cmd -> window, L"Picture"))
                drawMenuCommand (praat_getMenuCommand (i), i);
        }
        break;
    case 4:
        for (long i = 1, n = praat_getNumberOfActions (); i <= n; i ++) {
            praat_Command cmd = praat_getAction (i);
            const wchar_t *klas = ((Data_Table) cmd -> class1) -> _className;
            if (wcscmp (klas, L"N") < 0)
                drawAction (praat_getAction (i), i);
        }
        break;
    case 5:
        for (long i = 1, n = praat_getNumberOfActions (); i <= n; i ++) {
            praat_Command cmd = praat_getAction (i);
            const wchar_t *klas = ((Data_Table) cmd -> class1) -> _className;
            if (wcscmp (klas, L"N") >= 0)
                drawAction (praat_getAction (i), i);
        }
        break;
    }
}
Example #14
0
void structButtonEditor :: v_draw () {
	Graphics_clearWs (our graphics.get());
	switch (show) {
		case 1:
			for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
				Praat_Command cmd = praat_getMenuCommand (i);
				if (str32equ (cmd -> window, U"Objects"))
					drawMenuCommand (this, praat_getMenuCommand (i), i);
			}
			break;
		case 2:
			for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
				Praat_Command cmd = praat_getMenuCommand (i);
				if (str32equ (cmd -> window, U"Picture"))
					drawMenuCommand (this, praat_getMenuCommand (i), i);
			}
			break;
		case 3:
			for (long i = 1, n = praat_getNumberOfMenuCommands (); i <= n; i ++) {
				Praat_Command cmd = praat_getMenuCommand (i);
				if (! str32equ (cmd -> window, U"Objects") && ! str32equ (cmd -> window, U"Picture"))
					drawMenuCommand (this, praat_getMenuCommand (i), i);
			}
			break;
		case 4:
			for (long i = 1, n = praat_getNumberOfActions (); i <= n; i ++) {
				Praat_Command cmd = praat_getAction (i);
				const char32 *klas = cmd -> class1 -> className;
				if (str32cmp (klas, U"N") < 0)
					drawAction (this, praat_getAction (i), i);
			}
			break;
		case 5:
			for (long i = 1, n = praat_getNumberOfActions (); i <= n; i ++) {
				Praat_Command cmd = praat_getAction (i);
				const char32 *klas = cmd -> class1 -> className;
				if (str32cmp (klas, U"N") >= 0)
					drawAction (this, praat_getAction (i), i);
			}
			break;
	}
}
Example #15
0
void structTableEditor :: v_draw () {
	Table table = static_cast<Table> (data);
	double spacing = 2.0;   // millimetres at both edges
	double columnWidth, cellWidth;
	/*
	 * We fit 200 rows in 40 inches, which is 14.4 points per row.
	 */
	long rowmin = topRow, rowmax = rowmin + 197;
	long colmin = leftColumn, colmax = colmin + (kTableEditor_MAXNUM_VISIBLE_COLUMNS - 1);
	if (rowmax > table -> rows.size) rowmax = table -> rows.size;
	if (colmax > table -> numberOfColumns) colmax = table -> numberOfColumns;
	Graphics_clearWs (graphics.get());
	Graphics_setTextAlignment (graphics.get(), Graphics_CENTRE, Graphics_HALF);
	Graphics_setWindow (graphics.get(), 0.0, 1.0, rowmin + 197.5, rowmin - 2.5);
	Graphics_setColour (graphics.get(), Graphics_SILVER);
	Graphics_fillRectangle (graphics.get(), 0.0, 1.0, rowmin - 2.5, rowmin - 0.5);
	Graphics_setColour (graphics.get(), Graphics_BLACK);
	Graphics_line (graphics.get(), 0.0, rowmin - 0.5, 1.0, rowmin - 0.5);
	Graphics_setWindow (graphics.get(), 0.0, Graphics_dxWCtoMM (graphics.get(), 1.0), rowmin + 197.5, rowmin - 2.5);
	/*
	 * Determine the width of the column with the row numbers.
	 */
	columnWidth = Graphics_textWidth (graphics.get(), U"row");
	for (long irow = rowmin; irow <= rowmax; irow ++) {
		cellWidth = Graphics_textWidth (graphics.get(), Melder_integer (irow));
		if (cellWidth > columnWidth) columnWidth = cellWidth;
	}
	columnLeft [0] = columnWidth + 2 * spacing;
	Graphics_setColour (graphics.get(), Graphics_SILVER);
	Graphics_fillRectangle (graphics.get(), 0.0, columnLeft [0], rowmin - 0.5, rowmin + 197.5);
	Graphics_setColour (graphics.get(), Graphics_BLACK);
	Graphics_line (graphics.get(), columnLeft [0], rowmin - 0.5, columnLeft [0], rowmin + 197.5);
	/*
	 * Determine the width of the columns.
	 */
	for (long icol = colmin; icol <= colmax; icol ++) {
		const char32 *columnLabel = table -> columnHeaders [icol]. label;
		columnWidth = Graphics_textWidth (graphics.get(), Melder_integer (icol));
		if (! columnLabel) columnLabel = U"";
		cellWidth = Graphics_textWidth (graphics.get(), columnLabel);
		if (cellWidth > columnWidth) columnWidth = cellWidth;
		for (long irow = rowmin; irow <= rowmax; irow ++) {
			const char32 *cell = Table_getStringValue_Assert (table, irow, icol);
			Melder_assert (cell);
			if (cell [0] == U'\0') cell = U"?";
			cellWidth = Graphics_textWidth (graphics.get(), cell);
			if (cellWidth > columnWidth) columnWidth = cellWidth;
		}
		columnRight [icol - colmin] = columnLeft [icol - colmin] + columnWidth + 2 * spacing;
		if (icol < colmax) columnLeft [icol - colmin + 1] = columnRight [icol - colmin];
	}
	/*
		Text can be "graphic" or not.
	*/
	Graphics_setPercentSignIsItalic (our graphics.get(), our p_useTextStyles);
	Graphics_setNumberSignIsBold (our graphics.get(), our p_useTextStyles);
	Graphics_setCircumflexIsSuperscript (our graphics.get(), our p_useTextStyles);
	Graphics_setUnderscoreIsSubscript (our graphics.get(), our p_useTextStyles);
	/*
	 * Show the row numbers.
	 */
	Graphics_text (graphics.get(), columnLeft [0] / 2, rowmin - 1, U"row");
	for (long irow = rowmin; irow <= rowmax; irow ++) {
		Graphics_text (graphics.get(), columnLeft [0] / 2, irow, irow);
	}
	/*
	 * Show the column labels.
	 */
	for (long icol = colmin; icol <= colmax; icol ++) {
		double mid = (columnLeft [icol - colmin] + columnRight [icol - colmin]) / 2;
		const char32 *columnLabel = table -> columnHeaders [icol]. label;
		if (! columnLabel || columnLabel [0] == U'\0') columnLabel = U"?";
		Graphics_text (graphics.get(), mid, rowmin - 2, icol);
		Graphics_text (graphics.get(), mid, rowmin - 1, columnLabel);
	}
	/*
	 * Show the cell contents.
	 */
	for (long irow = rowmin; irow <= rowmax; irow ++) {
		for (long icol = colmin; icol <= colmax; icol ++) {
			double mid = (columnLeft [icol - colmin] + columnRight [icol - colmin]) / 2;
			const char32 *cell = Table_getStringValue_Assert (table, irow, icol);
			Melder_assert (cell);
			if (cell [0] == U'\0') cell = U"?";
			Graphics_text (graphics.get(), mid, irow, cell);
		}
	}
}
Example #16
0
void structManual :: v_draw () {
	ManPages manPages = (ManPages) our data;
	ManPage page;
	ManPage_Paragraph paragraph;
	#if motif
	Graphics_clearWs (our graphics.get());
	#endif
	if (our path == SEARCH_PAGE) {
		HyperPage_pageTitle (this, U"Best matches");
		HyperPage_intro (this, U"The best matches to your query seem to be:");
		for (int i = 1; i <= our numberOfMatches; i ++) {
			char32 link [300];
			page = manPages -> pages.at [matches [i]];
			Melder_sprint (link,300, U"• @@", page -> title);
			HyperPage_listItem (this, link);
		}
		return;
	}
	page = manPages -> pages.at [path];
	if (! our paragraphs) return;
	HyperPage_pageTitle (this, page -> title);
	for (paragraph = & page -> paragraphs [0]; paragraph -> type != 0; paragraph ++) {
		switch (paragraph -> type) {
			case  kManPage_type_INTRO: HyperPage_intro (this, paragraph -> text); break;
			case  kManPage_type_ENTRY: HyperPage_entry (this, paragraph -> text); break;
			case  kManPage_type_NORMAL: HyperPage_paragraph (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM: HyperPage_listItem (this, paragraph -> text); break;
			case  kManPage_type_TAG: HyperPage_listTag (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION: HyperPage_definition (this, paragraph -> text); break;
			case  kManPage_type_CODE: HyperPage_code (this, paragraph -> text); break;
			case  kManPage_type_PROTOTYPE: HyperPage_prototype (this, paragraph -> text); break;
			case  kManPage_type_FORMULA: HyperPage_formula (this, paragraph -> text); break;
			case  kManPage_type_PICTURE: HyperPage_picture (this, paragraph -> width,
				paragraph -> height, paragraph -> draw); break;
			case  kManPage_type_SCRIPT: HyperPage_script (this, paragraph -> width,
				paragraph -> height, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM1: HyperPage_listItem1 (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM2: HyperPage_listItem2 (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM3: HyperPage_listItem3 (this, paragraph -> text); break;
			case  kManPage_type_TAG1: HyperPage_listTag1 (this, paragraph -> text); break;
			case  kManPage_type_TAG2: HyperPage_listTag2 (this, paragraph -> text); break;
			case  kManPage_type_TAG3: HyperPage_listTag3 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION1: HyperPage_definition1 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION2: HyperPage_definition2 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION3: HyperPage_definition3 (this, paragraph -> text); break;
			case  kManPage_type_CODE1: HyperPage_code1 (this, paragraph -> text); break;
			case  kManPage_type_CODE2: HyperPage_code2 (this, paragraph -> text); break;
			case  kManPage_type_CODE3: HyperPage_code3 (this, paragraph -> text); break;
			case  kManPage_type_CODE4: HyperPage_code4 (this, paragraph -> text); break;
			case  kManPage_type_CODE5: HyperPage_code5 (this, paragraph -> text); break;
			default: break;
		}
	}
	if (ManPages_uniqueLinksHither (manPages, our path)) {
		long ilink, jlink, lastParagraph = 0;
		bool goAhead = true;
		while (page -> paragraphs [lastParagraph]. type != 0) lastParagraph ++;
		if (lastParagraph > 0) {
			const char32 *text = page -> paragraphs [lastParagraph - 1]. text;
			if (! text || text [0] == U'\0' || text [str32len (text) - 1] != U':') {
				if (our printing && our suppressLinksHither)
					goAhead = false;
				else
					HyperPage_entry (this, U"Links to this page");
			}
		}
		if (goAhead) for (ilink = 1; ilink <= page -> nlinksHither; ilink ++) {
			long link = page -> linksHither [ilink];
			bool alreadyShown = false;
			for (jlink = 1; jlink <= page -> nlinksThither; jlink ++)
				if (page -> linksThither [jlink] == link)
					alreadyShown = true;
			if (! alreadyShown) {
				const char32 *title = manPages -> pages.at [page -> linksHither [ilink]] -> title;
				char32 linkText [304];
				Melder_sprint (linkText, 304, U"@@", title, U"@");
				HyperPage_listItem (this, linkText);
			}
		}
	}
	if (! our printing && page -> date) {
		char32 signature [100];
		long date = page -> date;
		int imonth = date % 10000 / 100;
		if (imonth < 0 || imonth > 12) imonth = 0;
		Melder_sprint (signature,100,
			U"© ", str32equ (page -> author, U"ppgb") ? U"Paul Boersma" :
			       str32equ (page -> author, U"djmw") ? U"David Weenink" : page -> author,
			U", ", date % 100,
			U" ", month [imonth],
			U" ", date / 10000);
		HyperPage_any (this, U"", our p_font, our p_fontSize, 0, 0.0,
			0.0, 0.0, 0.1, 0.1, HyperPage_ADD_BORDER);
		HyperPage_any (this, signature, our p_font, our p_fontSize, Graphics_ITALIC, 0.0,
			0.03, 0.0, 0.1, 0.0, 0);
	}
}
Example #17
0
static void gui_drawingarea_cb_expose (ArtwordEditor me, GuiDrawingArea_ExposeEvent /* event */) {
	if (! my graphics) return;
	Artword artword = (Artword) my data;
	Graphics_clearWs (my graphics.get());
	Artword_draw (artword, my graphics.get(), my feature, true);
}
Example #18
0
Sound Artword_Speaker_to_Sound (Artword artword, Speaker speaker,
	double fsamp, int oversampling,
	Sound *out_w1, int iw1, Sound *out_w2, int iw2, Sound *out_w3, int iw3,
	Sound *out_p1, int ip1, Sound *out_p2, int ip2, Sound *out_p3, int ip3,
	Sound *out_v1, int iv1, Sound *out_v2, int iv2, Sound *out_v3, int iv3)
{
	try {
		autoSound result = Sound_createSimple (1, artword -> totalTime, fsamp);
		long numberOfSamples = result -> nx;
		double minTract [1+78], maxTract [1+78];   /* For drawing. */
		double Dt = 1 / fsamp / oversampling,
			rho0 = 1.14,
			c = 353,
			onebyc2 = 1.0 / (c * c),
			rho0c2 = rho0 * c * c,
			halfDt = 0.5 * Dt,
			twoDt = 2 * Dt,
			halfc2Dt = 0.5 * c * c * Dt,
			twoc2Dt = 2 * c * c * Dt,
			onebytworho0 = 1.0 / (2.0 * rho0),
			Dtbytworho0 = Dt / (2.0 * rho0);
		double tension, rrad, onebygrad, totalVolume;
		autoArt art = Art_create ();
		long sample;
		int n, m, M;
		autoDelta delta = Speaker_to_Delta (speaker);
		autoMelderMonitor monitor (U"Articulatory synthesis");
		Artword_intoArt (artword, art.peek(), 0.0);
		Art_Speaker_intoDelta (art.peek(), speaker, delta.peek());
		M = delta -> numberOfTubes;
		autoSound w1, w2, w3, p1, p2, p3, v1, v2, v3;
		if (iw1 > 0 && iw1 <= M) w1.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iw1 = 0;
		if (iw2 > 0 && iw2 <= M) w2.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iw2 = 0;
		if (iw3 > 0 && iw3 <= M) w3.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iw3 = 0;
		if (ip1 > 0 && ip1 <= M) p1.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else ip1 = 0;
		if (ip2 > 0 && ip2 <= M) p2.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else ip2 = 0;
		if (ip3 > 0 && ip3 <= M) p3.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else ip3 = 0;
		if (iv1 > 0 && iv1 <= M) v1.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iv1 = 0;
		if (iv2 > 0 && iv2 <= M) v2.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iv2 = 0;
		if (iv3 > 0 && iv3 <= M) v3.reset (Sound_createSimple (1, artword -> totalTime, fsamp)); else iv3 = 0;
		/* Initialize drawing. */
		{ int i; for (i = 1; i <= 78; i ++) { minTract [i] = 100; maxTract [i] = -100; } }
		totalVolume = 0.0;
		for (m = 1; m <= M; m ++) {
			Delta_Tube t = delta->tube + m;
			if (! t -> left1 && ! t -> right1) continue;
			t->Dx = t->Dxeq; t->dDxdt = 0;   /* 5.113 */
			t->Dy = t->Dyeq; t->dDydt = 0;   /* 5.113 */
			t->Dz = t->Dzeq;   /* 5.113 */
			t->A = t->Dz * ( t->Dy >= t->dy ? t->Dy + Dymin :
				t->Dy <= - t->dy ? Dymin :
				(t->dy + t->Dy) * (t->dy + t->Dy) / (4 * t->dy) + Dymin );   /* 4.4, 4.5 */
			#if EQUAL_TUBE_WIDTHS
				t->A = 0.0001;
			#endif
			t->Jleft = t->Jright = 0;   /* 5.113 */
			t->Qleft = t->Qright = rho0c2;   /* 5.113 */
			t->pleft = t->pright = 0;   /* 5.114 */
			t->Kleft = t->Kright = 0;   /* 5.114 */
			t->V = t->A * t->Dx;   /* 5.114 */
			totalVolume += t->V;
		}
		//Melder_casual (U"Starting volume: ", totalVolume * 1000, U" litres.");
		for (sample = 1; sample <= numberOfSamples; sample ++) {
			double time = (sample - 1) / fsamp;
			Artword_intoArt (artword, art.peek(), time);
			Art_Speaker_intoDelta (art.peek(), speaker, delta.peek());
			if (sample % MONITOR_SAMPLES == 0 && monitor.graphics()) {   // because we can be in batch
				Graphics graphics = monitor.graphics();
				double area [1+78];
				Graphics_Viewport vp;
				for (int i = 1; i <= 78; i ++) {
					area [i] = delta -> tube [i]. A;
					if (area [i] < minTract [i]) minTract [i] = area [i];
					if (area [i] > maxTract [i]) maxTract [i] = area [i];
				}
				Graphics_clearWs (graphics);

				vp = Graphics_insetViewport (monitor.graphics(), 0, 0.5, 0.5, 1);
				Graphics_setWindow (graphics, 0, 1, 0, 0.05);
				Graphics_setColour (graphics, Graphics_RED);
				Graphics_function (graphics, minTract, 1, 35, 0, 0.9);
				Graphics_function (graphics, maxTract, 1, 35, 0, 0.9);
				Graphics_setColour (graphics, Graphics_BLACK);
				Graphics_function (graphics, area, 1, 35, 0, 0.9);
				Graphics_setLineType (graphics, Graphics_DOTTED);
				Graphics_line (graphics, 0, 0, 1, 0);
				Graphics_setLineType (graphics, Graphics_DRAWN);
				Graphics_resetViewport (graphics, vp);

				vp = Graphics_insetViewport (graphics, 0, 0.5, 0, 0.5);
				Graphics_setWindow (graphics, 0, 1, -0.000003, 0.00001);
				Graphics_setColour (graphics, Graphics_RED);
				Graphics_function (graphics, minTract, 36, 37, 0.2, 0.8);
				Graphics_function (graphics, maxTract, 36, 37, 0.2, 0.8);
				Graphics_setColour (graphics, Graphics_BLACK);
				Graphics_function (graphics, area, 36, 37, 0.2, 0.8);
				Graphics_setLineType (graphics, Graphics_DOTTED);
				Graphics_line (graphics, 0, 0, 1, 0);
				Graphics_setLineType (graphics, Graphics_DRAWN);
				Graphics_resetViewport (graphics, vp);

				vp = Graphics_insetViewport (graphics, 0.5, 1, 0.5, 1);
				Graphics_setWindow (graphics, 0, 1, 0, 0.001);
				Graphics_setColour (graphics, Graphics_RED);
				Graphics_function (graphics, minTract, 38, 64, 0, 1);
				Graphics_function (graphics, maxTract, 38, 64, 0, 1);
				Graphics_setColour (graphics, Graphics_BLACK);
				Graphics_function (graphics, area, 38, 64, 0, 1);
				Graphics_setLineType (graphics, Graphics_DOTTED);
				Graphics_line (graphics, 0, 0, 1, 0);
				Graphics_setLineType (graphics, Graphics_DRAWN);
				Graphics_resetViewport (graphics, vp);

				vp = Graphics_insetViewport (graphics, 0.5, 1, 0, 0.5);
				Graphics_setWindow (graphics, 0, 1, 0.001, 0);
				Graphics_setColour (graphics, Graphics_RED);
				Graphics_function (graphics, minTract, 65, 78, 0.5, 1);
				Graphics_function (graphics, maxTract, 65, 78, 0.5, 1);
				Graphics_setColour (graphics, Graphics_BLACK);
				Graphics_function (graphics, area, 65, 78, 0.5, 1);
				Graphics_setLineType (graphics, Graphics_DRAWN);
				Graphics_resetViewport (graphics, vp);
				Melder_monitor ((double) sample / numberOfSamples, U"Articulatory synthesis: ", Melder_half (time), U" seconds");
			}
			for (n = 1; n <= oversampling; n ++) {
				for (m = 1; m <= M; m ++) {
					Delta_Tube t = delta -> tube + m;
					if (! t -> left1 && ! t -> right1) continue;

					/* New geometry. */

					#if CONSTANT_TUBE_LENGTHS
						t->Dxnew = t->Dx;
					#else
						t->dDxdtnew = (t->dDxdt + Dt * 10000 * (t->Dxeq - t->Dx)) /
							(1 + 200 * Dt);   /* Critical damping, 10 ms. */
						t->Dxnew = t->Dx + t->dDxdtnew * Dt;
					#endif
					/* 3-way: equal lengths. */
					/* This requires left tubes to be processed before right tubes. */
					if (t->left1 && t->left1->right2) t->Dxnew = t->left1->Dxnew;
					t->Dz = t->Dzeq;   /* immediate... */
					t->eleft = (t->Qleft - t->Kleft) * t->V;   /* 5.115 */
					t->eright = (t->Qright - t->Kright) * t->V;   /* 5.115 */
					t->e = 0.5 * (t->eleft + t->eright);   /* 5.116 */
					t->p = 0.5 * (t->pleft + t->pright);   /* 5.116 */
					t->DeltaP = t->e / t->V - rho0c2;   /* 5.117 */
					t->v = t->p / (rho0 + onebyc2 * t->DeltaP);   /* 5.118 */
					{
						double dDy = t->Dyeq - t->Dy;
						double cubic = t->k3 * dDy * dDy;
						Delta_Tube l1 = t->left1, l2 = t->left2, r1 = t->right1, r2 = t->right2;
						tension = dDy * (t->k1 + cubic);
						t->B = 2 * t->Brel * sqrt (t->mass * (t->k1 + 3 * cubic));
						if (t->k1left1 != 0.0 && l1)
							tension += t->k1left1 * t->k1 * (dDy - (l1->Dyeq - l1->Dy));
						if (t->k1left2 != 0.0 && l2)
							tension += t->k1left2 * t->k1 * (dDy - (l2->Dyeq - l2->Dy));
						if (t->k1right1 != 0.0 && r1)
							tension += t->k1right1 * t->k1 * (dDy - (r1->Dyeq - r1->Dy));
						if (t->k1right2 != 0.0 && r2)
							tension += t->k1right2 * t->k1 * (dDy - (r2->Dyeq - r2->Dy));
					}
					if (t->Dy < t->dy) {
						if (t->Dy >= - t->dy) {
							double dDy = t->dy - t->Dy, dDy2 = dDy * dDy;
							tension += dDy2 / (4 * t->dy) * (t->s1 + 0.5 * t->s3 * dDy2);
							t->B += 2 * dDy / (2 * t->dy) *
								sqrt (t->mass * (t->s1 + t->s3 * dDy2));
						} else {
							tension -= t->Dy * (t->s1 + t->s3 * (t->Dy * t->Dy + t->dy * t->dy));
							t->B += 2 * sqrt (t->mass * (t->s1 + t->s3 * (3 * t->Dy * t->Dy + t->dy * t->dy)));
						}
					}
					t->dDydtnew = (t->dDydt + Dt / t->mass * (tension + 2 * t->DeltaP * t->Dz * t->Dx)) /
						(1 + t->B * Dt / t->mass);   /* 5.119 */
					t->Dynew = t->Dy + t->dDydtnew * Dt;   /* 5.119 */
					#if NO_MOVING_WALLS
						t->Dynew = t->Dy;
					#endif
					t->Anew = t->Dz * ( t->Dynew >= t->dy ? t->Dynew + Dymin :
						t->Dynew <= - t->dy ? Dymin :
						(t->dy + t->Dynew) * (t->dy + t->Dynew) / (4 * t->dy) + Dymin );   /* 4.4, 4.5 */
					#if EQUAL_TUBE_WIDTHS
						t->Anew = 0.0001;
					#endif
					t->Ahalf = 0.5 * (t->A + t->Anew);   /* 5.120 */
					t->Dxhalf = 0.5 * (t->Dxnew + t->Dx);   /* 5.121 */
					t->Vnew = t->Anew * t->Dxnew;   /* 5.128 */
					{ double oneByDyav = t->Dz / t->A;
					/*t->R = 12 * 1.86e-5 * t->parallel * t->parallel * oneByDyav * oneByDyav;*/
					if (t->Dy < 0)
						t->R = 12 * 1.86e-5 / (Dymin * Dymin + t->dy * t->dy);
					else
						t->R = 12 * 1.86e-5 * t->parallel * t->parallel /
							((t->Dy + Dymin) * (t->Dy + Dymin) + t->dy * t->dy);
					t->R += 0.3 * t->parallel * oneByDyav;   /* 5.23 */ }
					t->r = (1 + t->R * Dt / rho0) * t->Dxhalf / t->Anew;   /* 5.122 */
					t->ehalf = t->e + halfc2Dt * (t->Jleft - t->Jright);   /* 5.123 */
					t->phalf = (t->p + halfDt * (t->Qleft - t->Qright) / t->Dx) / (1 + Dtbytworho0 * t->R);   /* 5.123 */
					#if MASS_LEAPFROG
						t->ehalf = t->ehalfold + 2 * halfc2Dt * (t->Jleft - t->Jright);
					#endif
					t->Jhalf = t->phalf * t->Ahalf;   /* 5.124 */
					t->Qhalf = t->ehalf / (t->Ahalf * t->Dxhalf) + onebytworho0 * t->phalf * t->phalf;   /* 5.124 */
					#if NO_BERNOULLI_EFFECT
						t->Qhalf = t->ehalf / (t->Ahalf * t->Dxhalf);
					#endif
				}
				for (m = 1; m <= M; m ++) {   /* Compute Jleftnew and Qleftnew. */
					Delta_Tube l = delta->tube + m, r1 = l -> right1, r2 = l -> right2, r = r1;
					Delta_Tube l1 = l, l2 = r ? r -> left2 : NULL;
					if (l->left1 == NULL) {   /* Closed boundary at the left side (diaphragm)? */
						if (r == NULL) continue;   /* Tube not connected at all. */
						l->Jleftnew = 0;   /* 5.132. */
						l->Qleftnew = (l->eleft - twoc2Dt * l->Jhalf) / l->Vnew;   /* 5.132. */
					}
					else   /* Left boundary open to another tube will be handled... */
						(void) 0;   /* ...together with the right boundary of the tube to the left. */
					if (r == NULL) {   /* Open boundary at the right side (lips, nostrils)? */
						rrad = 1 - c * Dt / 0.02;   /* Radiation resistance, 5.135. */
						onebygrad = 1 / (1 + c * Dt / 0.02);   /* Radiation conductance, 5.135. */
						#if NO_RADIATION_DAMPING
							rrad = 0;
							onebygrad = 0;
						#endif
						l->prightnew = ((l->Dxhalf / Dt + c * onebygrad) * l->pright +
							 2 * ((l->Qhalf - rho0c2) - (l->Qright - rho0c2) * onebygrad)) /
							(l->r * l->Anew / Dt + c * onebygrad);   /* 5.136 */
						l->Jrightnew = l->prightnew * l->Anew;   /* 5.136 */
						l->Qrightnew = (rrad * (l->Qright - rho0c2) +
							c * (l->prightnew - l->pright)) * onebygrad + rho0c2;   /* 5.136 */
					} else if (l2 == NULL && r2 == NULL) {   /* Two-way boundary. */
						if (l->v > criticalVelocity && l->A < r->A) {
							l->Pturbrightnew = -0.5 * rho0 * (l->v - criticalVelocity) *
								(1 - l->A / r->A) * (1 - l->A / r->A) * l->v;
							if (l->Pturbrightnew != 0.0)
								l->Pturbrightnew *= 1 + NUMrandomGauss (0, noiseFactor) /* * l->A */;
						}
						if (r->v < - criticalVelocity && r->A < l->A) {
							l->Pturbrightnew = 0.5 * rho0 * (r->v + criticalVelocity) *
								(1 - r->A / l->A) * (1 - r->A / l->A) * r->v;
							if (l->Pturbrightnew != 0.0)
								l->Pturbrightnew *= 1 + NUMrandomGauss (0, noiseFactor) /* * r->A */;
						}
						#if NO_TURBULENCE
							l->Pturbrightnew = 0;
						#endif
						l->Jrightnew = r->Jleftnew =
							(l->Dxhalf * l->pright + r->Dxhalf * r->pleft +
							 twoDt * (l->Qhalf - r->Qhalf + l->Pturbright)) /
							(l->r + r->r);   /* 5.127 */
						#if B91
							l->Jrightnew = r->Jleftnew =
								(l->pright + r->pleft +
								 2 * twoDt * (l->Qhalf - r->Qhalf + l->Pturbright) / (l->Dxhalf + r->Dxhalf)) /
								(l->r / l->Dxhalf + r->r / r->Dxhalf);
						#endif
						l->prightnew = l->Jrightnew / l->Anew;   /* 5.128 */
						r->pleftnew = r->Jleftnew / r->Anew;   /* 5.128 */
						l->Krightnew = onebytworho0 * l->prightnew * l->prightnew;   /* 5.128 */
						r->Kleftnew = onebytworho0 * r->pleftnew * r->pleftnew;   /* 5.128 */
						#if NO_BERNOULLI_EFFECT
							l->Krightnew = r->Kleftnew = 0;
						#endif
						l->Qrightnew =
							(l->eright + r->eleft + twoc2Dt * (l->Jhalf - r->Jhalf)
							 + l->Krightnew * l->Vnew + (r->Kleftnew - l->Pturbrightnew) * r->Vnew) /
							(l->Vnew + r->Vnew);   /* 5.131 */
						r->Qleftnew = l->Qrightnew + l->Pturbrightnew;   /* 5.131 */
					} else if (r2) {   /* Two adjacent tubes at the right side (velic). */
						r1->Jleftnew =
							(r1->Jleft * r1->Dxhalf * (1 / (l->A + r2->A) + 1 / r1->A) +
							 twoDt * ((l->Ahalf * l->Qhalf + r2->Ahalf * r2->Qhalf ) / (l->Ahalf  + r2->Ahalf) - r1->Qhalf)) /
							(1 / (1 / l->r + 1 / r2->r) + r1->r);   /* 5.138 */
						r2->Jleftnew =
							(r2->Jleft * r2->Dxhalf * (1 / (l->A + r1->A) + 1 / r2->A) +
							 twoDt * ((l->Ahalf * l->Qhalf + r1->Ahalf * r1->Qhalf ) / (l->Ahalf  + r1->Ahalf) - r2->Qhalf)) /
							(1 / (1 / l->r + 1 / r1->r) + r2->r);   /* 5.138 */
						l->Jrightnew = r1->Jleftnew + r2->Jleftnew;   /* 5.139 */
						l->prightnew = l->Jrightnew / l->Anew;   /* 5.128 */
						r1->pleftnew = r1->Jleftnew / r1->Anew;   /* 5.128 */
						r2->pleftnew = r2->Jleftnew / r2->Anew;   /* 5.128 */
						l->Krightnew = onebytworho0 * l->prightnew * l->prightnew;   /* 5.128 */
						r1->Kleftnew = onebytworho0 * r1->pleftnew * r1->pleftnew;   /* 5.128 */
						r2->Kleftnew = onebytworho0 * r2->pleftnew * r2->pleftnew;   /* 5.128 */
						#if NO_BERNOULLI_EFFECT
							l->Krightnew = r1->Kleftnew = r2->Kleftnew = 0;
						#endif
						l->Qrightnew = r1->Qleftnew = r2->Qleftnew =
							(l->eright + r1->eleft + r2->eleft + twoc2Dt * (l->Jhalf - r1->Jhalf - r2->Jhalf) +
							 l->Krightnew * l->Vnew + r1->Kleftnew * r1->Vnew + r2->Kleftnew * r2->Vnew) /
							(l->Vnew + r1->Vnew + r2->Vnew);   /* 5.137 */
					} else {
						Melder_assert (l2 != NULL);
						l1->Jrightnew =
							(l1->Jright * l1->Dxhalf * (1 / (r->A + l2->A) + 1 / l1->A) -
							 twoDt * ((r->Ahalf * r->Qhalf + l2->Ahalf * l2->Qhalf ) / (r->Ahalf  + l2->Ahalf) - l1->Qhalf)) /
							(1 / (1 / r->r + 1 / l2->r) + l1->r);   /* 5.138 */
						l2->Jrightnew =
							(l2->Jright * l2->Dxhalf * (1 / (r->A + l1->A) + 1 / l2->A) -
							 twoDt * ((r->Ahalf * r->Qhalf + l1->Ahalf  * l1->Qhalf ) / (r->Ahalf  + l1->Ahalf) - l2->Qhalf)) /
							(1 / (1 / r->r + 1 / l1->r) + l2->r);   /* 5.138 */
						r->Jleftnew = l1->Jrightnew + l2->Jrightnew;   /* 5.139 */
						r->pleftnew = r->Jleftnew / r->Anew;   /* 5.128 */
						l1->prightnew = l1->Jrightnew / l1->Anew;   /* 5.128 */
						l2->prightnew = l2->Jrightnew / l2->Anew;   /* 5.128 */
						r->Kleftnew = onebytworho0 * r->pleftnew * r->pleftnew;   /* 5.128 */
						l1->Krightnew = onebytworho0 * l1->prightnew * l1->prightnew;   /* 5.128 */
						l2->Krightnew = onebytworho0 * l2->prightnew * l2->prightnew;   /* 5.128 */
						#if NO_BERNOULLI_EFFECT
							r->Kleftnew = l1->Krightnew = l2->Krightnew = 0;
						#endif
						r->Qleftnew = l1->Qrightnew = l2->Qrightnew =
							(r->eleft + l1->eright + l2->eright + twoc2Dt * (l1->Jhalf + l2->Jhalf - r->Jhalf) +
							 r->Kleftnew * r->Vnew + l1->Krightnew * l1->Vnew + l2->Krightnew * l2->Vnew) /
							(r->Vnew + l1->Vnew + l2->Vnew);   /* 5.137 */
					}
				}

				/* Save some results. */

				if (n == (oversampling + 1) / 2) {
					double out = 0.0;
					for (m = 1; m <= M; m ++) {
						Delta_Tube t = delta->tube + m;
						out += rho0 * t->Dx * t->Dz * t->dDydt * Dt * 1000;   /* Radiation of wall movement, 5.140. */
						if (t->right1 == NULL)
							out += t->Jrightnew - t->Jright;   /* Radiation of open tube end. */
					}
					result -> z [1] [sample] = out /= 4 * NUMpi * 0.4 * Dt;   /* At 0.4 metres. */
					if (iw1) w1 -> z [1] [sample] = delta->tube[iw1].Dy;
					if (iw2) w2 -> z [1] [sample] = delta->tube[iw2].Dy;
					if (iw3) w3 -> z [1] [sample] = delta->tube[iw3].Dy;
					if (ip1) p1 -> z [1] [sample] = delta->tube[ip1].DeltaP;
					if (ip2) p2 -> z [1] [sample] = delta->tube[ip2].DeltaP;
					if (ip3) p3 -> z [1] [sample] = delta->tube[ip3].DeltaP;
					if (iv1) v1 -> z [1] [sample] = delta->tube[iv1].v;
					if (iv2) v2 -> z [1] [sample] = delta->tube[iv2].v;
					if (iv3) v3 -> z [1] [sample] = delta->tube[iv3].v;
				}
				for (m = 1; m <= M; m ++) {
					Delta_Tube t = delta->tube + m;
					t->Jleft = t->Jleftnew;
					t->Jright = t->Jrightnew;
					t->Qleft = t->Qleftnew;
					t->Qright = t->Qrightnew;
					t->Dy = t->Dynew;
					t->dDydt = t->dDydtnew;
					t->A = t->Anew;
					t->Dx = t->Dxnew;
					t->dDxdt = t->dDxdtnew;
					t->eleft = t->eleftnew;
					t->eright = t->erightnew;
					#if MASS_LEAPFROG
						t->ehalfold = t->ehalf;
					#endif
					t->pleft = t->pleftnew;
					t->pright = t->prightnew;
					t->Kleft = t->Kleftnew;
					t->Kright = t->Krightnew;
					t->V = t->Vnew;
					t->Pturbright = t->Pturbrightnew;
				}
			}
		}
		totalVolume = 0.0;
		for (m = 1; m <= M; m ++)
			totalVolume += delta->tube [m]. V;
		//Melder_casual (U"Ending volume: ", totalVolume * 1000, U" litres.");
		if (out_w1) *out_w1 = w1.transfer();
		if (out_w2) *out_w2 = w2.transfer();
		if (out_w3) *out_w3 = w3.transfer();
		if (out_p1) *out_p1 = p1.transfer();
		if (out_p2) *out_p2 = p2.transfer();
		if (out_p3) *out_p3 = p3.transfer();
		if (out_v1) *out_v1 = v1.transfer();
		if (out_v2) *out_v2 = v2.transfer();
		if (out_v3) *out_v3 = v3.transfer();
		return result.transfer();
	} catch (MelderError) {
		Melder_throw (artword, U" & ", speaker, U": articulatory synthesis not performed.");
	}
}
Example #19
0
void structManual :: v_draw () {
	ManPages manPages = (ManPages) data;
	ManPage page;
	ManPage_Paragraph paragraph;
	#if motif
	Graphics_clearWs (g);
	#endif
	if (path == SEARCH_PAGE) {
		HyperPage_pageTitle (this, L"Best matches");
		HyperPage_intro (this, L"The best matches to your query seem to be:");
		for (int i = 1; i <= numberOfMatches; i ++) {
			wchar link [300];
			page = (ManPage) manPages -> pages -> item [matches [i]];
			swprintf (link, 300, L"\\bu @@%ls", page -> title);
			HyperPage_listItem (this, link);
		}
		return;
	}
	page = (ManPage) manPages -> pages -> item [path];
	if (! paragraphs) return;
	HyperPage_pageTitle (this, page -> title);
	for (paragraph = & page -> paragraphs [0]; paragraph -> type != 0; paragraph ++) {
		switch (paragraph -> type) {
			case  kManPage_type_INTRO: HyperPage_intro (this, paragraph -> text); break;
			case  kManPage_type_ENTRY: HyperPage_entry (this, paragraph -> text); break;
			case  kManPage_type_NORMAL: HyperPage_paragraph (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM: HyperPage_listItem (this, paragraph -> text); break;
			case  kManPage_type_TAG: HyperPage_listTag (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION: HyperPage_definition (this, paragraph -> text); break;
			case  kManPage_type_CODE: HyperPage_code (this, paragraph -> text); break;
			case  kManPage_type_PROTOTYPE: HyperPage_prototype (this, paragraph -> text); break;
			case  kManPage_type_FORMULA: HyperPage_formula (this, paragraph -> text); break;
			case  kManPage_type_PICTURE: HyperPage_picture (this, paragraph -> width,
				paragraph -> height, paragraph -> draw); break;
			case  kManPage_type_SCRIPT: HyperPage_script (this, paragraph -> width,
				paragraph -> height, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM1: HyperPage_listItem1 (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM2: HyperPage_listItem2 (this, paragraph -> text); break;
			case  kManPage_type_LIST_ITEM3: HyperPage_listItem3 (this, paragraph -> text); break;
			case  kManPage_type_TAG1: HyperPage_listTag1 (this, paragraph -> text); break;
			case  kManPage_type_TAG2: HyperPage_listTag2 (this, paragraph -> text); break;
			case  kManPage_type_TAG3: HyperPage_listTag3 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION1: HyperPage_definition1 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION2: HyperPage_definition2 (this, paragraph -> text); break;
			case  kManPage_type_DEFINITION3: HyperPage_definition3 (this, paragraph -> text); break;
			case  kManPage_type_CODE1: HyperPage_code1 (this, paragraph -> text); break;
			case  kManPage_type_CODE2: HyperPage_code2 (this, paragraph -> text); break;
			case  kManPage_type_CODE3: HyperPage_code3 (this, paragraph -> text); break;
			case  kManPage_type_CODE4: HyperPage_code4 (this, paragraph -> text); break;
			case  kManPage_type_CODE5: HyperPage_code5 (this, paragraph -> text); break;
			default: break;
		}
	}
	if (ManPages_uniqueLinksHither (manPages, path)) {
		long ilink, jlink, lastParagraph = 0;
		int goAhead = TRUE;
		while (page -> paragraphs [lastParagraph]. type != 0) lastParagraph ++;
		if (lastParagraph > 0) {
			const wchar *text = page -> paragraphs [lastParagraph - 1]. text;
			if (text == NULL || text [0] == '\0' || text [wcslen (text) - 1] != ':') {
				if (printing && suppressLinksHither)
					goAhead = FALSE;
				else
					HyperPage_entry (this, L"Links to this page");
			}
		}
		if (goAhead) for (ilink = 1; ilink <= page -> nlinksHither; ilink ++) {
			long link = page -> linksHither [ilink];
			int alreadyShown = FALSE;
			for (jlink = 1; jlink <= page -> nlinksThither; jlink ++)
				if (page -> linksThither [jlink] == link)
					alreadyShown = TRUE;
			if (! alreadyShown) {
				const wchar *title = ((ManPage) manPages -> pages -> item [page -> linksHither [ilink]]) -> title;
				wchar linkText [304];
				swprintf (linkText, 304, L"@@%ls@", title);
				HyperPage_listItem (this, linkText);
			}
		}
	}
	if (! printing && page -> date) {
		wchar signature [100];
		long date = page -> date;
		int imonth = date % 10000 / 100;
		if (imonth < 0 || imonth > 12) imonth = 0;
		swprintf (signature, 100, L"\\co %ls, %ld %ls %ld",
			wcsequ (page -> author, L"ppgb") ? L"Paul Boersma" :
			wcsequ (page -> author, L"djmw") ? L"David Weenink" : page -> author,
			date % 100, month [imonth], date / 10000);
		HyperPage_any (this, L"", font, fontSize, 0, 0.0,
			0.0, 0.0, 0.1, 0.1, HyperPage_ADD_BORDER);
		HyperPage_any (this, signature, font, fontSize, Graphics_ITALIC, 0.0,
			0.03, 0.0, 0.1, 0.0, 0);
	}
}