[med-svn] [Git][med-team/praat][master] 4 commits: New upstream version 6.2.12

Rafael Laboissière (@rafael) gitlab at salsa.debian.org
Fri Apr 29 11:03:00 BST 2022



Rafael Laboissière pushed to branch master at Debian Med / praat


Commits:
abdc0154 by Rafael Laboissière at 2022-04-28T04:33:08-03:00
New upstream version 6.2.12
- - - - -
af29a4cb by Rafael Laboissière at 2022-04-28T04:36:00-03:00
Merge tag 'upstream/6.2.12'

Upstream version 6.2.12

- - - - -
da7839b9 by Rafael Laboissière at 2022-04-28T05:46:08-03:00
d/What_s_new_.html: Update upstream changelog

Gbp-Dch: Ignore

- - - - -
9d724403 by Rafael Laboissière at 2022-04-29T03:29:36-03:00
d/changelog: Add entry for release 6.2.12-1

Gbp-Dch: Ignore

- - - - -


14 changed files:

- debian/What_s_new_.html
- debian/changelog
- dwtools/Spectrum_and_MultiSampledSpectrogram.cpp
- fon/FunctionEditor.cpp
- fon/FunctionEditor.h
- fon/SoundEditor.cpp
- fon/TimeSoundAnalysisEditor.cpp
- fon/TimeSoundAnalysisEditor.h
- fon/manual_tutorials.cpp
- main/praat.plist
- stat/Table.cpp
- stat/Table.h
- stat/praat_Stat.cpp
- sys/praat_version.h


Changes:

=====================================
debian/What_s_new_.html
=====================================
@@ -7,6 +7,14 @@ What's new?
 <p>
 Latest changes in Praat.</p>
 <p>
+<b>6.2.12</b> (17 April 2022)</p>
+<ul>
+<li>
+ Table: Get sum...
+<li>
+ Scripting an editor window can now query analyses that are not visible (e.g. after zooming).
+</ul>
+<p>
 <b>6.2.11</b> (8 April 2022)</p>
 <ul>
 <li>
@@ -136,7 +144,7 @@ What used to be new?</h3>
 </ul>
 <hr>
 <address>
-	<p>© ppgb, April 8, 2022</p>
+	<p>© ppgb, April 17, 2022</p>
 </address>
 </body>
 </html>


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+praat (6.2.12-1) unstable; urgency=medium
+
+  * New upstream version 6.2.12
+
+ -- Rafael Laboissière <rafael at debian.org>  Thu, 28 Apr 2022 05:46:13 -0300
+
 praat (6.2.11-1) unstable; urgency=medium
 
   * New upstream version 6.2.11


=====================================
dwtools/Spectrum_and_MultiSampledSpectrogram.cpp
=====================================
@@ -120,29 +120,29 @@ void Spectrum_into_MultiSampledSpectrogram (Spectrum me, MultiSampledSpectrogram
 			if (ifreq == 1) {
 				/*
 					DC_BIN:
-					Fill with values from 0 Hz to the mid of the first window
+					Fill with values from 0 Hz to the mid of the first window.
 					Multiply with a window only the part that overlaps with the first window.
 				*/
 				(void) Sampled_getWindowSamples (me, my xmin, 0.5 * (spectrum_fmin + spectrum_fmax), & spectrum_imin, & spectrum_imax);
 				him = Spectrum_to_AnalyticSound_demodulateBand (me, spectrum_imin, spectrum_imax, approximateTimeOverSampling, 
-					window.part (window.size / 2 + 1, window.size));
+					 	window.part (window.size / 2 + 1, window.size));
 				thy zeroBin = FrequencyBin_create (thy tmin, thy tmax, his nx, his dx, his x1);
 				thy zeroBin -> z = his z.move();
 			} 
 			if (ifreq == thy nx) {
 				/*
 					NYQUIST_BIN:
-					Fill with the part from the mid of the last window to the end
+					Fill with the part from the mid of the last window to the end.
 					Window only the part that overlaps the last window.
 				*/
 				(void) Sampled_getWindowSamples (me, 0.5 * (spectrum_fmin + spectrum_fmax), my xmax, & spectrum_imin, & spectrum_imax);
 				him = Spectrum_to_AnalyticSound_demodulateBand (me, spectrum_imin, spectrum_imax, approximateTimeOverSampling, 
-					window.part (1 , window.size / 2));
+					 	window.part (1 , window.size / 2));
 				thy nyquistBin = FrequencyBin_create (thy tmin, thy tmax, his nx, his dx, his x1);
 				thy nyquistBin -> z = his z.move();
 			}
 		}
-		Melder_assert (thy frequencyBins.size == thy nx); // maintain invariant
+		Melder_assert (thy frequencyBins.size == thy nx);   // check invariant
 	} catch (MelderError) {
 		Melder_throw (me, U": cannot calculate MultiSampledSpectrogram.");
 	}


=====================================
fon/FunctionEditor.cpp
=====================================
@@ -76,6 +76,7 @@ static void updateGroup (FunctionEditor me) {
 			if (my pref_synchronizedZoomAndScroll()) {
 				thy startWindow = my startWindow;
 				thy endWindow = my endWindow;
+				thy v_windowChanged ();
 			}
 			thy startSelection = my startSelection;
 			thy endSelection = my endSelection;
@@ -511,6 +512,7 @@ static void menu_cb_zoom (FunctionEditor me, EDITOR_ARGS_FORM) {
 			U"“to” should be greater than “from”.");
 		my startWindow = from;
 		my endWindow = to;
+		my v_windowChanged ();
 		Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 		my v_updateText ();
 		updateScrollBar (me);
@@ -522,6 +524,7 @@ static void menu_cb_zoom (FunctionEditor me, EDITOR_ARGS_FORM) {
 static void do_showAll (FunctionEditor me) {
 	my startWindow = my tmin;
 	my endWindow = my tmax;
+	my v_windowChanged ();
 	Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 	my v_updateText ();
 	updateScrollBar (me);
@@ -538,6 +541,7 @@ static void do_zoomIn (FunctionEditor me) {
 	const double shift = (my endWindow - my startWindow) / 4.0;
 	my startWindow += shift;
 	my endWindow -= shift;
+	my v_windowChanged ();
 	Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 	my v_updateText ();
 	updateScrollBar (me);
@@ -559,6 +563,7 @@ static void do_zoomOut (FunctionEditor me) {
 	my endWindow += shift;
 	if (my endWindow > my tmax - 1e-12)
 		my endWindow = my tmax;
+	my v_windowChanged ();
 	Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 	my v_updateText ();
 	updateScrollBar (me);
@@ -577,6 +582,7 @@ static void do_zoomToSelection (FunctionEditor me) {
 		my endZoomHistory = my endWindow;   // remember for Zoom Back
 		my startWindow = my startSelection;
 		my endWindow = my endSelection;
+		my v_windowChanged ();
 		Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 		my v_updateText ();
 		updateScrollBar (me);
@@ -594,6 +600,7 @@ static void do_zoomBack (FunctionEditor me) {
 	if (my endZoomHistory > my startZoomHistory) {
 		my startWindow = my startZoomHistory;
 		my endWindow = my endZoomHistory;
+		my v_windowChanged ();
 		Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 		my v_updateText ();
 		updateScrollBar (me);
@@ -849,6 +856,7 @@ void FunctionEditor_shift (FunctionEditor me, double shift, bool needsUpdateGrou
 		if (my startWindow < my tmin + 1e-12)
 			my startWindow = my tmin;
 	}
+	my v_windowChanged ();
 	Melder_assert (isdefined (my startSelection));   // precondition of FunctionEditor_marksChanged()
 	FunctionEditor_marksChanged (me, needsUpdateGroup);
 }
@@ -875,6 +883,7 @@ void FunctionEditor_scrollToView (FunctionEditor me, double t) {
 		Melder_assert (isdefined (my startSelection));   // precondition of FunctionEditor_shift()
 		FunctionEditor_shift (me, t - my endWindow + 0.618 * (my endWindow - my startWindow), true);
 	} else {
+		my v_windowChanged ();
 		Melder_assert (isdefined (my startSelection));   // precondition of FunctionEditor_marksChanged()
 		FunctionEditor_marksChanged (me, true);
 	}
@@ -985,6 +994,7 @@ static void gui_cb_scroll (FunctionEditor me, GuiScrollBarEvent event) {
 			my endWindow = my tmax;
 	}
 	if (shifted || zoomed) {
+		my v_windowChanged ();
 		Melder_assert (isdefined (my startSelection));   // precondition of v_updateText()
 		my v_updateText ();
 		//updateScrollBar (me);
@@ -995,6 +1005,7 @@ static void gui_cb_scroll (FunctionEditor me, GuiScrollBarEvent event) {
 			if (theGroupMembers [i] && theGroupMembers [i] != me) {
 				theGroupMembers [i] -> startWindow = my startWindow;
 				theGroupMembers [i] -> endWindow = my endWindow;
+				theGroupMembers [i] -> v_windowChanged ();
 				Melder_assert (isdefined (theGroupMembers [i] -> startSelection));   // precondition of FunctionEditor_updateText()
 				FunctionEditor_updateText (theGroupMembers [i]);
 				updateScrollBar (theGroupMembers [i]);
@@ -1039,6 +1050,7 @@ static void gui_checkbutton_cb_group (FunctionEditor me, GuiCheckButtonEvent /*
 		if (my pref_synchronizedZoomAndScroll()) {
 			my startWindow = thy startWindow;
 			my endWindow = thy endWindow;
+			my v_windowChanged ();
 		}
 		my startSelection = thy startSelection;
 		my endSelection = thy endSelection;
@@ -1443,13 +1455,18 @@ void structFunctionEditor :: v_dataChanged () {
 	Melder_assert (Thing_isa (our function(), classFunction));
 	our tmin = our function() -> xmin;
  	our tmax = our function() -> xmax;
- 	if (our startWindow < our tmin || our startWindow > our tmax)
+ 	if (our startWindow < our tmin || our startWindow > our tmax) {
  		our startWindow = our tmin;
- 	if (our endWindow < our tmin || our endWindow > our tmax)
+ 		our v_windowChanged ();
+	}
+ 	if (our endWindow < our tmin || our endWindow > our tmax) {
  		our endWindow = our tmax;
+ 		our v_windowChanged ();
+	}
  	if (our startWindow >= our endWindow) {
  		our startWindow = our tmin;
  		our endWindow = our tmax;
+ 		our v_windowChanged ();
 	}
 	Melder_clip (our tmin, & our startSelection, our tmax);
 	Melder_clip (our tmin, & our endSelection, our tmax);


=====================================
fon/FunctionEditor.h
=====================================
@@ -147,6 +147,7 @@ Thing_define (FunctionEditor, Editor) {
 		override;
 
 	virtual void v_draw () = 0;
+	virtual void v_windowChanged () { }
 	virtual bool v_hasSelectionViewer () { return false; }
 	virtual void v_drawSelectionViewer () { }
 	virtual void v_drawRealTimeSelectionViewer (double /* time */) { }


=====================================
fon/SoundEditor.cpp
=====================================
@@ -1,6 +1,6 @@
 /* SoundEditor.cpp
  *
- * Copyright (C) 1992-2020 Paul Boersma, 2007 Erez Volk (FLAC support)
+ * Copyright (C) 1992-2022 Paul Boersma, 2007 Erez Volk (FLAC support)
  *
  * This code is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@ void structSoundEditor :: v_dataChanged () {
 	Melder_assert (sound);
 	if (sound -> classInfo == classSound)   // LongSound editors can get spurious v_dataChanged messages (e.g. in a TextGrid editor)
 		Matrix_getWindowExtrema (sound, 1, sound -> nx, 1, sound -> ny, & d_sound.minimum, & d_sound.maximum);   // BUG unreadable
-	v_reset_analysis ();
 	SoundEditor_Parent :: v_dataChanged ();
 }
 


=====================================
fon/TimeSoundAnalysisEditor.cpp
=====================================
@@ -126,12 +126,17 @@ void structTimeSoundAnalysisEditor :: v_info () {
 	}
 }
 
+void structTimeSoundAnalysisEditor :: v_dataChanged () {
+	our v_reset_analysis ();
+	our TimeSoundAnalysisEditor_Parent :: v_dataChanged ();
+}
+
 void structTimeSoundAnalysisEditor :: v_reset_analysis () {
-	d_spectrogram. reset();
-	d_pitch. reset();
-	d_intensity. reset();
-	d_formant. reset();
-	d_pulses. reset();
+	our d_spectrogram. reset();
+	our d_pitch. reset();
+	our d_intensity. reset();
+	our d_formant. reset();
+	our d_pulses. reset();
 }
 
 enum {


=====================================
fon/TimeSoundAnalysisEditor.h
=====================================
@@ -2,7 +2,7 @@
 #define _TimeSoundAnalysisEditor_h_
 /* TimeSoundAnalysisEditor.h
  *
- * Copyright (C) 1992-2007,2009-2016,2018,2020 Paul Boersma
+ * Copyright (C) 1992-2007,2009-2016,2018,2020,2022 Paul Boersma
  *
  * This code is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -40,6 +40,8 @@ Thing_define (TimeSoundAnalysisEditor, TimeSoundEditor) {
 		override;
 	void v_info ()
 		override;
+	void v_dataChanged ()
+		override;
 	void v_createMenuItems_query (EditorMenu menu)
 		override;
 	bool v_mouseInWideDataView (GuiDrawingArea_MouseEvent event, double x_world, double y_fraction)
@@ -51,6 +53,11 @@ Thing_define (TimeSoundAnalysisEditor, TimeSoundEditor) {
 	{
 		return p_spectrogram_show || p_pitch_show || p_intensity_show || p_formant_show ? 0.5 : 0.0;
 	}
+	void v_windowChanged ()
+		override
+	{
+		our v_reset_analysis ();
+	}
 
 	virtual bool v_hasAnalysis    () { return true; }
 	virtual bool v_hasSpectrogram () { return true; }


=====================================
fon/manual_tutorials.cpp
=====================================
@@ -22,8 +22,11 @@
 void manual_tutorials_init (ManPages me);
 void manual_tutorials_init (ManPages me) {
 
-MAN_BEGIN (U"What's new?", U"ppgb", 20220408)
+MAN_BEGIN (U"What's new?", U"ppgb", 20220417)
 INTRO (U"Latest changes in Praat.")
+NORMAL (U"##6.2.12# (17 April 2022)")
+LIST_ITEM (U"• Table: Get sum...")
+LIST_ITEM (U"• Scripting an editor window can now query analyses that are not visible (e.g. after zooming).")
 NORMAL (U"##6.2.11# (8 April 2022)")
 LIST_ITEM (U"• Windows: Demo window could hang with use of Chinese keyboard (after Play).")
 NORMAL (U"##6.2.10# (17 March 2022)")


=====================================
main/praat.plist
=====================================
@@ -648,6 +648,20 @@
 			<key>LSTypeIsPackage</key>
 			<integer>0</integer>
 		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>tsv</string>
+			</array>
+			<key>CFBundleTypeIconSystemGenerated</key>
+			<integer>1</integer>
+			<key>CFBundleTypeName</key>
+			<string>tab-separated values</string>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>LSHandlerRank</key>
+			<string>Default</string>
+		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
 	<string>Praat</string>


=====================================
stat/Table.cpp
=====================================
@@ -1,6 +1,6 @@
 /* Table.cpp
  *
- * Copyright (C) 2002-2021 Paul Boersma
+ * Copyright (C) 2002-2022 Paul Boersma
  *
  * This code is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -465,18 +465,32 @@ double Table_getNumericValue_Assert (Table me, integer rowNumber, integer column
 	return row -> cells [columnNumber]. number;
 }
 
+static double getSum (Table me, integer columnNumber) {
+	longdouble sum = 0.0;
+	for (integer irow = 1; irow <= my rows.size; irow ++) {
+		const TableRow row = my rows.at [irow];
+		sum += row -> cells [columnNumber]. number;
+	}
+	return double (sum);
+}
+
+double Table_getSum (Table me, integer columnNumber) {
+	try {
+		Table_checkSpecifiedColumnNumberWithinRange (me, columnNumber);
+		Table_numericize_checkDefined (me, columnNumber);
+		return getSum (me, columnNumber);
+	} catch (MelderError) {
+		Melder_throw (me, U": cannot compute sum of column ", columnNumber, U".");
+	}
+}
+
 double Table_getMean (Table me, integer columnNumber) {
 	try {
 		Table_checkSpecifiedColumnNumberWithinRange (me, columnNumber);
 		Table_numericize_checkDefined (me, columnNumber);
 		if (my rows.size < 1)
 			return undefined;
-		longdouble sum = 0.0;
-		for (integer irow = 1; irow <= my rows.size; irow ++) {
-			const TableRow row = my rows.at [irow];
-			sum += row -> cells [columnNumber]. number;
-		}
-		return double (sum) / my rows.size;
+		return getSum (me, columnNumber) / my rows.size;
 	} catch (MelderError) {
 		Melder_throw (me, U": cannot compute mean of column ", columnNumber, U".");
 	}


=====================================
stat/Table.h
=====================================
@@ -2,7 +2,7 @@
 #define _Table_h_
 /* Table.h
  *
- * Copyright (C) 2002-2012,2014-2019,2021 Paul Boersma
+ * Copyright (C) 2002-2012,2014-2019,2021,2022 Paul Boersma
  *
  * This code is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -68,6 +68,7 @@ void Table_setNumericValue (Table me, integer row, integer column, double value)
 void Table_numericize_Assert (Table me, integer columnNumber);
 
 double Table_getQuantile (Table me, integer column, double quantile);
+double Table_getSum (Table me, integer column);
 double Table_getMean (Table me, integer column);
 double Table_getMaximum (Table me, integer icol);
 double Table_getMinimum (Table me, integer icol);


=====================================
stat/praat_Stat.cpp
=====================================
@@ -1,6 +1,6 @@
 /* praat_Stat.cpp
  *
- * Copyright (C) 1992-2019,2021 Paul Boersma
+ * Copyright (C) 1992-2019,2021,2022 Paul Boersma
  *
  * This code is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -452,6 +452,18 @@ DO
 	QUERY_ONE_FOR_REAL_END (U" (minimum of ", columnLabel, U")")
 }
 
+DIRECT (QUERY_ONE_FOR_INTEGER__Table_getNumberOfColumns) {
+	QUERY_ONE_FOR_INTEGER (Table)
+		const integer result = my numberOfColumns;
+	QUERY_ONE_FOR_INTEGER_END (U" columns")
+}
+
+DIRECT (QUERY_ONE_FOR_INTEGER__Table_getNumberOfRows) {
+	QUERY_ONE_FOR_INTEGER (Table)
+		const integer result = my rows.size;
+	QUERY_ONE_FOR_INTEGER_END (U" rows")
+}
+
 FORM (QUERY_ONE_FOR_REAL__Table_getQuantile, U"Table: Get quantile", nullptr) {
 	SENTENCE (columnLabel, U"Column label", U"")
 	POSITIVE (quantile, U"Quantile", U"0.50 (= median)")
@@ -473,16 +485,14 @@ DO
 	QUERY_ONE_FOR_REAL_END (U" (standard deviation of ", columnLabel, U")")
 }
 
-DIRECT (QUERY_ONE_FOR_INTEGER__Table_getNumberOfColumns) {
-	QUERY_ONE_FOR_INTEGER (Table)
-		const integer result = my numberOfColumns;
-	QUERY_ONE_FOR_INTEGER_END (U" columns")
-}
-
-DIRECT (QUERY_ONE_FOR_INTEGER__Table_getNumberOfRows) {
-	QUERY_ONE_FOR_INTEGER (Table)
-		const integer result = my rows.size;
-	QUERY_ONE_FOR_INTEGER_END (U" rows")
+FORM (QUERY_ONE_FOR_REAL__Table_getSum, U"Table: Get sum", nullptr) {
+	SENTENCE (columnLabel, U"Column label", U"")
+	OK
+DO
+	QUERY_ONE_FOR_REAL (Table)
+		const integer columnNumber = Table_getColumnIndexFromColumnLabel (me, columnLabel);
+		const double result = Table_getSum (me, columnNumber);
+	QUERY_ONE_FOR_REAL_END (U" (mean of ", columnLabel, U")")
 }
 
 FORM (QUERY_ONE_FOR_REAL__Table_getValue, U"Table: Get value", nullptr) {
@@ -1200,6 +1210,8 @@ void praat_uvafon_stat_init () {
 				QUERY_ONE_FOR_REAL__Table_getMinimum);
 		praat_addAction1 (classTable, 1, U"Get maximum...", nullptr, 1,
 				QUERY_ONE_FOR_REAL__Table_getMaximum);
+		praat_addAction1 (classTable, 1, U"Get sum...", nullptr, 1,
+				QUERY_ONE_FOR_REAL__Table_getSum);
 		praat_addAction1 (classTable, 1, U"Get mean...", nullptr, 1,
 				QUERY_ONE_FOR_REAL__Table_getMean);
 		praat_addAction1 (classTable, 1, U"Get group mean...", nullptr, 1,


=====================================
sys/praat_version.h
=====================================
@@ -1,5 +1,5 @@
-#define PRAAT_VERSION_STR 6.2.11
-#define PRAAT_VERSION_NUM 6211
+#define PRAAT_VERSION_STR 6.2.12
+#define PRAAT_VERSION_NUM 6212
 #define PRAAT_YEAR 2022
 #define PRAAT_MONTH April
-#define PRAAT_DAY 8
+#define PRAAT_DAY 17



View it on GitLab: https://salsa.debian.org/med-team/praat/-/compare/351420b7225d78c90298e5813e5eefc80e54549b...9d724403ec2189ff4c66cc10030e4b5c5f98164b

-- 
View it on GitLab: https://salsa.debian.org/med-team/praat/-/compare/351420b7225d78c90298e5813e5eefc80e54549b...9d724403ec2189ff4c66cc10030e4b5c5f98164b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220429/80f4f021/attachment-0001.htm>


More information about the debian-med-commit mailing list