Skip to content

Commit 1298e0e

Browse files
committed
update plugins to use new event information
1 parent 87f6b98 commit 1298e0e

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

Plugins/LfpDisplayNode/LfpDisplayNode.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,15 @@ void LfpDisplayNode::updateSettings()
131131

132132
uint32 LfpDisplayNode::getChannelSourceID(const EventChannel* event) const
133133
{
134-
int metaDataIndex = event->findMetaData(MetaDataDescriptor::UINT16, 3, "source.channel.identifier.full");
135-
if (metaDataIndex < 0)
134+
135+
if (event->getTimestampOrigin() == EventChannel::timestampsDerivedFromChannel)
136+
{
137+
return getProcessorFullId(event->getTimestampOriginProcessor(), event->getTimestampOriginSubProcessor());
138+
}
139+
else
136140
{
137141
return getProcessorFullId(event->getSourceNodeID(), event->getSubProcessorIdx());
138142
}
139-
uint16 values[3];
140-
event->getMetaDataValue(metaDataIndex)->getValue(static_cast<uint16*>(values));
141-
return getProcessorFullId(values[1], values[2]);
142143
}
143144

144145
void LfpDisplayNode::setSubprocessor(int sp)

Plugins/LfpDisplayNodeBeta/LfpDisplayNode.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ void LfpDisplayNode::updateSettings()
9696

9797
uint32 LfpDisplayNode::getChannelSourceID(const EventChannel* event) const
9898
{
99-
int metaDataIndex = event->findMetaData(MetaDataDescriptor::UINT16, 3, "source.channel.identifier.full");
100-
if (metaDataIndex < 0)
99+
if (event->getTimestampOrigin() == EventChannel::timestampsDerivedFromChannel)
100+
{
101+
return getProcessorFullId(event->getTimestampOriginProcessor(), event->getTimestampOriginSubProcessor());
102+
}
103+
else
101104
{
102105
return getProcessorFullId(event->getSourceNodeID(), event->getSubProcessorIdx());
103106
}
104-
uint16 values[3];
105-
event->getMetaDataValue(metaDataIndex)->getValue(static_cast<uint16*>(values));
106-
return getProcessorFullId(values[1], values[2]);
107107
}
108108

109109
bool LfpDisplayNode::resizeBuffer()

Plugins/PhaseDetector/PhaseDetector.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ void PhaseDetector::updateSettings()
143143
if (getNumInputs() != lastNumInputs)
144144
modules.getReference(i).inputChan = -1;
145145
const DataChannel* in = getDataChannel(modules[i].inputChan);
146-
EventChannel* ev = new EventChannel(EventChannel::TTL, 8, 1, (in) ? in->getSampleRate() : CoreServices::getGlobalSampleRate(), this);
146+
EventChannel *ev;
147+
if (in)
148+
ev = new EventChannel(EventChannel::TTL, 8, 1, in, this);
149+
else
150+
ev = new EventChannel(EventChannel::TTL, 8, 1, -1, this);
151+
147152
ev->setName("Phase detector output " + String(i + 1));
148153
ev->setDescription("Triggers when the input signal mets a given phase condition");
149154
String identifier = "dataderived.phase.";

0 commit comments

Comments
 (0)