Exemplo n.º 1
0
        private void player_Stopped(object sender, PlaybackStoppedEventArgs e)
        {
            if (!Changing)
            {
                //MessageBox.Show(e.Exception.ToString());
                t.Stop();
                if (ActualFileIndex == Playlist.Count - 1)
                    ActualFileIndex = 0;
                else
                    ActualFileIndex++;

                GetAndFillWithSongInfo();

                source = CodecFactory.Instance.GetCodec(Playlist[ActualFileIndex]);
                if (playerInit)
                {
                    ttbbPlayPause.Icon = Icon.FromHandle(ToolbarIcons.ic_play_arrow_white_18dp.GetHicon());
                    ttbbPlayPause.Tooltip = "Wznów odtwarzanie";
                    player.Initialize(source);
                    source.SetPosition(new TimeSpan(0, 0, 0));
                    t.Start();
                    player.Play();
                    mtbTime.Maximum = Convert.ToInt32(source.GetLength().TotalSeconds);
                    mtbTime.Value = 0;
                }
            }
        }
Exemplo n.º 2
0
 private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     CurrentStateChanged();
     if (e.HasError)
     {
         ErrorOccurred?.Invoke(this, new ErrorOccurredEventArgs(e.Exception.Message));
         _fadingService.Cancel();
         StopAndReset();
         _soundOut.Dispose();
         _soundOut = null;
     }
 }
Exemplo n.º 3
0
 void soundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (_isdisposing) return;
     if (_manualstop) { _manualstop = false; return; }
     if (!e.HasError) OnTrackFinished();
     CurrentStateChanged();
 }