Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor numeric type fixes

...

All data in the GUI is timestamped. The timestamps are represented in in64 int64 format, representing the sample count from the start of acquisition, which can be converted to seconds by dividing into the corresponding sample rate. In the case of continuous data, the timestamp corresponding to the first sample of each processing block can be obtained with the getTimestamp() method. For spikes and events, the timestamp is embedded into the data structure itself.

...

  • The type of data channel (HEADSTAGE, AUX, or ADC)
  • A string field with the units the data represents
  • A bitVolts field representing the conversion factor from float32 int16 format to uint16 float32 format.
  • An automatically-generated string with a historic of which processors this data has been through

...

An event or spike cannot be instantiated manually by the use of the new operator. Instead, each event class has a specialized static factory method that takes all the necessary data to create an event as well as its channel definition, so it can check that no mismatch exists. Once created, an event or spike cannot be modified. An example of event creation could be:

TextEventPtr textEvent = TextEvent::createTextEvent(textEventChannelPointer, timestamp, "Event Text");

Note that special pointer types have been created for each class to ensure that no memory leaks exist. Those are typedefs to Juce’s ScopedPointers templated to the right classes.

...

The handleEvent() and handleSpike() methods contain, as part of their arguments, a const reference to a MidiMessage which contains the serialized event as well as a const pointer to the matching channel definition. Event classes feature a static method to deserialize those messages into objects, similar to the create methods. In the same way, they need a pointer to the channel definition so it can know how to interpret the serialized data. An example would be:

TextEventPtr textEvent = TextEvent::deserializeFromMessage(midiMessage, channelPointer);

...