From 330f0eebe3bd5560770fa57fa6f15a15beac49e0 Mon Sep 17 00:00:00 2001
From: kmichaelfox <kmichaelfox.contact@gmail.com>
Date: Thu, 7 Sep 2017 17:25:15 -0700
Subject: [PATCH] Add subprocessor channel filtering by sample rate to
 LfpDisplayEditor

---
 Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp | 5 ++---
 Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayEditor.cpp | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp b/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp
index d11d15f8b..faf09813c 100644
--- a/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp
+++ b/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp
@@ -573,7 +573,7 @@ int LfpDisplayCanvas::getChannelSampleRate(int channel)
 
 void LfpDisplayCanvas::setDrawableSampleRate(float samplerate)
 {
-    std::cout << "setting the drawable sample rate in the canvas" << std::endl;
+//    std::cout << "setting the drawable sample rate in the canvas" << std::endl;
     lfpDisplay->setDisplayedSampleRate(samplerate);
 }
 
@@ -2167,7 +2167,6 @@ int LfpDisplay::getRange(DataChannel::DataChannelTypes type)
 
 void LfpDisplay::setChannelHeight(int r, bool resetSingle)
 {
-    std::cout << "setting channel height in LfpDisplay" << std::endl;
     if (!getSingleChannelState()) cachedDisplayChannelHeight = r;
     
     for (int i = 0; i < numChans; i++)
@@ -2246,7 +2245,7 @@ float LfpDisplay::getDisplayedSampleRate()
 // already as a result of some other procedure
 void LfpDisplay::setDisplayedSampleRate(float samplerate)
 {
-    std::cout << "Setting the displayed samplerate for LfpDisplayCanvas to " << samplerate << std::endl;
+//    std::cout << "Setting the displayed samplerate for LfpDisplayCanvas to " << samplerate << std::endl;
     drawableSampleRate = samplerate;
 }
 
diff --git a/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayEditor.cpp b/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayEditor.cpp
index ebe0fe29b..73f800555 100644
--- a/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayEditor.cpp
+++ b/Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayEditor.cpp
@@ -124,6 +124,7 @@ void LfpDisplayEditor::updateSubprocessorSelectorOptions()
     
     if (sampleRateToSet >= 0)
     {
+        subprocessorSelection->setSelectedId(sampleRateToSet + 1, dontSendNotification);
         setCanvasDrawableSampleRate(sampleRateToSet);
     }
 }
@@ -132,7 +133,6 @@ void LfpDisplayEditor::setCanvasDrawableSampleRate(int index)
 {
     if (canvas)
     {
-        std::cout << "selected index = " << index << std::endl;
         ((LfpDisplayCanvas*)canvas.get())->setDrawableSampleRate(*(inputSampleRates.begin() + (index)));
     }
 }
-- 
GitLab