From 5a71aabe795699dc564c4f609e478609e99c3651 Mon Sep 17 00:00:00 2001
From: Aaron Cuevas Lopez <aacuelo@teleco.upv.es>
Date: Thu, 12 Jan 2017 05:21:04 +0100
Subject: [PATCH] Create own virtual methods for
 GenericEditor::startAcquisition and stopAcquisition

---
 .../ChannelMappingNode/ChannelMappingEditor.cpp       |  1 -
 Source/Plugins/SerialInput/SerialInputEditor.cpp      |  2 --
 Source/Processors/Editors/GenericEditor.cpp           | 11 ++++++++---
 Source/Processors/Editors/GenericEditor.h             | 10 ++++++++--
 Source/Processors/FileReader/FileReaderEditor.cpp     |  4 ----
 Source/Processors/FileReader/FileReaderEditor.h       |  4 ++--
 .../Processors/GenericProcessor/GenericProcessor.cpp  |  4 ++--
 7 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Source/Plugins/ChannelMappingNode/ChannelMappingEditor.cpp b/Source/Plugins/ChannelMappingNode/ChannelMappingEditor.cpp
index 18d46f974..293edda18 100644
--- a/Source/Plugins/ChannelMappingNode/ChannelMappingEditor.cpp
+++ b/Source/Plugins/ChannelMappingNode/ChannelMappingEditor.cpp
@@ -951,7 +951,6 @@ void ChannelMappingEditor::startAcquisition()
 {
 	if (reorderActive)
 		modifyButton->setToggleState(false,sendNotificationSync);
-	GenericEditor::startAcquisition();
 }
 
 int ChannelMappingEditor::getChannelDisplayNumber(int chan) const
diff --git a/Source/Plugins/SerialInput/SerialInputEditor.cpp b/Source/Plugins/SerialInput/SerialInputEditor.cpp
index 070935b7c..18cc7d6da 100644
--- a/Source/Plugins/SerialInput/SerialInputEditor.cpp
+++ b/Source/Plugins/SerialInput/SerialInputEditor.cpp
@@ -73,7 +73,6 @@ void SerialInputEditor::startAcquisition()
     deviceList->setEnabled(false);
     baudrateList->setEnabled(false);
     refreshButton->setEnabled(false);
-    GenericEditor::startAcquisition();
 }
 
 void SerialInputEditor::stopAcquisition()
@@ -82,7 +81,6 @@ void SerialInputEditor::stopAcquisition()
     deviceList->setEnabled(true);
     baudrateList->setEnabled(true);
     refreshButton->setEnabled(true);
-    GenericEditor::stopAcquisition();
 }
 
 
diff --git a/Source/Processors/Editors/GenericEditor.cpp b/Source/Processors/Editors/GenericEditor.cpp
index 12a2fd060..36b2f6d6f 100755
--- a/Source/Processors/Editors/GenericEditor.cpp
+++ b/Source/Processors/Editors/GenericEditor.cpp
@@ -311,9 +311,9 @@ void GenericEditor::stopRecording()
         channelSelector->activateRecButtons();
 }
 
-void GenericEditor::startAcquisition()
+void GenericEditor::editorStartAcquisition()
 {
-
+	startAcquisition();
     //std::cout << "GenericEditor received message to start acquisition." << std::endl;
 
     if (channelSelector != 0)
@@ -331,8 +331,10 @@ void GenericEditor::startAcquisition()
 
 }
 
-void GenericEditor::stopAcquisition()
+void GenericEditor::editorStopAcquisition()
 {
+	stopAcquisition();
+
     if (channelSelector != 0)
         channelSelector->stopAcquisition();
 
@@ -348,6 +350,9 @@ void GenericEditor::stopAcquisition()
 
 }
 
+void GenericEditor::startAcquisition() {}
+void GenericEditor::stopAcquisition() {}
+
 void GenericEditor::fadeIn()
 {
     isFading = true;
diff --git a/Source/Processors/Editors/GenericEditor.h b/Source/Processors/Editors/GenericEditor.h
index 8cbd08d15..bf01af411 100755
--- a/Source/Processors/Editors/GenericEditor.h
+++ b/Source/Processors/Editors/GenericEditor.h
@@ -131,10 +131,16 @@ public:
     void stopRecording();
 
     /** Called just prior to the start of acquisition, to allow the editor to prepare.*/
-    virtual void startAcquisition();
+    void editorStartAcquisition();
+
+	/** Called just prior to the start of acquisition, to allow custom commands. */
+	virtual void startAcquisition();
 
     /** Called after the end of acquisition.*/
-    virtual void stopAcquisition();
+    void editorStopAcquisition();
+
+	/** Called after the end of acquisition, to allow custom commands .*/
+	virtual void stopAcquisition();
 
     /** Returns the name of the editor.*/
     String getName();
diff --git a/Source/Processors/FileReader/FileReaderEditor.cpp b/Source/Processors/FileReader/FileReaderEditor.cpp
index f8edf2a7c..71ea74d9b 100644
--- a/Source/Processors/FileReader/FileReaderEditor.cpp
+++ b/Source/Processors/FileReader/FileReaderEditor.cpp
@@ -204,8 +204,6 @@ void FileReaderEditor::startAcquisition()
 {
     recordSelector->setEnabled (false);
     timeLimits->setEnable (false);
-
-    GenericEditor::startAcquisition();
 }
 
 
@@ -213,8 +211,6 @@ void FileReaderEditor::stopAcquisition()
 {
     recordSelector->setEnabled (true);
     timeLimits->setEnable (true);
-
-    GenericEditor::stopAcquisition();
 }
 
 
diff --git a/Source/Processors/FileReader/FileReaderEditor.h b/Source/Processors/FileReader/FileReaderEditor.h
index 724384e50..c66794e54 100644
--- a/Source/Processors/FileReader/FileReaderEditor.h
+++ b/Source/Processors/FileReader/FileReaderEditor.h
@@ -67,8 +67,8 @@ public:
     void setTotalTime   (unsigned int ms);
     void setCurrentTime (unsigned int ms);
 
-    void startAcquisition() override;
-    void stopAcquisition()  override;
+	void startAcquisition() override;
+	void stopAcquisition()  override;
 
     void setFile (String file);
 
diff --git a/Source/Processors/GenericProcessor/GenericProcessor.cpp b/Source/Processors/GenericProcessor/GenericProcessor.cpp
index 79cbadf38..abc131ddf 100755
--- a/Source/Processors/GenericProcessor/GenericProcessor.cpp
+++ b/Source/Processors/GenericProcessor/GenericProcessor.cpp
@@ -525,7 +525,7 @@ void GenericProcessor::enableEditor()
     GenericEditor* ed = getEditor();
 
     if (ed != 0)
-        ed->startAcquisition();
+        ed->editorStartAcquisition();
 }
 
 
@@ -534,7 +534,7 @@ void GenericProcessor::disableEditor()
     GenericEditor* ed = getEditor();
 
     if (ed != nullptr)
-        ed->stopAcquisition();
+        ed->editorStopAcquisition();
 }
 
 
-- 
GitLab