LibMuse 6.0.2
com.choosemuse.libmuse.MuseDataListener Class Referenceabstract

Public Member Functions

abstract void receiveMuseDataPacket (MuseDataPacket packet, Muse muse)
 
abstract void receiveMuseArtifactPacket (MuseArtifactPacket packet, Muse muse)
 

Detailed Description

Implement this interface to receive data from the headband. The data may be either data packets or artifact packets. Check out MuseDataPacketType for information about all acceptable data packet types. All packets can be handled in one listener or you can specify a separate listener for every specific packet type.

A packet is only sent if a listener was registered to listen for this packet type.

Member Function Documentation

§ receiveMuseArtifactPacket()

abstract void com.choosemuse.libmuse.MuseDataListener.receiveMuseArtifactPacket ( MuseArtifactPacket  packet,
Muse  muse 
)
abstract

Handler method for Muse artifact packets. Packet is sent only if listener was registered to listen for such packets.

Warning
It is important that you do not perform any computation intensive tasks in this callback. This would result in significant delays in all the listener callbacks from being called. You should delegate any intensive tasks to another thread or schedule it to run with a delay through handler/scheduler for the platform.

However, you can register/unregister listeners in this callback. All previously registered listeners would still receive callbacks for this current event. On subsequent events, the newly registered listeners will be called. For example, if you had 2 listeners 'A' and 'B' for this event. If, on the callback for listener A, listener A unregisters all listeners and registers a new listener 'C' and then in the callback for listener 'B', you unregister all listeners again and register a new listener 'D'. Then on the subsequent event callback, only listener D's callback will be invoked.

Parameters
packetThe artifact packet
museThe Muse that sent the artifact packet.

§ receiveMuseDataPacket()

abstract void com.choosemuse.libmuse.MuseDataListener.receiveMuseDataPacket ( MuseDataPacket  packet,
Muse  muse 
)
abstract

Handler method for Muse data packets

Warning
It is important that you do not perform any computation intensive tasks in this callback. This would result in significant delays in all the listener callbacks from being called. You should delegate any intensive tasks to another thread or schedule it to run with a delay through handler/scheduler for the platform.

However, you can register/unregister listeners in this callback. All previously registered listeners would still receive callbacks for this current event. On subsequent events, the newly registered listeners will be called. For example, if you had 2 listeners 'A' and 'B' for this event. If, on the callback for listener A, listener A unregisters all listeners and registers a new listener 'C' and then in the callback for listener 'B', you unregister all listeners again and register a new listener 'D'. Then on the subsequent event callback, only listener D's callback will be invoked.

Parameters
packetThe data packet
museThe Muse that sent the data packet.

The documentation for this class was generated from the following file: