Ejemplo n.º 1
0
        public ScoreControl(IUnityContainer container, IOutput output, IMidiInput midiInput, IInputEvents inputEvents, IMediaServiceHost mediaServiceHost,
                            IVirtualKeyBoard virtualKeyboard, ILogger logger, XScore musicScore) : this()
        {
            _container        = container;
            _output           = output;
            _intputEvents     = inputEvents;
            _midiInput        = midiInput;
            _virtualKeyboard  = virtualKeyboard;
            _musicScore       = musicScore;
            _mediaServiceHost = mediaServiceHost;
            _logger           = logger;

            _updateScrollTimer = new Timer(ScrollTimerHandler, null, Timeout.Infinite, _scrollTimingPerdiod);

            _scoreParser = new ScoreParser(_musicScore, ScoreGrid);
            _scoreParser.Render();
            ScoreGrid.Width = _scoreParser.GetMaxHorizontalPosition();

            nextBarDetails          = new BarDetails();
            nextBarDetails.NoteTime = 0;
            nextBarDetails.XCoord   = 0;

            _intputEvents.MessageReceived += HandleInputEvent;

            _midiInput.StartRecording();

            ConfigureSongEventController();
        }
Ejemplo n.º 2
0
 private Extractor(
     IKeyboardWatcher keyboardWatcher = null,
     IClientSideIncomingMessageDispatcher clientSideIncomingMessageDispatcher = null,
     IServerSideIncomingMessageDispatcher serverSideIncomingMessageDispatcher = null,
     IInstrumentFactory instrumentFactory = null,
     IThreeDeeCaptureCoordinateUpdater threeDeeCaptureCoordinateUpdater = null,
     IFlightDataRetriever flightDataRetriever = null,
     IFlightDataUpdater flightDataUpdater     = null)
 {
     State = new ExtractorState();
     LoadSettings();
     _instrumentFactory = instrumentFactory ?? new InstrumentFactory();
     _ehsiStateTracker  = new EHSIStateTracker(_instruments);
     _inputEvents       = new InputEvents(_instruments, _ehsiStateTracker);
     _clientSideIncomingMessageDispatcher = clientSideIncomingMessageDispatcher ??
                                            new ClientSideIncomingMessageDispatcher(_inputEvents);
     if (!Settings.Default.DisableDirectInputMediator)
     {
         Mediator = new Mediator(null);
         _mediatorEventHandler = new MediatorStateChangeHandler(new DIHotkeyDetection(Mediator), _inputEvents);
     }
     _keyboardWatcher = keyboardWatcher ?? new KeyboardWatcher(_inputEvents, Log);
     _serverSideIncomingMessageDispatcher = serverSideIncomingMessageDispatcher ??
                                            new ServerSideIncomingMessageDispatcher(_inputEvents);
     _flightDataRetriever = flightDataRetriever ?? new FlightDataRetriever();
     _threeDeeCaptureCoordinateUpdater = threeDeeCaptureCoordinateUpdater ??
                                         new ThreeDeeCaptureCoordinateUpdater(
         _texturesSharedMemoryImageCoordinates);
     _flightDataUpdater           = flightDataUpdater ?? new FlightDataUpdater(_texturesSharedMemoryImageCoordinates);
     _performanceCounterInstaller = new PerformanceCounterInstaller();
 }
Ejemplo n.º 3
0
 public VirtualKeyBoard(IInputEvents inputEvents, IMidiInput midiInput, ILogger logger)
 {
     _inputEvents = inputEvents;
     _midiInput   = midiInput;
     _logger      = logger;
     Initialise();
 }
Ejemplo n.º 4
0
        public ScoreControl(IUnityContainer container, IOutput output, IMidiInput midiInput, IInputEvents inputEvents, IMediaServiceHost mediaServiceHost, 
            IVirtualKeyBoard virtualKeyboard, ILogger logger, XScore musicScore)
            : this()
        {
            _container = container;
            _output = output;
            _intputEvents = inputEvents;
            _midiInput = midiInput;
            _virtualKeyboard = virtualKeyboard;
            _musicScore = musicScore;
            _mediaServiceHost = mediaServiceHost;
            _logger = logger;

            _updateScrollTimer = new Timer(ScrollTimerHandler, null, Timeout.Infinite, _scrollTimingPerdiod);

            _scoreParser = new ScoreParser(_musicScore, ScoreGrid);
            _scoreParser.Render();
            ScoreGrid.Width = _scoreParser.GetMaxHorizontalPosition();

            nextBarDetails = new BarDetails();
            nextBarDetails.NoteTime = 0;
            nextBarDetails.XCoord = 0;

            _intputEvents.MessageReceived += HandleInputEvent;

            _midiInput.StartRecording();

            ConfigureSongEventController();
        }
Ejemplo n.º 5
0
 private Extractor(
     IKeyboardWatcher keyboardWatcher = null,
     IClientSideIncomingMessageDispatcher clientSideIncomingMessageDispatcher = null,
     IServerSideIncomingMessageDispatcher serverSideIncomingMessageDispatcher = null,
     IInstrumentFactory instrumentFactory     = null,
     IFlightDataRetriever flightDataRetriever = null,
     IFlightDataUpdater flightDataUpdater     = null)
 {
     State = new ExtractorState();
     LoadSettings();
     _instrumentFactory = instrumentFactory ?? new InstrumentFactory();
     _ehsiStateTracker  = new EHSIStateTracker(_instruments);
     _inputEvents       = new InputEvents(_instruments, _ehsiStateTracker);
     _clientSideIncomingMessageDispatcher = clientSideIncomingMessageDispatcher ??
                                            new ClientSideIncomingMessageDispatcher(_inputEvents);
     if (!Settings.Default.DisableDirectInputMediator)
     {
         Mediator = new Mediator(Application.OpenForms.Count > 0 ? Application.OpenForms[0]:null);
         _mediatorEventHandler = new MediatorStateChangeHandler(new DIHotkeyDetection(Mediator), _inputEvents);
     }
     _keyboardWatcher = keyboardWatcher ?? new KeyboardWatcher(_inputEvents, Log);
     _serverSideIncomingMessageDispatcher = serverSideIncomingMessageDispatcher ??
                                            new ServerSideIncomingMessageDispatcher(_inputEvents);
     _flightDataRetriever         = flightDataRetriever ?? new FlightDataRetriever();
     _flightDataUpdater           = flightDataUpdater ?? new FlightDataUpdater();
     _performanceCounterInstaller = new PerformanceCounterInstaller();
 }
Ejemplo n.º 6
0
 public NoteGuessViewModel(IOutput outputDevice, IInputEvents inputDevice,
                           IVirtualKeyBoard keyBoard)
 {
     _testActive     = false;
     _outputDevice   = outputDevice;
     _keyboard       = keyBoard;
     _goRelayCommand = new RelayCommand(StartTest, () => true);
     //Subscribe to input messages.
     inputDevice.MessageReceived += (o, e) => HandleInputDeviceInput(o, e);
 }
Ejemplo n.º 7
0
 public MediatorStateChangeHandler(
     IDIHotkeyDetection diHotkeyDetection,
     IInputEvents inputEvents,
     IDirectInputEventHotkeyFilter directInputEventHotkeyFilter = null,
     IKeySettingsReader keySettingsReader = null)
 {
     _directInputEventHotkeyFilter = directInputEventHotkeyFilter ?? new DirectInputEventHotkeyFilter();
     _diHotkeyDetection            = diHotkeyDetection;
     _inputEvents       = inputEvents;
     _keySettingsReader = keySettingsReader ?? new KeySettingsReader();
 }
Ejemplo n.º 8
0
 public KeyEventHandler(
     IInputEvents inputEvents,
     IKeyInputEventHotkeyFilter keyInputEventHotkeyFilter = null,
     IKeyEventArgsAugmenter keyEventArgsAugmenter         = null,
     IKeySettingsReader keySettingsReader = null
     )
 {
     _inputEvents = inputEvents;
     _keyInputEventHotkeyFilter = keyInputEventHotkeyFilter ?? new KeyInputEventHotkeyFilter();
     _keyEventArgsAugmenter     = keyEventArgsAugmenter ?? new KeyEventArgsAugmenter();
     _keySettingsReader         = keySettingsReader ?? new KeySettingsReader();
 }
Ejemplo n.º 9
0
        public MainWindowViewModel(IUnityContainer container,  IMediaServiceHost mediaServiceHost, 
            IDialogService dialogService, IOutput outputDevice, IMidiInput inputDevice,
            IVirtualKeyBoard keyBoard, ITestControlService currentTest, IInputEvents inputEvents)
        {
            _container =container;
            _dialoagService = dialogService;
            _mediaServiceHost = mediaServiceHost;
            _output = outputDevice;
            _input = inputDevice;
            _keyBoard = keyBoard;
            _currentTestControl = currentTest;

            availableTestControls = new ObservableCollection<ITestControlService>();
            availableTestControls.Add(_currentTestControl);
            availableTestControls.Add(_container.Resolve<NoteGuess.NoteGuessControl>());

            ResolveViews();
        }
Ejemplo n.º 10
0
 public void Construct(MapStoreId mapStoreId,
                       [Inject(Id = MapEditorInstaller.SECTION_TILE_EDITOR_ID)]
                       IMapEditorTool sectionTileEditor,
                       [Inject(Id = MapEditorInstaller.UNIT_TILE_EDITOR_ID)]
                       IMapEditorTool unitTileEditor,
                       [Inject(Id = MapEditorInstaller.PLAYER_UNITS_TILE_EDITOR_ID)]
                       IMapEditorTool playerUnitsTileEditor,
                       IMapDataStore mapDataStore,
                       IInputLock inputLock,
                       IInputEvents inputEvents,
                       ILogger logger)
 {
     _mapStoreId            = mapStoreId;
     _sectionTileEditor     = sectionTileEditor;
     _playerUnitsTileEditor = playerUnitsTileEditor;
     _unitTileEditor        = unitTileEditor;
     _mapDataStore          = mapDataStore;
     _inputLock             = inputLock;
     _inputEvents           = inputEvents;
     _logger = logger;
 }
 public ServerSideIncomingMessageDispatcher(IInputEvents inputEvents)
 {
     _inputEvents = inputEvents;
 }
Ejemplo n.º 12
0
 public ClientSideIncomingMessageDispatcher(
     IInputEvents inputEvents)
 {
     _inputEvents = inputEvents;
 }
Ejemplo n.º 13
0
 public KeyboardWatcher(IInputEvents inputEvents, ILog log = null)
 {
     _keyEventHandler = new KeyEventHandler(inputEvents);
     _log             = log ?? LogManager.GetLogger(GetType());
 }
Ejemplo n.º 14
0
 public TwoButtonsInputScheme(IGame game, IInputEvents input)
 {
     this._game  = game;
     this._input = input;
 }
Ejemplo n.º 15
0
        public MainWindowViewModel(IUnityContainer container, IMediaServiceHost mediaServiceHost,
                                   IDialogService dialogService, IOutput outputDevice, IMidiInput inputDevice,
                                   IVirtualKeyBoard keyBoard, ITestControlService currentTest, IInputEvents inputEvents)
        {
            _container          = container;
            _dialoagService     = dialogService;
            _mediaServiceHost   = mediaServiceHost;
            _output             = outputDevice;
            _input              = inputDevice;
            _keyBoard           = keyBoard;
            _currentTestControl = currentTest;

            availableTestControls = new ObservableCollection <ITestControlService>();
            availableTestControls.Add(_currentTestControl);
            availableTestControls.Add(_container.Resolve <NoteGuess.NoteGuessControl>());

            ResolveViews();
        }
Ejemplo n.º 16
0
		public TwoButtonsInputScheme (IGameState state, IInputEvents input)
		{
			this._state = state;
			this._input = input;
		}
Ejemplo n.º 17
0
 public TwoButtonsInputScheme(IGameState state, IInputEvents input)
 {
     this._state = state;
     this._input = input;
 }
Ejemplo n.º 18
0
 public Events(IInputEvents inputEvents, IStateEvents stateEvents, IWorldEvents worldEvents)
 {
     Input = inputEvents;
     State = stateEvents;
     World = worldEvents;
 }