The following commit has been merged in the master branch:
commit a8b11d915e50f7c1ee1f3cf49e6e4e3f72085a96
Author: Andrei Zavada <[email protected]>
Date:   Thu Apr 25 19:16:55 2013 +0300

    elicit embedded annotations on montage

diff --git a/src/ui/sf/montage.cc b/src/ui/sf/montage.cc
index 36c2cd4..71fb38d 100644
--- a/src/ui/sf/montage.cc
+++ b/src/ui/sf/montage.cc
@@ -778,26 +778,27 @@ draw_montage( cairo_t* cr)
                        auto    wa = fmod(aa, evpz) / evpz * da_wd,
                                ww = (ae - aa) / evpz * da_wd;
 
-                       if ( A.type == sigfile::SAnnotation::TType::plain ) {
-                               int disp = 0 +
-                                       ((last_z > A.span.a)
-                                        ? ++overlap_count * 5
-                                        : (overlap_count = 0));
-                               last_z = A.span.z;
-
-                               
_p.CwB[SExpDesignUI::TColour::sf_embedded_annotations].set_source_rgba( cr);
-
-                               cairo_set_line_width( cr, 2.5);
-                               cairo_rectangle( cr, wa, 0, ww, da_ht);
-                               cairo_fill( cr);
-                               cairo_stroke( cr);
+                       int disp = 0 +
+                               ((last_z > A.span.a)
+                                ? ++overlap_count * 5
+                                : (overlap_count = 0));
+                       last_z = A.span.z;
+
+                       
_p.CwB[SExpDesignUI::TColour::sf_embedded_annotations].set_source_rgba( cr, .9);
+                       cairo_set_line_width( cr, 2.5);
+                       cairo_rectangle( cr, wa, 0, ww, da_ht);
+                       cairo_stroke( cr);
 
-                               cairo_select_font_face( cr, "serif", 
CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
-                               cairo_set_font_size( cr, 11);
-                               cairo_set_source_rgb( cr, 0., 0., 0.);
-                               cairo_move_to( cr, fmod(aa, evpz) / evpz * 
da_wd, da_ht - 12 - disp);
-                               cairo_show_text( cr, A.label.c_str());
-                       }
+                       
_p.CwB[SExpDesignUI::TColour::sf_embedded_annotations].set_source_rgba( cr);
+                       cairo_rectangle( cr, wa, 0, ww, da_ht);
+                       cairo_fill( cr);
+                       cairo_stroke( cr);
+
+                       cairo_select_font_face( cr, "serif", 
CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
+                       cairo_set_font_size( cr, 11);
+                       cairo_set_source_rgb( cr, 0., 0., 0.);
+                       cairo_move_to( cr, fmod(aa, evpz) / evpz * da_wd, da_ht 
- 12 - disp);
+                       cairo_show_text( cr, A.label.c_str());
                }
        }
        case TMode::showing_remixed:
diff --git a/src/ui/sf/sf.cc b/src/ui/sf/sf.cc
index a74d29c..b669686 100644
--- a/src/ui/sf/sf.cc
+++ b/src/ui/sf/sf.cc
@@ -142,10 +142,12 @@ SScoringFacility (agh::CSubject& J,
        for ( auto& H : channels )
                for ( auto& A : H.crecording.F().annotations() )
                        common_annotations.push_back( {&H.crecording.F(), &A}); 
// bitch&
-       sort( common_annotations.begin(), common_annotations.end(),
+       common_annotations.sort(
              []( const pair<const sigfile::CSource*, const 
sigfile::SAnnotation*>& a1,
                  const pair<const sigfile::CSource*, const 
sigfile::SAnnotation*>& a2)
              { return *a1.second < *a2.second; });
+       common_annotations.unique();
+       printf( "collected %zu embedded annotations\n", 
common_annotations.size());
 
       // count n_eeg_channels
        n_eeg_channels =
diff --git a/src/ui/sf/sf.hh b/src/ui/sf/sf.hh
index d334981..ac60163 100644
--- a/src/ui/sf/sf.hh
+++ b/src/ui/sf/sf.hh
@@ -314,7 +314,7 @@ class SScoringFacility
        update_all_channels_profile_display_scale();
 
       // collected common annotations
-       vector<pair<const sigfile::CSource*, const sigfile::SAnnotation*>>
+       list<pair<const sigfile::CSource*, const sigfile::SAnnotation*>>
                common_annotations;
 
       // timeline

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to