public ScorePlayer(string filePath) { com = SharedSerialPort.StartInstance(); sr = new StreamReader(filePath); ss = ScoreSharer.StartInstance(); float.TryParse(ReadLine(), out bpm); float.TryParse(ReadLine(), out offset); notes = new List <float> [4]; types = new List <char> [4]; isGreenOn = new bool[4]; isBlueOn = new bool[4]; for (int i = 0; i < 4; i++) { notes[i] = new List <float>(); types[i] = new List <char>(); isGreenOn[i] = false; isBlueOn[i] = false; } //timer da 1000us = 1ms MsTimer = new Tick(MsTimer_Elapsed); MsTimer.Microseconds = 1000L; fillDone = false; FillLists(); //parte da - (warmup + offset) currentMs = -(((60000.0f / bpm) / 4.0f * 20.0f + offset)); MsTimer.Start(); }
private FormSong(DirectoryInfo chartPath) { this.chart = new Chart(chartPath); bbm = new BeatBitMasker(); ss = ScoreSharer.StartInstance(); InitializeComponent(); labelName.Text = chartPath.Name; chart.Start(); }
public static ScoreSharer StartInstance() { if (_instance == null) { _instance = new ScoreSharer(); } return(_instance); }