From 36a580a79a2ed5956a2768120c1e4d0ec1fe7b5c Mon Sep 17 00:00:00 2001
From: Jakob Voigts <jvoigts@mit.edu>
Date: Sat, 23 Apr 2016 23:38:10 -0400
Subject: [PATCH] added range markers

---
 .../LfpDisplayNode/LfpDisplayCanvas.cpp       | 29 +++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
index ea3a3419c..2f9f0c32d 100644
--- a/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
+++ b/Source/Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp
@@ -420,10 +420,11 @@ void LfpDisplayCanvas::resized()
     
     brightnessSliderA->setBounds(920,getHeight()-50,100,22);
     sliderALabel->setBounds(1020, getHeight()-50, 180, 22);
+    brightnessSliderA->setValue(0.9); //set default value
     
     brightnessSliderB->setBounds(920,getHeight()-25,100,22);
     sliderBLabel->setBounds(1020, getHeight()-25, 180, 22);
-
+    brightnessSliderB->setValue(0.1); //set default value
     
     int bh = 25/typeButtons.size();
     for (int i = 0; i < typeButtons.size(); i++)
@@ -2109,10 +2110,28 @@ void LfpChannelDisplay::pxPaint()
         for (int i = ifrom; i < ito ; i += stepSize) // redraw only changed portion
         {
             
-            int zeromarker = getY()+center;
-            if(zeromarker>0 & zeromarker<display->lfpChannelBitmap.getHeight()){
-                if ( bdLfpChannelBitmap.getPixelColour(i,zeromarker) == Colour(0,0,0) ) { // make sure we're not drawing over an existing plot from another channel
-                    bdLfpChannelBitmap.setPixelColour(i,zeromarker,Colour(50,50,50));
+            //draw zero line
+            int m = getY()+center;
+            if(m>0 & m<display->lfpChannelBitmap.getHeight()){
+                if ( bdLfpChannelBitmap.getPixelColour(i,m) == Colour(0,0,0) ) { // make sure we're not drawing over an existing plot from another channel
+                    bdLfpChannelBitmap.setPixelColour(i,m,Colour(50,50,50));
+                }
+            }
+            
+            //draw range margers
+            if (isSelected)
+            {
+                m = getY()+center+channelHeight/2;
+                if(m>0 & m<display->lfpChannelBitmap.getHeight()){
+                    if ( bdLfpChannelBitmap.getPixelColour(i,m) == Colour(0,0,0) ) { // make sure we're not drawing over an existing plot from another channel
+                        bdLfpChannelBitmap.setPixelColour(i,m,Colour(50,50,50));
+                    }
+                }
+                m = getY()+center-channelHeight/2;
+                if(m>0 & m<display->lfpChannelBitmap.getHeight()){
+                    if ( bdLfpChannelBitmap.getPixelColour(i,m) == Colour(0,0,0) ) { // make sure we're not drawing over an existing plot from another channel
+                        bdLfpChannelBitmap.setPixelColour(i,m,Colour(50,50,50));
+                    }
                 }
             }
             
-- 
GitLab