Ejemplo n.º 1
0
 private void SongController_BarStarted(object sender, BarStartedEventArgs e)
 {
     if (playing)
     {
         if (e.BarNumber > 1 && e.BarNumber % 4 == 1)
         {
             DetailsList.SelectedIndex = (DetailsList.SelectedIndex + 1) % DetailsList.Items.Count;
         }
     }
 }
Ejemplo n.º 2
0
        private void Controller_BarStarted(object sender, BarStartedEventArgs e)
        {
            if (playing)
            {
                if (e.BarNumber % 2 == 1)
                {
                    if (_nextIndex != null)
                    {
                        processingAutoMove        = true;
                        DetailsList.SelectedIndex = _nextIndex.Value;
                        _nextIndex         = null;
                        processingAutoMove = false;
                    }
                }

                if (e.BarNumber % 2 == 0 && DetailsList.Items.Count > 0)
                {
                    SetNext((DetailsList.SelectedIndex + 1) % DetailsList.Items.Count);
                }
            }
        }
Ejemplo n.º 3
0
        private void _songController_BarStarted(object sender, BarStartedEventArgs e)
        {
            if (playing)
            {
                if (!_controllerBarWhenPlayStarted.HasValue)
                {
                    _controllerBarWhenPlayStarted = e.BarNumber;
                }


                var current  = (e.BarNumber - _controllerBarWhenPlayStarted.Value) % _measures.Length;
                var next     = (current + 1) % _measures.Length;
                var previous = current == 0
                    ? _measures.Length - 1
                    : current - 1;

                _measures[previous].DisplayGrid.Background = Brushes.White;
                _measures[current].DisplayGrid.Background  = Brushes.Yellow;

                _songController.SetNextMelodyBar(_measures[next].Measure.Notes);
            }
        }