Ejemplo n.º 1
0
        private void InitVideo()
        {
            if (checkFileName())
            {
                try
                {
                    if (_video != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _video.Dispose();
                            _video      = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _video      = new Video(_filePath);
                        _cachedPath = _filePath;
                    }

                    _video.Owner = VideoPanel;
                    isVideo      = true;
                    if (_audio != null)
                    {
                        _audio.Dispose(); _audio = null;
                    }
                }
                catch
                {
                    if (_audio != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _audio.Dispose();
                            _video      = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _audio      = new Audio(_filePath);
                        _cachedPath = _filePath;
                    }
                    isVideo = false;
                    if (_video != null)
                    {
                        _video.Dispose(); _video = null;
                    }
                }
                InitEvents();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Stop music that is currently playing and dispose of the song.
 /// Does nothing if no music is playing.
 /// </summary>
 public void Stop()
 {
     if (isPlaying)
     {
         currentSong.Stop();
         currentSong.Dispose();
         currentSong       = null;
         isPlaying         = false;
         lastMusicPosition = 0;
     }
 }
Ejemplo n.º 3
0
 public override void Dispose()
 {
     mAVAudio.Dispose();
 }