[med-svn] [aghermann] 06/85: more of the same (0453af650)

andrei zavada hmmr-guest at alioth.debian.org
Thu Sep 26 23:46:22 UTC 2013


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to branch master
in repository aghermann.

commit 61e02bf84ccef5a1dd876f94e1e6cbaf754705c3
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Tue Sep 3 00:29:16 2013 +0300

    more of the same (0453af650)
---
 upstream/src/aghermann/ui/globals.cc             |    4 +-
 upstream/src/aghermann/ui/mw/measurements.cc     |   14 +-
 upstream/src/aghermann/ui/mw/mw.cc               |  144 +++++------
 upstream/src/aghermann/ui/mw/mw.hh               |   93 ++++---
 upstream/src/aghermann/ui/mw/simulations.cc      |  110 ++++----
 upstream/src/aghermann/ui/mw/splash.cc           |   69 ++---
 upstream/src/aghermann/ui/mw/widgets.hh          |   94 ++++---
 upstream/src/aghermann/ui/sf/channel.cc          |   63 ++---
 upstream/src/aghermann/ui/sf/construct.cc        |  298 +++++++++++-----------
 upstream/src/aghermann/ui/sf/ica.cc              |   24 +-
 upstream/src/aghermann/ui/sf/mainmenu_cb.cc      |   11 +-
 upstream/src/aghermann/ui/sf/montage-overlays.cc |   12 +-
 upstream/src/aghermann/ui/sf/montage.cc          |   50 ++--
 upstream/src/aghermann/ui/sf/montage_cb.cc       |   73 +++---
 upstream/src/aghermann/ui/ui++.hh                |   72 +++---
 upstream/src/aghermann/ui/ui.hh                  |   10 +-
 upstream/src/libmetrics/mc-artifacts.hh          |   22 +-
 upstream/src/libmetrics/mc-artifacts.ii          |    5 +-
 upstream/src/libmetrics/mc.cc                    |   46 ++--
 upstream/src/libmetrics/mc.hh                    |   46 ++--
 upstream/src/libmetrics/page-metrics-base.hh     |   65 ++---
 upstream/src/libmetrics/psd.cc                   |   16 +-
 upstream/src/libmetrics/psd.hh                   |   44 ++--
 upstream/src/libmetrics/swu.cc                   |   49 ++--
 upstream/src/libmetrics/swu.hh                   |   26 +-
 upstream/src/libsigproc/exstrom.hh               |   31 ++-
 upstream/src/libsigproc/ext-filters.hh           |   10 +-
 upstream/src/libsigproc/sigproc.cc               |    3 +-
 upstream/src/libsigproc/sigproc.hh               |   78 +++---
 upstream/src/libsigproc/sigproc.ii               |   22 +-
 upstream/src/libsigproc/winfun.cc                |   21 +-
 31 files changed, 831 insertions(+), 794 deletions(-)

diff --git a/upstream/src/aghermann/ui/globals.cc b/upstream/src/aghermann/ui/globals.cc
index 14e64c4..d66e205 100644
--- a/upstream/src/aghermann/ui/globals.cc
+++ b/upstream/src/aghermann/ui/globals.cc
@@ -15,7 +15,7 @@
 using namespace std;
 using namespace agh::ui;
 
-char        global::buf[AGH_BUF_SIZE];
+char    global::buf[AGH_BUF_SIZE];
 
 GdkDevice
         *global::client_pointer;
@@ -26,7 +26,7 @@ UniqueApp
 GtkWindow
         *global::main_window;
 
-double        global::hdpmm,
+double  global::hdpmm,
         global::vdpmm;
 
 
diff --git a/upstream/src/aghermann/ui/mw/measurements.cc b/upstream/src/aghermann/ui/mw/measurements.cc
index f4d612c..e9a6367 100644
--- a/upstream/src/aghermann/ui/mw/measurements.cc
+++ b/upstream/src/aghermann/ui/mw/measurements.cc
@@ -101,7 +101,7 @@ draw_timeline( cairo_t *cr) const
                 tl_start_fixed_tm.tm_min = 0;
                 time_t tl_start_fixed = mktime( &tl_start_fixed_tm);
 
-                double        scale = 0.;
+                double  scale = 0.;
                 switch (_p._p.display_profile_type ) {
                 case metrics::TType::psd: scale = _p._p.profile_scale_psd; break;
                 case metrics::TType::swu: scale = _p._p.profile_scale_swu; break;
@@ -149,7 +149,7 @@ draw_timeline( cairo_t *cr) const
                                 e_pixels = e_pixel_end - e_pixel_start;
 
                         // episode start timestamp
-                        time_t        dima = E.start_time();
+                        time_t  dima = E.start_time();
                         strftime( global::buf, 79, "%F %T",
                                   localtime( &dima));
                         string ss = agh::str::sasprintf(
@@ -172,10 +172,10 @@ draw_timeline( cairo_t *cr) const
                                         cairo_pattern_create_linear(
                                                 tl_left_margin() + e_pixel_start - fuzz, 0,
                                                 tl_left_margin() + e_pixel_start + e_pixels + fuzz, 0);
-                                cairo_pattern_add_color_stop_rgba( cp, 0.,                                        1., 1., 1., 0.);
-                                cairo_pattern_add_color_stop_rgba( cp, 0. + (double)fuzz/(e_pixels + fuzz*2),        1., 1., 1., .3);
-                                cairo_pattern_add_color_stop_rgba( cp, 1. - (double)fuzz/(e_pixels + fuzz*2),        1., 1., 1., .3);
-                                cairo_pattern_add_color_stop_rgba( cp, 1.,                                        1., 1., 1., 0.);
+                                cairo_pattern_add_color_stop_rgba( cp, 0.,                                      1., 1., 1., 0.);
+                                cairo_pattern_add_color_stop_rgba( cp, 0. + (double)fuzz/(e_pixels + fuzz*2),   1., 1., 1., .3);
+                                cairo_pattern_add_color_stop_rgba( cp, 1. - (double)fuzz/(e_pixels + fuzz*2),   1., 1., 1., .3);
+                                cairo_pattern_add_color_stop_rgba( cp, 1.,                                      1., 1., 1., 0.);
 
                                 cairo_set_line_width( cr, .2);
                                 cairo_set_source( cr, cp);
@@ -231,7 +231,7 @@ draw_timeline( cairo_t *cr) const
                                         _p._p.CwB[TColour::mw_ticks /* bounds? */].set_source_rgba( cr, .7);
                                         cairo_set_line_width( cr, .5);
 
-                                        auto        dxe = tl_left_margin() + e_pixel_start,
+                                        auto    dxe = tl_left_margin() + e_pixel_start,
                                                 dye = tl_height() - 12;
                                         cairo_move_to( cr, dxe, dye - F(0.) * tl_height()/2);
                                         for ( size_t i = 0; i < M.total_pages(); ++i ) {
diff --git a/upstream/src/aghermann/ui/mw/mw.cc b/upstream/src/aghermann/ui/mw/mw.cc
index b68eaff..e491648 100644
--- a/upstream/src/aghermann/ui/mw/mw.cc
+++ b/upstream/src/aghermann/ui/mw/mw.cc
@@ -161,38 +161,38 @@ SExpDesignUI (SSessionChooser *parent,
         sort_segregate (false),
         browse_command ("thunar"),
         config_keys_s ({
-                SValidator<string>("WindowGeometry.Main",                &_geometry_placeholder),
-                SValidator<string>("Common.CurrentSession",                &_aghdd_placeholder),
-                SValidator<string>("Common.CurrentChannel",                &_aghtt_placeholder),
-                SValidator<string>("Measurements.BrowseCommand",        &browse_command),
+                SValidator<string>("WindowGeometry.Main",        &_geometry_placeholder),
+                SValidator<string>("Common.CurrentSession",      &_aghdd_placeholder),
+                SValidator<string>("Common.CurrentChannel",      &_aghtt_placeholder),
+                SValidator<string>("Measurements.BrowseCommand", &browse_command),
         }),
         config_keys_b ({
-                SValidator<bool>("Common.OnlyPlainAnnotations",                &only_plain_global_annotations),
-                SValidator<bool>("ScanTree.StrictSubjectIdCheck",        &strict_subject_id_checks),
-                SValidator<bool>("ScanTree.SuppressScanReport",                &suppress_scan_report),
+                SValidator<bool>("Common.OnlyPlainAnnotations",   &only_plain_global_annotations),
+                SValidator<bool>("ScanTree.StrictSubjectIdCheck", &strict_subject_id_checks),
+                SValidator<bool>("ScanTree.SuppressScanReport",   &suppress_scan_report),
         }),
         config_keys_d ({
-                SValidator<int>("Common.Sort.By",                        (int*)&sort_by,                                        SValidator<int>::SVFRangeIn ( 0,   3)),
-                SValidator<int>("Common.Sort.Ascending",                (int*)&sort_ascending,                                SValidator<int>::SVFRangeIn ( 0,   1)),
-                SValidator<int>("Common.Sort.Segregate",                (int*)&sort_segregate,                                SValidator<int>::SVFRangeIn ( 0,   1)),
-                SValidator<int>("Measurements.DisplayProfileType",        (int*)&display_profile_type,                        SValidator<int>::SVFRangeIn ( 0,   3)),
-                SValidator<int>("Measurements.SmoothSide",                (int*)&smooth_profile,                                SValidator<int>::SVFRangeIn ( 1,  20)),
-                SValidator<int>("Measurements.TimelineHeight",                (int*)&tl_height,                                SValidator<int>::SVFRangeIn (10, 600)),
-                SValidator<int>("Measurements.TimelinePPH",                (int*)&tl_pph,                                        SValidator<int>::SVFRangeIn (10, 600)),
-                SValidator<int>("ScoringFacility.IntersignalSpace",        (int*)&SScoringFacility::IntersignalSpace,        SValidator<int>::SVFRangeIn (10, 800)),
-                SValidator<int>("ScoringFacility.HypnogramHeight",        (int*)&SScoringFacility::HypnogramHeight,        SValidator<int>::SVFRangeIn (10, 300)),
-                SValidator<int>("ModelRun.SWASmoothOver",                (int*)&SModelrunFacility::swa_smoothover,        SValidator<int>::SVFRangeIn ( 1,   5)),
+                SValidator<int>("Common.Sort.By",                   (int*)&sort_by,                             SValidator<int>::SVFRangeIn ( 0,   3)),
+                SValidator<int>("Common.Sort.Ascending",            (int*)&sort_ascending,                      SValidator<int>::SVFRangeIn ( 0,   1)),
+                SValidator<int>("Common.Sort.Segregate",            (int*)&sort_segregate,                      SValidator<int>::SVFRangeIn ( 0,   1)),
+                SValidator<int>("Measurements.DisplayProfileType",  (int*)&display_profile_type,                SValidator<int>::SVFRangeIn ( 0,   3)),
+                SValidator<int>("Measurements.SmoothSide",          (int*)&smooth_profile,                      SValidator<int>::SVFRangeIn ( 1,  20)),
+                SValidator<int>("Measurements.TimelineHeight",      (int*)&tl_height,                           SValidator<int>::SVFRangeIn (10, 600)),
+                SValidator<int>("Measurements.TimelinePPH",         (int*)&tl_pph,                              SValidator<int>::SVFRangeIn (10, 600)),
+                SValidator<int>("ScoringFacility.IntersignalSpace", (int*)&SScoringFacility::IntersignalSpace,  SValidator<int>::SVFRangeIn (10, 800)),
+                SValidator<int>("ScoringFacility.HypnogramHeight",  (int*)&SScoringFacility::HypnogramHeight,   SValidator<int>::SVFRangeIn (10, 300)),
+                SValidator<int>("ModelRun.SWASmoothOver",           (int*)&SModelrunFacility::swa_smoothover,   SValidator<int>::SVFRangeIn ( 1,   5)),
         }),
         config_keys_g ({
-                SValidator<double>("UltradianCycleDetectionAccuracy",        &uc_accuracy_factor,                                SValidator<double>::SVFRangeIn (0.5, 20.)),
-                SValidator<double>("Measurements.ProfileScalePSD",        &profile_scale_psd,                                SValidator<double>::SVFRangeIn (0., 1e10)), // can be 0, will trigger autoscale
-                SValidator<double>("Measurements.ProfileScaleSWU",        &profile_scale_swu,                                SValidator<double>::SVFRangeIn (0., 1e10)),
-                SValidator<double>("Measurements.ProfileScaleMC",        &profile_scale_mc,                                SValidator<double>::SVFRangeIn (0., 1e10)),
-                SValidator<double>("Profiles.PSD.FreqFrom",                &active_profile_psd_freq_from,                        SValidator<double>::SVFRangeIn (0., 20.)),
-                SValidator<double>("Profiles.PSD.FreqUpto",                &active_profile_psd_freq_upto,                        SValidator<double>::SVFRangeIn (0., 20.)),
-                SValidator<double>("Profiles.SWU.F0",                        &active_profile_swu_f0,                                SValidator<double>::SVFRangeIn (0., 20.)),
-                SValidator<double>("Profiles.MC.F0",                        &active_profile_mc_f0,                                SValidator<double>::SVFRangeIn (0., 20.)),
-                SValidator<double>("Common.ScrollFactor",                &scroll_factor,                                        SValidator<double>::SVFRangeIn (1.001, 1.5)),
+                SValidator<double>("UltradianCycleDetectionAccuracy", &uc_accuracy_factor,           SValidator<double>::SVFRangeIn (0.5, 20.)),
+                SValidator<double>("Measurements.ProfileScalePSD",    &profile_scale_psd,            SValidator<double>::SVFRangeIn (0., 1e10)), // can be 0, will trigger autoscale
+                SValidator<double>("Measurements.ProfileScaleSWU",    &profile_scale_swu,            SValidator<double>::SVFRangeIn (0., 1e10)),
+                SValidator<double>("Measurements.ProfileScaleMC",     &profile_scale_mc,             SValidator<double>::SVFRangeIn (0., 1e10)),
+                SValidator<double>("Profiles.PSD.FreqFrom",           &active_profile_psd_freq_from, SValidator<double>::SVFRangeIn (0., 20.)),
+                SValidator<double>("Profiles.PSD.FreqUpto",           &active_profile_psd_freq_upto, SValidator<double>::SVFRangeIn (0., 20.)),
+                SValidator<double>("Profiles.SWU.F0",                 &active_profile_swu_f0,        SValidator<double>::SVFRangeIn (0., 20.)),
+                SValidator<double>("Profiles.MC.F0",                  &active_profile_mc_f0,         SValidator<double>::SVFRangeIn (0., 20.)),
+                SValidator<double>("Common.ScrollFactor",             &scroll_factor,                SValidator<double>::SVFRangeIn (1.001, 1.5)),
         })
 {
         nodestroy_by_cb = true;
@@ -212,8 +212,9 @@ SExpDesignUI (SSessionChooser *parent,
                         throw invalid_argument ("The last used experiment directory does not exist (or is not writable),"
                                                 " and a dummy fallback directory could not be created in your $HOME."
                                                 " Whatever the reason, this is really too bad: I can't fix it for you.");
-        } else
+        } else {
                 sure_dir = dir;
+        }
         ED = new agh::CExpDesign (sure_dir,
                                   bind( &SExpDesignUI::sb_main_progress_indicator, this,
                                         placeholders::_1, placeholders::_2, placeholders::_3,
@@ -226,22 +227,22 @@ SExpDesignUI (SSessionChooser *parent,
 
         // bind fields to widgets
         // tab 1
-        W_V1.reg( eSMPMaxThreads,                &ED->num_threads);
-        W_V1.reg( eScanTreeStrict,                &ED->strict_subject_id_checks);
+        W_V1.reg( eSMPMaxThreads,               &ED->num_threads);
+        W_V1.reg( eScanTreeStrict,              &ED->strict_subject_id_checks);
         W_V1.reg( eArtifDampenWindowType, (int*)&ED->af_dampen_window_type);
-        W_V1.reg( eArtifDampenFactor,                &ED->af_dampen_factor);
+        W_V1.reg( eArtifDampenFactor,           &ED->af_dampen_factor);
         W_V1.reg( eFFTParamsWindowType,   (int*)&ED->fft_params.welch_window_type);
         W_V1.reg( eMCParamIIRBackpolate,        &ED->mc_params.iir_backpolate);
-        W_V1.reg( eMCParamMCGain,                &ED->mc_params.mc_gain);
-        W_V1.reg( eMCParamBandWidth,                &ED->mc_params.bandwidth);
-        W_V1.reg( eMCParamFreqInc,                &ED->mc_params.freq_inc);
+        W_V1.reg( eMCParamMCGain,               &ED->mc_params.mc_gain);
+        W_V1.reg( eMCParamBandWidth,            &ED->mc_params.bandwidth);
+        W_V1.reg( eMCParamFreqInc,              &ED->mc_params.freq_inc);
         W_V1.reg( eMCParamNBins,                &ED->mc_params.n_bins);
-        W_V1.reg( eSWUParamMinUpswingDuration,        &ED->swu_params.min_upswing_duration);
+        W_V1.reg( eSWUParamMinUpswingDuration,  &ED->swu_params.min_upswing_duration);
 
-        W_V1.reg( eScanTreeSuppressReport,        &suppress_scan_report);
-        W_V1.reg( eFFTParamsPageSize,                &pagesize_item);
+        W_V1.reg( eScanTreeSuppressReport,          &suppress_scan_report);
+        W_V1.reg( eFFTParamsPageSize,               &pagesize_item);
         W_V1.reg( eFFTParamsBinSize,                &binsize_item);
-        W_V1.reg( eFFTParamsPlanType,          (int*)&ED->fft_params.plan_type);
+        W_V1.reg( eFFTParamsPlanType,         (int*)&ED->fft_params.plan_type);
         W_V1.reg( eUltradianCycleDetectionAccuracy, &uc_accuracy_factor);
         for ( size_t i = 0; i < sigfile::SPage::TScore::TScore_total; ++i )
                 W_V1.reg( eScoreCode[i], &ext_score_codes[i]);
@@ -249,40 +250,40 @@ SExpDesignUI (SSessionChooser *parent,
                 W_V1.reg( eBand[i][0], &ED->freq_bands[i][0]);
                 W_V1.reg( eBand[i][1], &ED->freq_bands[i][1]);
         }
-        W_V1.reg( eDAMsmtPPH, (int*)&tl_pph);
-        W_V1.reg( eDAMsmtTLHeight, (int*)&tl_height);
-        W_V1.reg( eDAPageHeight, (int*)&SScoringFacility::IntersignalSpace);
+        W_V1.reg( eDAMsmtPPH,         (int*)&tl_pph);
+        W_V1.reg( eDAMsmtTLHeight,    (int*)&tl_height);
+        W_V1.reg( eDAPageHeight,      (int*)&SScoringFacility::IntersignalSpace);
         W_V1.reg( eDAHypnogramHeight, (int*)&SScoringFacility::HypnogramHeight);
-        W_V1.reg( eDAEMGHeight, (int*)&SScoringFacility::EMGProfileHeight);
-        W_V1.reg( eBrowseCommand, &browse_command);
-        W_V1.reg( eScrollSpeedFactor, &scroll_factor);
+        W_V1.reg( eDAEMGHeight,       (int*)&SScoringFacility::EMGProfileHeight);
+        W_V1.reg( eBrowseCommand,           &browse_command);
+        W_V1.reg( eScrollSpeedFactor,       &scroll_factor);
 
         // set _saved, too
-        fft_params_welch_window_type_saved        = ED->fft_params.welch_window_type;
-        fft_params_plan_type_saved                = ED->fft_params.plan_type;
-        af_dampen_window_type_saved                = ED->af_dampen_window_type;
-        af_dampen_factor_saved                        = ED->af_dampen_factor;
-        mc_params_saved                                = ED->mc_params;
-        pagesize_item_saved = pagesize_item        = figure_pagesize_item();
-        binsize_item_saved = binsize_item         = figure_binsize_item();
+        fft_params_welch_window_type_saved  = ED->fft_params.welch_window_type;
+        fft_params_plan_type_saved          = ED->fft_params.plan_type;
+        af_dampen_window_type_saved         = ED->af_dampen_window_type;
+        af_dampen_factor_saved              = ED->af_dampen_factor;
+        mc_params_saved                     = ED->mc_params;
+        pagesize_item_saved = pagesize_item = figure_pagesize_item();
+        binsize_item_saved = binsize_item   = figure_binsize_item();
 
         // tab 2
-        W_V2.reg( eCtlParamAnnlNTries,                &ED->ctl_params0.siman_params.n_tries);
-        W_V2.reg( eCtlParamAnnlItersFixedT,        &ED->ctl_params0.siman_params.iters_fixed_T);
-        W_V2.reg( eCtlParamAnnlStepSize,        &ED->ctl_params0.siman_params.step_size);
-        W_V2.reg( eCtlParamAnnlBoltzmannk,        &ED->ctl_params0.siman_params.k);
+        W_V2.reg( eCtlParamAnnlNTries,           &ED->ctl_params0.siman_params.n_tries);
+        W_V2.reg( eCtlParamAnnlItersFixedT,      &ED->ctl_params0.siman_params.iters_fixed_T);
+        W_V2.reg( eCtlParamAnnlStepSize,         &ED->ctl_params0.siman_params.step_size);
+        W_V2.reg( eCtlParamAnnlBoltzmannk,       &ED->ctl_params0.siman_params.k);
         W_V2.reg( eCtlParamAnnlDampingMu,        &ED->ctl_params0.siman_params.mu_t);
-        W_V2.reg( eCtlParamAnnlTMinMantissa,        &ctl_params0_siman_params_t_min_mantissa);
-        W_V2.reg( eCtlParamAnnlTMinExponent,        &ctl_params0_siman_params_t_min_exponent);
-        W_V2.reg( eCtlParamAnnlTInitialMantissa,&ctl_params0_siman_params_t_initial_mantissa);
-        W_V2.reg( eCtlParamAnnlTInitialExponent,&ctl_params0_siman_params_t_initial_exponent);
+        W_V2.reg( eCtlParamAnnlTMinMantissa,     &ctl_params0_siman_params_t_min_mantissa);
+        W_V2.reg( eCtlParamAnnlTMinExponent,     &ctl_params0_siman_params_t_min_exponent);
+        W_V2.reg( eCtlParamAnnlTInitialMantissa, &ctl_params0_siman_params_t_initial_mantissa);
+        W_V2.reg( eCtlParamAnnlTInitialExponent, &ctl_params0_siman_params_t_initial_exponent);
 
         W_V2.reg( eCtlParamDBAmendment1,                &ED->ctl_params0.DBAmendment1);
         W_V2.reg( eCtlParamDBAmendment2,                &ED->ctl_params0.DBAmendment2);
         W_V2.reg( eCtlParamAZAmendment1,                &ED->ctl_params0.AZAmendment1);
         W_V2.reg( eCtlParamNSWAPpBeforeSimStart,  (int*)&ED->swa_laden_pages_before_SWA_0);
-        W_V2.reg( eCtlParamReqScoredPercent,                &ED->req_percent_scored);
-        W_V2.reg( eCtlParamScoreUnscoredAsWake,                &ED->score_unscored_as_wake);
+        W_V2.reg( eCtlParamReqScoredPercent,            &ED->req_percent_scored);
+        W_V2.reg( eCtlParamScoreUnscoredAsWake,         &ED->score_unscored_as_wake);
 
         // tunables are isolated so they can be reset separately
         for ( size_t t = 0; t < agh::ach::TTunable::_basic_tunables; ++t ) {
@@ -301,10 +302,10 @@ SExpDesignUI (SSessionChooser *parent,
 
         // set check and radio menuitems in global menu
         switch ( sort_by ) {
-        case TSubjectSortBy::name:                gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortName,                TRUE); break;
-        case TSubjectSortBy::age:                gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAge,                TRUE); break;
-        case TSubjectSortBy::admission_date:        gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAdmissionDate,TRUE); break;
-        case TSubjectSortBy::avg_profile_power:        gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAvgPower,        TRUE); break;
+        case TSubjectSortBy::name:              gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortName,          TRUE); break;
+        case TSubjectSortBy::age:               gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAge,           TRUE); break;
+        case TSubjectSortBy::admission_date:    gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAdmissionDate, TRUE); break;
+        case TSubjectSortBy::avg_profile_power: gtk_check_menu_item_set_active( (GtkCheckMenuItem*)iExpSubjectSortAvgPower,      TRUE); break;
         }
         gtk_check_menu_item_set_active( iExpSubjectSortAscending, sort_ascending);
         gtk_check_menu_item_set_active( iExpSubjectSortSegregate, sort_segregate);
@@ -468,14 +469,13 @@ SExpDesignUI::
 do_detect_ultradian_cycle( agh::CRecording& M)
 {
         gsl_siman_params_t siman_params;
-        // specially for ubuntu
-        siman_params.n_tries                =   (int)(5 * uc_accuracy_factor);
-        siman_params.iters_fixed_T        =   (int)(10 * uc_accuracy_factor);
-        siman_params.step_size                =    4;
-        siman_params.k                        =    1.0;
-        siman_params.t_initial          =   10 * uc_accuracy_factor;
-        siman_params.mu_t                =    1.003;
-        siman_params.t_min                =    5e-2;
+        siman_params.n_tries       = (int)(5 * uc_accuracy_factor);
+        siman_params.iters_fixed_T = (int)(10 * uc_accuracy_factor);
+        siman_params.step_size     =    4;
+        siman_params.k             =    1.0;
+        siman_params.t_initial     =   10 * uc_accuracy_factor;
+        siman_params.mu_t          =    1.003;
+        siman_params.t_min         =    5e-2;
 
         agh::beersma::SUltradianCycle
                 L = agh::beersma::ultradian_cycles(
diff --git a/upstream/src/aghermann/ui/mw/mw.hh b/upstream/src/aghermann/ui/mw/mw.hh
index daa8fd9..58baf7a 100644
--- a/upstream/src/aghermann/ui/mw/mw.hh
+++ b/upstream/src/aghermann/ui/mw/mw.hh
@@ -75,11 +75,11 @@ class SExpDesignUI
                         *using_episode;
                 bool is_episode_focused() const
                         { return using_episode != nullptr; }
-                bool        is_focused;
+                bool    is_focused;
 
                 bool get_episode_from_timeline_click( unsigned along);  // possibly sets episode_focused
 
-                time_t        tl_start,
+                time_t  tl_start,
                         admission_date;
 
                 time_t timeline_start()  const { return _p._p.timeline_start;  }
@@ -139,8 +139,8 @@ class SExpDesignUI
         subject_presentation_by_csubject( const agh::CSubject&);
 
       // flags
-        bool        draw_nremrem_cycles;
-        bool        finalize_ui:1,
+        bool    draw_nremrem_cycles;
+        bool    finalize_ui:1,
                 suppress_redraw:1,
                 nodestroy_by_cb:1;
 
@@ -158,18 +158,24 @@ class SExpDesignUI
 
         void show_empty_experiment_blurb();
         int try_download();
-        GPid dl_pid;
+        GPid    dl_pid;
 
       // collected emumerated inventory items, purely informational
         // ED strings (channels, sessions, etc)
         list<string>
-                AghDD,        AghGG,        AghEE;
+                AghDD,
+                AghGG,
+                AghEE;
         list<sigfile::SChannel>
-                AghHH,        AghTT;
+                AghHH,
+                AghTT;
         list<sigfile::SChannel>::iterator
-                _AghHi,        _AghTi;
+                _AghHi,
+                _AghTi;
         list<string>::iterator
-                _AghGi,        _AghDi,        _AghEi;
+                _AghGi,
+                _AghDi,
+                _AghEi;
         const char* AghH() const { return (_AghHi != AghHH.end()) ? _AghHi->name() : "(invalid channel)"; }
         const char* AghT() const { return (_AghTi != AghTT.end()) ? _AghTi->name() : "(invalid channel)"; }
         const char* AghG() const { return (_AghGi != AghGG.end()) ? _AghGi->c_str() : "(invalid group)"; }
@@ -216,60 +222,53 @@ class SExpDesignUI
                 display_profile_type;
         // profile-specific variable parameter(s) exposed on main toolbar
         // 1. PSD
-        double        active_profile_psd_freq_from,
+        double  active_profile_psd_freq_from,
                 active_profile_psd_freq_upto;
         // 2. SWU
-        double        active_profile_swu_f0; // has to be a frequency, no doubt
+        double  active_profile_swu_f0; // has to be a frequency, no doubt
         // 3. MC
-        double        active_profile_mc_f0;
+        double  active_profile_mc_f0;
 
         agh::SProfileParamSet make_active_profile_paramset() const;
 
       // own variables aka saved settings
-        bool        only_plain_global_annotations,
+        bool    only_plain_global_annotations,
                 strict_subject_id_checks,
                 suppress_scan_report;
 
-        double        uc_accuracy_factor;
-        int        pagesize_item,
+        double  uc_accuracy_factor;
+        int     pagesize_item,
                 binsize_item;
         size_t figure_pagesize_item(); // from corresponding ED->fft_params.* fields
         size_t figure_binsize_item();
         size_t pagesize() const
-                {
-                        return FFTPageSizeValues[pagesize_item];
-                }
+                { return FFTPageSizeValues[pagesize_item]; }
         double binsize() const
-                {
-                        return FFTBinSizeValues[binsize_item];
-                }
+                { return FFTBinSizeValues[binsize_item]; }
 
         sigfile::CHypnogram::TCustomScoreCodes
                 ext_score_codes;
 
         // scales
-        double        profile_scale_psd,
+        double  profile_scale_psd,
                 profile_scale_swu,
                 profile_scale_mc;
         double calculate_profile_scale();
         void modify_active_profile_scale( GdkScrollDirection);
         void modify_profile_scales( GdkScrollDirection);
 
-        bool        autoscale;
-        size_t        smooth_profile;
+        bool    autoscale;
+        size_t  smooth_profile;
 
         // timeline
-        time_t        timeline_start,
+        time_t  timeline_start,
                 timeline_end;
         size_t T2P( time_t t) const
-                {
-                        return difftime( t, timeline_start) / 3600. * tl_pph;
-                }
+                { return difftime( t, timeline_start) / 3600. * tl_pph; }
         time_t P2T( int p) const
-                {
-                        return p * 3600. / tl_pph + timeline_start;
-                }
-        size_t        tl_height,
+                { return p * 3600. / tl_pph + timeline_start; }
+
+        size_t  tl_height,
                 tl_width,
                 tl_left_margin,
                 tl_right_margin,
@@ -277,7 +276,7 @@ class SExpDesignUI
                 tl_pph;
 
         // geometry
-        string        _geometry_placeholder,
+        string  _geometry_placeholder,
                 _aghdd_placeholder,
                 _aghtt_placeholder;
 
@@ -287,7 +286,7 @@ class SExpDesignUI
                 avg_profile_power
         };
         TSubjectSortBy sort_by;
-        bool        sort_ascending,
+        bool    sort_ascending,
                 sort_segregate;
         void sort_subjects();
 
@@ -295,16 +294,16 @@ class SExpDesignUI
         static double scroll_factor;
 
         // _saved items
-        size_t        tl_pph_saved,
+        size_t  tl_pph_saved,
                 tl_height_saved;
-        int        pagesize_item_saved,
+        int     pagesize_item_saved,
                 binsize_item_saved;
         sigproc::TWinType
                 fft_params_welch_window_type_saved,
                 af_dampen_window_type_saved;
         metrics::psd::TFFTWPlanType
                 fft_params_plan_type_saved;
-        double        af_dampen_factor_saved;
+        double  af_dampen_factor_saved;
 
         // sigfile::SFFTParamSet
         //         fft_params_saved; // members not represented in widgets as is
@@ -315,10 +314,10 @@ class SExpDesignUI
         SUIVarCollection
                 W_V1,
                 W_V2, W_Vtunables;
-        double        ctl_params0_siman_params_t_min_mantissa;
-        double        ctl_params0_siman_params_t_initial_mantissa;
-        int        ctl_params0_siman_params_t_min_exponent;
-        int        ctl_params0_siman_params_t_initial_exponent;
+        double  ctl_params0_siman_params_t_min_mantissa;
+        double  ctl_params0_siman_params_t_initial_mantissa;
+        int     ctl_params0_siman_params_t_min_exponent;
+        int     ctl_params0_siman_params_t_initial_exponent;
 
       // status bar bits
         void sb_message( const string&) const;
@@ -330,21 +329,21 @@ class SExpDesignUI
         struct SDndIface {
                 GtkTargetEntry
                         target_list[];
-                size_t        n_targets;
+                size_t  n_targets;
         };
         SDndIface
                 dnd;
         int dnd_maybe_admit_one( const char* fname);
 
-        string        browse_command;
+        string  browse_command;
 
         SGeometry
                 geometry;
 
-        forward_list<agh::confval::SValidator<string>>        config_keys_s;
-        forward_list<agh::confval::SValidator<bool>>        config_keys_b;
-        forward_list<agh::confval::SValidator<int>>        config_keys_d;
-        forward_list<agh::confval::SValidator<double>>        config_keys_g;
+        forward_list<agh::confval::SValidator<string>> config_keys_s;
+        forward_list<agh::confval::SValidator<bool>>   config_keys_b;
+        forward_list<agh::confval::SValidator<int>>    config_keys_d;
+        forward_list<agh::confval::SValidator<double>> config_keys_g;
         int load_settings();
         int save_settings();
 
diff --git a/upstream/src/aghermann/ui/mw/simulations.cc b/upstream/src/aghermann/ui/mw/simulations.cc
index 592b5dc..67db89c 100644
--- a/upstream/src/aghermann/ui/mw/simulations.cc
+++ b/upstream/src/aghermann/ui/mw/simulations.cc
@@ -29,10 +29,11 @@ populate_2()
         for ( auto &G : ED->groups ) {
 
                 gtk_tree_store_append( mSimulations, &iter_g, NULL);
-                gtk_tree_store_set( mSimulations, &iter_g,
-                                    0, G.first.c_str(),
-                                    msimulations_visibility_switch_col, TRUE,
-                                    -1);
+                gtk_tree_store_set(
+                        mSimulations, &iter_g,
+                        0, G.first.c_str(),
+                        msimulations_visibility_switch_col, TRUE,
+                        -1);
 
                 for ( auto &J : G.second ) {
                         auto& EE = J.measurements[*_AghDi];
@@ -40,37 +41,47 @@ populate_2()
                              EE.episodes.empty() ) // subject lacking one
                                 continue;
 
-                        gtk_tree_store_append( mSimulations, &iter_j, &iter_g);
-                        gtk_tree_store_set( mSimulations, &iter_j,
-                                            0, J.id.c_str(),
-                                            msimulations_visibility_switch_col, TRUE,
-                                            -1);
+                        gtk_tree_store_append(
+                                mSimulations,
+                                &iter_j, &iter_g);
+                        gtk_tree_store_set(
+                                mSimulations, &iter_j,
+                                0, J.id.c_str(),
+                                msimulations_visibility_switch_col, TRUE,
+                                -1);
 
                       // collect previously obtained modruns
                         for ( auto &MS : EE.modrun_sets ) {
                                 const agh::SProfileParamSet& P = MS.first;
-                                gtk_tree_store_append( mSimulations, &iter_m, &iter_j);
-                                gtk_tree_store_set( mSimulations, &iter_m,
-                                                    0, P.display_name().c_str(),
-                                                    msimulations_visibility_switch_col, TRUE,
-                                                    -1);
+                                gtk_tree_store_append(
+                                        mSimulations,
+                                        &iter_m, &iter_j);
+                                gtk_tree_store_set(
+                                        mSimulations, &iter_m,
+                                        0, P.display_name().c_str(),
+                                        msimulations_visibility_switch_col, TRUE,
+                                        -1);
 
                                 for ( auto &HS : MS.second ) {
                                         const string& H = HS.first;
                                         const agh::ach::CModelRun& M = HS.second;
 
-                                        gtk_tree_store_append( mSimulations, &iter_h, &iter_m);
-                                        gtk_tree_store_set( mSimulations, &iter_h,
-                                                            0, H.c_str(),
-                                                            msimulations_visibility_switch_col, TRUE,
-                                                            -1);
+                                        gtk_tree_store_append(
+                                                mSimulations,
+                                                &iter_h, &iter_m);
+                                        gtk_tree_store_set(
+                                                mSimulations, &iter_h,
+                                                0, H.c_str(),
+                                                msimulations_visibility_switch_col, TRUE,
+                                                -1);
 
                                         // status (put CF here)
                                         snprintf_buf( "CF = %g", M.cf);
-                                        gtk_tree_store_set( mSimulations, &iter_h,
-                                                            1, global::buf,
-                                                            msimulations_modref_col, &M,
-                                                            -1);
+                                        gtk_tree_store_set(
+                                                mSimulations, &iter_h,
+                                                1, global::buf,
+                                                msimulations_modref_col, &M,
+                                                -1);
 
                                         // tunable columns
                                         for ( size_t t = 0; t < M.tx.size(); ++t ) {
@@ -78,8 +89,9 @@ populate_2()
                                                 const auto& td = agh::ach::stock[tg];
                                                 snprintf_buf( td.fmt,
                                                               M.tx[t] * td.display_scale_factor);
-                                                gtk_tree_store_set( mSimulations, &iter_h,
-                                                                    2+t, global::buf, -1);
+                                                gtk_tree_store_set(
+                                                        mSimulations, &iter_h,
+                                                        2+t, global::buf, -1);
                                         }
                                 }
                         }
@@ -89,30 +101,40 @@ populate_2()
                         if ( Mi == EE.modrun_sets.end() ||
                              Mi->second.find( AghT()) == Mi->second.end() ) {
 
-                                gtk_tree_store_append( mSimulations, &iter_m, &iter_j);
-                                gtk_tree_store_set( mSimulations, &iter_m,
-                                                    0, P_new.display_name().c_str(),
-                                                    -1);
-                                gtk_tree_store_append( mSimulations, &iter_h, &iter_m);
-                                gtk_tree_store_set( mSimulations, &iter_h,
-                                                    0, AghT(),
-                                                    -1);
+                                gtk_tree_store_append(
+                                        mSimulations,
+                                        &iter_m, &iter_j);
+                                gtk_tree_store_set(
+                                        mSimulations, &iter_m,
+                                        0, P_new.display_name().c_str(),
+                                        -1);
+
+                                gtk_tree_store_append(
+                                        mSimulations,
+                                        &iter_h, &iter_m);
+                                gtk_tree_store_set(
+                                        mSimulations, &iter_h,
+                                        0, AghT(),
+                                        -1);
 
                                 agh::ach::CModelRun *virgin;
                                 int retval =
-                                        ED->setup_modrun( J.id.c_str(), AghD(), AghT(),
-                                                          P_new,
-                                                          &virgin);
+                                        ED->setup_modrun(
+                                                J.id.c_str(), AghD(), AghT(),
+                                                P_new,
+                                                &virgin);
                                 if ( retval ) {
-                                        gtk_tree_store_set( mSimulations, &iter_h,
-                                                            1, agh::str::tokens_trimmed( agh::CProfile::explain_status( retval), ";").front().c_str(),
-                                                            msimulations_modref_col, NULL,
-                                                            -1);
+                                        gtk_tree_store_set(
+                                                mSimulations, &iter_h,
+                                                1, agh::str::tokens_trimmed( agh::CProfile::explain_status( retval), ";").front().c_str(),
+                                                msimulations_modref_col, NULL,
+                                                -1);
                                 } else {
-                                        gtk_tree_store_set( mSimulations, &iter_h,
-                                                            1, "(untried — dbl-click to run)",
-                                                            msimulations_modref_col, virgin,
-                                                            -1);
+                                        gtk_tree_store_set(
+                                                mSimulations, &iter_h,
+                                                1, "(untried — dbl-click to run)",
+                                                msimulations_modref_col, virgin,
+                                                -1);
                                 }
                         }
                 }
diff --git a/upstream/src/aghermann/ui/mw/splash.cc b/upstream/src/aghermann/ui/mw/splash.cc
index e817db2..cae4c82 100644
--- a/upstream/src/aghermann/ui/mw/splash.cc
+++ b/upstream/src/aghermann/ui/mw/splash.cc
@@ -63,9 +63,10 @@ void
 SExpDesignUI::
 show_empty_experiment_blurb()
 {
-        gtk_container_foreach( (GtkContainer*)cMeasurements,
-                               (GtkCallback) gtk_widget_destroy,
-                               NULL);
+        gtk_container_foreach(
+                (GtkContainer*)cMeasurements,
+                (GtkCallback) gtk_widget_destroy,
+                NULL);
         const char *blurb =
                 "<b><big>Empty experiment\n</big></b>\n"
                 "When you have your recordings ready as a set of .edf files,\n"
@@ -83,25 +84,30 @@ show_empty_experiment_blurb()
         GtkLabel *blurb_label = (GtkLabel*)gtk_label_new( "");
         gtk_label_set_markup( blurb_label, blurb);
 
-        gtk_box_pack_start( (GtkBox*)cMeasurements,
-                            (GtkWidget*)blurb_label,
-                            TRUE, TRUE, 10);
+        gtk_box_pack_start(
+                (GtkBox*)cMeasurements,
+                (GtkWidget*)blurb_label,
+                TRUE, TRUE, 10);
         GtkWidget *bDownload = gtk_button_new_with_label("  Get sample dataset  ");
-        g_object_set( (GObject*)bDownload,
-                      "expand", FALSE,
-                      "halign", GTK_ALIGN_CENTER,
-                      NULL);
-        g_signal_connect( bDownload, "clicked",
-                          (GCallback)bDownload_clicked_cb,
-                          this);
-        gtk_box_pack_start( (GtkBox*)cMeasurements,
-                            bDownload,
-                            FALSE, FALSE, 0);
-
-        gtk_box_pack_start( (GtkBox*)cMeasurements,
-                            (GtkWidget*)gtk_image_new_from_file(
-                                            PACKAGE_DATADIR "/" PACKAGE "/idle-bg.svg"),
-                            TRUE, FALSE, 0);
+        g_object_set(
+                (GObject*)bDownload,
+                "expand", FALSE,
+                "halign", GTK_ALIGN_CENTER,
+                NULL);
+        g_signal_connect(
+                bDownload, "clicked",
+                (GCallback)bDownload_clicked_cb,
+                this);
+        gtk_box_pack_start(
+                (GtkBox*)cMeasurements,
+                bDownload,
+                FALSE, FALSE, 0);
+
+        gtk_box_pack_start(
+                (GtkBox*)cMeasurements,
+                (GtkWidget*)gtk_image_new_from_file(
+                        PACKAGE_DATADIR "/" PACKAGE "/idle-bg.svg"),
+                TRUE, FALSE, 0);
 
         gtk_widget_show_all( (GtkWidget*)cMeasurements);
 }
@@ -113,16 +119,19 @@ int
 SExpDesignUI::
 try_download()
 {
-        gtk_container_foreach( (GtkContainer*)cMeasurements,
-                               (GtkCallback) gtk_widget_destroy,
-                               NULL);
+        gtk_container_foreach(
+                (GtkContainer*)cMeasurements,
+                (GtkCallback) gtk_widget_destroy,
+                NULL);
         auto tTerm = (VteTerminal*)vte_terminal_new();
-        g_signal_connect( tTerm, "child-exited",
-                          (GCallback)download_process_child_exited_cb,
-                           this);
-        gtk_box_pack_start( (GtkBox*)cMeasurements,
-                            (GtkWidget*)tTerm,
-                            TRUE, FALSE, 0);
+        g_signal_connect(
+                tTerm, "child-exited",
+                (GCallback)download_process_child_exited_cb,
+                this);
+        gtk_box_pack_start(
+                (GtkBox*)cMeasurements,
+                (GtkWidget*)tTerm,
+                TRUE, FALSE, 0);
         set_wMainWindow_interactive( false, true);
         // punch a hole for VteTerminal for any user ^C
         gtk_widget_set_sensitive( (GtkWidget*)cMeasurements, TRUE);
diff --git a/upstream/src/aghermann/ui/mw/widgets.hh b/upstream/src/aghermann/ui/mw/widgets.hh
index 1b88e68..803d4db 100644
--- a/upstream/src/aghermann/ui/mw/widgets.hh
+++ b/upstream/src/aghermann/ui/mw/widgets.hh
@@ -68,7 +68,7 @@ struct SExpDesignUIWidgets {
                 mannotations_ref_col = mannotations_visibility_switch_col + 1;
 
       // misc
-        gulong         wMainWindow_delete_event_cb_handler_id,
+        gulong  wMainWindow_delete_event_cb_handler_id,
                 eMsmtSession_changed_cb_handler_id,
                 eMsmtChannel_changed_cb_handler_id;
 
@@ -94,8 +94,11 @@ struct SExpDesignUIWidgets {
       // 1. Measurements
         GtkMenuItem
                 *iiMainMenu,
-                *iExpRefresh, *iExpPurgeComputed, *iExpAnnotations,
-                *iExpClose, *iExpQuit,
+                *iExpRefresh,
+                *iExpPurgeComputed,
+                *iExpAnnotations,
+                *iExpClose,
+                *iExpQuit,
                 *iExpBasicSADetectUltradianCycles,
                 *iiExpGlobalOperations,
                 *iiExpSubjectSort,
@@ -115,12 +118,12 @@ struct SExpDesignUIWidgets {
 
 
         // profile mode & parameters
-        GtkBox        *cMsmtTopArea,
+        GtkBox  *cMsmtTopArea,
                 *cMsmtMainToolbar,
                 *cMsmtProfileParamsContainer;
         GtkComboBox
                 *eMsmtProfileType;
-        GtkBox        *cMsmtProfileParamsPSD,
+        GtkBox  *cMsmtProfileParamsPSD,
                 *cMsmtProfileParamsSWU,
                 *cMsmtProfileParamsMC;
         GtkSpinButton
@@ -153,7 +156,7 @@ struct SExpDesignUIWidgets {
                 *cMeasurements;
         GtkStatusbar
                 *sbMainStatusBar;
-        guint        sbMainContextIdGeneral;
+        guint   sbMainContextIdGeneral;
         // menus
         GtkMenu
                 *iiSubjectTimeline;
@@ -220,17 +223,24 @@ struct SExpDesignUIWidgets {
 
         // settings
         GtkSpinButton
-                *eCtlParamAnnlNTries,                *eCtlParamAnnlItersFixedT,
-                *eCtlParamAnnlStepSize,                *eCtlParamAnnlBoltzmannk,
-                *eCtlParamAnnlTInitialMantissa,        *eCtlParamAnnlTInitialExponent,
-                *eCtlParamAnnlDampingMu,        *eCtlParamAnnlTMinMantissa,
-                *eCtlParamAnnlTMinExponent,        *eCtlParamNSWAPpBeforeSimStart,
+                *eCtlParamAnnlNTries,
+                *eCtlParamAnnlItersFixedT,
+                *eCtlParamAnnlStepSize,
+                *eCtlParamAnnlBoltzmannk,
+                *eCtlParamAnnlTInitialMantissa,
+                *eCtlParamAnnlTInitialExponent,
+                *eCtlParamAnnlDampingMu,
+                *eCtlParamAnnlTMinMantissa,
+                *eCtlParamAnnlTMinExponent,
+                *eCtlParamNSWAPpBeforeSimStart,
                 *eCtlParamReqScoredPercent;
         GtkCheckButton
-                *eCtlParamDBAmendment1,                *eCtlParamDBAmendment2,
+                *eCtlParamDBAmendment1,
+                *eCtlParamDBAmendment2,
                 *eCtlParamAZAmendment1;
         GtkLabel
-                *lCtlParamDBAmendment1,                *lCtlParamDBAmendment2,
+                *lCtlParamDBAmendment1,
+                *lCtlParamDBAmendment2,
                 *lCtlParamAZAmendment1;
 
         GtkRadioButton
@@ -311,17 +321,6 @@ struct SExpDesignUIWidgets {
                 *eBatchSetupRangeInc,
                 *eBatchSetupRangeSteps;
 
-        // // montage defaults
-        // GtkDialog
-        //         *wMontageDefaults;
-        // GtkEntry
-        //         *eMontageDefaultsChannelList;
-        // GtkCheckButton
-        //         *eMontageDefaultsShowPSD,
-        //         *eMontageDefaultsShowPSDSpectrum,
-        //         *eMontageDefaultsShowMC,
-        //         *eMontageDefaultsShowEMG;
-
         // global artifact detection
         GtkDialog
                 *wGlobalArtifactDetection;
@@ -345,31 +344,48 @@ struct SExpDesignUIWidgets {
 
       // colours
         enum TColour {
-                mw_night,        mw_day,
-                mw_profile,        mw_ticks,        mw_bounds,
+                mw_night,
+                mw_day,
+                mw_profile,
+                mw_ticks,
+                mw_bounds,
                 mw_labels,
 
                 sf_artifact,
                 sf_annotations,
                 sf_embedded_annotations,
                 sf_selection,
-                sf_profile_psd,        sf_profile_mc, sf_profile_swu,
-                sf_phasic_spindle, sf_phasic_Kcomplex, sf_phasic_eyeblink,
+                sf_profile_psd,
+                sf_profile_mc,
+                sf_profile_swu,
+                sf_phasic_spindle,
+                sf_phasic_Kcomplex,
+                sf_phasic_eyeblink,
                 sf_hypnogram,
                 sf_cursor,
                 sf_emg,
-                sf_labels,        sf_ticks,
+                sf_labels,
+                sf_ticks,
 
-                mf_swa,                mf_swa_sim,        mf_process_s,
+                mf_swa,
+                mf_swa_sim,
+                mf_process_s,
                 mf_paper,
                 mf_labels,
                 mf_ticks,
 
-                band_delta,        band_theta,        band_alpha,
-                band_beta,        band_gamma,
-
-                score_none,        score_nrem1,        score_nrem2,
-                score_nrem3,        score_nrem4,        score_rem,
+                band_delta,
+                band_theta,
+                band_alpha,
+                band_beta,
+                band_gamma,
+
+                score_none,
+                score_nrem1,
+                score_nrem2,
+                score_nrem3,
+                score_nrem4,
+                score_rem,
                 score_wake,
                 score_invalid,  // has no color chooser
         };
@@ -378,14 +394,10 @@ struct SExpDesignUIWidgets {
 
         static TColour
         score2colour( sigfile::SPage::TScore s)
-                {
-                        return (TColour)((unsigned)s + (unsigned)TColour::score_none);
-                }
+                { return (TColour)((unsigned)s + (unsigned)TColour::score_none); }
         static TColour
         band2colour( metrics::TBand b)
-                {
-                        return (TColour)((unsigned)b + (unsigned)TColour::band_delta);
-                }
+                { return (TColour)((unsigned)b + (unsigned)TColour::band_delta); }
 };
 
 }
diff --git a/upstream/src/aghermann/ui/sf/channel.cc b/upstream/src/aghermann/ui/sf/channel.cc
index 718ffd5..6cc501a 100644
--- a/upstream/src/aghermann/ui/sf/channel.cc
+++ b/upstream/src/aghermann/ui/sf/channel.cc
@@ -69,34 +69,34 @@ SChannel (agh::CRecording& r,
         draw_phasic_eyeblink (true),
         apply_reconstituted (false),
         config_keys_b ({
-                SValidator<bool>( string("h")+to_string(seq) + ".hidden",                        &hidden),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_zeroline",                &draw_zeroline),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_original_signal",                &draw_original_signal),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_filtered_signal",                &draw_filtered_signal),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_emg",                        &draw_emg),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_psd",                        &draw_psd),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_swu",                        &draw_swu),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_psd_bands",                &draw_psd_bands),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_spectrum",                &draw_spectrum),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_mc",                        &draw_mc),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_spindle",                &draw_phasic_spindle),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_Kcomplex",                &draw_phasic_Kcomplex),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_eyeblink",                &draw_phasic_eyeblink),
-                SValidator<bool>( string("h")+to_string(seq) + ".autoscale_profile",                &autoscale_profile),
-                SValidator<bool>( string("h")+to_string(seq) + ".resample_signal",                &resample_signal),
-                SValidator<bool>( string("h")+to_string(seq) + ".resample_power",                &resample_power),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_course",        &draw_selection_course),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_envelope",        &draw_selection_envelope),
-                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_dzcdf",                &draw_selection_dzcdf),
+                SValidator<bool>( string("h")+to_string(seq) + ".hidden",                  &hidden),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_zeroline",           &draw_zeroline),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_original_signal",    &draw_original_signal),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_filtered_signal",    &draw_filtered_signal),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_emg",                &draw_emg),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_psd",                &draw_psd),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_swu",                &draw_swu),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_psd_bands",          &draw_psd_bands),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_spectrum",           &draw_spectrum),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_mc",                 &draw_mc),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_spindle",     &draw_phasic_spindle),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_Kcomplex",    &draw_phasic_Kcomplex),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_phasic_eyeblink",    &draw_phasic_eyeblink),
+                SValidator<bool>( string("h")+to_string(seq) + ".autoscale_profile",       &autoscale_profile),
+                SValidator<bool>( string("h")+to_string(seq) + ".resample_signal",         &resample_signal),
+                SValidator<bool>( string("h")+to_string(seq) + ".resample_power",          &resample_power),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_course",   &draw_selection_course),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_envelope", &draw_selection_envelope),
+                SValidator<bool>( string("h")+to_string(seq) + ".draw_selection_dzcdf",    &draw_selection_dzcdf),
         }),
         config_keys_g ({
-                SValidator<double>( string("h")+to_string(seq) + ".zeroy",                        &zeroy,                        SValidator<double>::SVFRangeIn (-100., 4000.)),
-                SValidator<double>( string("h")+to_string(seq) + ".selection_start_time",        &selection_start_time),
-                SValidator<double>( string("h")+to_string(seq) + ".selection_end_time",                &selection_end_time),
-                SValidator<double>( string("h")+to_string(seq) + ".signal_display_scale",        &signal_display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
-                SValidator<double>( string("h")+to_string(seq) + ".psd_display_scale",                &psd.display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
-                SValidator<double>( string("h")+to_string(seq) + ".swu_display_scale",                &swu.display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
-                SValidator<double>( string("h")+to_string(seq) + ".mc_display_scale",                &mc.display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
+                SValidator<double>( string("h")+to_string(seq) + ".zeroy",                 &zeroy,                    SValidator<double>::SVFRangeIn (-100., 4000.)),
+                SValidator<double>( string("h")+to_string(seq) + ".selection_start_time",  &selection_start_time),
+                SValidator<double>( string("h")+to_string(seq) + ".selection_end_time",    &selection_end_time),
+                SValidator<double>( string("h")+to_string(seq) + ".signal_display_scale",  &signal_display_scale,     SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
+                SValidator<double>( string("h")+to_string(seq) + ".psd_display_scale",     &psd.display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
+                SValidator<double>( string("h")+to_string(seq) + ".swu_display_scale",     &swu.display_scale,        SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
+                SValidator<double>( string("h")+to_string(seq) + ".mc_display_scale",      &mc.display_scale,         SValidator<double>::SVFRangeIn (DBL_MIN, INFINITY)),
         }),
         marquee_start (0.),
         marquee_end (0.),
@@ -202,7 +202,7 @@ in_annotations( const double time) const
                              A.span.a, A.span.z,
                              time, time) )
                         ret.push_back( &A);
-        return ret;
+        return move(ret);
 }
 
 
@@ -409,8 +409,8 @@ pair<double, double>
 SScoringFacility::SChannel::
 mark_flat_regions_as_artifacts( const double minsize, const double pad)
 {
-        double        total_before = artifacts.total();
-        size_t        marked_here = 0;
+        double  total_before = artifacts.total();
+        size_t  marked_here = 0;
         auto d =
                 sigproc::derivative( signal_original);
         size_t        last_j = 0;
@@ -509,7 +509,8 @@ update_channel_menu_items( const double x)
 {
         _p.suppress_redraw = true;
 
-        bool        need_filtered = (have_low_pass() or have_high_pass() or have_notch_filter())
+        bool    need_filtered =
+                (have_low_pass() or have_high_pass() or have_notch_filter())
                 or (not artifacts().empty());
 
         gtk_widget_set_visible( (GtkWidget*)_p.iSFPageShowOriginal, need_filtered);
@@ -533,7 +534,7 @@ update_channel_menu_items( const double x)
         gtk_check_menu_item_set_active( _p.iSFPageSelectionDrawEnvelope, draw_selection_envelope);
         gtk_check_menu_item_set_active( _p.iSFPageSelectionDrawDzxdf,    draw_selection_dzcdf);
 
-        bool        is_eeg = (schannel().type() == sigfile::SChannel::TType::eeg),
+        bool    is_eeg = (schannel().type() == sigfile::SChannel::TType::eeg),
                 is_emg = (schannel().type() == sigfile::SChannel::TType::emg),
                 have_profile = is_eeg or is_emg;
         gtk_widget_set_visible( (GtkWidget*)_p.iSFPageProfilesSubmenuSeparator, have_profile);
diff --git a/upstream/src/aghermann/ui/sf/construct.cc b/upstream/src/aghermann/ui/sf/construct.cc
index 7001695..d6cdb0b 100644
--- a/upstream/src/aghermann/ui/sf/construct.cc
+++ b/upstream/src/aghermann/ui/sf/construct.cc
@@ -30,44 +30,42 @@ SScoringFacilityWidgets ()
         //  we do it all mostly ourself, except for some delete-event binding to gtk_true()
 
         // general & montage page navigation
-        if ( !AGH_GBGETOBJ (GtkWindow,                wSF) ||
-             !AGH_GBGETOBJ (GtkLabel,                lSFHint) ||
-             !AGH_GBGETOBJ (GtkListStore,        mSFScoringPageSize) ||
-             !AGH_GBGETOBJ (GtkComboBox,        eSFPageSize) ||
-             !AGH_GBGETOBJ (GtkSpinButton,        eSFCurrentPage) ||
-             !AGH_GBGETOBJ (GtkAdjustment,        jSFPageNo) ||
-             !AGH_GBGETOBJ (GtkLabel,                lSFTotalPages) ||
-             !AGH_GBGETOBJ (GtkButton,                eSFCurrentPos) ||
-             !AGH_GBGETOBJ (GtkExpander,        cSFHypnogram) ||
-             !AGH_GBGETOBJ (GtkHBox,                cSFControlBar) ||
-             !AGH_GBGETOBJ (GtkBox,                cSFScoringModeContainer) ||
-             !AGH_GBGETOBJ (GtkBox,                cSFICAModeContainer) )
-                throw runtime_error ("Failed to construct SF widgets (0)");
-
-        if ( !AGH_GBGETOBJ (GtkButton,                bSFBack) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFForward) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFGotoPrevUnscored) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFGotoNextUnscored) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFGotoPrevArtifact) ||
-             !AGH_GBGETOBJ (GtkButton,                bSFGotoNextArtifact) ||
-             !AGH_GBGETOBJ (GtkToggleButton,        bSFDrawCrosshair) )
-                throw runtime_error ("Failed to construct SF widgets (0)");
-
-        if ( !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageMenu) ||
-             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFMontageDrawOriginalSignal) ||
-             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFMontageDrawProcessedSignal) ||
-             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFMontageDrawZeroLine) ||
-             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFMontageDrawFast) ||
+        if ( !AGH_GBGETOBJ (GtkWindow,         wSF) ||
+             !AGH_GBGETOBJ (GtkLabel,          lSFHint) ||
+             !AGH_GBGETOBJ (GtkListStore,      mSFScoringPageSize) ||
+             !AGH_GBGETOBJ (GtkComboBox,       eSFPageSize) ||
+             !AGH_GBGETOBJ (GtkSpinButton,     eSFCurrentPage) ||
+             !AGH_GBGETOBJ (GtkAdjustment,     jSFPageNo) ||
+             !AGH_GBGETOBJ (GtkLabel,          lSFTotalPages) ||
+             !AGH_GBGETOBJ (GtkButton,         eSFCurrentPos) ||
+             !AGH_GBGETOBJ (GtkExpander,       cSFHypnogram) ||
+             !AGH_GBGETOBJ (GtkHBox,           cSFControlBar) ||
+             !AGH_GBGETOBJ (GtkBox,            cSFScoringModeContainer) ||
+             !AGH_GBGETOBJ (GtkBox,            cSFICAModeContainer) ||
+
+             !AGH_GBGETOBJ (GtkButton,         bSFBack) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFForward) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFGotoPrevUnscored) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFGotoNextUnscored) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFGotoPrevArtifact) ||
+             !AGH_GBGETOBJ (GtkButton,         bSFGotoNextArtifact) ||
+             !AGH_GBGETOBJ (GtkToggleButton,   bSFDrawCrosshair) ||
+
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageMenu) ||
+             !AGH_GBGETOBJ (GtkCheckMenuItem,  iSFMontageDrawOriginalSignal) ||
+             !AGH_GBGETOBJ (GtkCheckMenuItem,  iSFMontageDrawProcessedSignal) ||
+             !AGH_GBGETOBJ (GtkCheckMenuItem,  iSFMontageDrawZeroLine) ||
+             !AGH_GBGETOBJ (GtkCheckMenuItem,  iSFMontageDrawFast) ||
 //             !AGH_GBGETOBJ (GtkCheckMenuItem,        iSFMontageDraw) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontagePatterns) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageICA) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontagePhaseDiff) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageScoreAssist) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageScoreImport) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageScoreExport) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageScoreClear) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageClose) ||
-             !AGH_GBGETOBJ (GtkMenuItem,        iSFMontageCloseAndNext) )
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontagePatterns) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageICA) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontagePhaseDiff) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageScoreAssist) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageScoreImport) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageScoreExport) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageScoreClear) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageClose) ||
+             !AGH_GBGETOBJ (GtkMenuItem,       iSFMontageCloseAndNext) )
                 throw runtime_error ("Failed to construct SF widgets (1)");
 
         G_CONNECT_1 (iSFMontageMenu, activate);
@@ -107,18 +105,18 @@ SScoringFacilityWidgets ()
         G_CONNECT_1 (iSFMontageClose, activate);
         G_CONNECT_1 (iSFMontageCloseAndNext, activate);
 
-        if ( !(AGH_GBGETOBJ (GtkButton,                bSFScoreClear)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreNREM1)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreNREM2)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreNREM3)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreNREM4)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreREM))   ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFScoreWake))  ||
-             !(AGH_GBGETOBJ (GtkTable,                cSFSleepStageStats)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                lSFPercentScored)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                lScoreStatsNREMPercent)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                lScoreStatsREMPercent)) ||
-             !(AGH_GBGETOBJ (GtkLabel,                lScoreStatsWakePercent)) )
+        if ( !(AGH_GBGETOBJ (GtkButton,  bSFScoreClear)) ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreNREM1)) ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreNREM2)) ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreNREM3)) ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreNREM4)) ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreREM))   ||
+             !(AGH_GBGETOBJ (GtkButton,  bSFScoreWake))  ||
+             !(AGH_GBGETOBJ (GtkTable,   cSFSleepStageStats)) ||
+             !(AGH_GBGETOBJ (GtkLabel,   lSFPercentScored)) ||
+             !(AGH_GBGETOBJ (GtkLabel,   lScoreStatsNREMPercent)) ||
+             !(AGH_GBGETOBJ (GtkLabel,   lScoreStatsREMPercent)) ||
+             !(AGH_GBGETOBJ (GtkLabel,   lScoreStatsWakePercent)) )
                 throw runtime_error ("Failed to construct SF widgets (2)");
 
         G_CONNECT_1 (bSFScoreClear, clicked);
@@ -129,9 +127,9 @@ SScoringFacilityWidgets ()
         G_CONNECT_1 (bSFScoreREM, clicked);
         G_CONNECT_1 (bSFScoreWake, clicked);
 
-        if ( !(AGH_GBGETOBJ (GtkDrawingArea,        daSFMontage)) ||
-             !(AGH_GBGETOBJ (GtkDrawingArea,        daSFHypnogram)) ||
-             !(AGH_GBGETOBJ (GtkStatusbar,        sbSF)) )
+        if ( !(AGH_GBGETOBJ (GtkDrawingArea, daSFMontage)) ||
+             !(AGH_GBGETOBJ (GtkDrawingArea, daSFHypnogram)) ||
+             !(AGH_GBGETOBJ (GtkStatusbar,   sbSF)) )
                 throw runtime_error ("Failed to construct SF widgets (3)");
 
         sbSFContextIdGeneral = gtk_statusbar_get_context_id( sbSF, "General context");
@@ -150,33 +148,33 @@ SScoringFacilityWidgets ()
         G_CONNECT_3 (daSFHypnogram, motion, notify, event);
 
         // ICA
-        if ( !(AGH_GBGETOBJ (GtkComboBox,        eSFICARemixMode)) ||
-             !(AGH_GBGETOBJ (GtkComboBox,        eSFICANonlinearity)) ||
-             !(AGH_GBGETOBJ (GtkComboBox,        eSFICAApproach)) ||
-             !(AGH_GBGETOBJ (GtkListStore,        mSFICARemixMode)) ||
-             !(AGH_GBGETOBJ (GtkListStore,        mSFICANonlinearity)) ||
-             !(AGH_GBGETOBJ (GtkListStore,        mSFICAApproach)) ||
-             !(AGH_GBGETOBJ (GtkCheckButton,        eSFICAFineTune)) ||
-             !(AGH_GBGETOBJ (GtkCheckButton,        eSFICAStabilizationMode)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAa1)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAa2)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAmu)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAepsilon)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICANofICs)) ||
-             !(AGH_GBGETOBJ (GtkAdjustment,        jSFICANofICs)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAEigVecFirst)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAEigVecLast)) ||
-             !(AGH_GBGETOBJ (GtkAdjustment,        jSFICAEigVecFirst)) ||
-             !(AGH_GBGETOBJ (GtkAdjustment,        jSFICAEigVecLast)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICASampleSizePercent)) ||
-             !(AGH_GBGETOBJ (GtkSpinButton,        eSFICAMaxIterations)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFICATry)) ||
-             !(AGH_GBGETOBJ (GtkToggleButton,        bSFICAPreview)) ||
-             !(AGH_GBGETOBJ (GtkToggleButton,        bSFICAShowMatrix)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFICAApply)) ||
-             !(AGH_GBGETOBJ (GtkButton,                bSFICACancel)) ||
-             !(AGH_GBGETOBJ (GtkDialog,                wSFICAMatrix)) ||
-             !(AGH_GBGETOBJ (GtkTextView,        tSFICAMatrix)) )
+        if ( !(AGH_GBGETOBJ (GtkComboBox,     eSFICARemixMode)) ||
+             !(AGH_GBGETOBJ (GtkComboBox,     eSFICANonlinearity)) ||
+             !(AGH_GBGETOBJ (GtkComboBox,     eSFICAApproach)) ||
+             !(AGH_GBGETOBJ (GtkListStore,    mSFICARemixMode)) ||
+             !(AGH_GBGETOBJ (GtkListStore,    mSFICANonlinearity)) ||
+             !(AGH_GBGETOBJ (GtkListStore,    mSFICAApproach)) ||
+             !(AGH_GBGETOBJ (GtkCheckButton,  eSFICAFineTune)) ||
+             !(AGH_GBGETOBJ (GtkCheckButton,  eSFICAStabilizationMode)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAa1)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAa2)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAmu)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAepsilon)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICANofICs)) ||
+             !(AGH_GBGETOBJ (GtkAdjustment,   jSFICANofICs)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAEigVecFirst)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAEigVecLast)) ||
+             !(AGH_GBGETOBJ (GtkAdjustment,   jSFICAEigVecFirst)) ||
+             !(AGH_GBGETOBJ (GtkAdjustment,   jSFICAEigVecLast)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICASampleSizePercent)) ||
+             !(AGH_GBGETOBJ (GtkSpinButton,   eSFICAMaxIterations)) ||
+             !(AGH_GBGETOBJ (GtkButton,       bSFICATry)) ||
+             !(AGH_GBGETOBJ (GtkToggleButton, bSFICAPreview)) ||
+             !(AGH_GBGETOBJ (GtkToggleButton, bSFICAShowMatrix)) ||
+             !(AGH_GBGETOBJ (GtkButton,       bSFICAApply)) ||
+             !(AGH_GBGETOBJ (GtkButton,       bSFICACancel)) ||
+             !(AGH_GBGETOBJ (GtkDialog,       wSFICAMatrix)) ||
+             !(AGH_GBGETOBJ (GtkTextView,     tSFICAMatrix)) )
                 throw runtime_error ("Failed to construct SF widgets (4)");
 
         gtk_combo_box_set_model_properly( eSFICANonlinearity, mSFICANonlinearity);
@@ -214,69 +212,69 @@ SScoringFacilityWidgets ()
         G_CONNECT_1 (bSFICACancel, clicked);
 
         // ------- menus
-        if ( !(AGH_GBGETOBJ (GtkLabel,                 lSFOverChannel)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPage)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFICAPage)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPageSelection)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPageAnnotation)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPageProfiles)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPagePhasicEvents)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPageHidden)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFPower)) ||
-             !(AGH_GBGETOBJ (GtkMenu,                 iiSFScore)) ||
-
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageShowOriginal)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageShowProcessed)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageUseResample)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageDrawZeroline)) ||
-             !(AGH_GBGETOBJ (GtkSeparatorMenuItem,        iSFPageProfilesSubmenuSeparator)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawPSDProfile)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawPSDSpectrum)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawSWUProfile)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawMCProfile)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawEMGProfile)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawPhasicSpindles)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawPhasicKComplexes)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                 iSFPageDrawPhasicEyeBlinks)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageFilter)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSaveChannelAsSVG)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSaveMontageAsSVG)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageExportSignal)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageUseThisScale)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageArtifactsDetect)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageArtifactsClear)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageArtifactsMarkFlat)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageHide)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                 iSFPageHidden)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                 iSFPageSpaceEvenly)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                 iSFPageLocateSelection)) ||
-
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationSeparator)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationDelete)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationEdit)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationClearAll)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationGotoNext)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageAnnotationGotoPrev)) ||
-
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSelectionMarkArtifact)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSelectionClearArtifact)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSelectionFindPattern)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPageSelectionAnnotate)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageSelectionDrawCourse)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageSelectionDrawEnvelope)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPageSelectionDrawDzxdf)) ||
-
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPowerExportRange)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPowerExportAll)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPowerSmooth)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPowerDrawBands)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFPowerUseThisScale)) ||
-             !(AGH_GBGETOBJ (GtkCheckMenuItem,                iSFPowerAutoscale)) ||
-
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFScoreAssist)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFScoreImport)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFScoreExport)) ||
-             !(AGH_GBGETOBJ (GtkMenuItem,                iSFScoreClear)) )
+        if ( !(AGH_GBGETOBJ (GtkLabel,             lSFOverChannel)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPage)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFICAPage)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPageSelection)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPageAnnotation)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPageProfiles)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPagePhasicEvents)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPageHidden)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFPower)) ||
+             !(AGH_GBGETOBJ (GtkMenu,              iiSFScore)) ||
+
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageShowOriginal)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageShowProcessed)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageUseResample)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawZeroline)) ||
+             !(AGH_GBGETOBJ (GtkSeparatorMenuItem, iSFPageProfilesSubmenuSeparator)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawPSDProfile)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawPSDSpectrum)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawSWUProfile)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawMCProfile)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawEMGProfile)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawPhasicSpindles)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawPhasicKComplexes)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageDrawPhasicEyeBlinks)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageFilter)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSaveChannelAsSVG)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSaveMontageAsSVG)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageExportSignal)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageUseThisScale)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageArtifactsDetect)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageArtifactsClear)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageArtifactsMarkFlat)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageHide)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageHidden)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSpaceEvenly)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageLocateSelection)) ||
+
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationSeparator)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationDelete)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationEdit)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationClearAll)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationGotoNext)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageAnnotationGotoPrev)) ||
+
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSelectionMarkArtifact)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSelectionClearArtifact)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSelectionFindPattern)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPageSelectionAnnotate)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageSelectionDrawCourse)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageSelectionDrawEnvelope)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPageSelectionDrawDzxdf)) ||
+
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPowerExportRange)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPowerExportAll)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPowerSmooth)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPowerDrawBands)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFPowerUseThisScale)) ||
+             !(AGH_GBGETOBJ (GtkCheckMenuItem,     iSFPowerAutoscale)) ||
+
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFScoreAssist)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFScoreImport)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFScoreExport)) ||
+             !(AGH_GBGETOBJ (GtkMenuItem,          iSFScoreClear)) )
                 throw runtime_error ("Failed to construct SF widgets (5)");
 
         gtk_menu_item_set_submenu( iSFPageHidden, (GtkWidget*)iiSFPageHidden);
@@ -337,14 +335,14 @@ SScoringFacilityWidgets ()
 
       // petty dialogs
         // annotations
-        if ( !AGH_GBGETOBJ (GtkDialog,                        wSFAnnotationLabel) ||
-             !AGH_GBGETOBJ (GtkEntry,                        eSFAnnotationLabel) ||
-             !AGH_GBGETOBJ (GtkRadioButton,                eSFAnnotationTypePlain) ||
-             !AGH_GBGETOBJ (GtkRadioButton,                eSFAnnotationTypeSpindle) ||
-             !AGH_GBGETOBJ (GtkRadioButton,                eSFAnnotationTypeKComplex) ||
-             !AGH_GBGETOBJ (GtkRadioButton,                eSFAnnotationTypeBlink) ||
-             !AGH_GBGETOBJ (GtkDialog,                        wSFAnnotationSelector) ||
-             !AGH_GBGETOBJ (GtkComboBox,                eSFAnnotationSelectorWhich) )
+        if ( !AGH_GBGETOBJ (GtkDialog,      wSFAnnotationLabel) ||
+             !AGH_GBGETOBJ (GtkEntry,       eSFAnnotationLabel) ||
+             !AGH_GBGETOBJ (GtkRadioButton, eSFAnnotationTypePlain) ||
+             !AGH_GBGETOBJ (GtkRadioButton, eSFAnnotationTypeSpindle) ||
+             !AGH_GBGETOBJ (GtkRadioButton, eSFAnnotationTypeKComplex) ||
+             !AGH_GBGETOBJ (GtkRadioButton, eSFAnnotationTypeBlink) ||
+             !AGH_GBGETOBJ (GtkDialog,      wSFAnnotationSelector) ||
+             !AGH_GBGETOBJ (GtkComboBox,    eSFAnnotationSelectorWhich) )
                 throw runtime_error ("Failed to construct SF widgets (6)");
 
         mSFAnnotationsAtCursor = gtk_list_store_new(1, G_TYPE_STRING);
diff --git a/upstream/src/aghermann/ui/sf/ica.cc b/upstream/src/aghermann/ui/sf/ica.cc
index f0344e7..0ddbad3 100644
--- a/upstream/src/aghermann/ui/sf/ica.cc
+++ b/upstream/src/aghermann/ui/sf/ica.cc
@@ -55,10 +55,10 @@ setup_ica()
         }
 
         vector<TICASetupFun> src;
-        size_t        checking_sr = 0,
+        size_t  checking_sr = 0,
                 checking_total_samples = (size_t)-1;
         for ( auto &H : channels ) {
-                size_t        this_sr = H.crecording.F().samplerate(H.h()),
+                size_t  this_sr = H.crecording.F().samplerate(H.h()),
                         this_ts = H.crecording.total_samples();
                 if ( checking_sr and this_sr != checking_sr ) {
                         pop_ok_message(
@@ -88,17 +88,17 @@ setup_ica()
         gtk_spin_button_set_value( eSFICAEigVecFirst, 1);
         gtk_spin_button_set_value( eSFICAEigVecLast, channels.size());
 
-        g_signal_emit_by_name( eSFICAApproach,                "changed");
+        g_signal_emit_by_name( eSFICAApproach,            "changed");
         g_signal_emit_by_name( eSFICANonlinearity,        "changed");
-        g_signal_emit_by_name( eSFICAFineTune,                "toggled");
-        g_signal_emit_by_name( eSFICAStabilizationMode,        "toggled");
-        g_signal_emit_by_name( eSFICAa1,                "value-changed");
-        g_signal_emit_by_name( eSFICAa2,                "value-changed");
-        g_signal_emit_by_name( eSFICAmu,                "value-changed");
-        g_signal_emit_by_name( eSFICAepsilon,                "value-changed");
-        g_signal_emit_by_name( eSFICASampleSizePercent,        "value-changed");
-        g_signal_emit_by_name( eSFICAMaxIterations,        "value-changed");
-        g_signal_emit_by_name( eSFICARemixMode,                "changed");
+        g_signal_emit_by_name( eSFICAFineTune,            "toggled");
+        g_signal_emit_by_name( eSFICAStabilizationMode,   "toggled");
+        g_signal_emit_by_name( eSFICAa1,                  "value-changed");
+        g_signal_emit_by_name( eSFICAa2,                  "value-changed");
+        g_signal_emit_by_name( eSFICAmu,                  "value-changed");
+        g_signal_emit_by_name( eSFICAepsilon,             "value-changed");
+        g_signal_emit_by_name( eSFICASampleSizePercent,   "value-changed");
+        g_signal_emit_by_name( eSFICAMaxIterations,       "value-changed");
+        g_signal_emit_by_name( eSFICARemixMode,           "changed");
 
         // populate mSFICAPage
         gtk_container_foreach( (GtkContainer*)iiSFICAPage, (GtkCallback)gtk_widget_destroy, NULL);
diff --git a/upstream/src/aghermann/ui/sf/mainmenu_cb.cc b/upstream/src/aghermann/ui/sf/mainmenu_cb.cc
index e948083..4acd9cf 100644
--- a/upstream/src/aghermann/ui/sf/mainmenu_cb.cc
+++ b/upstream/src/aghermann/ui/sf/mainmenu_cb.cc
@@ -257,11 +257,12 @@ namespace {
 #define EVENT_X 30
 
 size_t position_for_channel = -1;
-void channel_menu_position( GtkMenu*,
-                            gint *x,
-                            gint *y,
-                            gboolean*, //push_in,
-                            const gpointer userdata)
+void channel_menu_position(
+        GtkMenu*,
+        gint *x,
+        gint *y,
+        gboolean*, //push_in,
+        const gpointer userdata)
 {
         auto& SF = *(SScoringFacility*)userdata;
         int mwx, mwy, rwx, rwy;
diff --git a/upstream/src/aghermann/ui/sf/montage-overlays.cc b/upstream/src/aghermann/ui/sf/montage-overlays.cc
index efa1519..3572dca 100644
--- a/upstream/src/aghermann/ui/sf/montage-overlays.cc
+++ b/upstream/src/aghermann/ui/sf/montage-overlays.cc
@@ -28,9 +28,9 @@ draw_overlays( cairo_t* cr,
         if ( _p.mode != TMode::scoring )
                 return;
 
-        float        pbot = zeroy + _p.interchannel_gap / 2.2,
+        float   pbot = zeroy + _p.interchannel_gap / 2.2,
                 ptop = zeroy - _p.interchannel_gap / 2.2;
-        bool        overlay = false;
+        bool    overlay = false;
 
        // PSD profile
         if ( draw_psd and schannel().type() == sigfile::SChannel::TType::eeg ) {
@@ -113,11 +113,11 @@ draw_overlays( cairo_t* cr,
 
                 if ( draw_spectrum and _p.pagesize_is_right()
                      and _p.cur_page() < crecording.full_pages() ) {
-                        guint        gx = 120,
+                        guint   gx = 120,
                                 gy = ptop + 25,
                                 gh = min( 60.f, pbot - ptop - 5),
                                 gw  = 80;
-                        size_t        m;
+                        size_t  m;
 
                         cairo_set_source_rgba( cr, 1., 1., 1., .8);
                         cairo_rectangle( cr, gx-15, gy-5, gw+15+5, gh+5+5);
@@ -318,8 +318,8 @@ draw_overlays( cairo_t* cr,
                 _p._draw_hour_ticks( cr, zeroy, pbot);
 
       // crosshair (is drawn once in SScoringFacility::draw_montage), voltage at
-        if ( _p.draw_crosshair and
-             _p.crosshair_at_time >= 0. and
+        if ( _p.draw_crosshair &&
+             _p.crosshair_at_time >= 0. &&
              _p.crosshair_at_time * samplerate() < n_samples() ) {
                 cairo_set_font_size( cr, 10);
                 cairo_select_font_face( cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
diff --git a/upstream/src/aghermann/ui/sf/montage.cc b/upstream/src/aghermann/ui/sf/montage.cc
index bc452fc..072d1ef 100644
--- a/upstream/src/aghermann/ui/sf/montage.cc
+++ b/upstream/src/aghermann/ui/sf/montage.cc
@@ -34,9 +34,9 @@ SScoringFacility::SChannel::
 draw_signal( const valarray<TFloat>& signal,
              size_t width, int vdisp, cairo_t *cr) const
 {
-        ssize_t        start  = _p.cur_vpage_start()  * samplerate(), // signed please
-                end    = _p.cur_vpage_end()    * samplerate(),
-                run    = end - start,
+        ssize_t start    = _p.cur_vpage_start()  * samplerate(), // signed please
+                end      = _p.cur_vpage_end()    * samplerate(),
+                run      = end - start,
                 half_pad = run * _p.skirting_run_per1;
         cairo_draw_signal(
                 cr, signal,
@@ -113,7 +113,7 @@ find_free_space()
                         thomas.push_back( {ch});
         sort( thomas.begin(), thomas.end());
 
-        int        mean_gap,
+        int     mean_gap,
                 widest_gap = 0,
                 widest_after = 0;
         int sum = 0;
@@ -216,7 +216,7 @@ draw_page( cairo_t *cr,
            const int wd, const float y0,
            bool draw_marquee) const
 {
-        int        ptop = y0 - _p.interchannel_gap/2,
+        int     ptop = y0 - _p.interchannel_gap/2,
                 pbot = ptop + _p.interchannel_gap;
 
       // zeroline
@@ -235,7 +235,7 @@ draw_page( cairo_t *cr,
                      selection_start_time, selection_end_time,
                      _p.cur_xvpage_start(), _p.cur_xvpage_end()) ) {
 
-                double        pre = _p.skirting_run_per1 * _p.vpagesize(),
+                double  pre = _p.skirting_run_per1 * _p.vpagesize(),
                         ma = (selection_start_time - _p.cur_xvpage_start()) / _p.xvpagesize() * wd,
                         me = (selection_end_time   - _p.cur_xvpage_start()) / _p.xvpagesize() * wd;
                 {
@@ -446,9 +446,9 @@ draw_page( cairo_t *cr,
                 }
         }
 
-        double        half_pad = _p.pagesize() * _p.skirting_run_per1;
+        double  half_pad = _p.pagesize() * _p.skirting_run_per1;
 
-        double        cvpa = _p.cur_xvpage_start(),
+        double  cvpa = _p.cur_xvpage_start(),
                 cvpe = _p.cur_xvpage_end(),
                 evpz = cvpe - cvpa;
       // artifacts (changed bg)
@@ -485,8 +485,8 @@ draw_page( cairo_t *cr,
       // annotations
         if ( _p.mode == SScoringFacility::TMode::scoring
              and not annotations.empty() ) {
-                double last_label_end = 0;
-                int overlap_count = 0;
+                double  last_label_end = 0;
+                int     overlap_count = 0;
 
                 cairo_select_font_face( cr, "serif", CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
                 cairo_set_font_size( cr, 11);
@@ -494,12 +494,12 @@ draw_page( cairo_t *cr,
 
                 for ( auto &A : annotations ) {
                         if ( agh::alg::overlap( A.span.a, A.span.z, cvpa, cvpe) ) {
-                                double        aa = A.span.a - cvpa,
+                                double  aa = A.span.a - cvpa,
                                         ae = A.span.z - cvpa;
                                 agh::alg::ensure_within( aa, -half_pad, -half_pad + evpz);
                                 agh::alg::ensure_within( ae, -half_pad, -half_pad + evpz);
 
-                                auto        wa = fmod(aa, evpz) / evpz * wd,
+                                auto    wa = fmod(aa, evpz) / evpz * wd,
                                         ww = (ae - aa) / evpz * wd;
 
                                 if ( A.type == sigfile::SAnnotation::TType::plain ) {
@@ -526,8 +526,8 @@ draw_page( cairo_t *cr,
                                         cairo_show_text( cr, A.label.c_str());
                                         cairo_stroke( cr);
 
-                                } else if ( A.type == sigfile::SAnnotation::TType::phasic_event_spindle
-                                            and draw_phasic_spindle ) {
+                                } else if ( A.type == sigfile::SAnnotation::TType::phasic_event_spindle &&
+                                            draw_phasic_spindle ) {
                                         cairo_pattern_t *cp = cairo_pattern_create_linear( wa, 0., wa + ww, 0.);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_spindle].pattern_add_color_stop_rgba( cp, 0., 0.);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_spindle].pattern_add_color_stop_rgba( cp, .5, 0.3);
@@ -539,8 +539,8 @@ draw_page( cairo_t *cr,
                                         cairo_stroke( cr);
                                         cairo_pattern_destroy( cp);
 
-                                } else if ( A.type == sigfile::SAnnotation::TType::phasic_event_K_complex
-                                            and draw_phasic_Kcomplex ) {
+                                } else if ( A.type == sigfile::SAnnotation::TType::phasic_event_K_complex &&
+                                            draw_phasic_Kcomplex ) {
                                         cairo_pattern_t *cp = cairo_pattern_create_linear( 0., ptop, 0., pbot);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_Kcomplex].pattern_add_color_stop_rgba( cp, 0., 0.);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_Kcomplex].pattern_add_color_stop_rgba( cp, .5, 0.4);
@@ -552,8 +552,8 @@ draw_page( cairo_t *cr,
                                         cairo_stroke( cr);
                                         cairo_pattern_destroy( cp);
 
-                                } else if ( A.type == sigfile::SAnnotation::TType::eyeblink
-                                            and draw_phasic_eyeblink ) {
+                                } else if ( A.type == sigfile::SAnnotation::TType::eyeblink &&
+                                            draw_phasic_eyeblink ) {
                                         cairo_pattern_t *cp = cairo_pattern_create_linear( 0., ptop, 0., pbot);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_eyeblink].pattern_add_color_stop_rgba( cp, 0., 0.);
                                         _p._p.CwB[SExpDesignUI::TColour::sf_phasic_eyeblink].pattern_add_color_stop_rgba( cp, .5, 0.4);
@@ -723,9 +723,9 @@ void
 SScoringFacility::
 draw_montage( cairo_t* cr)
 {
-        double        true_frac = 1. - 1. / (1. + 2*skirting_run_per1),
+        double  true_frac = 1. - 1. / (1. + 2*skirting_run_per1),
                 half_pad = pagesize() * skirting_run_per1;
-        size_t        ef = da_wd * (1. - true_frac);  // w + 10% = d
+        size_t  ef = da_wd * (1. - true_frac);  // w + 10% = d
 
         using namespace sigfile;
         switch ( mode ) {
@@ -746,8 +746,8 @@ draw_montage( cairo_t* cr)
         case TMode::scoring:
       // background, is now common to all channels
         {
-                double        ppart = (double)pagesize()/vpagesize();
-                int        cp = cur_page();
+                double  ppart = (double)pagesize()/vpagesize();
+                int     cp = cur_page();
                 for ( int pp = cp-1; ; ++pp ) {
                         double ppoff = ((double)pp * pagesize() - cur_vpage_start()) / vpagesize();
                         if ( ppoff > 1.5 )
@@ -776,7 +776,7 @@ draw_montage( cairo_t* cr)
                 double last_label_end = 0.;
                 int overlap_count = 0;
 
-                double        cvpa = cur_xvpage_start(),
+                double  cvpa = cur_xvpage_start(),
                         cvpe = cur_xvpage_end(),
                         evpz = cvpe - cvpa;
 
@@ -784,12 +784,12 @@ draw_montage( cairo_t* cr)
                         //auto &S = *SA.first;
                         auto &A = *SA.second;
                         if ( agh::alg::overlap( A.span.a, A.span.z, cvpa, cvpe) ) {
-                                double        aa = A.span.a - cvpa,
+                                double  aa = A.span.a - cvpa,
                                         ae = A.span.z - cvpa;
                                 agh::alg::ensure_within( aa, -half_pad, -half_pad + evpz);
                                 agh::alg::ensure_within( ae, -half_pad, -half_pad + evpz);
 
-                                auto        wa = fmod(aa, evpz) / evpz * da_wd,
+                                auto    wa = fmod(aa, evpz) / evpz * da_wd,
                                         ww = (ae - aa) / evpz * da_wd;
 
                                 cairo_text_extents( cr, A.label.c_str(), &extents);
diff --git a/upstream/src/aghermann/ui/sf/montage_cb.cc b/upstream/src/aghermann/ui/sf/montage_cb.cc
index 922a0cc..d52b70a 100644
--- a/upstream/src/aghermann/ui/sf/montage_cb.cc
+++ b/upstream/src/aghermann/ui/sf/montage_cb.cc
@@ -22,9 +22,12 @@
 
 
 using namespace std;
-using namespace agh;
 using namespace agh::ui;
 
+using agh::str::sasprintf;
+using agh::str::homedir2tilda;
+
+
 extern "C" {
 
 gboolean
@@ -131,9 +134,7 @@ daSFMontage_button_press_event_cb(
              (Ch->draw_psd || Ch->draw_mc) && event->y > Ch->zeroy ) {
                 switch ( event->button ) {
                 case 1:
-                        if ( event->state & GDK_MODIFIER_MASK )
-                                ;
-                        else
+                        if ( !(event->state & GDK_MODIFIER_MASK) )
                                 SF.set_cur_vpage( (event->x / SF.da_wd) * SF.total_vpages());
                         // will eventually call set_cur_vpage(), which will do redraw
                     break;
@@ -143,8 +144,9 @@ daSFMontage_button_press_event_cb(
                     break;
                 case 3:
                         Ch->update_power_menu_items();
-                        gtk_menu_popup( SF.iiSFPower,
-                                        NULL, NULL, NULL, NULL, 3, event->time);
+                        gtk_menu_popup(
+                                SF.iiSFPower,
+                                NULL, NULL, NULL, NULL, 3, event->time);
                     break;
                 }
 
@@ -286,7 +288,7 @@ daSFMontage_motion_notify_event_cb(
 
         case SScoringFacility::TMode::moving_selection:
         {
-                auto        new_start_time = SF.time_at_click( event->x) - SF.moving_selection_handle_offset,
+                auto    new_start_time = SF.time_at_click( event->x) - SF.moving_selection_handle_offset,
                         new_end_time = new_start_time + (SF.using_channel->selection_end_time - SF.using_channel->selection_start_time);
                 auto& H = *SF.using_channel;
                 // reposition marquee
@@ -599,16 +601,21 @@ iSFPageHide_activate_cb(
         // add an item to iSFPageHidden
         auto item = (GtkWidget*)(SF.using_channel->menu_item_when_hidden =
                                  (GtkMenuItem*)gtk_menu_item_new_with_label( SF.using_channel->name()));
-        g_object_set( (GObject*)item,
-                      "visible", TRUE,
-                      NULL);
-        g_signal_connect( (GObject*)item,
-                          "activate", (GCallback)iSFPageShowHidden_activate_cb,
-                          &SF);
-        gtk_container_add( (GtkContainer*)SF.iiSFPageHidden,
-                           item);
+        g_object_set(
+                (GObject*)item,
+                "visible", TRUE,
+                NULL);
+        g_signal_connect(
+                (GObject*)item,
+                "activate", (GCallback)iSFPageShowHidden_activate_cb,
+                &SF);
+        gtk_container_add(
+                (GtkContainer*)SF.iiSFPageHidden,
+                item);
+
         ++SF.n_hidden;
-        gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
+        gtk_widget_queue_draw(
+                (GtkWidget*)SF.daSFMontage);
 }
 
 
@@ -879,15 +886,15 @@ iSFPageSaveChannelAsSVG_activate_cb(
         auto& SF = *(SScoringFacility*)userdata;
         auto& ED = SF._p;
         string j_dir = ED.ED->subject_dir( SF.using_channel->crecording.subject());
-        string fname = str::sasprintf(
+        string fname = sasprintf(
                 "%s/%s/%s-p%zu@%zu.svg",
                 j_dir.c_str(), ED.AghD(), ED.AghT(), SF.cur_vpage(), SF.vpagesize());
 
         SF.using_channel->draw_for_montage( fname, SF.da_wd, SF.interchannel_gap);
         ED.sb_message(
-                str::sasprintf(
+                sasprintf(
                         "Wrote \"%s\"",
-                        agh::str::homedir2tilda(fname).c_str()));
+                        homedir2tilda(fname).c_str()));
 }
 
 
@@ -899,13 +906,13 @@ iSFPageSaveMontageAsSVG_activate_cb(
         auto& SF = *(SScoringFacility*)userdata;
         auto& ED = SF._p;
         string j_dir = ED.ED->subject_dir( SF.using_channel->crecording.subject());
-        string fname = str::sasprintf(
+        string fname = sasprintf(
                         "%s/%s/montage-p%zu@%zu.svg",
                         j_dir.c_str(), ED.AghD(), SF.cur_vpage(), SF.vpagesize());
 
         SF.draw_montage( fname);
         ED.sb_message(
-                str::sasprintf( "Wrote \"%s\"", agh::str::homedir2tilda(fname).c_str()));
+                sasprintf( "Wrote \"%s\"", homedir2tilda(fname).c_str()));
 }
 
 
@@ -919,12 +926,12 @@ iSFPageExportSignal_activate_cb(
         string fname_base = r.F().filename();
         r.F().export_filtered(
                 SF.using_channel->h(),
-                str::sasprintf( "%s-filt.tsv", fname_base.c_str()));
+                sasprintf( "%s-filt.tsv", fname_base.c_str()));
         r.F().export_original(
                 SF.using_channel->h(),
-                str::sasprintf( "%s-filt.tsv", fname_base.c_str()));
+                sasprintf( "%s-filt.tsv", fname_base.c_str()));
         SF.sb_message(
-                str::sasprintf( "Wrote \"%s-{filt,orig}.tsv\"", fname_base.c_str()));
+                sasprintf( "Wrote \"%s-{filt,orig}.tsv\"", fname_base.c_str()));
 }
 
 
@@ -1253,13 +1260,13 @@ iSFPowerExportRange_activate_cb(
         auto& R = SF.using_channel->crecording;
 
         if ( SF.using_channel->draw_psd ) {
-                string fname = str::sasprintf(
+                string fname = sasprintf(
                         "%s-psd_%g-%g.tsv",
                         R.psd_profile.fname_base().c_str(), SF.using_channel->psd.from, SF.using_channel->psd.upto);
                 R.psd_profile.export_tsv(
                         SF.using_channel->psd.from, SF.using_channel->psd.upto,
                         fname);
-                SF.sb_message( str::sasprintf( "Wrote \"%s\"", str::homedir2tilda(fname).c_str()));
+                SF.sb_message( sasprintf( "Wrote \"%s\"", homedir2tilda(fname).c_str()));
         }
         // if ( SF.using_channel->draw_swu ) {
         //         fname_base = R.swu_profile.fname_base();
@@ -1293,25 +1300,25 @@ iSFPowerExportAll_activate_cb(
 
         string fname_base;
         if ( SF.using_channel->draw_psd ) {
-                string fname = str::sasprintf(
+                string fname = sasprintf(
                         "%s-psd.tsv",
                         SF.using_channel->crecording.psd_profile.fname_base().c_str());
                 R.psd_profile.export_tsv( fname);
-                SF.sb_message( str::sasprintf( "Wrote \"%s\"", agh::str::homedir2tilda(fname).c_str()));
+                SF.sb_message( sasprintf( "Wrote \"%s\"", homedir2tilda(fname).c_str()));
         }
         if ( SF.using_channel->draw_swu ) {
-                string fname = str::sasprintf(
+                string fname = sasprintf(
                         "%s-swu.tsv",
                         SF.using_channel->crecording.swu_profile.fname_base().c_str());
                 R.swu_profile.export_tsv( fname);
-                SF.sb_message( str::sasprintf( "Wrote \"%s\"", agh::str::homedir2tilda(fname).c_str()));
+                SF.sb_message( sasprintf( "Wrote \"%s\"", homedir2tilda(fname).c_str()));
         }
         if ( SF.using_channel->draw_mc ) {
-                string fname = str::sasprintf(
+                string fname = sasprintf(
                         "%s-psd.tsv",
                         SF.using_channel->crecording.psd_profile.fname_base().c_str());
                 R.psd_profile.export_tsv( fname);
-                SF.sb_message( str::sasprintf( "Wrote \"%s\"", agh::str::homedir2tilda(fname).c_str()));
+                SF.sb_message( sasprintf( "Wrote \"%s\"", homedir2tilda(fname).c_str()));
         }
 }
 
@@ -1352,7 +1359,7 @@ iSFPowerUseThisScale_activate_cb(
 {
         auto& SF = *(SScoringFacility*)userdata;
 
-        auto        sane_psd_display_scale = SF.using_channel->psd.display_scale,
+        auto    sane_psd_display_scale = SF.using_channel->psd.display_scale,
                 sane_swu_display_scale = SF.using_channel->swu.display_scale,
                 sane_mc_display_scale  = SF.using_channel->mc.display_scale;
         for ( auto& H : SF.channels ) {
diff --git a/upstream/src/aghermann/ui/ui++.hh b/upstream/src/aghermann/ui/ui++.hh
index 4c75c59..dd130c7 100644
--- a/upstream/src/aghermann/ui/ui++.hh
+++ b/upstream/src/aghermann/ui/ui++.hh
@@ -44,7 +44,7 @@ struct SGeometry {
                 {}
         bool is_valid() const
                 {
-                        return        (x > 0) && (x < 3000) &&
+                        return  (x > 0) && (x < 3000) &&
                                 (y > 0) && (y < 3000) &&
                                 (w > 1) && (w < 50000) &&
                                 (h > 1) && (h < 50000);
@@ -195,24 +195,24 @@ class SUIVar_ : public SUIVar_base {
 
 
 template <> inline void
-SUIVar_<GtkSpinButton, double>::up()        const { gtk_spin_button_set_value( w, *v); }
+SUIVar_<GtkSpinButton, double>::up()     const { gtk_spin_button_set_value( w, *v); }
 template <> inline void
-SUIVar_<GtkSpinButton, double>::down()        const { *v = gtk_spin_button_get_value( w); }
+SUIVar_<GtkSpinButton, double>::down()   const { *v = gtk_spin_button_get_value( w); }
 
 template <> inline void
-SUIVar_<GtkSpinButton, float>::up()        const { gtk_spin_button_set_value( w, *v); }
+SUIVar_<GtkSpinButton, float>::up()      const { gtk_spin_button_set_value( w, *v); }
 template <> inline void
-SUIVar_<GtkSpinButton, float>::down()        const { *v = gtk_spin_button_get_value( w); }
+SUIVar_<GtkSpinButton, float>::down()    const { *v = gtk_spin_button_get_value( w); }
 
 template <> inline void
 SUIVar_<GtkSpinButton, int>::up()        const { gtk_spin_button_set_value( w, (double)*v); }
 template <> inline void
-SUIVar_<GtkSpinButton, int>::down()        const { *v = (int)round(gtk_spin_button_get_value( w)); }
+SUIVar_<GtkSpinButton, int>::down()      const { *v = (int)round(gtk_spin_button_get_value( w)); }
 
 template <> inline void
-SUIVar_<GtkSpinButton, size_t>::up()        const { gtk_spin_button_set_value( w, (double)*v); }
+SUIVar_<GtkSpinButton, size_t>::up()     const { gtk_spin_button_set_value( w, (double)*v); }
 template <> inline void
-SUIVar_<GtkSpinButton, size_t>::down()        const
+SUIVar_<GtkSpinButton, size_t>::down()   const
 {
         auto t = (long int)round(gtk_spin_button_get_value( w));
         if ( t < 0 ) {
@@ -223,22 +223,22 @@ SUIVar_<GtkSpinButton, size_t>::down()        const
 }
 
 template <> inline void
-SUIVar_<GtkComboBox, int>::up()                const { gtk_combo_box_set_active( w, *v); }
+SUIVar_<GtkComboBox, int>::up()          const { gtk_combo_box_set_active( w, *v); }
 template <> inline void
 SUIVar_<GtkComboBox, int>::down()        const { *v = gtk_combo_box_get_active( w); }
 
 template <> inline void
-SUIVar_<GtkCheckButton, bool>::up()        const { gtk_toggle_button_set_active( (GtkToggleButton*)w, *v); }
+SUIVar_<GtkCheckButton, bool>::up()      const { gtk_toggle_button_set_active( (GtkToggleButton*)w, *v); }
 template <> inline void
-SUIVar_<GtkCheckButton, bool>::down()        const { *v = gtk_toggle_button_get_active( (GtkToggleButton*)w); }
+SUIVar_<GtkCheckButton, bool>::down()    const { *v = gtk_toggle_button_get_active( (GtkToggleButton*)w); }
 
 template <> inline void
-SUIVar_<GtkRadioButton, bool>::up()        const { gtk_toggle_button_set_active( (GtkToggleButton*)w, *v); }
+SUIVar_<GtkRadioButton, bool>::up()      const { gtk_toggle_button_set_active( (GtkToggleButton*)w, *v); }
 template <> inline void
-SUIVar_<GtkRadioButton, bool>::down()        const { *v = gtk_toggle_button_get_active( (GtkToggleButton*)w); }
+SUIVar_<GtkRadioButton, bool>::down()    const { *v = gtk_toggle_button_get_active( (GtkToggleButton*)w); }
 
 template <> inline void
-SUIVar_<GtkEntry, string>::up()                const { gtk_entry_set_text( w, v->c_str()); }
+SUIVar_<GtkEntry, string>::up()          const { gtk_entry_set_text( w, v->c_str()); }
 template <> inline void
 SUIVar_<GtkEntry, string>::down()        const { v->assign( gtk_entry_get_text( w)); }
 
@@ -253,42 +253,32 @@ class SUIVarCollection {
                 }
 
         void reg( GtkSpinButton *w, float* v)
-                {
-                        c.push_back( new SUIVar_<GtkSpinButton, float> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkSpinButton, float> (w, v)); }
+
         void reg( GtkSpinButton *w, double* v)
-                {
-                        c.push_back( new SUIVar_<GtkSpinButton, double> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkSpinButton, double> (w, v)); }
+
         void reg( GtkSpinButton *w, int* v)
-                {
-                        c.push_back( new SUIVar_<GtkSpinButton, int> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkSpinButton, int> (w, v)); }
+
         void reg( GtkSpinButton *w, size_t* v)
-                {
-                        c.push_back( new SUIVar_<GtkSpinButton, size_t> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkSpinButton, size_t> (w, v)); }
+
         void reg( GtkComboBox *w, int* v)
-                {
-                        c.push_back( new SUIVar_<GtkComboBox, int> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkComboBox, int> (w, v)); }
+
         void reg( GtkCheckButton *w, bool* v)
-                {
-                        c.push_back( new SUIVar_<GtkCheckButton, bool> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkCheckButton, bool> (w, v)); }
+
         void reg( GtkRadioButton *w, bool* v)
-                {
-                        c.push_back( new SUIVar_<GtkRadioButton, bool> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkRadioButton, bool> (w, v)); }
+
         void reg( GtkEntry *w, string* v)
-                {
-                        c.push_back( new SUIVar_<GtkEntry, string> (w, v));
-                }
+                { c.push_back( new SUIVar_<GtkEntry, string> (w, v)); }
+
         // odd one out
         void reg( GtkListStore *m, list<string> *l)
-                {
-                        c.push_back( new SUIVar_<GtkListStore, list<string>> (m, l));
-                }
+                { c.push_back( new SUIVar_<GtkListStore, list<string>> (m, l)); }
 
         void up() const
                 {
diff --git a/upstream/src/aghermann/ui/ui.hh b/upstream/src/aghermann/ui/ui.hh
index 3bd852b..3c7b6a8 100644
--- a/upstream/src/aghermann/ui/ui.hh
+++ b/upstream/src/aghermann/ui/ui.hh
@@ -107,17 +107,17 @@ void set_cursor_busy( bool busy, GtkWidget *wid);
 
 
 
-#define AGH_GBGETOBJ(Type, A)                                \
+#define AGH_GBGETOBJ(Type, A)                                   \
         (A = (Type*)(gtk_builder_get_object( builder, #A)))
 
-#define AGH_GBGETOBJ3(B, Type, A)                        \
+#define AGH_GBGETOBJ3(B, Type, A)                       \
         (A = (Type*)(gtk_builder_get_object( B, #A)))
 
-#define G_CONNECT_1(W, A)                                                \
+#define G_CONNECT_1(W, A)                                               \
         g_signal_connect(W, #A, (GCallback)W ## _ ## A ## _cb, this)
-#define G_CONNECT_2(W, A1, A2)                                                \
+#define G_CONNECT_2(W, A1, A2)                                          \
         g_signal_connect(W, #A1 "-" #A2, (GCallback)W ## _ ## A1 ## _ ## A2 ## _cb, this)
-#define G_CONNECT_3(W, A1, A2, A3)                                        \
+#define G_CONNECT_3(W, A1, A2, A3)                                      \
         g_signal_connect(W, #A1 "-" #A2 "-" #A3, (GCallback)W ## _ ## A1 ## _ ## A2 ## _ ## A3 ## _cb, this)
 
 }
diff --git a/upstream/src/libmetrics/mc-artifacts.hh b/upstream/src/libmetrics/mc-artifacts.hh
index 4d59445..d5ca1f8 100644
--- a/upstream/src/libmetrics/mc-artifacts.hh
+++ b/upstream/src/libmetrics/mc-artifacts.hh
@@ -27,23 +27,23 @@ namespace metrics {
 namespace mc {
 
 struct SArtifactDetectionPP {
-        double        scope,
+        double	scope,
                 upper_thr, lower_thr,
                 f0, fc, bandwidth,
                 mc_gain, iir_backpolate;
-        double        E, dmin, dmax;
-        size_t        sssu_hist_size,
+        double	E, dmin, dmax;
+        size_t	sssu_hist_size,
                 smooth_side;
-        bool        estimate_E,
+        bool	estimate_E,
                 use_range;
         SArtifactDetectionPP ()
-                : scope (4.),
-                  upper_thr (9.), lower_thr (-9.),
-                  f0 (1.), fc (1.8), bandwidth (1.5),
-                  mc_gain (10.), iir_backpolate (.5),
-                  E (4.), dmin (-10), dmax (20),
-                  sssu_hist_size (100), smooth_side (0),
-                  estimate_E (true), use_range (false)
+              : scope (4.),
+		upper_thr (9.), lower_thr (-9.),
+		f0 (1.), fc (1.8), bandwidth (1.5),
+		mc_gain (10.), iir_backpolate (.5),
+		E (4.), dmin (-10), dmax (20),
+		sssu_hist_size (100), smooth_side (0),
+		estimate_E (true), use_range (false)
                 {}
 };
 
diff --git a/upstream/src/libmetrics/mc-artifacts.ii b/upstream/src/libmetrics/mc-artifacts.ii
index 8a520a4..192f7a1 100644
--- a/upstream/src/libmetrics/mc-artifacts.ii
+++ b/upstream/src/libmetrics/mc-artifacts.ii
@@ -18,7 +18,7 @@ vector<size_t> // don't estimate, use pi*B*x^2 (E) as provided
 detect_artifacts( const valarray<T>& signal, size_t sr,
                   const SArtifactDetectionPP& P)
 {
-        auto        sssu
+        auto	sssu
                 = do_sssu_reduction(
                         signal,
                         sr, P.scope, P.scope,
@@ -39,8 +39,7 @@ detect_artifacts( const valarray<T>& signal, size_t sr,
                         : estimate_E(
                                 sssu_diff,
                                 P.sssu_hist_size);
-        else
-                E = P.E;
+        else	E = P.E;
 
         vector<size_t>
                 marked;
diff --git a/upstream/src/libmetrics/mc.cc b/upstream/src/libmetrics/mc.cc
index 374404a..483ea99 100644
--- a/upstream/src/libmetrics/mc.cc
+++ b/upstream/src/libmetrics/mc.cc
@@ -41,34 +41,36 @@ string
 metrics::mc::CProfile::
 fname_base() const
 {
-        return agh::str::sasprintf(
-                  "%s.%s-%lu"
-                  ":%g+%g-%g_%g" "_%g" "_%g_%g",
-                  _using_F().filename(), _using_F().channel_by_id(_using_sig_no).name(),
-                  _using_F().dirty_signature( _using_sig_no),
-                  Pp.pagesize, Pp.step,
-                  Pp.scope, Pp.iir_backpolate,
-                  Pp.mc_gain,
-                  Pp.f0fc, Pp.bandwidth);
+        return move(
+		agh::str::sasprintf(
+			"%s.%s-%lu"
+			":%g+%g-%g_%g" "_%g" "_%g_%g",
+			_using_F().filename(), _using_F().channel_by_id(_using_sig_no).name(),
+			_using_F().dirty_signature( _using_sig_no),
+			Pp.pagesize, Pp.step,
+			Pp.scope, Pp.iir_backpolate,
+			Pp.mc_gain,
+			Pp.f0fc, Pp.bandwidth));
 }
 
 string
 metrics::mc::CProfile::
 mirror_fname() const
 {
-        return agh::str::sasprintf(
-                  "%s-%s-%lu"
-                  ":%g+%g-%g_%g" "_%g" "_%g_%g" "_%g_%g@%zu"
-                  ".mc",
-                  agh::fs::make_fname_base (_using_F().filename(), "", agh::fs::TMakeFnameOption::hidden).c_str(),
-                  _using_F().channel_by_id(_using_sig_no).name(),
-                  _using_F().dirty_signature( _using_sig_no),
-                  Pp.pagesize, Pp.step,
-                  Pp.scope, Pp.iir_backpolate,
-                  Pp.mc_gain,
-                  Pp.f0fc, Pp.bandwidth,
-                  Pp.freq_from, Pp.freq_inc,
-                  sizeof(TFloat));
+        return move(
+		agh::str::sasprintf(
+			"%s-%s-%lu"
+			":%g+%g-%g_%g" "_%g" "_%g_%g" "_%g_%g@%zu"
+			".mc",
+			agh::fs::make_fname_base (_using_F().filename(), "", agh::fs::TMakeFnameOption::hidden).c_str(),
+			_using_F().channel_by_id(_using_sig_no).name(),
+			_using_F().dirty_signature( _using_sig_no),
+			Pp.pagesize, Pp.step,
+			Pp.scope, Pp.iir_backpolate,
+			Pp.mc_gain,
+			Pp.f0fc, Pp.bandwidth,
+			Pp.freq_from, Pp.freq_inc,
+			sizeof(TFloat)));
 }
 
 int
diff --git a/upstream/src/libmetrics/mc.hh b/upstream/src/libmetrics/mc.hh
index ad50683..c7f2ac9 100644
--- a/upstream/src/libmetrics/mc.hh
+++ b/upstream/src/libmetrics/mc.hh
@@ -29,27 +29,25 @@ namespace mc {
 
 struct SPPack
   : public metrics::SPPack {
-        double        scope,
+        double	scope,
                 f0fc,
                 //f0, // = 1.,
                 //fc, // = 1.8;
                 bandwidth,      // = 1.5;
                 iir_backpolate, // = 0.5;        // 0.0 < Backpolate < 1.0 on s: standard 0.5
                 mc_gain;        // = 10.0;        // Gain (DigiRange/PhysiRange) of MicroContinuity
-        size_t        smooth_side;
-        double        freq_from,
+        size_t	smooth_side;
+        double	freq_from,
                 freq_inc;
-        size_t        n_bins;
+        size_t	n_bins;
 
         SPPack (const SPPack&) = default;
         SPPack ()
-                {
-                        reset();
-                }
+                { reset(); }
 
         bool same_as( const SPPack& rv) const
                 {
-                        return        metrics::SPPack::same_as(rv) &&
+                        return	metrics::SPPack::same_as(rv) &&
                                 scope == rv.scope &&
                                 iir_backpolate == rv.iir_backpolate &&
                                 mc_gain == rv.mc_gain &&
@@ -89,22 +87,20 @@ struct SPPack
 
         void reset()
                 {
-                        scope                        =     30 / 6.;  // 5 sec is close to 4 sec ('recommended')
-                        f0fc                        =      .8;
-                        bandwidth                =     1.5;
-                        iir_backpolate                =     0.5;        // 0.0 < Backpolate < 1.0 on s: standard 0.5
-                        mc_gain                        =    10.0;        // Gain (DigiRange/PhysiRange) of MicroContinuity
-                        smooth_side                =     0;
-                        freq_from                =     0.5;
-                        freq_inc                =      .5;
-                        n_bins                        =     5;
+                        scope           =     30 / 6.;  // 5 sec is close to 4 sec ('recommended')
+                        f0fc            =      .8;
+                        bandwidth       =     1.5;
+                        iir_backpolate  =     0.5;        // 0.0 < Backpolate < 1.0 on s: standard 0.5
+                        mc_gain         =    10.0;        // Gain (DigiRange/PhysiRange) of MicroContinuity
+                        smooth_side     =     0;
+                        freq_from       =      .5;
+                        freq_inc        =      .5;
+                        n_bins          =     5;
                 }
 
         size_t
         compute_n_bins( size_t) const // to match psd::SPPack::compute_n_bins
-                {
-                        return n_bins;
-                }
+                { return n_bins; }
 };
 
 
@@ -120,13 +116,11 @@ class CProfile
         SPPack Pp;
 
         const char* metric_name() const
-                {
-                        return metrics::name( TType::mc);
-                }
+                { return metrics::name( TType::mc); }
 
         valarray<TFloat> course( double binf) const
                 {
-                        size_t        bin = agh::alg::value_within(
+                        size_t	bin = agh::alg::value_within(
                                 (int)((binf - Pp.freq_from) / Pp.freq_inc),
                                 0, (int)bins()-1);
                         return metrics::CProfile::course(bin);
@@ -142,7 +136,7 @@ class CProfile
 
         // to enable use as mapped type
         CProfile (const CProfile& rv)
-              : metrics::CProfile (rv)
+	      : metrics::CProfile (rv)
                 {}
 };
 
@@ -184,7 +178,7 @@ do_sssu_reduction( const valarray<T>& S,
                            f0, fc,
                            bandwidth);
 
-        size_t        scope_samples = scope * samplerate,
+        size_t	scope_samples = scope * samplerate,
                 inc_samples = inc * samplerate,
                 lpages = S.size() / inc_samples;
         valarray<T>
diff --git a/upstream/src/libmetrics/page-metrics-base.hh b/upstream/src/libmetrics/page-metrics-base.hh
index 6e61284..b3ae84a 100644
--- a/upstream/src/libmetrics/page-metrics-base.hh
+++ b/upstream/src/libmetrics/page-metrics-base.hh
@@ -84,28 +84,25 @@ class CProfile {
                   double pagesize, double step, size_t bins);
         CProfile (const CProfile&) = default;
     public:
-        SPPack        Pp;
+        SPPack	Pp;
 
         virtual const char* metric_name() const = 0;
 
-        const sigfile::CSource& source() const
-                {
-                        return _using_F();
-                }
-        int sig_no() const
-                {
-                        return _using_sig_no;
-                }
+        const sigfile::CSource&
+	source() const
+                { return _using_F(); }
 
-        bool have_data() const
-                {
-                        return _status & TFlags::computed;
-                }
+        int
+	sig_no() const
+                { return _using_sig_no; }
 
-        size_t bins() const
-                {
-                        return _bins;
-                }
+        bool
+	have_data() const
+                { return _status & TFlags::computed; }
+
+        size_t
+	bins() const
+                { return _bins; }
 
         size_t steps() const; // overlapping pages
         size_t samplerate() const;
@@ -128,21 +125,18 @@ class CProfile {
 
       // power course
         // full (note the returned array size is length * n_bins)
-        valarray<TFloat> course() const
-                {
-                        return _data;
-                }
+        valarray<TFloat>
+	course() const
+                { return _data; }
 
         // in a bin
-        valarray<TFloat> course( size_t m) const
-                {
-                        return _data[ slice(m, steps(), _bins) ];
-                }
+        valarray<TFloat>
+	course( size_t m) const
+                { return _data[ slice(m, steps(), _bins) ]; }
 
-        valarray<TFloat> spectrum( size_t p) const
-                {
-                        return _data[ slice(p * _bins, _bins, 1) ];
-                }
+        valarray<TFloat>
+	spectrum( size_t p) const
+                { return _data[ slice(p * _bins, _bins, 1) ]; }
 
 
     public:
@@ -154,14 +148,11 @@ class CProfile {
 
         int compute( const SPPack&);
         int compute()
-                {
-                        return compute( Pp);
-                }
+                { return compute( Pp); }
+
         bool need_compute( const SPPack&);  // not const because it does mirror_back
         bool need_compute()
-                {
-                        return need_compute( Pp);
-                }
+                { return need_compute( Pp); }
 
 
     protected:
@@ -173,11 +164,11 @@ class CProfile {
                 computed = (1<<0),
                 computable = (1<<1)
         };
-        int        _status;
+        int	_status;
 
         valarray<TFloat>  // arrays in a given bin extracted by slices
                 _data;    // it is always double because it is saved/loaded in this form
-        size_t        _bins;
+        size_t	_bins;
 
         agh::hash_t
                 _signature_when_mirrored;
diff --git a/upstream/src/libmetrics/psd.cc b/upstream/src/libmetrics/psd.cc
index b4e7f40..30e6b16 100644
--- a/upstream/src/libmetrics/psd.cc
+++ b/upstream/src/libmetrics/psd.cc
@@ -98,10 +98,10 @@ go_compute()
 {
         _data.resize( steps() * _bins);
 
-        size_t        sr = samplerate();
-        size_t        spp = sr * Pp.pagesize,
+        size_t	sr = samplerate();
+        size_t	spp = sr * Pp.pagesize,
                 sps = sr * Pp.step;
-//        double        freq_max = (spp+1)/2 / sr;
+//        double freq_max = (spp+1)/2 / sr;
 
       // 0. get signal sample; always use double not TFloat
       // so that saved power is usable irrespective of what TFloat is today
@@ -150,14 +150,14 @@ go_compute()
         }
 
         // go
-        TFloat        f = 0.;
-        size_t        p, b, k = 1,
+        TFloat	f = 0.;
+        size_t	p, b, k = 1,
                 window = sr;
         // what about some smooth edges?
         valarray<double>
                 W (spp);
         {
-                size_t        t9 = spp - window,   // start of the last window but one
+                size_t	t9 = spp - window,   // start of the last window but one
                         t;
                 auto wfun = sigproc::winf[Pp.welch_window_type];
                 for ( t = 0; t < window/2; ++t )
@@ -219,8 +219,8 @@ export_tsv( const string& fname) const
         if ( !f )
                 return -1;
 
-        size_t bin, p;
-        float bum = 0.;
+        size_t	bin, p;
+        float	bum = 0.;
 
         auto sttm = _using_F().start_time();
         char *asctime_ = asctime( localtime( &sttm));
diff --git a/upstream/src/libmetrics/psd.hh b/upstream/src/libmetrics/psd.hh
index 9331970..269f13b 100644
--- a/upstream/src/libmetrics/psd.hh
+++ b/upstream/src/libmetrics/psd.hh
@@ -72,26 +72,21 @@ struct SPPack
                 plan_type;
 
         SPPack ()
-                {
-                        reset();
-                }
+                { reset(); }
 
-        bool same_as( const SPPack& rv) const
-                {
-                        return metrics::SPPack::same_as(rv);
-                }
-        void make_same( const SPPack& rv)
-                {
-                        metrics::SPPack::make_same(rv);
-                }
+        bool
+	same_as( const SPPack& rv) const
+                { return metrics::SPPack::same_as(rv); }
+        void
+	make_same( const SPPack& rv)
+                { metrics::SPPack::make_same(rv); }
 
         size_t
         compute_n_bins( size_t samplerate) const
-                {
-                        return (samplerate * pagesize + 1) / 2 / samplerate / binsize;
-                }
+                { return (samplerate * pagesize + 1) / 2 / samplerate / binsize; }
 
-        void check() const
+        void
+	check() const
                 {
                         metrics::SPPack::check();
 
@@ -118,7 +113,8 @@ struct SPPack
                         throw invalid_argument ("Invalid binsize");
                 }
 
-        void reset()
+        void
+	reset()
                 {
                         metrics::SPPack::reset();
                         binsize = .25;
@@ -136,22 +132,22 @@ class CProfile
         CProfile (const sigfile::CTypedSource&, int sig_no,
                   const SPPack&);
 
-        SPPack Pp;
+        SPPack	Pp;
 
-        const char* metric_name() const
-                {
-                        return metrics::name( TType::psd);
-                }
+        const char*
+	metric_name() const
+                { return metrics::name( TType::psd); }
 
         // in a frequency range
-        valarray<TFloat> course( double from, double upto) const
+        valarray<TFloat>
+	course( double from, double upto) const
                 {
                         valarray<TFloat> acc (0., steps());
-                        size_t        bin_a = min( (size_t)(from / Pp.binsize), _bins),
+                        size_t	bin_a = min( (size_t)(from / Pp.binsize), _bins),
                                 bin_z = min( (size_t)(upto / Pp.binsize), _bins);
                         for ( size_t b = bin_a; b < bin_z; ++b )
                                 acc += metrics::CProfile::course(b);
-                        return acc;
+                        return move(acc);
                 }
 
         int go_compute();
diff --git a/upstream/src/libmetrics/swu.cc b/upstream/src/libmetrics/swu.cc
index 874ffa4..4b1fd95 100644
--- a/upstream/src/libmetrics/swu.cc
+++ b/upstream/src/libmetrics/swu.cc
@@ -20,9 +20,10 @@
 #include "swu.hh"
 
 using namespace std;
+using namespace metrics;
 
 
-metrics::swu::CProfile::
+swu::CProfile::
 CProfile (const sigfile::CTypedSource& F, const int sig_no,
           const SPPack &params)
       : metrics::CProfile (F, sig_no,
@@ -36,36 +37,38 @@ CProfile (const sigfile::CTypedSource& F, const int sig_no,
 
 
 string
-metrics::swu::CProfile::
+swu::CProfile::
 fname_base() const
 {
-        return agh::str::sasprintf(
-                  "%s.%s-%lu"
-                  ":%g+%g-%g",
-                  _using_F().filename(), _using_F().channel_by_id(_using_sig_no).name(),
-                  _using_F().dirty_signature( _using_sig_no),
-                  Pp.pagesize, Pp.step, Pp.min_upswing_duration);
+        return move(
+		agh::str::sasprintf(
+			"%s.%s-%lu"
+			":%g+%g-%g",
+			_using_F().filename(), _using_F().channel_by_id(_using_sig_no).name(),
+			_using_F().dirty_signature( _using_sig_no),
+			Pp.pagesize, Pp.step, Pp.min_upswing_duration));
 }
 
 
 string
-metrics::swu::CProfile::
+swu::CProfile::
 mirror_fname() const
 {
-        return agh::str::sasprintf(
-                  "%s.%s-%lu"
-                  ":%g+%g-%g@%zu"
-                  ".swu",
-                  agh::fs::make_fname_base (_using_F().filename(), "", agh::fs::TMakeFnameOption::hidden).c_str(),
-                  _using_F().channel_by_id(_using_sig_no).name(),
-                  _using_F().dirty_signature( _using_sig_no),
-                  Pp.pagesize, Pp.step, Pp.min_upswing_duration,
-                  sizeof(TFloat));
+        return move(
+		agh::str::sasprintf(
+			"%s.%s-%lu"
+			":%g+%g-%g@%zu"
+			".swu",
+			agh::fs::make_fname_base (_using_F().filename(), "", agh::fs::TMakeFnameOption::hidden).c_str(),
+			_using_F().channel_by_id(_using_sig_no).name(),
+			_using_F().dirty_signature( _using_sig_no),
+			Pp.pagesize, Pp.step, Pp.min_upswing_duration,
+			sizeof(TFloat)));
 }
 
 
 int
-metrics::swu::CProfile::
+swu::CProfile::
 go_compute()
 {
         _data.resize( steps() * _bins);
@@ -74,10 +77,10 @@ go_compute()
                 _using_F().get_signal_filtered( _using_sig_no));
 
         for ( size_t p = 0; p < steps(); ++p ) {
-                auto        a = p * (samplerate() * Pp.step),
+                auto	a = p * (samplerate() * Pp.step),
                         z = a + (samplerate() * Pp.pagesize);
-                auto        la = a, lz = a;
-                double        Q = 0.;
+                auto	la = a, lz = a;
+                double	Q = 0.;
 
               // 1. upswing proper
                 // find a stretch of uninterrupted positive values
@@ -115,7 +118,7 @@ go_compute()
 
 
 int
-metrics::swu::CProfile::
+swu::CProfile::
 export_tsv( const string& fname) const
 {
         FILE *f = fopen( fname.c_str(), "w");
diff --git a/upstream/src/libmetrics/swu.hh b/upstream/src/libmetrics/swu.hh
index 81713f6..717ed7f 100644
--- a/upstream/src/libmetrics/swu.hh
+++ b/upstream/src/libmetrics/swu.hh
@@ -33,24 +33,20 @@ namespace swu {
 struct SPPack
   : public metrics::SPPack {
 
-        double        min_upswing_duration;
+        double	min_upswing_duration;
 
         SPPack ()
-                {
-                        reset();
-                }
+                { reset(); }
         size_t
         compute_n_bins( size_t) const
-                {
-                        return 1;
-                }
+                { return 1; }
 
-        void check() const  // throws if not ok
-                {
-                        metrics::SPPack::check();
-                }
+        void
+	check() const  // throws if not ok
+                { metrics::SPPack::check(); }
 
-        void reset()
+        void
+	reset()
                 {
                         metrics::SPPack::reset();
                         min_upswing_duration = .3;
@@ -69,13 +65,11 @@ class CProfile
         SPPack Pp;
 
         const char* metric_name() const
-                {
-                        return metrics::name( TType::swu);
-                }
+                { return metrics::name( TType::swu); }
 
         valarray<TFloat> course( double) const
                 {
-                        size_t        bin = 0; // (size_t)(binf - freq_from / Pp.freq_inc);
+                        size_t	bin = 0; // (size_t)(binf - freq_from / Pp.freq_inc);
                         return metrics::CProfile::course(bin);
                 }
 
diff --git a/upstream/src/libsigproc/exstrom.hh b/upstream/src/libsigproc/exstrom.hh
index 68ed9c8..16a96b1 100644
--- a/upstream/src/libsigproc/exstrom.hh
+++ b/upstream/src/libsigproc/exstrom.hh
@@ -192,7 +192,7 @@ template <typename T>
 valarray<T>
 dcof_bwlp( unsigned n, T fcf)
 {
-        T        theta,     // M_PI * fcf / 2.0
+        T	theta,     // M_PI * fcf / 2.0
                 st,        // sine of theta
                 ct,        // cosine of theta
                 parg,      // pole angle
@@ -251,7 +251,7 @@ template <typename T>
 valarray<T>
 dcof_bwbp( unsigned n, T f1f, T f2f)
 {
-        T        theta,     // M_PI * (f2f - f1f) / 2.0
+        T       theta,     // M_PI * (f2f - f1f) / 2.0
                 cp,        // cosine of phi
                 st,        // sine of theta
                 ct,        // cosine of theta
@@ -292,6 +292,7 @@ dcof_bwbp( unsigned n, T f1f, T f2f)
         dcof[0] = 1.0;
         for ( k = 3; k <= 2*n; ++k )
                 dcof[k] = dcof[2*k-2];
+
         return move(dcof);
 }
 
@@ -413,7 +414,7 @@ template <typename T>
 T
 sf_bwlp( unsigned n, T fcf)
 {
-        T        omega = M_PI * fcf,      // M_PI * fcf
+        T       omega = M_PI * fcf,      // M_PI * fcf
                 fomega = sin(omega),     // function of omega
                 parg0 = M_PI / (T)(2*n), // zeroth pole angle
                 sf;                      // scaling factor
@@ -447,7 +448,7 @@ template <typename T>
 T
 sf_bwhp( unsigned n, T fcf)
 {
-        T        omega = M_PI * fcf,      // M_PI * fcf
+        T       omega = M_PI * fcf,      // M_PI * fcf
                 fomega = sin(omega),     // function of omega
                 parg0 = M_PI / (T)(2*n), // zeroth pole angle
                 sf;                      // scaling factor
@@ -481,7 +482,7 @@ T
 __attribute__ ((const))
 sf_bwbp( unsigned n, T f1f, T f2f )
 {
-        T        ctt = 1.0 / tan(M_PI * (f2f - f1f) / 2.0),       // cotangent of theta
+        T       ctt = 1.0 / tan(M_PI * (f2f - f1f) / 2.0),       // cotangent of theta
                 sfr = 1., sfi = 0.,  // real and imaginary parts of the scaling factor
                 parg,      // pole angle
                 sparg,     // sine of pole angle
@@ -508,7 +509,7 @@ T
 __attribute__ ((const))
 sf_bwbs( unsigned n, T f1f, T f2f )
 {
-        T        tt  = tan(M_PI * (f2f - f1f) / 2.0),       // tangent of theta
+        T       tt  = tan(M_PI * (f2f - f1f) / 2.0),       // tangent of theta
                 sfr = 1., sfi = 0.,  // real and imaginary parts of the scaling factor
                 parg,      // pole angle
                 sparg,     // sine of pole angle
@@ -544,9 +545,9 @@ low_pass( const valarray<T>& in,
           float cutoff, unsigned order, bool scale)
 {
 //        printf( "low_pass( %zu, %g, %u, %d)\n", samplerate, cutoff, order, scale);
-        size_t        i, j;
+        size_t	i, j;
 
-        T        fcf = 2. * cutoff/samplerate;
+        T       fcf = 2. * cutoff/samplerate;
         valarray<T>
                 dcof = dcof_bwlp( order, fcf);                /* the d coefficients */
         valarray<int>
@@ -588,7 +589,7 @@ high_pass( const valarray<T>& in,
            size_t samplerate,
            float cutoff, unsigned order, bool scale)
 {
-        size_t        i, j;
+        size_t	i, j;
 
         T        fcf = 2. * cutoff/samplerate;
         valarray<T>
@@ -615,7 +616,7 @@ high_pass( const valarray<T>& in,
         unsigned
                 nc = ccof.size(),
                 nd = dcof.size();
-        size_t        in_size = in.size(),
+        size_t	in_size = in.size(),
                 out_size = in_size + nc;
         valarray<T> out (out_size);
 
@@ -643,9 +644,9 @@ band_pass( const valarray<T>& in,
            float lo_cutoff, float hi_cutoff,
            unsigned order, bool scale)
 {
-        size_t        i, j;
+        size_t	i, j;
 
-        T        f1f = 2. * lo_cutoff/samplerate,
+        T	f1f = 2. * lo_cutoff/samplerate,
                 f2f = 2. * hi_cutoff/samplerate;
         valarray<T>
                 dcof = dcof_bwbp( order, f1f, f2f);                /* the d coefficients */
@@ -698,9 +699,9 @@ band_stop( const valarray<T>& in,
            float lo_cutoff, float hi_cutoff,
            unsigned order, bool scale)
 {
-        size_t        i, j;
+        size_t	i, j;
 
-        T        f1f = 2. * lo_cutoff/samplerate,
+        T       f1f = 2. * lo_cutoff/samplerate,
                 f2f = 2. * hi_cutoff/samplerate;
         valarray<T>
                 dcof = dcof_bwbp( order, f1f, f2f);                /* the d coefficients */
@@ -760,8 +761,6 @@ extern template valarray<TFloat> high_pass( const valarray<TFloat>&, size_t, flo
 extern template valarray<TFloat> band_pass( const valarray<TFloat>&, size_t, float, float, unsigned, bool);
 extern template valarray<TFloat> band_stop( const valarray<TFloat>&, size_t, float, float, unsigned, bool);
 
-
-
 }  // namespace exstrom
 
 #endif
diff --git a/upstream/src/libsigproc/ext-filters.hh b/upstream/src/libsigproc/ext-filters.hh
index 5e0cd09..249a98c 100644
--- a/upstream/src/libsigproc/ext-filters.hh
+++ b/upstream/src/libsigproc/ext-filters.hh
@@ -87,13 +87,13 @@ class CFilterIIR
                 }
 
 
-        bool        anticipate;
+        bool	anticipate;
         valarray<T>
                 filter_state_p,
                 filter_state_z,
                 poles,
                 zeros;
-        T        gain,
+        T       gain,
                 back_polate;
 
     public:
@@ -127,7 +127,7 @@ class CFilterSE
                 {
                         CFilterIIR<T>::calculate_iir_coefficients();
 
-                        T        ts = 1.0 / CFilterIIR<T>::samplerate,
+                        T	ts = 1.0 / CFilterIIR<T>::samplerate,
                                 fprewarp, r, s, t;
 
                         fprewarp = tan( f0 * M_PI * ts) / (M_PI * ts);
@@ -150,7 +150,7 @@ class CFilterSE
                 }
 
     private:
-        T        f0,
+        T       f0,
                 fc,
                 bandwidth;
 };
@@ -176,7 +176,7 @@ class CFilterDUE
                 {
                         CFilterIIR<T>::calculate_iir_coefficients();
 
-                        T        ts = 1. / CFilterIIR<T>::samplerate,
+                        T       ts = 1. / CFilterIIR<T>::samplerate,
                                 fprewarp = tan( M_PI * minus_3db_frequency * ts) / (M_PI * ts),
                                 r = 1. / (2. * M_PI * fprewarp),
                                 s = ts / 2.;
diff --git a/upstream/src/libsigproc/sigproc.cc b/upstream/src/libsigproc/sigproc.cc
index 6ad39ce..caab6b9 100644
--- a/upstream/src/libsigproc/sigproc.cc
+++ b/upstream/src/libsigproc/sigproc.cc
@@ -37,7 +37,8 @@ resample_f( const valarray<float>& signal,
         if ( unlikely (end <= start) || (end > signal.size()) )
                 throw runtime_error ("bad args for resample");
 
-        valarray<float>        resampled (to_size);
+        valarray<float>
+		resampled (to_size);
         SRC_DATA S;
         S.data_in       = const_cast<float*>(&signal[start]);
         S.input_frames  = end - start;
diff --git a/upstream/src/libsigproc/sigproc.hh b/upstream/src/libsigproc/sigproc.hh
index 45ef906..b2311f6 100644
--- a/upstream/src/libsigproc/sigproc.hh
+++ b/upstream/src/libsigproc/sigproc.hh
@@ -59,7 +59,8 @@ resample( const valarray<float>& signal,
           size_t to_size,
           int alg = SRC_SINC_FASTEST)
 {
-        return resample_f( signal, start, end, to_size, alg);
+        return move(
+		resample_f( signal, start, end, to_size, alg));
 }
 
 valarray<double>
@@ -87,7 +88,7 @@ template <typename T>
 struct SSignalRef {
         const valarray<T>&
                 signal;
-        size_t        samplerate;
+        size_t	samplerate;
 };
 
 
@@ -112,12 +113,15 @@ raw_signal_profile( const SSignalRef<T>& sigref,
         valarray<T>
                 ret,
                 env_u, env_l;
-        envelope( sigref,
-                  env_dh, env_dt,
-                  &env_l, &env_u);
+
+        envelope(
+		sigref,
+		env_dh, env_dt,
+		&env_l, &env_u);
         ret.resize( env_l.size());
         ret = env_u - env_l;
-        return ret;
+
+        return move(ret);
 }
 
 
@@ -146,46 +150,52 @@ struct SCachedEnvelope
                 {
                         if ( lower.size() == 0 ||
                              scope != scope_ ) {
-                                envelope( (SSignalRef<T>)*this,
-                                          scope = scope_,
-                                          1./SSignalRef<T>::samplerate,
-                                          &lower,
-                                          &upper); // don't need anchor points, nor their count
-                                mid.resize(lower.size());
+                                envelope(
+					(SSignalRef<T>)*this,
+					scope = scope_,
+					1./SSignalRef<T>::samplerate,
+					&lower,
+					&upper); // don't need anchor points, nor their count
+                                mid.resize( lower.size());
                                 mid = (upper + lower)/2;
                         }
                         return {lower, upper};
                 }
-        void drop()
+        void
+	drop()
                 {
                         upper.resize(0);
                         lower.resize(0);
                 }
 
-        T breadth( double scope_, size_t i)
+        T
+	breadth( double scope_, size_t i)
                 {
                         operator()( scope_);
                         return upper[i] - lower[i];
                 }
-        valarray<T> breadth( double scope_)
+        valarray<T>
+	breadth( double scope_)
                 {
                         operator()( scope_);
-                        return upper - lower;
+                        return move(upper - lower);
                 }
 
-        T centre( double scope_, size_t i)
+        T
+	centre( double scope_, size_t i)
                 {
                         operator()( scope_);
                         return mid[i];
                 }
-        valarray<T> centre( double scope_)
+        valarray<T>
+	centre( double scope_)
                 {
                         operator()( scope_);
-                        return mid;
+                        return move(mid);
                 }
 
     private:
-        double        scope;
+        double	scope;
         valarray<T>
                 upper,
                 mid,
@@ -211,12 +221,14 @@ struct SCachedDzcdf
                                         step = step_, sigma = sigma_, smooth = smooth_);
                         return data;
                 }
-        void drop()
+
+        void
+	drop()
                 {
                         data.resize(0);
                 }
     private:
-        double        step,
+        double	step,
                 sigma;
         unsigned
                 smooth;
@@ -237,18 +249,20 @@ struct SCachedLowPassCourse
                 {
                         if ( data.size() == 0 ||
                              fcutoff != fcutoff_ || order != order_ )
-                                data = exstrom::low_pass( SSignalRef<T>::signal, SSignalRef<T>::samplerate,
-                                                          fcutoff = fcutoff_, order = order_,
-                                                          true);
+                                data = exstrom::low_pass(
+					SSignalRef<T>::signal, SSignalRef<T>::samplerate,
+					fcutoff = fcutoff_, order = order_,
+					true);
                         return data;
                 }
-        void drop()
+        void
+	drop()
                 {
                         data.resize(0);
                 }
 
     private:
-        double        fcutoff;
+        double	fcutoff;
         unsigned
                 order;
         valarray<TFloat>
@@ -268,9 +282,10 @@ struct SCachedBandPassCourse
                 {
                         if ( data.size() == 0 ||
                              ffrom != ffrom_ || fupto != fupto_ || order != order_ )
-                                data = exstrom::band_pass( SSignalRef<T>::signal, SSignalRef<T>::samplerate,
-                                                           ffrom = ffrom_, fupto = fupto_, order = order_,
-                                                           true);
+                                data = exstrom::band_pass(
+					SSignalRef<T>::signal, SSignalRef<T>::samplerate,
+					ffrom = ffrom_, fupto = fupto_, order = order_,
+					true);
                         return data;
                 }
         void drop()
@@ -279,7 +294,7 @@ struct SCachedBandPassCourse
                 }
 
     private:
-        double        ffrom, fupto;
+        double	ffrom, fupto;
         unsigned
                 order;
         valarray<TFloat>
@@ -309,7 +324,6 @@ phase_diff( const SSignalRef<T>& sig1,
 
 
 
-
 #include "sigproc.ii"
 
 } // namespace sigproc
diff --git a/upstream/src/libsigproc/sigproc.ii b/upstream/src/libsigproc/sigproc.ii
index 27a858b..9c0ef9f 100644
--- a/upstream/src/libsigproc/sigproc.ii
+++ b/upstream/src/libsigproc/sigproc.ii
@@ -86,9 +86,9 @@ interpolate( const vector<unsigned long>& xi,
 
         gsl_spline_init( spline, &x_known[0], &y_known[0], xi.size());
 
-        double        t;
-        size_t        pad = (1./samplerate / dt) // this I understand
-                        / 2;                // this, I don't
+        double	t;
+        size_t	pad = (1./samplerate / dt) // this I understand
+		       / 2;                // this, I don't
         valarray<T>
                 out (ceilf((x_known[x_known.size()-1] - x_known[0] + 1./samplerate) / dt) + 1);
         for ( i = pad, t = x_known[0]; t < x_known[x_known.size()-1]; ++i, t += dt )
@@ -97,7 +97,7 @@ interpolate( const vector<unsigned long>& xi,
         gsl_interp_accel_free( acc);
         gsl_spline_free( spline);
 
-        return move( out);
+        return move(out);
 }
 
 
@@ -115,8 +115,8 @@ envelope( const SSignalRef<T>& in,
           vector<unsigned long> *mini_p = nullptr, // return vector of extremum indices
           vector<unsigned long> *maxi_p = nullptr)
 {
-        auto&        S = in.signal;
-        ssize_t        n_samples = S.size(),
+        auto&	S = in.signal;
+        ssize_t	n_samples = S.size(),
                 dh2 = dh_ * in.samplerate / 2;
 
         vector<unsigned long>
@@ -204,9 +204,9 @@ dzcdf( const SSignalRef<T>& in,
         valarray<T> y (in.signal.size());
 
       // calculate the bloody zcdf
-        double        window = 4*dt; // half a second, good enough
-        double        t, tdiff;
-        size_t        I = 0, J;
+        double	window = 4*dt; // half a second, good enough
+        double	t, tdiff;
+        size_t	I = 0, J;
         for ( size_t i = 0; i < out_size; ++i ) {
                 t = i*dt;
                 xi[i] = t * in.samplerate;
@@ -270,8 +270,8 @@ phase_diff( const SSignalRef<T>& sig1,
                 sig2p = exstrom::band_pass( valarray<T> (&sig2.signal[sa], sz - sa), sig2.samplerate, fa, fz, order, true);
 
       // slide one against the other a little
-        double        diff = INFINITY, old_diff, diff_min = INFINITY;
-        int        dist, dist_min = 0;
+        double	diff = INFINITY, old_diff, diff_min = INFINITY;
+        int	dist, dist_min = 0;
         // go east
         dist = 0;
         do {
diff --git a/upstream/src/libsigproc/winfun.cc b/upstream/src/libsigproc/winfun.cc
index 9d36407..a81110f 100644
--- a/upstream/src/libsigproc/winfun.cc
+++ b/upstream/src/libsigproc/winfun.cc
@@ -18,14 +18,6 @@
 
 using namespace std;
 
-// must match those defined in glade
-const char*
-        sigproc::welch_window_type_names[sigproc::TWinType::TWinType_total] = {
-        "Bartlett", "Blackman", "Blackman-Harris",
-        "Hamming",  "Hanning",  "Parzen",
-        "Square",   "Welch"
-};
-
 
 namespace {
 
@@ -133,6 +125,19 @@ TFloat (*sigproc::winf[])(size_t, size_t) = {
         win_welch
 };
 
+// must match those defined in glade
+const char*
+        sigproc::welch_window_type_names[sigproc::TWinType::TWinType_total] = {
+        "Bartlett",
+	"Blackman",
+	"Blackman-Harris",
+        "Hamming",
+	"Hanning",
+	"Parzen",
+        "Square",
+	"Welch"
+};
+
 
 // Local Variables:
 // Mode: c++

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list