Skip to content

Commit fc01f00

Browse files
authored
Merge pull request #260 from melodieborel/master
PSTH fixes
2 parents 77dbd04 + 15757ed commit fc01f00

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Source/Plugins/EvntTrigAvg/EvntTrigAvg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void EvntTrigAvg::handleEvent(const EventChannel* eventInfo, const MidiMessage&
182182
else if (eventInfo->getChannelType() == EventChannel::TTL && eventInfo == eventChannelArray[triggerEvent])
183183
{// if TTL from right channel
184184
TTLEventPtr ttl = TTLEvent::deserializeFromMessage(event, eventInfo);
185-
if (ttl->getChannel() == triggerChannel)
185+
if (ttl->getChannel() == triggerChannel && ttl->getState())
186186
ttlTimestampBuffer.push_back(Event::getTimestamp(event)); // add timestamp of TTL to buffer
187187
}
188188
}
@@ -290,7 +290,7 @@ AudioProcessorEditor* EvntTrigAvg::createEditor()
290290

291291
float EvntTrigAvg::getSampleRate()
292292
{
293-
return juce::AudioProcessor::getSampleRate();
293+
return CoreServices::getGlobalSampleRate();
294294
}
295295

296296
int EvntTrigAvg::getLastTTLCalculated()

Source/Plugins/EvntTrigAvg/EvntTrigAvgCanvas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ void EvntTrigAvgDisplay::paint(Graphics &g)
234234
GraphUnit* graph;
235235
ScopedLock myScopedLock(*processor->getMutex());
236236
if(histoData[i][1]==0){ // if sortedId == 0
237-
graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0]+sizeof(channelColours))%(sizeof(channelColours))],labels[histoData[i][0]],&minMaxMean[i][2],&histoData[i][2]); // pass &histoData[i][2] instead of 3 to pass on how many bins are used
237+
graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0])%16],labels[histoData[i][0]],&minMaxMean[i][2],&histoData[i][2]); // pass &histoData[i][2] instead of 3 to pass on how many bins are used
238238
}
239239
else{
240-
graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0]+sizeof(channelColours))%(sizeof(channelColours))],"ID "+String(histoData[i][1]),&minMaxMean[i][2],&histoData[i][2]);
240+
graph = new GraphUnit(processor,canvas,channelColours[(histoData[i][0])%16],"ID "+String(histoData[i][1]),&minMaxMean[i][2],&histoData[i][2]);
241241
}
242242
graphs.push_back(graph);
243243
graph->setBounds(0, 40*(graphCount), width-20, 40);

0 commit comments

Comments
 (0)