From 7986d2fc8c2661c138f9ae09a2ad1dfe9369ed6c Mon Sep 17 00:00:00 2001
From: Aaron Cuevas Lopez <aacuelo@teleco.upv.es>
Date: Fri, 7 Jul 2017 02:17:07 +0200
Subject: [PATCH] Add some needed methods to the record subsystem

---
 Source/Processors/RecordNode/EventQueue.h     | 3 ++-
 Source/Processors/RecordNode/RecordEngine.cpp | 5 +++++
 Source/Processors/RecordNode/RecordEngine.h   | 7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Source/Processors/RecordNode/EventQueue.h b/Source/Processors/RecordNode/EventQueue.h
index a83e6d45b..771bbc67e 100644
--- a/Source/Processors/RecordNode/EventQueue.h
+++ b/Source/Processors/RecordNode/EventQueue.h
@@ -130,7 +130,8 @@ private:
 
 	JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EventQueue);
 };
-
+//NOTE: Events are sent as midimessages while spikes as spike objects due to the difference on how they are passed to the record node.
+//Once the probe system is implemented, this will be normalized
 typedef EventQueue<MidiMessage> EventMsgQueue;
 typedef EventQueue<SpikeEvent> SpikeMsgQueue;
 typedef ReferenceCountedObjectPtr<AsyncEventMessage<MidiMessage>> EventMessagePtr;
diff --git a/Source/Processors/RecordNode/RecordEngine.cpp b/Source/Processors/RecordNode/RecordEngine.cpp
index ed88af8b1..6aaef305f 100644
--- a/Source/Processors/RecordNode/RecordEngine.cpp
+++ b/Source/Processors/RecordNode/RecordEngine.cpp
@@ -103,6 +103,11 @@ int RecordEngine::getNumRecordedChannels() const
     return channelMap.size();
 }
 
+int RecordEngine::getNumRecordedEvents() const
+{
+	return AccessClass::getProcessorGraph()->getRecordNode()->getTotalEventChannels();
+}
+
 void RecordEngine::registerSpikeSource (const GenericProcessor* processor) {}
 
 int RecordEngine::getNumRecordedProcessors() const
diff --git a/Source/Processors/RecordNode/RecordEngine.h b/Source/Processors/RecordNode/RecordEngine.h
index a87fa260f..f6864ec06 100644
--- a/Source/Processors/RecordNode/RecordEngine.h
+++ b/Source/Processors/RecordNode/RecordEngine.h
@@ -156,6 +156,7 @@ protected:
     /** Gets the specified channel from the channel array stored in RecordNode */
     const DataChannel* getDataChannel (int index) const;
 
+	/** Gets the specified event channel from the channel array stored in RecordNode */
 	const EventChannel* getEventChannel(int index) const;
 
     /** Gets the specified channel group info structure from the array stored in RecordNode */
@@ -173,6 +174,12 @@ protected:
     /** Gets the number of recorded channels */
     int getNumRecordedChannels() const;
 
+	/** Gets the number of recorded event channels
+	 (right now all channels are recorded) */
+	int getNumRecordedEvents() const;
+
+	/** TODO: to fill when the probe system is implemented*/
+	//int getNumRecordedSpikes() const;
 
     /** Gets the number of processors being recorded
     */
-- 
GitLab