Exemplo n.º 1
0
        private void ResetAllInTestMode()
        {
            TestModeBtn.Content    = "In Test Mode";
            TestModeBtn.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#02C4A4"));

            if (_audioObject.GetPlayBackState() != PlayBackState.Stopped)
            {
                _audioObject.StopAudio();
            }

            _waveDisplay.ChannelPosition = 0;
            _sessionIndex = 0;

            //_mouseClickFlag = false;
            _loopFalg     = false;
            _testModeFlag = true;

            WaveFormDisplay.RepeatRegionHeight = 0;
            WaveFormDisplay.RepeatRegionWidth  = 0;

            LoopBtn.Content     = (Image)FindResource("NoLoop");
            _allTrialsCompleted = false;
            PlayEnabled(true);
            MushraTestModeOnOff?.Invoke(this, _testModeFlag);
            DisposeAudioComponents();
            ConstructMushraComponents();
        }
Exemplo n.º 2
0
        private void MUSHRASessionWindow_SessionCreated(object sender, MushraTestDetailsModel e)
        {
            _mushraTestDetailsModel = e;
            ClearState();

            _mushraSessionEnumerator = _mushraTestDetailsModel.trials.ToList();

            _sessCreatedFlag = ConstructMushraComponents();

            ConfigureTimer();

            if (_isCanvasCleared)
            {
                WaveFormDisplay.ConstructWaveFormControl();
                _isCanvasCleared = false;
            }

            if (_sessCreatedFlag)
            {
                MushraTestModeOnOff?.Invoke(this, false);
                PlayEnabled(true);
                _settingsObject.SessionCreatedFlag = true;
                Log.Write(LogLevel.Info, "The MUSHRA 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();
                }
            }
        }
Exemplo n.º 3
0
        private void OnTestModeBtnClicked(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)
                    {
                        MushraTestModeOnOff?.Invoke(sender, false);
                        return;
                    }

                    ResetAllInTestMode();
                }
                else
                {
                    MushraTestModeOnOff?.Invoke(sender, false);
                }
            }
        }