private void ResetAllInTestMode() { TestModeBtn.Content = "In Test Mode"; TestModeBtn.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#02C4A4")); if (_audioObject.GetPlayBackState() != PlayBackState.Stopped) { _audioObject.StopAudio(); } _microTimer.Stop(); TestModeOnOff?.Invoke(this, true); _waveDisplay.ChannelPosition = 0; _sessionIndex = 0; _clickedButton = 0; _loopFalg = false; _testModeFlag = true; WaveFormDisplay.RepeatRegionHeight = 0; WaveFormDisplay.RepeatRegionWidth = 0; PlayEnabled(true); DisposeAudioComponents(); ConstructABCTestComponents(); HighlightPlayingAudio(0); LoopBtn.Content = (Image)FindResource("NoLoop"); }
private void TestModeBtn_Click(object sender, RoutedEventArgs e) { if (_sessCreatedFlag == false) { return; } if (TestModeBtn.Content.ToString() == "In Test Mode") { if (!_allTrialsCompleted) { if (MessageBox.Show("Are you sure!!! you want to exit the Test Mode???", "Info", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes) { _scoreLogger.CloseFile(); ResetAllInAuditionMode(); return; } } } else if (TestModeBtn.Content.ToString() == "In Audition Mode") { Window window = new Window { Title = "Score Sheet Info", Content = new ScoreSheetInfo() }; window.SizeToContent = SizeToContent.WidthAndHeight; window.ResizeMode = ResizeMode.NoResize; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; if (window.ShowDialog() == true) { if (SaveScoreFile() == false) { TestModeOnOff?.Invoke(sender, false); return; } ResetAllInTestMode(); } else { TestModeOnOff?.Invoke(sender, false); } } }
private void ABCSessionWindow_SessionCreated(object sender, ABCTestDetailsModel e) { _abcTestDetailsModel = e; ClearState(); LoopBtn.Content = (Image)FindResource("NoLoop"); ConfigureTimer(); abcSessionEnumerator = _abcTestDetailsModel?.trials?.ToList(); _trialCount = abcSessionEnumerator.Count(); _sessCreatedFlag = ConstructABCTestComponents(); if (_isCanvasCleared) { WaveFormDisplay.ConstructWaveFormControl(); _isCanvasCleared = false; } TestModeOnOff?.Invoke(this, false); if (_sessCreatedFlag) { _settingsObject.SessionCreatedFlag = true; PlayEnabled(true); HighlightPlayingAudio(0); Log.Write(LogLevel.Info, "The ABC Session has been loaded Sucessfully!!!"); } else { using (var obj = new FileMenuViewObject()) { MessageBox.Show("Audio Hardware not Connected/Installed", "Error", MessageBoxButton.OK, MessageBoxImage.Error); obj.CloseSession(); } } }