public void Edit() { var w = new AddListenMusicWindow { SoundWin = {Title = "Uređivanje zvuka"}, MediaEL = {Source = SoundSource.Source}, btnPlay = {IsEnabled = true} }; var mainWin = DesignerMainWindow.GetInstance(); int currentSlideNr = mainWin.GetCurrentSlideNr(); if (w.ShowDialog() != true) return; SoundSource.Source = w.TheElem.Source; SoundSource.LoadedBehavior = MediaState.Stop; mainWin.canMainCanvas.SaveAllSlideData(Practice.GetInstance().GetSlideByPosition(currentSlideNr)); }
public Sound OpenHiddenSound() { var sound = new Sound(false); var w = new AddListenMusicWindow(); if (w.ShowDialog() == true) { var mainWin = DesignerMainWindow.GetInstance(); int currentSlideNr = mainWin.GetCurrentSlideNr(); sound.SoundSource.Source = w.TheElem.Source; sound.SoundSource.LoadedBehavior = MediaState.Stop; sound.ObjectName = Utilities.GiveUniqueName(sound.SoundSource.Source); SetZIndex(sound, Practice.GetInstance().GetSlideByPosition(mainWin.GetCurrentSlideNr()).SlideObjects.Count); return sound; } return null; }
public static Sound NewSound(bool autoplay) { var sound = new Sound(autoplay); var w = new AddListenMusicWindow(); if (w.ShowDialog() != true) return null; var mainWin = DesignerMainWindow.GetInstance(); Point currentMousePosition = mainWin.GetCurrentMousePosition(); sound.SoundSource.Source = w.TheElem.Source; sound.SoundSource.LoadedBehavior = MediaState.Stop; sound.ObjectName = Utilities.GiveUniqueName(sound.SoundSource.Source); sound.ObjectPath = w.ObjectPath; InkCanvas.SetTop(sound, currentMousePosition.Y); InkCanvas.SetLeft(sound, currentMousePosition.X); SetZIndex(sound, Practice.GetInstance().GetSlideByPosition(mainWin.GetCurrentSlideNr()).SlideObjects.Count); return sound; }