Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: rutapon/vss
 void Events_StateChanged(object sender, MediaStateChange e)
 {
     UISync.Execute(() => label1.Text = e.NewState.ToString());
 }
Exemplo n.º 2
0
 void EventsStateChanged(object sender, MediaStateChange e)
 {
     UISync.Execute(() => label1.Text = e.NewState.ToString());
     switch (e.NewState)
     {
         case MediaState.Playing:
             UISync.Execute(() => btnPlayPause.Text = LocRm.GetString("Pause"));
             break;
         default:
             UISync.Execute(() => btnPlayPause.Text = LocRm.GetString("Play"));
             break;
     }
 }
Exemplo n.º 3
0
        void EventsStateChanged(object sender, MediaStateChange e)
        {
            UISync.Execute(() => label1.Text = e.NewState.ToString());
            switch (e.NewState)
            {
                case MediaState.Playing:
                    UISync.Execute(() => btnPlayPause.Text = "||");
                    break;
                case MediaState.Ended:
                    if (chkRepeatAll.Checked)
                        Go(1);

                    UISync.Execute(() => btnPlayPause.Text = ">");
                    break;
                default:
                    UISync.Execute(() => btnPlayPause.Text = ">");
                    break;
            }
        }
Exemplo n.º 4
0
        void Events_StateChanged(object sender, MediaStateChange e)
        {
            this.Dispatcher.BeginInvoke(new Action(delegate
            {

            }));
        }
Exemplo n.º 5
0
 void EventsStateChanged(object sender, MediaStateChange e)
 {
     switch (e.NewState)
     {
         case MediaState.Ended:
         case MediaState.Stopped:
         case MediaState.Error:
             if (_stopEvent != null && !_stopping)
             {
                 _stopping = true;
                 try
                 {
                     _stopEvent.Set();
                 }
                 catch
                 {
                     // ignored
                 }
             }
             break;
     }
 }
Exemplo n.º 6
0
        void EventsStateChanged(object sender, MediaStateChange e)
        {
            lock (_lock)
            {
                switch (e.NewState)
                {
                    case MediaState.Ended:
                    case MediaState.Stopped:
                    case MediaState.Error:
                        if (_isrunning || _starting)
                        {
                            DisposePlayer();
                            Duration = Time = 0;

                            _starting = false;
                            _isrunning = false;
                            Thread.Sleep(1000); //lets buffered frames stop before raising finished event
                            //if file source then dont reconnect
                            if (!Seekable && !_stoprequested)
                            {
                                if (PlayingFinished != null)
                                    PlayingFinished(sender, ReasonToFinishPlaying.DeviceLost);
                                if (AudioFinished != null)
                                    AudioFinished(sender, ReasonToFinishPlaying.DeviceLost);

                            }
                            else
                            {
                                if (PlayingFinished != null)
                                    PlayingFinished(sender, ReasonToFinishPlaying.StoppedByUser);
                                if (AudioFinished != null)
                                    AudioFinished(sender, ReasonToFinishPlaying.StoppedByUser);
                            }
                        }
                        _stoprequested = false;
                        break;
                }
            }
        }