123456789101112131415161718192021222324252627282930313233343536373839 |
- #pragma once
-
- #include <openvibe/ov_all.h>
- #include <toolkit/ovtk_all.h>
-
- #include <map>
- #include <vector>
- #include <string>
-
- class vrpn_Connection;
- class vrpn_Button_Server;
-
- namespace OpenViBE {
- namespace SSVEP {
- class CApplication;
-
- class CVRPNServer
- {
- public:
- static CVRPNServer* getInstance(CApplication* application);
- ~CVRPNServer() = default;
- void processFrame();
-
- void addButton(const CString& name, int buttonCount);
- void changeButtonState(const std::string& name, int index, int state);
- int getButtonState(const std::string& name, const int index) { return m_buttonCache[name][index]; }
-
- private:
- static CVRPNServer* m_vrpnServerInstance;
- static CApplication* m_application;
-
- explicit CVRPNServer(CApplication* application);
-
- vrpn_Connection* m_connection = nullptr;
- std::map<std::string, vrpn_Button_Server*> m_buttonServer;
- std::map<std::string, std::vector<int>> m_buttonCache;
- };
- } // namespace SSVEP
- } // namespace OpenViBE
|