Exemple #1
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;
	}
}
Exemple #2
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;
    }
}
void praat_reportMemoryUse () {
	MelderInfo_open ();
	MelderInfo_writeLine (U"Memory use by Praat:\n");
	MelderInfo_writeLine (U"Currently in use:\n"
		U"   Strings: ", MelderString_allocationCount () - MelderString_deallocationCount ());
	MelderInfo_writeLine (U"   Arrays: ", NUM_getTotalNumberOfArrays ());
	MelderInfo_writeLine (U"   Things: ", Thing_getTotalNumberOfThings (),
		U" (objects in list: ", theCurrentPraatObjects -> n, U")");
	long numberOfMotifWidgets =
	#if motif
		Gui_getNumberOfMotifWidgets ();
		MelderInfo_writeLine (U"   Motif widgets: ", numberOfMotifWidgets);
	#else
		0;
	#endif
	MelderInfo_writeLine (U"   Other: ",
		Melder_allocationCount () - Melder_deallocationCount ()
		- Thing_getTotalNumberOfThings () - NUM_getTotalNumberOfArrays ()
		- (MelderString_allocationCount () - MelderString_deallocationCount ())
		- numberOfMotifWidgets);
	MelderInfo_writeLine (
		U"\nMemory history of this session:\n"
		U"   Total created: ", Melder_bigInteger (Melder_allocationCount ()), U" (", Melder_bigInteger (Melder_allocationSize ()), U" bytes)");
	MelderInfo_writeLine (U"   Total deleted: ", Melder_bigInteger (Melder_deallocationCount ()));
	MelderInfo_writeLine (U"   Reallocations: ", Melder_bigInteger (Melder_movingReallocationsCount ()), U" moving, ",
		Melder_bigInteger (Melder_reallocationsInSituCount ()), U" in situ");
	MelderInfo_writeLine (
		U"   Strings created: ", Melder_bigInteger (MelderString_allocationCount ()), U" (", Melder_bigInteger (MelderString_allocationSize ()), U" bytes)");
	MelderInfo_writeLine (
		U"   Strings deleted: ", Melder_bigInteger (MelderString_deallocationCount ()), U" (", Melder_bigInteger (MelderString_deallocationSize ()), U" bytes)");
	MelderInfo_writeLine (U"\nHistory of all sessions from ", statistics.dateOfFirstSession, U" until today:");
	MelderInfo_writeLine (U"   Sessions: ", statistics.interactiveSessions, U" interactive, ",
		statistics.batchSessions, U" batch");
	MelderInfo_writeLine (U"   Total memory use: ", Melder_bigInteger ((int64) statistics.memory + Melder_allocationSize ()), U" bytes");
	MelderInfo_writeLine (U"\nNumber of fixed menu commands: ", praat_getNumberOfMenuCommands ());
	MelderInfo_writeLine (U"Number of dynamic menu commands: ", praat_getNumberOfActions ());
	MelderInfo_close ();
}