remote_control.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "include/remote_notify.h"
  3. class SocketRemote;
  4. class CMessageQueue;
  5. class CRemoteCtrl:public IRemoteCtrl,public IRemoteNotify
  6. {
  7. public:
  8. CRemoteCtrl(IMonitroNotify* n);
  9. virtual void Login(std::string account, std::string pass) override;
  10. virtual void Start(EgoType type, std::array<IRender*, RenderPosition::ALL>& ar) override;
  11. virtual std::string GetAccount() override;
  12. virtual std::string GetPassword() override;
  13. virtual std::string GetName() override;
  14. virtual void ReqUserList() override;
  15. virtual void OnConnect(int32_t peer) override;
  16. virtual void OnLeave() override;
  17. virtual void OnConnected(bool bRet) override;
  18. virtual void OnRobot(const remote::Robot& robot) override;
  19. virtual void OnLogin(int32_t uid, bool bRet) override;
  20. virtual void OnVideoReq(int32_t index, int32_t peer) override;
  21. virtual void OnVideoOffer(int32_t index, const char* type, const char* sdp) override;
  22. virtual void OnVideoAnswer(int32_t index, const char* type, const char* sdp) override;
  23. virtual void OnVideoCandidate(int32_t index, const char* candidate,
  24. int32_t sdp_mline_index,
  25. const char* sdp_mid) override;
  26. virtual void OnNotifyState(int32_t rid, UserState state) override;
  27. virtual void OnVideoRep(bool ok, int32_t index, int32_t peer) override;
  28. virtual void OnNotifyDel(int32_t peer, EgoType type) override;
  29. virtual void OnVideoLeave(int32_t peer, EgoType type) override;
  30. virtual void OverlayVideo(RenderPosition pos,const webrtc::VideoFrame& frame) override;
  31. EgoType GetType();
  32. SocketRemote* GetRemoteClient();
  33. private:
  34. IMonitroNotify* _notify;
  35. EgoType _type = EgoType::User;
  36. std::unique_ptr<SocketRemote> _client;
  37. bool _connected = false;
  38. std::string _accountText;
  39. std::string _passText;
  40. std::string _account;
  41. std::string _pass;
  42. std::string _name;
  43. int32_t _peer = -1;
  44. std::unique_ptr< CMessageQueue> _message;
  45. int32_t _uid = -1;
  46. };