예제 #1
0
        /// <summary>
        /// Действие при изменение текста в полях со значениями времени
        /// </summary>
        public void TimeChanged()
        {
            if (SelectedEpisodeOption == null)
            {
                return;
            }

            var time = ConvertFromEpisodeTime(EditableEpisodeTime);

            if (SelectedJumper != null)
            {
                var jumperIndex = Jumpers.IndexOf(SelectedJumper);
                if (jumperIndex > 0)
                {
                    var previousJumper = Jumpers[jumperIndex - 1];
                    if (time.JumperTime < previousJumper.EndTime)
                    {
                        SelectedJumper.StartTime = previousJumper.EndTime;
                        EditableEpisodeTime      = ConvertToEpisodeTime(SelectedEpisodeOption, SelectedJumper);
                        TimeChanged();
                    }
                }

                SelectedJumper.StartTime           = time.JumperTime;
                SelectedJumper.SkipCount           = time.SkipCount;
                SelectedEpisodeOption.CreditsStart = time.CreditsStart;
            }

            NotifyEditingProperties();
            NotifyOfPropertyChange(() => EpisodeDuration);
            NotifyOfPropertyChange(() => EditableEpisodeTime);
            NotifyOfPropertyChange(() => SelectedJumper);
        }
예제 #2
0
        /// <summary>
        ///     Начальные действия джамперов
        /// </summary>
        private async void StartJumperActions()
        {
            if (CurrentJumper.IsWorking)
            {
                return;
            }
            CurrentJumper.IsWorking = true;
            switch (CurrentJumper.JumperMode)
            {
            case JumperMode.Skip:
                var time = (long)CurrentJumper.EndTime.TotalMilliseconds;
                await Task.Run(() => MediaPlayer.Time = time);

                break;

            case JumperMode.Mute:
                await Task.Run(() => MediaPlayer.Mute = !MediaPlayer.Mute);

                break;

            case JumperMode.IncreaseVolume:
            case JumperMode.LowerVolume:
                await Task.Run(() => MediaPlayer.Volume = CurrentJumper.StandardVolumeValue);

                break;
            }

            var currentIndex = Jumpers.IndexOf(CurrentJumper);

            CurrentJumper = currentIndex == Jumpers.Count - 1 ? null : Jumpers[currentIndex + 1];
        }