Esempio n. 1
0
        private void SetTempo(object tempo)
        {
            if (tempo.GetType() == typeof(int))
            {
                _panelService.SetTempo((int)tempo);
                PanelTempo = (int)tempo;
            }
            else
            {
                var tempoVals  = tempo.ToString().Split(new[] { ',' });
                var multiplier = tempoVals.Length > 1 ? Convert.ToInt32(tempoVals[1]) / 100f : 0.95;

                int tempoVal = Convert.ToInt32(Math.Round(Convert.ToInt32(tempoVals[0]) * multiplier, 0));
                _panelService.SetTempo(tempoVal);
                PanelTempo = tempoVal;
            }
        }