/// <summary> /// Stops the performance /// </summary> public void Stop() { played = false; if (ReplayView.Get().Avatar.IsEnabled&& skeletonScrolling != null) { skeletonScrolling.Stop(); } if (DrawingSheetView.Get().ReplayVideo.Source != null) { DrawingSheetView.Get().ReplayVideo.Position = new TimeSpan(0, 0, 0, 0, 5); DrawingSheetView.Get().ReplayVideo.Stop(); } if (DrawingSheetView.Get().ReplayAudio.Source != null) { DrawingSheetView.Get().ReplayAudio.Position = new TimeSpan(0, 0, 0, 0, 5); DrawingSheetView.Get().ReplayAudio.Stop(); } Tools.resetStopWatch(); ReplayAvatar.offset = 0; ReplayAvatar.realTime = true; currentListNumber = 0; ReplayView.Get().PauseButton.IsEnabled = false; // Icons cleaning and initialization of the feedback queue thanks to the save IconViewModel.get().clearAll(); if (filePath != null) { DrawingSheetView.Get().ReplayVideo.Source = new Uri(filePath, UriKind.Relative); } }
public static IconViewModel get() { if (iconViewModel == null) { iconViewModel = new IconViewModel(); } return(iconViewModel); }
public static IconViewModel get(IconView view) { if (iconViewModel == null) { iconViewModel = new IconViewModel(); } iconView = view; return(iconViewModel); }
private void ResetColorRessources() { DrawingSheetAvatarViewModel.Get().modifColorOpenGL("Default"); App.Current.Resources["UnselectedTabColor"] = mainBackgroundColor; App.Current.Resources["SelectedTabColor"] = mainTabColor; App.Current.Resources["GeneralTextColor"] = mainFontColor; App.Current.Resources["FeedbackStreamColor"] = Color.FromArgb(255, 128, 128, 128); IconViewModel.get().setFFT((Color)App.Current.Resources["GeneralTextColor"], (Color)App.Current.Resources["UnselectedTabColor"]); DrawingSheetStreamViewModel.Get().changeColorFeedbacks(); Main.session.fillPersoWithActual(); }
private void ChangeResourceColor(string resource) { ColorDialog dlg = new ColorDialog(); if (dlg.ShowDialog() == DialogResult.OK) { App.Current.Resources[resource] = (System.Windows.Media.Color.FromArgb(dlg.Color.A, dlg.Color.R, dlg.Color.G, dlg.Color.B)); if (resource == "FeedbackStreamColor") { DrawingSheetStreamViewModel.Get().changeColorFeedbacks(); } IconViewModel.get().setFFT((Color)App.Current.Resources["GeneralTextColor"], (Color)App.Current.Resources["UnselectedTabColor"]); Main.session.fillPersoWithSpecial(resource); } }
/// <summary> /// Constructor /// Bind functions to events /// </summary> private IconViewModel() { Agitation.agitationEvent += iconAgitation; FFT.reflexEvent += iconBadReflex; Pitch.BoringEvent += iconBoringVoice; AudioProvider.speedEvent += iconSpeed; EmotionRecognition.emoEvent += iconEmotion; fftDrawingGroup = new DrawingGroup(); fftImageSource = new DrawingImage(fftDrawingGroup); this.foregroundPixels = new byte[EnergyBitmapHeight]; this.fftBitmap = new WriteableBitmap(EnergyBitmapWidth, EnergyBitmapHeight, 96, 96, PixelFormats.Indexed1, new BitmapPalette(new List <Color> { Color.FromRgb(30, 31, 36), Color.FromRgb(201, 201, 201) })); for (int i = 0; i < this.foregroundPixels.Length; ++i) { this.foregroundPixels[i] = 0xff; } CompositionTarget.Rendering += UpdateFFT; LecturerTrainer.Model.AudioAnalysis.FFT.FFTEvent += FFTEvent; iconViewModel = this; }