using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Microsoft.DirectX.AudioVideoPlayback;


namespace vclass.broadcast.client
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class clientForm : System.Windows.Forms.Form
	{
			Video myVideo;
		
		
		private System.Windows.Forms.Panel myPanel;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button3;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public clientForm()
		{
			//
			// Required for Windows Form Designer support
			//
			try
			{
				InitializeComponent();
			}
			catch(Exception e){
				Console.WriteLine("hata:"+e.StackTrace);
			}
				//
				// TODO: Add any constructor code after InitializeComponent call
				//
			}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.myPanel = new System.Windows.Forms.Panel();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.button3 = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// myPanel
			// 
			this.myPanel.AutoScroll = true;
			this.myPanel.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
			this.myPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.myPanel.Location = new System.Drawing.Point(32, 24);
			this.myPanel.Name = "myPanel";
			this.myPanel.Size = new System.Drawing.Size(320, 240);
			this.myPanel.TabIndex = 0;
			this.myPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.My_panel_Paint);
			// 
			// button1
			// 
			this.button1.BackColor = System.Drawing.SystemColors.ActiveBorder;
			this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.button1.Location = new System.Drawing.Point(32, 272);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(112, 56);
			this.button1.TabIndex = 1;
			this.button1.Text = "Start Class Video";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// button2
			// 
			this.button2.BackColor = System.Drawing.SystemColors.ActiveBorder;
			this.button2.Location = new System.Drawing.Point(144, 272);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(104, 56);
			this.button2.TabIndex = 2;
			this.button2.Text = "Stop Class Video";
			this.button2.Click += new System.EventHandler(this.button2_Click);
			// 
			// button3
			// 
			this.button3.BackColor = System.Drawing.SystemColors.ActiveBorder;
			this.button3.Location = new System.Drawing.Point(248, 272);
			this.button3.Name = "button3";
			this.button3.Size = new System.Drawing.Size(104, 56);
			this.button3.TabIndex = 3;
			this.button3.Text = "Save Video";
			this.button3.Click += new System.EventHandler(this.button3_Click);
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(8, 17);
			this.BackColor = System.Drawing.SystemColors.InactiveCaption;
			this.ClientSize = new System.Drawing.Size(384, 352);
			this.Controls.Add(this.button3);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.myPanel);
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Name = "Form1";
			this.Text = "Form1";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		public static void Main() 
		{
			try
			{
				Application.Run(new clientForm());
			}
			catch(Exception x){
				Console.WriteLine("hata: 1 :" + x.StackTrace);
			}
			}

		private void My_panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
			myVideo = new Video("http://ciragan:10140");
			myVideo.Owner = myPanel;
			//myVideo.Size = new Size(384, 320);


		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			//myVideo.Open("http://ciragan:10140");
			myVideo.Play();

		}

		private void button3_Click(object sender, System.EventArgs e)
		{
				myVideo.Pause();
			}

		private void button2_Click(object sender, System.EventArgs e)
		{
			myVideo.Stop();
		}
	}
}
