Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        public void Go()
        {
            string filePath = Path.Combine("..", "..");
            string fileDirectory = "Data";
            string fileName = "test.mpg";
            if (File.Exists(fileName))
            {
                filePath = "";
                fileDirectory = "";
            }
            else if (File.Exists(Path.Combine(fileDirectory, fileName)))
            {
                filePath = "";
            }

            string file = Path.Combine(Path.Combine(filePath, fileDirectory), fileName);

            int width = 352;
            int height = 240;

            Events.KeyboardDown +=
                new EventHandler<KeyboardEventArgs>(this.KeyboardDown);
            Events.Tick += new EventHandler<TickEventArgs>(this.Tick);
            Events.Quit += new EventHandler<QuitEventArgs>(this.Quit);

            Video.WindowIcon();
            Video.WindowCaption = "SDL.NET - Movie Player";
            screen = Video.SetVideoMode(width, height);
            Mixer.Close();
            movie = new Movie(file);
            Console.WriteLine("Time: " + movie.Length);
            Console.WriteLine("Width: " + movie.Size.Width);
            Console.WriteLine("Height: " + movie.Size.Height);
            Console.WriteLine("HasAudio: " + movie.HasAudio);
            Console.WriteLine("HasVideo: " + movie.HasVideo);
            movie.Display(screen);
            movie.Play();
            Events.Run();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             if (this.movie != null)
             {
                 this.movie.Dispose();
                 this.movie = null;
             }
         }
         this.disposed = true;
     }
 }