Пример #1
0
        public void Record()
        {
            if (IsRecording)
            {
                return;
            }
            if (IsPlaying)
            {
                Stop();
            }

            // Clear current sequence if any
            Clear();

            // Start recording
            try
            {
                Clock.Start();
                _midiInput.StartRecording();
                _midiInput.MessageReceived += HandleChannelMessageReceived;

                IsRecording = true;
                CanPlay     = true;
                CanRecord   = false;
                CanStop     = true;
            }
            catch (Exception ex)
            {
                Exceptions.ErrHandler(ex);
            }
        }
Пример #2
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();
        }
Пример #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();
        }