This is an automated email from the git hooks/post-receive script. hmmr-guest pushed a commit to branch master in repository aghermann.
commit e8bf672c1f466a0e68d5736908bad1beebfa053d Author: Andrei Zavada <[email protected]> Date: Sun Sep 15 02:10:31 2013 +0300 SF: fix next/prev annotation jump --- upstream/src/aghermann/ui/sf/montage_cb.cc | 6 +++--- upstream/src/aghermann/ui/sf/sf.cc | 14 +++++++------- upstream/src/aghermann/ui/sf/sf.hh | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/upstream/src/aghermann/ui/sf/montage_cb.cc b/upstream/src/aghermann/ui/sf/montage_cb.cc index bdf9475..ac1628c 100644 --- a/upstream/src/aghermann/ui/sf/montage_cb.cc +++ b/upstream/src/aghermann/ui/sf/montage_cb.cc @@ -1071,7 +1071,7 @@ iSFPageAnnotationGotoNext_activate_cb( return; size_t p = SF.cur_vpage(); while ( ++p < SF.total_vpages() ) - if ( SF.page_has_annotations( p, *SF.using_channel)) { + if ( SF.vpage_has_annotations( p, *SF.using_channel)) { SF.sb_clear(); SF.set_cur_vpage( p); return; @@ -1090,9 +1090,9 @@ iSFPageAnnotationGotoPrev_activate_cb( return; size_t p = SF.cur_vpage(); while ( --p != (size_t)-1 ) - if ( SF.page_has_annotations( p, *SF.using_channel)) { + if ( SF.vpage_has_annotations( p, *SF.using_channel)) { SF.sb_clear(); - SF.set_cur_vpage( p); + SF.set_cur_page( p); return; } SF.sb_message( "No more annotations before this"); diff --git a/upstream/src/aghermann/ui/sf/sf.cc b/upstream/src/aghermann/ui/sf/sf.cc index 05abd01..835c15a 100644 --- a/upstream/src/aghermann/ui/sf/sf.cc +++ b/upstream/src/aghermann/ui/sf/sf.cc @@ -631,16 +631,16 @@ page_has_artifacts( const size_t p, const bool search_all) const bool SScoringFacility:: -page_has_annotations( const size_t p, const SChannel& H) const +vpage_has_annotations( const size_t p, const SChannel& H) const { - int half_pad_samples = skirting_run_per1 * vpagesize() * H.samplerate(); - int cvpa = p * pagesize() * H.samplerate() - half_pad_samples, - cvpe = (p+1) * pagesize() * H.samplerate() + half_pad_samples; - for ( auto &A : H.annotations ) - if ( agh::alg::overlap( (int)A.span.a, (int)A.span.z, cvpa, cvpe) ) + for ( auto &A : H.annotations ) { + if ( agh::alg::overlap( + A.span.a, A.span.z, + (p + 0.) * vpagesize(), (p+1.) * vpagesize()) ) return true; - else if ( (int)A.span.a > cvpe ) // no more up to and on current page + else if ( A.span.a > (p+1.) * vpagesize() ) // no more up to and on current page return false; + } return false; } diff --git a/upstream/src/aghermann/ui/sf/sf.hh b/upstream/src/aghermann/ui/sf/sf.hh index 0523f42..6377706 100644 --- a/upstream/src/aghermann/ui/sf/sf.hh +++ b/upstream/src/aghermann/ui/sf/sf.hh @@ -142,6 +142,8 @@ class SScoringFacility size_t cur_page() const { return _cur_page; } size_t cur_vpage() const { return _cur_vpage; } void set_cur_vpage( size_t p, bool touch_self = true); + void set_cur_page( size_t p, bool touch_self = true) + { set_cur_vpage( p2ap(p), touch_self); } size_t cur_page_start() const // in seconds @@ -156,7 +158,7 @@ class SScoringFacility { return sigfile::SPage::char2score( hypnogram[_cur_page]); } bool page_has_artifacts( size_t, bool check_all_channels = true) const; - bool page_has_annotations( size_t, const SChannel&) const; + bool vpage_has_annotations( size_t, const SChannel&) const; // pagesize size_t pagesize() const; -- Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
