示例#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();
        }
示例#2
0
 /// <summary>
 /// Creates a new recording session object
 /// </summary>
 /// <param name="midiInput">Expected to be injected</param>
 public RecordSession(IMidiInput midiInput, IOutput output, IVirtualKeyBoard virtualKeyboard)
 {
     _midiInput       = midiInput;
     _output          = output;
     _virtualKeyboard = virtualKeyboard;
     Init();
 }
示例#3
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();
        }
示例#4
0
 /// <summary>
 /// Creates a new recording session object
 /// </summary>
 /// <param name="midiInput">Expected to be injected</param>
 public RecordSession(IMidiInput midiInput, IOutput output, IVirtualKeyBoard virtualKeyboard)
 {
     _midiInput = midiInput;
     _output = output;
     _virtualKeyboard = virtualKeyboard;
     Init();
 }
示例#5
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);
 }
示例#6
0
        public KeyBoardControl(IVirtualKeyBoard keyBoard)
            : this()
        {
            keyBoard.DrawKeys(KeyBoardCanvas);

            _keyboard = keyBoard;

            var window = Application.Current.MainWindow;
            //Hookup keyboard presses
            window.KeyDown += (o, e) => _keyboard.HandleKeyboardPress(o, e);
            window.KeyUp += (o, e) => _keyboard.HandleKeyboardPress(o, e);
        }
示例#7
0
        public KeyBoardControl(IVirtualKeyBoard keyBoard) : this()
        {
            keyBoard.DrawKeys(KeyBoardCanvas);

            _keyboard = keyBoard;


            var window = Application.Current.MainWindow;

            //Hookup keyboard presses
            window.KeyDown += (o, e) => _keyboard.HandleKeyboardPress(o, e);
            window.KeyUp   += (o, e) => _keyboard.HandleKeyboardPress(o, e);
        }
        //, ITestControlService currentTest)
        public MainWindowViewModel(IUnityContainer container,  IMediaService mediaService, 
            IDialogService dialogService, IOutput outputDevice, IMidiInput inputDevice,
            IVirtualKeyBoard keyBoard)
        {
            _container =container;
            _dialoagService = dialogService;
            _mediaService = mediaService;
            _output = outputDevice;
            _input = inputDevice;
            _keyBoard = keyBoard;
            //_currentTest = currentTest.Control;

            ResolveViews();

            //Hook up keyboard (mouse presses) to output
            _keyBoard.KeyPressEvent += (o, e) => _output.Send(e);
        }
示例#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();
        }
示例#10
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();
        }
 public KeyBoardControl(IVirtualKeyBoard keyBoard)
     : this()
 {
     keyBoard.DrawKeys(KeyBoardCanvas);
 }