public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, ISessionManager sessionManager, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager, IUserInputManager inputManager, IZipClient zipClient, IHttpClient httpClient, IConnectionManager connectionManager)
        {
            _logger = logManager.GetLogger("InternalDirectShowPlayer");
            _hiddenWindow = hiddenWindow;
            _presentation = presentation;
            _sessionManager = sessionManager;
            _httpClient = httpClient;
            _connectionManager = connectionManager;
            _playbackManager = playbackManager;
            _config = config;
            _isoManager = isoManager;
            _inputManager = inputManager;
            _zipClient = zipClient;

            _config.Configuration.InternalPlayerConfiguration.VideoConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.AudioConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.SubtitleConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.COMConfig.SetDefaults();

            //use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
            //if (_privateCom == null)
            //    _privateCom = new URCOMLoader(_config, _zipClient);
            URCOMLoader.Instance.Initialize(_config, _zipClient, logManager);

            EnsureMediaFilters();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericExternalPlayer" /> class.
 /// </summary>
 /// <param name="playbackManager">The playback manager.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="userInput">The user input.</param>
 public GenericExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput, IIsoManager isoManager)
 {
     _playbackManager = playbackManager;
     Logger           = logger;
     _userInput       = userInput;
     _isoManager      = isoManager;
 }
        public ScreensaverManager(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, IApiClient apiClient, ITheaterConfigurationManager theaterConfigurationManager, ILogManager logManager, IServerEvents serverEvents)
        {
            _userInput = userInput;
            _presentationManager = presentationManager;
            _playback = playback;
            _session = session;
            _apiClient = apiClient;
            _theaterConfigurationManager = theaterConfigurationManager;
            _logger = logManager.GetLogger(GetType().Name);
            _serverEvents = serverEvents;

            _session.UserLoggedIn += session_UserChanged;
            _session.UserLoggedOut += session_UserChanged;

            _playback.PlaybackCompleted += _playback_PlaybackCompleted;
            _playback.PlaybackStarted += _playback_PlaybackStarted;

            _serverEvents.BrowseCommand += _serverEvents_BrowseCommand;
            _serverEvents.MessageCommand += _serverEvents_MessageCommand;
            _serverEvents.PlayCommand += _serverEvents_PlayCommand;
            _serverEvents.PlaystateCommand += _serverEvents_PlaystateCommand;
            _serverEvents.GeneralCommand += _serverEvents_GeneralCommand; 

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            StartTimer();
        }
Ejemplo n.º 4
0
        public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, ISessionManager sessionManager, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager, IUserInputManager inputManager, IZipClient zipClient, IHttpClient httpClient, IConnectionManager connectionManager)
        {
            _logger            = logManager.GetLogger("InternalDirectShowPlayer");
            _hiddenWindow      = hiddenWindow;
            _presentation      = presentation;
            _sessionManager    = sessionManager;
            _httpClient        = httpClient;
            _connectionManager = connectionManager;
            _playbackManager   = playbackManager;
            _config            = config;
            _isoManager        = isoManager;
            _inputManager      = inputManager;
            _zipClient         = zipClient;

            _config.Configuration.InternalPlayerConfiguration.VideoConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.AudioConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.SubtitleConfig.SetDefaults();
            _config.Configuration.InternalPlayerConfiguration.COMConfig.SetDefaults();

            //use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
            if (_privateCom == null)
            {
                _privateCom = new URCOMLoader(_config, _zipClient);
            }

            EnsureMediaFilters();
        }
Ejemplo n.º 5
0
        public ScreensaverManager(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, IApiClient apiClient, ITheaterConfigurationManager theaterConfigurationManager, ILogManager logManager, IServerEvents serverEvents)
        {
            _userInput                   = userInput;
            _presentationManager         = presentationManager;
            _playback                    = playback;
            _session                     = session;
            _apiClient                   = apiClient;
            _theaterConfigurationManager = theaterConfigurationManager;
            _logger       = logManager.GetLogger(GetType().Name);
            _serverEvents = serverEvents;

            _session.UserLoggedIn  += session_UserChanged;
            _session.UserLoggedOut += session_UserChanged;

            _playback.PlaybackCompleted += _playback_PlaybackCompleted;
            _playback.PlaybackStarted   += _playback_PlaybackStarted;

            _serverEvents.BrowseCommand    += _serverEvents_BrowseCommand;
            _serverEvents.MessageCommand   += _serverEvents_MessageCommand;
            _serverEvents.PlayCommand      += _serverEvents_PlayCommand;
            _serverEvents.PlaystateCommand += _serverEvents_PlaystateCommand;
            _serverEvents.GeneralCommand   += _serverEvents_GeneralCommand;

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            StartTimer();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public MainWindow(ILogger logger, IPlaybackManager playbackManager, IApiClient apiClient, IImageManager imageManager, IApplicationHost appHost, IPresentationManager appWindow, IUserInputManager userInput, ITheaterConfigurationManager config, INavigationService nav)
            : base()
        {
            _logger           = logger;
            _appHost          = appHost;
            _appWindow        = appWindow;
            _config           = config;
            _playbackManager  = playbackManager;
            UserInputManager  = userInput;
            NavigationManager = nav;

            Loaded += MainWindow_Loaded;

            InitializeComponent();

            RotatingBackdrops = new RotatingBackdropsViewModel(apiClient, _config, imageManager, playbackManager, logger);

            _config.ConfigurationUpdated       += _config_ConfigurationUpdated;
            _playbackManager.PlaybackStarted   += _playbackManager_PlaybackStarted;
            _playbackManager.PlaybackCompleted += _playbackManager_PlaybackCompleted;

            //Timeline.DesiredFrameRateProperty.OverrideMetadata(
            //    typeof(Timeline),
            //    new FrameworkPropertyMetadata { DefaultValue = 30 }
            //);
        }
 public RouletteStrategyTester(IVisualizer visualizer, IUserInputManager userInputManager, IStatisticsManager statisticsManager)
 {
     _visualizer        = visualizer;
     _userInputManager  = userInputManager;
     _statisticsManager = statisticsManager;
     _simulator         = new RouletteStrategySimulator();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow" /> class.
        /// </summary>
        public MainWindow(ILogger logger, IPlaybackManager playbackManager, IApiClient apiClient, IImageManager imageManager, IApplicationHost appHost, IPresentationManager appWindow, IUserInputManager userInput, ITheaterConfigurationManager config, INavigationService nav, IScreensaverManager screensaverManager)
            : base()
        {
            _logger = logger;
            _appHost = appHost;
            _appWindow = appWindow;
            _config = config;
            _playbackManager = playbackManager;
            UserInputManager = userInput;
            NavigationManager = nav;

            Loaded += MainWindow_Loaded;

            InitializeComponent();

            RotatingBackdrops = new RotatingBackdropsViewModel(apiClient, _config, imageManager, playbackManager, logger, screensaverManager);

            _config.ConfigurationUpdated += _config_ConfigurationUpdated;
            _playbackManager.PlaybackStarted += _playbackManager_PlaybackStarted;
            _playbackManager.PlaybackCompleted += _playbackManager_PlaybackCompleted;

            //Timeline.DesiredFrameRateProperty.OverrideMetadata(
            //    typeof(Timeline),
            //    new FrameworkPropertyMetadata { DefaultValue = 30 }
            //);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Shows the modal.
        /// </summary>
        /// <param name="owner">The owner.</param>
        public void ShowModal(Window owner, IUserInputManager userInputManager = null)
        {
            _userInputManager = userInputManager;

            WindowStyle = WindowStyle.None;
            ResizeMode = ResizeMode.NoResize;
            ShowInTaskbar = false;
            WindowStartupLocation = WindowStartupLocation.Manual;
            AllowsTransparency = true;

            Width = owner.Width;
            Height = owner.Height;
            Top = owner.Top;
            Left = owner.Left;
            WindowState = owner.WindowState;
            Owner = owner;

            EventHandler closedHanlder = null;
            closedHanlder = (sender, e) => {
                owner.Activate();
                Closed -= closedHanlder;
            };

            Closed += closedHanlder;

            Show();
        }
        public MediaCenterRemoteEntryPoint(IPresentationManager presenation, IPlaybackManager playback, ILogManager logManager, INavigationService nav, IUserInputManager userInput)
        {
            _presenation = presenation;
            _playback = playback;
            _nav = nav;
            _userInput = userInput;

            _logger = logManager.GetLogger(GetType().Name);
        }
Ejemplo n.º 11
0
        public MediaCenterRemoteEntryPoint(IPresentationManager presenation, IPlaybackManager playback, ILogManager logManager, INavigationService nav, IUserInputManager userInput)
        {
            _presenation = presenation;
            _playback    = playback;
            _nav         = nav;
            _userInput   = userInput;

            _logger = logManager.GetLogger(GetType().Name);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NVlcPlayer" /> class.
        /// </summary>
        /// <param name="hiddenWindow">The hidden window.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="playbackManager">The playback manager.</param>
        public NVlcPlayer(IHiddenWindow hiddenWindow, ILogManager logManager, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IUserInputManager userInput, IPresentationManager presentation)
        {
            _hiddenWindow = hiddenWindow;
            _playbackManager = playbackManager;
            _config = config;
            _userInput = userInput;
            _presentation = presentation;

            _logger = logManager.GetLogger(Name);
        }
 public ScreensaverEntryPoint(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, IApiClient apiClient, IImageManager imageManager, ILogger logger)
 {
     _userInput = userInput;
     _presentationManager = presentationManager;
     _playback = playback;
     _session = session;
     _apiClient = apiClient;
     _imageManager = imageManager;
     _logger = logger;
 }
        private const double DuplicateCommandPeriod = 500;// Milliseconds


        public CommandManager(IPresentationManager presentationManager, IPlaybackManager playbackManager, INavigationService navigationService, IUserInputManager userInputManager, ILogManager logManager)
        {
            _userInputManager = userInputManager;
            _inputCommandMaps = new InputCommandMaps();

            _userInputManager.KeyDown += input_KeyDown;
            _userInputManager.AppCommand += input_AppCommand;

            _logger = logManager.GetLogger(GetType().Name);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NVlcPlayer" /> class.
        /// </summary>
        /// <param name="hiddenWindow">The hidden window.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="playbackManager">The playback manager.</param>
        public NVlcPlayer(IHiddenWindow hiddenWindow, ILogManager logManager, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IUserInputManager userInput, IPresentationManager presentation)
        {
            _hiddenWindow    = hiddenWindow;
            _playbackManager = playbackManager;
            _config          = config;
            _userInput       = userInput;
            _presentation    = presentation;

            _logger = logManager.GetLogger(Name);
        }
Ejemplo n.º 16
0
        private const double DuplicateCommandPeriod = 500;// Milliseconds


        public CommandManager(IPresentationManager presentationManager, IPlaybackManager playbackManager, INavigationService navigationService, IUserInputManager userInputManager, ILogManager logManager)
        {
            _userInputManager      = userInputManager;
            _defaultCommandActions = new DefaultCommandActions(presentationManager, playbackManager, navigationService, logManager);

            _userInputManager.KeyDown    += input_KeyDown;
            _userInputManager.AppCommand += input_AppCommand;

            _logger = logManager.GetLogger(GetType().Name);
        }
Ejemplo n.º 17
0
 public ScreensaverEntryPoint(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, IApiClient apiClient, IImageManager imageManager, ILogger logger)
 {
     _userInput           = userInput;
     _presentationManager = presentationManager;
     _playback            = playback;
     _session             = session;
     _apiClient           = apiClient;
     _imageManager        = imageManager;
     _logger = logger;
 }
Ejemplo n.º 18
0
 public WebSocketEntryPoint(ISessionManager sessionManager, ILogManager logManager, INavigationService navigationService, IPlaybackManager playbackManager, IPresentationManager presentationManager, ICommandManager commandManager, IUserInputManager userInputManager, IConnectionManager connectionManager)
 {
     _sessionManager = sessionManager;
     _logger = logManager.GetLogger(GetType().Name);
     _navigationService = navigationService;
     _playbackManager = playbackManager;
     _presentationManager = presentationManager;
     _commandManager = commandManager;
     _userInputManager = userInputManager;
     _connectionManager = connectionManager;
 }
 public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, IUserInputManager userInput, IApiClient apiClient, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager)
 {
     _logger          = logManager.GetLogger("DirectShowPlayer");
     _hiddenWindow    = hiddenWindow;
     _presentation    = presentation;
     _userInput       = userInput;
     _apiClient       = apiClient;
     _playbackManager = playbackManager;
     _config          = config;
     _isoManager      = isoManager;
 }
 public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, IUserInputManager userInput, IApiClient apiClient, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager)
 {
     _logger = logManager.GetLogger("DirectShowPlayer");
     _hiddenWindow = hiddenWindow;
     _presentation = presentation;
     _userInput = userInput;
     _apiClient = apiClient;
     _playbackManager = playbackManager;
     _config = config;
     _isoManager = isoManager;
 }
        void Start()
        {
            mLoginController  = ArchitectureConfig.Architecture.LogicLayer.GetModule <ILoginController>();
            mUserInputManager = ArchitectureConfig.Architecture.LogicLayer.GetModule <IUserInputManager>();

            mLoginController.Login();

            MissionSystem m = new MissionSystem();

            m.SetmJumpCount();
        }
Ejemplo n.º 22
0
 public PickUpUiAdapter(PlayerContext player, SceneObjectContext sceneObject, MapObjectContext mapObject, SessionContext session, VehicleContext vehicle, FreeMoveContext freeMove, IUserInputManager userInputManager, UiContext uiContext)
 {
     this.player           = player;
     this.sceneObject      = sceneObject;
     this.mapObject        = mapObject;
     this.session          = session;
     this.vehicle          = vehicle;
     this.freeMove         = freeMove;
     this.userInputManager = userInputManager;
     this.uiContext        = uiContext;
 }
Ejemplo n.º 23
0
 public ConsoleRunner(
     IStreamHelper streamHelper,
     IMeasDataChunksProvider measDataChunksProvider,
     IUserInputManager userInputManager,
     ICommandLineParser cmdParser)
 {
     _streamHelper           = streamHelper;
     _measDataChunksProvider = measDataChunksProvider;
     _userInputManager       = userInputManager;
     _cmdParser = cmdParser;
 }
 public WebSocketEntryPoint(ISessionManager sessionManager, ILogManager logManager, IApplicationHost appHost, IImageManager imageManager, INavigationService navigationService, IPlaybackManager playbackManager, IPresentationManager presentationManager, ICommandManager commandManager, IUserInputManager userInputManager, IConnectionManager connectionManager)
 {
     _sessionManager      = sessionManager;
     _logger              = logManager.GetLogger(GetType().Name);
     _appHost             = (ApplicationHost)appHost;
     _imageManager        = imageManager;
     _navigationService   = navigationService;
     _playbackManager     = playbackManager;
     _presentationManager = presentationManager;
     _commandManager      = commandManager;
     _userInputManager    = userInputManager;
     _connectionManager   = connectionManager;
 }
Ejemplo n.º 25
0
 public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, ISessionManager sessionManager, IApiClient apiClient, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager, IUserInputManager inputManager, IZipClient zipClient, IHttpClient httpClient)
 {
     _logger          = logManager.GetLogger("InternalDirectShowPlayer");
     _hiddenWindow    = hiddenWindow;
     _presentation    = presentation;
     _sessionManager  = sessionManager;
     _apiClient       = apiClient;
     _httpClient      = httpClient;
     _playbackManager = playbackManager;
     _config          = config;
     _isoManager      = isoManager;
     _inputManager    = inputManager;
     _zipClient       = zipClient;
 }
 public InternalDirectShowPlayer(ILogManager logManager, IHiddenWindow hiddenWindow, IPresentationManager presentation, ISessionManager sessionManager, IApiClient apiClient, IPlaybackManager playbackManager, ITheaterConfigurationManager config, IIsoManager isoManager, IUserInputManager inputManager, IZipClient zipClient, IHttpClient httpClient)
 {
     _logger = logManager.GetLogger("InternalDirectShowPlayer");
     _hiddenWindow = hiddenWindow;
     _presentation = presentation;
     _sessionManager = sessionManager;
     _apiClient = apiClient;
     _httpClient = httpClient;
     _playbackManager = playbackManager;
     _config = config;
     _isoManager = isoManager;
     _inputManager = inputManager;
     _zipClient = zipClient;
 }
 public WebSocketEntryPoint(ISessionManager sessionManagerManager, IApiClient apiClient, ILogManager logManager, IApplicationHost appHost, IImageManager imageManager, INavigationService navigationService, IPlaybackManager playbackManager, IPresentationManager presentationManager, ICommandManager commandManager, IServerEvents serverEvents, IUserInputManager userInputManager)
 {
     _sessionManager = sessionManagerManager;
     _apiClient = apiClient;
     _logger = logManager.GetLogger(GetType().Name);
     _appHost = (ApplicationHost)appHost;
     _imageManager = imageManager;
     _navigationService = navigationService;
     _playbackManager = playbackManager;
     _presentationManager = presentationManager;
     _commandManager = commandManager;
     _userInputManager = userInputManager;
     _serverEvents = serverEvents;
 }
Ejemplo n.º 28
0
        public FullscreenVideoPage(IUserInputManager userInputManager, IPlaybackManager playbackManager, INavigationService nav, IPresentationManager presentation, IApiClient apiClient, IImageManager imageManager, ILogger logger, IServerEvents serverEvents)
        {
            _userInputManager = userInputManager;
            _playbackManager  = playbackManager;
            _nav          = nav;
            _presentation = presentation;
            _apiClient    = apiClient;
            _imageManager = imageManager;
            _logger       = logger;
            _serverEvents = serverEvents;

            InitializeComponent();

            IsMouseIdle = false;
        }
        public FullscreenVideoPage(IUserInputManager userInputManager, IPlaybackManager playbackManager, INavigationService nav, IPresentationManager presentation, IConnectionManager connectionManager, IImageManager imageManager, ILogger logger, IHiddenWindow hiddenWindow)
        {
            _userInputManager = userInputManager;
            _playbackManager = playbackManager;
            _nav = nav;
            _presentation = presentation;
            _connectionManager = connectionManager;
            _imageManager = imageManager;
            _logger = logger;
            _hiddenWindow = hiddenWindow;

            InitializeComponent();

            IsMouseIdle = false;
        }
Ejemplo n.º 30
0
        public SocketListener(string serverId, IApiClient apiClient, IPlaybackManager playbackManager, IUserInputManager userInputManager, IPresentationManager presentationManager, ISessionManager sessionManager, ILogger logger, INavigationService navigationService, ICommandManager commandManager, IConnectionManager connectionManager)
        {
            _serverId = serverId;
            _apiClient = apiClient;
            _playbackManager = playbackManager;
            _userInputManager = userInputManager;
            _presentationManager = presentationManager;
            _sessionManager = sessionManager;
            _logger = logger;
            _navigationService = navigationService;
            _commandManager = commandManager;
            _connectionManager = connectionManager;

            BindEvents(apiClient);
        }
Ejemplo n.º 31
0
        public FullscreenVideoPage(IUserInputManager userInputManager, IPlaybackManager playbackManager, INavigationService nav, IPresentationManager presentation, IConnectionManager connectionManager, IImageManager imageManager, ILogger logger, IHiddenWindow hiddenWindow)
        {
            _userInputManager = userInputManager;
            _playbackManager  = playbackManager;
            _nav               = nav;
            _presentation      = presentation;
            _connectionManager = connectionManager;
            _imageManager      = imageManager;
            _logger            = logger;
            _hiddenWindow      = hiddenWindow;

            InitializeComponent();

            IsMouseIdle = false;
        }
        public FullscreenVideoPage(IUserInputManager userInputManager, IPlaybackManager playbackManager, INavigationService nav, IPresentationManager presentation, IApiClient apiClient, IImageManager imageManager, ILogger logger, IServerEvents serverEvents)
        {
            _userInputManager = userInputManager;
            _playbackManager = playbackManager;
            _nav = nav;
            _presentation = presentation;
            _apiClient = apiClient;
            _imageManager = imageManager;
            _logger = logger;
            _serverEvents = serverEvents;

            InitializeComponent();

            IsMouseIdle = false;
        }
Ejemplo n.º 33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationService" /> class.
        /// </summary>
        /// <param name="themeManager">The theme manager.</param>
        /// <param name="playbackManagerFactory">The playback manager factory.</param>
        /// <param name="apiClient">The API client.</param>
        /// <param name="presentationManager">The presentation manager.</param>
        public NavigationService(IThemeManager themeManager, Func <IPlaybackManager> playbackManagerFactory, IApiClient apiClient, IPresentationManager presentationManager, ITheaterConfigurationManager config, Func <ISessionManager> sessionFactory, IApplicationHost appHost, IInstallationManager installationManager, IImageManager imageManager, ILogger logger, IUserInputManager userInputManager, IServerEvents serverEvents)
        {
            _themeManager           = themeManager;
            _playbackManagerFactory = playbackManagerFactory;
            _apiClient           = apiClient;
            _presentationManager = presentationManager;
            _config              = config;
            _sessionFactory      = sessionFactory;
            _appHost             = appHost;
            _installationManager = installationManager;
            _imageManager        = imageManager;
            _logger              = logger;
            _userInputManager    = userInputManager;
            _serverEvents        = serverEvents;

            presentationManager.WindowLoaded += presentationManager_WindowLoaded;
        }
Ejemplo n.º 34
0
        public UnityVehicleCmdGenerator(IUserInputManager manager)
        {
            _lastCmd      = new VehicleCmd();
            _inputManager = manager;
            // 界面不会影响车辆控制
            var keyReceiver = new KeyReceiver(Layer.Ui, BlockType.None);

            _inputManager.RegisterKeyReceiver(keyReceiver);
            keyReceiver.AddAction(UserInputKey.MoveVertical, data => _lastCmd.MoveVertical     = data.Axis);
            keyReceiver.AddAction(UserInputKey.MoveHorizontal, data => _lastCmd.MoveHorizontal = data.Axis);
            keyReceiver.AddAction(UserInputKey.VehicleSpeedUp, data => _lastCmd.IsSpeedup      = true);
            keyReceiver.AddAction(UserInputKey.VehicleBrake, data => _lastCmd.IsHandbrake      = true);
            keyReceiver.AddAction(UserInputKey.VehicleHorn, data => _lastCmd.IsHornOn          = true);

            keyReceiver.AddAction(UserInputKey.VehicleLeftShift, data => _lastCmd.IsLeftShift   = true);
            keyReceiver.AddAction(UserInputKey.VehicleRightShift, data => _lastCmd.IsRightShift = true);
            keyReceiver.AddAction(UserInputKey.VehicleStunt, data => _lastCmd.IsStunt           = true);
        }
Ejemplo n.º 35
0
        public ScreensaverManager(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, ITheaterConfigurationManager theaterConfigurationManager, ILogManager logManager)
        {
            _userInput                   = userInput;
            _presentationManager         = presentationManager;
            _playback                    = playback;
            _session                     = session;
            _theaterConfigurationManager = theaterConfigurationManager;
            _logger = logManager.GetLogger(GetType().Name);

            _session.UserLoggedIn  += session_UserChanged;
            _session.UserLoggedOut += session_UserChanged;

            _playback.PlaybackCompleted += _playback_PlaybackCompleted;
            _playback.PlaybackStarted   += _playback_PlaybackStarted;

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            StartTimer();

            _session.UserLoggedIn += _session_UserLoggedIn;
        }
Ejemplo n.º 36
0
        public ScreensaverManager(IUserInputManager userInput, IPresentationManager presentationManager, IPlaybackManager playback, ISessionManager session, ITheaterConfigurationManager theaterConfigurationManager, ILogManager logManager)
        {
            _userInput = userInput;
            _presentationManager = presentationManager;
            _playback = playback;
            _session = session;
            _theaterConfigurationManager = theaterConfigurationManager;
            _logger = logManager.GetLogger(GetType().Name);

            _session.UserLoggedIn += session_UserChanged;
            _session.UserLoggedOut += session_UserChanged;

            _playback.PlaybackCompleted += _playback_PlaybackCompleted;
            _playback.PlaybackStarted += _playback_PlaybackStarted;

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            StartTimer();

            _session.UserLoggedIn += _session_UserLoggedIn;
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Shows the modal.
        /// </summary>
        /// <param name="owner">The owner.</param>
        public void ShowModal(Window owner, IUserInputManager userInputManager = null)
        {
            _userInputManager = userInputManager;

            WindowStyle           = WindowStyle.None;
            ResizeMode            = ResizeMode.NoResize;
            ShowInTaskbar         = false;
            WindowStartupLocation = WindowStartupLocation.Manual;
            AllowsTransparency    = true;

            Width       = owner.Width;
            Height      = owner.Height;
            Top         = owner.Top;
            Left        = owner.Left;
            WindowState = owner.WindowState;
            Owner       = owner;


            ShowDialog();

            owner.Activate();
        }
        /// <summary>
        /// Shows the modal.
        /// </summary>
        /// <param name="owner">The owner.</param>
        public void ShowModal(Window owner, IUserInputManager userInputManager = null)
        {
            _userInputManager = userInputManager;

            WindowStyle = WindowStyle.None;
            ResizeMode = ResizeMode.NoResize;
            ShowInTaskbar = false;
            WindowStartupLocation = WindowStartupLocation.Manual;
            AllowsTransparency = true;

            Width = owner.Width;
            Height = owner.Height;
            Top = owner.Top;
            Left = owner.Left;
            WindowState = owner.WindowState;
            Owner = owner;

     
            ShowDialog();

            owner.Activate();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationService" /> class.
        /// </summary>
        /// <param name="themeManager">The theme manager.</param>
        /// <param name="playbackManagerFactory">The playback manager factory.</param>
        /// <param name="apiClient">The API client.</param>
        /// <param name="presentationManager">The presentation manager.</param>
        public NavigationService(IThemeManager themeManager, Func<IPlaybackManager> playbackManagerFactory, IApiClient apiClient, IPresentationManager presentationManager, ITheaterConfigurationManager config, Func<ISessionManager> sessionFactory, IApplicationHost appHost, IInstallationManager installationManager, IImageManager imageManager, ILogger logger, IUserInputManager userInputManager, IServerEvents serverEvents)
        {
            _themeManager = themeManager;
            _playbackManagerFactory = playbackManagerFactory;
            _apiClient = apiClient;
            _presentationManager = presentationManager;
            _config = config;
            _sessionFactory = sessionFactory;
            _appHost = appHost;
            _installationManager = installationManager;
            _imageManager = imageManager;
            _logger = logger;
            _userInputManager = userInputManager;
            _serverEvents = serverEvents;

            presentationManager.WindowLoaded += presentationManager_WindowLoaded;
        }
Ejemplo n.º 40
0
 public MpcHcExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput, IHttpClient httpClient)
     : base(playbackManager, logger, userInput)
 {
     _httpClient = httpClient;
 }
 public MpcHcExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput, IHttpClient httpClient)
     : base(playbackManager, logger, userInput)
 {
     _httpClient = httpClient;
 }
Ejemplo n.º 42
0
 public TmtExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput)
     : base(playbackManager, logger, userInput)
 {
 }
Ejemplo n.º 43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericExternalPlayer" /> class.
 /// </summary>
 /// <param name="playbackManager">The playback manager.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="userInput">The user input.</param>
 public GenericExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput, IIsoManager isoManager)
 {
     _playbackManager = playbackManager;
     Logger = logger;
     _userInput = userInput;
     _isoManager = isoManager;
 }
Ejemplo n.º 44
0
        public void Handle(SimpleProto data)
        {
            Contexts contexts = SingletonManager.Get <FreeUiManager>().Contexts1;

            if (data.Key == FreeMessageConstant.PlayerCmd)
            {
                int          id     = data.Ks[1];
                PlayerEntity player = contexts.player.GetEntityWithEntityKey(new Core.EntityComponent.EntityKey(id, (short)EEntityType.Player));
                if (player != null)
                {
                    player.playerIntercept.InterceptType = data.Ks[0];
                    PlayerActEnum.CmdType type = (PlayerActEnum.CmdType)data.Ks[0];
                    switch (type)
                    {
                    case PlayerActEnum.CmdType.Walk:
                        player.playerIntercept.MovePos = new Vector3(data.Fs[0], data.Fs[1], data.Fs[2]);
                        break;

                    case PlayerActEnum.CmdType.ClearKeys:
                        player.playerIntercept.InterceptKeys.Clear();
                        player.playerIntercept.PressKeys.Clear();
                        break;

                    case PlayerActEnum.CmdType.PressKey:
                        player.playerIntercept.PressKeys.AddKeyTime(data.Ins[1], data.Ins[0]);
                        break;

                    case PlayerActEnum.CmdType.InterceptKey:
                        player.playerIntercept.InterceptKeys.AddKeyTime(data.Ins[1], data.Ins[0]);
                        break;

                    case PlayerActEnum.CmdType.Attack:
                        player.playerIntercept.AttackPlayerId = data.Ks[2];
                        break;

                    default:
                        break;
                    }
                }
            }

            if (data.Key == FreeMessageConstant.PlayerPressKey)
            {
                KeyCode code = KeyCode.None;
                foreach (KeyCode kc in Enum.GetValues(typeof(KeyCode)))
                {
                    if (Enum.GetName(typeof(KeyCode), kc).ToLower().Equals(data.Ss[0].ToLower()))
                    {
                        code = kc;
                    }
                }

                if (code == KeyCode.None)
                {
                    return;
                }

                IUserInputManager manager = contexts.userInput.userInputManager.Instance;
                Dictionary <UserInputKey, List <KeyConvertItem> > config = manager.GetInputDic();
                PlayerEntity player = contexts.player.flagSelfEntity;

                string keyName = "None";
                bool   positive = true, hold = false;
                foreach (InputAction ia in Luminosity.IO.InputManager.GetControlScheme("normal").Actions)
                {
                    foreach (InputBinding ib in ia.Bindings)
                    {
                        if (ib.Positive == code || ib.Negative == code)
                        {
                            keyName  = ia.Name;
                            positive = ib.Positive == code;
                            hold     = ib.Type == InputType.DigitalAxis;
                        }
                    }
                }

                if (data.Bs[0])
                {
                    Dictionary <UserInputKey, int>  PosDict  = new Dictionary <UserInputKey, int>();
                    Dictionary <UserInputKey, bool> HoldDict = new Dictionary <UserInputKey, bool>();
                    foreach (UserInputKey uik in config.Keys)
                    {
                        foreach (KeyConvertItem item in config[uik])
                        {
                            if (item.Key == code && item.State == UserInputState.KeyDown)
                            {
                                PosDict.Add(uik, 0);
                                HoldDict.Add(uik, false);
                            }

                            if (item.Key == code && item.State == UserInputState.KeyHold)
                            {
                                PosDict.Add(uik, 0);
                                HoldDict.Add(uik, true);
                            }

                            if (keyName.Equals(item.InputKey))
                            {
                                PosDict.Add(uik, positive ? 1 : -1);
                                HoldDict.Add(uik, hold);
                            }
                        }
                    }

                    if (PosDict.Count > 0)
                    {
                        foreach (UserInputKey uik in PosDict.Keys)
                        {
                            if (data.Ins[0] == 0 || !HoldDict[uik])
                            {
                                manager.InsertKey(new KeyData(uik, PosDict[uik]));
                            }

                            if (data.Ins[0] > 0 && HoldDict[uik])
                            {
                                player.playerIntercept.RealPressKeys.AddKeyTime((int)uik, data.Ins[0], PosDict[uik]);
                            }
                        }
                    }
                }
                else
                {
                    Dictionary <UserInputKey, int> UpDict     = new Dictionary <UserInputKey, int>();
                    Dictionary <UserInputKey, int> RealseDict = new Dictionary <UserInputKey, int>();

                    foreach (UserInputKey uik in config.Keys)
                    {
                        foreach (KeyConvertItem item in config[uik])
                        {
                            if (item.Key == code)
                            {
                                if (item.State == UserInputState.KeyUp)
                                {
                                    UpDict.Add(uik, 0);
                                }
                                else
                                {
                                    RealseDict.Add(uik, 0);
                                }
                            }

                            if (keyName.Equals(item.InputKey))
                            {
                                RealseDict.Add(uik, 0);
                            }
                        }
                    }

                    if (UpDict.Count > 0)
                    {
                        foreach (UserInputKey uik in UpDict.Keys)
                        {
                            manager.InsertKey(new KeyData(uik));
                        }
                    }

                    if (RealseDict.Count > 0)
                    {
                        foreach (UserInputKey uik in RealseDict.Keys)
                        {
                            player.playerIntercept.RealPressKeys.Release((int)uik);
                        }
                    }
                }
            }
        }
Ejemplo n.º 45
0
        //这里所有的操作层级都设置为Env,如果有特殊遮挡需求请修改层级并修改这段注释
        public void BeginReceiveUserInput(IUserInputManager manager)
        {
            _userInputManager = manager;
            #region Env keyreceiver

            // 有UI打开的情况下,不能开枪, 不能瞄准
            _specialKeyReceiver = new KeyReceiver(UiConstant.specicalCmdKeyLayer, BlockType.None);
            for (int i = 0; i < _inputMapperList.Count; i++)
            {
                _inputMapperList[i].RegisterSpecialCmdKeyInput(_specialKeyReceiver, _userCmd);
            }
            _specialKeyReceiver.AddAction(UserInputKey.Fire, (data) => _userCmd.IsLeftAttack         = true);
            _specialKeyReceiver.AddAction(UserInputKey.RightAttack, (data) => _userCmd.IsRightAttack = true);
            _specialKeyReceiver.AddAction(UserInputKey.CameraFocus, (data) => _userCmd.IsCameraFocus = true);
            _userInputManager.RegisterKeyReceiver(_specialKeyReceiver);

            _keyReceiver = new KeyReceiver(UiConstant.userCmdKeyLayer, BlockType.None);
            for (int i = 0; i < _inputMapperList.Count; i++)
            {
                _inputMapperList[i].RegisterEnvKeyInput(_keyReceiver, _userCmd);
            }
            _keyReceiver.AddAction(UserInputKey.SwitchFireMode, (data) => _userCmd.IsSwitchFireMode = true);
            _keyReceiver.AddAction(UserInputKey.DrawWeapon, (data) => _userCmd.IsDrawWeapon         = true);
            _keyReceiver.AddAction(UserInputKey.Throwing, (data) => _userCmd.IsThrowing             = true);
            _keyReceiver.AddAction(UserInputKey.FirstPerson, (data) => _userCmd.ChangeCamera        = true);
            _keyReceiver.AddAction(UserInputKey.FreeCamera, (data) => _userCmd.IsCameraFree         = true);
            _keyReceiver.AddAction(UserInputKey.Jump, (data) => _userCmd.IsJump     = true);
            _keyReceiver.AddAction(UserInputKey.Crouch, (data) => _userCmd.IsCrouch = true);
            _keyReceiver.AddAction(UserInputKey.Prone, (data) => _userCmd.IsProne   = true);
            //_keyReceiver.AddAction(UserInputKey.Injured, (data) => _userCmd.BeState = 2);
            //_keyReceiver.AddAction(UserInputKey.Swim, (data) => _userCmd.BeState = 1);
            _keyReceiver.AddAction(UserInputKey.Reload, (data) => _userCmd.IsReload             = true);
            _keyReceiver.AddAction(UserInputKey.PeekLeft, (data) => _userCmd.IsPeekLeft         = true);
            _keyReceiver.AddAction(UserInputKey.PeekRight, (data) => _userCmd.IsPeekRight       = true);
            _keyReceiver.AddAction(UserInputKey.SwitchWeapon, (data) => _userCmd.IsSwitchWeapon = true);
            _keyReceiver.AddAction(UserInputKey.DropWeapon, (data) => _userCmd.IsDropWeapon     = true);
            _keyReceiver.AddAction(UserInputKey.Switch1, data => _userCmd.SwitchNumber          = 1);
            _keyReceiver.AddAction(UserInputKey.Switch7, data => _userCmd.SwitchNumber          = 7);
            _keyReceiver.AddAction(UserInputKey.IsPDown, data => _userCmd.IsPDown               = true);
            _keyReceiver.AddAction(UserInputKey.IsYDown, data => _userCmd.IsYDown               = true);
            _keyReceiver.AddAction(UserInputKey.AddMark, data => _userCmd.IsAddMark             = true);
            _keyReceiver.AddAction(UserInputKey.BreathHold, data => _userCmd.IsHoldBreath       = true);
            _keyReceiver.AddAction(UserInputKey.SwitchAutoRun, data => _userCmd.IsSwitchAutoRun = true);
            _keyReceiver.AddAction(UserInputKey.IsCDown, data => _userCmd.IsCDown               = true);
            _keyReceiver.AddAction(UserInputKey.IsSpaceDown, data => _userCmd.IsSpaceDown       = true);
            _keyReceiver.AddAction(UserInputKey.HoldF, data => _userCmd.IsF = true);
            _keyReceiver.AddAction(UserInputKey.SprayPaint, data => _userCmd.IsSprayPaint = true);
            _keyReceiver.AddAction(UserInputKey.ScopeIn, data => _userCmd.IsScopeIn       = true);
            _keyReceiver.AddAction(UserInputKey.ScopeOut, data => _userCmd.IsScopeOut     = true);
            _userInputManager.RegisterKeyReceiver(_keyReceiver);

            #endregion

            #region Ui Keyreciever

            _uiKeyReceiver = new KeyReceiver(UiConstant.userCmdUIKeyLayer, BlockType.None);
            _uiKeyReceiver.AddAction(UserInputKey.MoveHorizontal, (data) => _userCmd.MoveHorizontal = data.Axis);
            _uiKeyReceiver.AddAction(UserInputKey.MoveVertical, (data) => _userCmd.MoveVertical     = data.Axis);
            _uiKeyReceiver.AddAction(UserInputKey.MoveUpDown, (data) => _userCmd.MoveUpDown         = data.Axis);
            _uiKeyReceiver.AddAction(UserInputKey.Run, (data) => _userCmd.IsRun             = true);
            _uiKeyReceiver.AddAction(UserInputKey.IsTabDown, data => _userCmd.IsTabDown     = true);
            _uiKeyReceiver.AddAction(UserInputKey.SlightWalk, data => _userCmd.IsSlightWalk = true);
            _userInputManager.RegisterKeyReceiver(_uiKeyReceiver);

            #endregion

#if UNITY_EDITOR
            foreach (var mockCmd in _mockCmdList)
            {
                mockCmd(_userCmd);
            }
#endif

            var pointerReceiver = new PointerReceiver(UiConstant.userCmdPointLayer, BlockType.None);
            pointerReceiver.AddAction(UserInputKey.Yaw, (pointerData) =>
            {
                for (int i = 0; i < yaws.Length - 1; i++)
                {
                    yaws[i] = yaws[i + 1];
                }
                yaws[yaws.Length - 1] = pointerData.MouseX;
                float total           = 0;
                for (int i = yaws.Length - 1; i >= Math.Max(0, yaws.Length - BigMapDebug.SmoothFactor); i--)
                {
                    total = total + yaws[i];
                }
                total = total / (float)BigMapDebug.SmoothFactor;
                //Debug.LogFormat("deltaYaw is {0}, deltaTime {1}", total, Time.deltaTime);
#if UNITY_EDITOR
                if (!Cursor.visible)
                {
                    _userCmd.DeltaYaw = total;
                }
#else
                _userCmd.DeltaYaw = total;
#endif
            });
            pointerReceiver.AddAction(UserInputKey.Pitch, (pointerData) =>
            {
                for (int i = 0; i < pitchs.Length - 1; i++)
                {
                    pitchs[i] = pitchs[i + 1];
                }
                pitchs[pitchs.Length - 1] = pointerData.MouseY;
                float total = 0;
                for (int i = pitchs.Length - 1; i >= Math.Max(0, pitchs.Length - BigMapDebug.SmoothFactor); i--)
                {
                    total = total + pitchs[i];
                }
                total = total / (float)BigMapDebug.SmoothFactor;
#if UNITY_EDITOR
                if (!Cursor.visible)
                {
                    _userCmd.DeltaPitch = -total;
                }
#else
                _userCmd.DeltaPitch = -total;
#endif
            });

            _userInputManager.RegisterPointerReceiver(pointerReceiver);
        }
 public TmtExternalPlayer(IPlaybackManager playbackManager, ILogger logger, IUserInputManager userInput)
     : base(playbackManager, logger, userInput)
 {
 }
 public DirectShowPlayer(ILogger logger, IHiddenWindow hiddenWindow, InternalDirectShowPlayer playerWrapper,
     IntPtr applicationWindowHandle, ISessionManager sessionManager, ITheaterConfigurationManager mbtConfig,
     IUserInputManager input, IApiClient apiClient,  IZipClient zipClient, IHttpClient httpClient)
 {
     _logger = logger;
     _hiddenWindow = hiddenWindow;
     _playerWrapper = playerWrapper;
     _applicationWindowHandle = applicationWindowHandle;
     _sessionManager = sessionManager;
     _httpClient = httpClient;
     _input = input;
     _input.KeyDown += HiddenForm_KeyDown;
     //_input.
     _mbtConfig = mbtConfig;
     _apiClient = apiClient;
 }
        public DirectShowPlayer(ILogger logger, IHiddenWindow hiddenWindow, InternalDirectShowPlayer playerWrapper,
            IntPtr applicationWindowHandle, ISessionManager sessionManager, ITheaterConfigurationManager mbtConfig,
            IUserInputManager input, IApiClient apiClient,  IZipClient zipClient, IHttpClient httpClient)
        {
            _logger = logger;
            _hiddenWindow = hiddenWindow;
            _playerWrapper = playerWrapper;
            _applicationWindowHandle = applicationWindowHandle;
            _sessionManager = sessionManager;
            _httpClient = httpClient;
            _input = input;
            _input.KeyDown += HiddenForm_KeyDown;
            //_input.
            _mbtConfig = mbtConfig;
            _apiClient = apiClient;

            _mbtConfig.Configuration.InternalPlayerConfiguration.VideoConfig.SetDefaults();
            _mbtConfig.Configuration.InternalPlayerConfiguration.AudioConfig.SetDefaults();
            _mbtConfig.Configuration.InternalPlayerConfiguration.SubtitleConfig.SetDefaults();
            _mbtConfig.Configuration.InternalPlayerConfiguration.COMConfig.SetDefaults();

            //use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
            if (_urCom == null)
                _urCom = new URCOMLoader(_mbtConfig, zipClient);
        }