using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace pcd_g1
{
	/// <summary>
	/// musicPlayer.xaml の相互作用ロジック
	/// </summary>
	public partial class musicPlayer : UserControl
	{
		public musicPlayer()
		{
			InitializeComponent();
			this.mediaElement1.LoadedBehavior = MediaState.Manual;
		}

		public double Balance
		{
			get
			{
				return this.mediaElement1.Balance;
			}
			set
			{
				this.mediaElement1.Balance = value;
			}
		}

		public double BufferingProgress
		{
			get
			{
				return this.mediaElement1.BufferingProgress;
			}
		}

		public bool CanPause
		{
			get
			{
				return this.mediaElement1.CanPause;
			}
		}

		public MediaClock Clock
		{
			get
			{
				return this.mediaElement1.Clock;
			}
			set
			{
				this.mediaElement1.Clock = value;
			}
		}

		public void Close()
		{
			this.mediaElement1.Close();
		}

		public bool HasAudio
		{
			get
			{
				return this.mediaElement1.HasAudio;
			}
		}

		public bool IsBuffering
		{
			get
			{
				return this.mediaElement1.IsBuffering;
			}
		}

		public bool IsMuted
		{
			get
			{
				return this.mediaElement1.IsMuted;
			}
			set
			{
				this.mediaElement1.IsMuted = true;
			}
		}

		public void Pause()
		{
			this.mediaElement1.Pause();
		}

		public void Play()
		{
			this.mediaElement1.Play();
		}

		public TimeSpan Position
		{
			get
			{
				return this.mediaElement1.Position;
			}
			set
			{
				this.mediaElement1.Position = value;
			}
		}

		bool repeat = false;
		public bool Repeat
		{
			get
			{
				return repeat;
			}
			set
			{
				repeat = value;
			}
		}

		public bool ScrubbingEnded
		{
			get
			{
				return this.mediaElement1.ScrubbingEnabled;
			}
		}

		public Uri Source
		{
			get
			{
				return this.mediaElement1.Source;
			}
			set
			{
				this.mediaElement1.Source = value;
			}
		}

		public double SpeedRatio
		{
			get
			{
				return this.mediaElement1.SpeedRatio;
			}
			set
			{
				this.mediaElement1.SpeedRatio = value;
			}
		}

		public void Stop()
		{
			this.mediaElement1.Stop();
		}

		public double Volume
		{
			get
			{
				return this.mediaElement1.Volume;
			}
			set
			{
				this.mediaElement1.Volume = value;
			}
		}

		private void mediaElement1_MediaEnded(object sender, RoutedEventArgs e)
		{
			if (repeat)
			{
				this.mediaElement1.Stop();
				this.mediaElement1.Play();
			}
		}

	}
}
