You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovasCPluginLSLOutput.h 1.5KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * \brief Acquisition Server plugin outputting signals and stimulations to LabStreamingLayer (LSL) streams
  3. * \version 0.1
  4. * \author Jussi T. Lindgren / Inria
  5. */
  6. #pragma once
  7. #if defined TARGET_HAS_ThirdPartyLSL
  8. #include <lsl_cpp.h>
  9. #include "ovasIAcquisitionServerPlugin.h"
  10. namespace OpenViBE {
  11. namespace AcquisitionServer {
  12. class CAcquisitionServer;
  13. namespace Plugins {
  14. class CPluginLSLOutput final : public IAcquisitionServerPlugin
  15. {
  16. // Plugin interface
  17. public:
  18. explicit CPluginLSLOutput(const Kernel::IKernelContext& ctx);
  19. ~CPluginLSLOutput() override;
  20. bool startHook(const std::vector<CString>& selectedChannelNames, const size_t sampling, const size_t nChannel, const size_t nSamplePerSentBlock) override;
  21. void stopHook() override;
  22. void loopHook(std::deque<std::vector<float>>& buffers, CStimulationSet& stimSet, const uint64_t start, const uint64_t end,
  23. const uint64_t sampleTime) override;
  24. // Plugin implementation
  25. bool m_IsLSLOutputEnabled = false;
  26. std::string m_SignalStreamName = "openvibeSignal";
  27. std::string m_SignalStreamID;
  28. std::string m_MarkerStreamName = "openvibeMarkers";
  29. std::string m_MarkerStreamID;
  30. private:
  31. lsl::stream_outlet* m_signalOutlet = nullptr;
  32. lsl::stream_outlet* m_stimulusOutlet = nullptr;
  33. size_t m_nSamplePerSentBlock = 0;
  34. bool m_useOVTimestamps = false;
  35. CTime m_startTime = CTime(0);
  36. };
  37. } // namespace Plugins
  38. } // namespace AcquisitionServer
  39. } // namespace OpenViBE
  40. #endif // TARGET_HAS_ThirdPartyLSL