[med-svn] [SCM] aghermann branch, master, updated. 4f7a3b774136ffffbaf9b05d90bd568347bc5461

Andrei Zavada johnhommer at gmail.com
Fri Nov 16 00:50:51 UTC 2012


The following commit has been merged in the master branch:
commit 27f53a9368b65d20f56f5fe59fcec53cb7e4a6fa
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Sat Nov 10 12:58:24 2012 +0200

    move window_type_names array to sigproc

diff --git a/src/metrics/psd.cc b/src/metrics/psd.cc
index a4e8fe9..f74d660 100644
--- a/src/metrics/psd.cc
+++ b/src/metrics/psd.cc
@@ -61,16 +61,6 @@ reset()
 
 
 
-// must match those defined in glade
-const array<const char*, 8>
-	metrics::psd::SFFTParamSet::welch_window_type_names = {{
-	"Bartlett", "Blackman", "Blackman-Harris",
-	"Hamming",  "Hanning",  "Parzen",
-	"Square",   "Welch"
-}};
-
-
-
 
 
 
diff --git a/src/metrics/psd.hh b/src/metrics/psd.hh
index 57fa05b..e181796 100644
--- a/src/metrics/psd.hh
+++ b/src/metrics/psd.hh
@@ -37,15 +37,6 @@ namespace psd {
 
 
 struct SFFTParamSet {
-
-	static const array<const char*, 8> welch_window_type_names;
-	static const char* welch_window_type_name( sigproc::TWinType i)
-		{
-			return (likely (i < sigproc::TWinType::_total))
-				? welch_window_type_names[(int)i]
-				: "(bad window type)";
-		}
-
 	SFFTParamSet (const SFFTParamSet& rv) = default;
 	SFFTParamSet ()
 		{
diff --git a/src/sigproc/sigproc.cc b/src/sigproc/sigproc.cc
index 2b1c058..841a12c 100644
--- a/src/sigproc/sigproc.cc
+++ b/src/sigproc/sigproc.cc
@@ -19,6 +19,14 @@
 
 using namespace std;
 
+// must match those defined in glade
+const char*
+	sigproc::welch_window_type_names[sigproc::TWinType::_total] = {
+	"Bartlett", "Blackman", "Blackman-Harris",
+	"Hamming",  "Hanning",  "Parzen",
+	"Square",   "Welch"
+};
+
 
 
 template void sigproc::smooth( valarray<TFloat>&, size_t);
diff --git a/src/sigproc/sigproc.hh b/src/sigproc/sigproc.hh
index 1fd162e..a4fb62b 100644
--- a/src/sigproc/sigproc.hh
+++ b/src/sigproc/sigproc.hh
@@ -43,6 +43,10 @@ enum TWinType : int {
 	_total
 };
 
+extern const char*
+	welch_window_type_names[TWinType::_total];
+
+
 extern TFloat (*winf[])(size_t, size_t);
 
 
diff --git a/src/ui/mw/mw-populate.cc b/src/ui/mw/mw-populate.cc
index 7790c9f..7a307ea 100644
--- a/src/ui/mw/mw-populate.cc
+++ b/src/ui/mw/mw-populate.cc
@@ -521,7 +521,7 @@ populate_1()
 	snprintf_buf( "<small>%zusec/%gHz/%s</small>",
 		      ED->fft_params.pagesize,
 		      ED->fft_params.binsize,
-		      metrics::psd::SFFTParamSet::welch_window_type_name( ED->fft_params.welch_window_type));
+		      sigproc::welch_window_type_names[ED->fft_params.welch_window_type]);
 	gtk_label_set_markup( lMsmtPSDInfo, __buf__);
 
 	snprintf_buf( "<small>%gHz/%g/%g</small>",

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list