示例#1
0
        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));
        }
示例#2
0
        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;
        }
示例#3
0
        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;
        }