private async Task SaveUsingVLCAsync(ConversionOptions options)
        {
            ConversionStarted?.Invoke();

            int start = (int)options.StartPosition.TotalSeconds;
            int end   = (int)options.EndPosition.TotalSeconds;
            //string startFull = start + "." + options.StartPosition.Milliseconds.ToString("D3");
            //string endFull = end + "." + options.EndPosition.Milliseconds.ToString("D3");
            var mp = _playerService.GetMediaPlayerForTrimming(options.FilePath, options.OutputFilePath, start, end);

            mp.Play();
            mp.EndReached += Mp_EndReached;
            while (true)
            {
                await Task.Delay(1000);

                if (!mp.IsPlaying)
                {
                    break;
                }
            }
            mp.Stop();
            App.DebugLog("stopped");
            mp.EndReached -= Mp_EndReached;
            mp.Dispose();
            AddToLibrary(outputPath);
            ConversionEnded?.Invoke(outputPath);
        }
 private void FFmpegConverter_ConversionEnded(object sender, EventArgs e)
 {
     App.DebugLog("FFmpegConverter_ConversionEnded IsConverting");
     AddToLibrary(outputPath);
     ConversionEnded?.Invoke(outputPath);
     SubtitlesTrimmed?.Invoke(_options);
     if (_canDeleteOutputFileSubtitles == true)
     {
         _canDeleteOutputFileSubtitles = false;
         DeleteOutputFileSubtitles();
     }
 }
Beispiel #3
0
 public void OnComplete()
 {
     ConversionEnded?.Invoke(this, new EventArgs());
 }