Muse-IO C++ - Receiving multiple Data Packets at once



I have downloaded the Windows Muse SDK and have looked at the sample code for ‘GettingData’.

I want to, at any given time, receive multiple data packets for metrics such as alpha, beta, gamma, theta, delta (relative and absolute) as well as artifact packets.

Am I right in thinking you need to have multiple data listeners for each data type you’re interested in? And then have separate instances of the DataModel class for each metric to store the packet data? E.g.

my_muse_->register_data_listener(data_listener_alpha_, MuseDataPacketType::ALPHA_RELATIVE);
my_muse_->register_data_listener(data_listener_beta_, MuseDataPacketType::BETA_RELATIVE);

void SessionPage::receive_muse_data_packet(const std::shared_ptr & packet, const std::shared_ptr & muse) {
if (packet->packet_type() == MuseDataPacketType::ALPHA_RELATIVE) {
OutputDebugString(L"MainPage::receive_muse_data_packet - ALPHA\n");
else if (packet->packet_type() == MuseDataPacketType::BETA_RELATIVE) {
OutputDebugString(L"MainPage::receive_muse_data_packet - BETA\n");
else {
OutputDebugString(L"MainPage::receive_muse_data_packet - GAMMA\n");

Essentially I would like to have it so my application can append a bunch of metrics to a CSV file for every second the Muse is running.

Thank you in advance.



You can setup a single listener then switch on the data packet type when you receive it.