예제 #1
0
파일: PlayerPause.cs 프로젝트: Raumo0/Labs
 public override void Play(Player player)
 {
     if (player.Thread != null)
     {
         player.SetState(PlayerPlay.Instance);
         player.Thread.Resume();
     }
 }
예제 #2
0
파일: PlayerPlay.cs 프로젝트: Raumo0/Labs
 public override void Pause(Player player)
 {
     if (player.Thread != null)
     {
         player.SetState(PlayerPause.Instance);
         player.Thread.Suspend();
     }
 }
예제 #3
0
파일: PlayerStop.cs 프로젝트: Raumo0/Labs
 public override void Play(Player player)
 {
     player.SetState(PlayerPlay.Instance);
     if (player.Thread == null)
     {
         player.Thread = new Thread(player.PlayPlaylist);
         player.Thread.Start();
     }
 }
예제 #4
0
파일: PlayerPause.cs 프로젝트: Raumo0/Labs
 public override void Stop(Player player)
 {
     if (player.Thread != null)
     {
         try
         {
             player.SetState(PlayerStop.Instance);
             player.Thread.Abort();
         }
         catch (ThreadAbortException)
         {
             Thread.ResetAbort();
             player.Thread = null;
         }
     }
 }
예제 #5
0
파일: Program.cs 프로젝트: Raumo0/Labs
        static void Main(string[] args)
        {
            var playLists = LoadPlayLists();

            var player = new Player(playLists[0]);
            player.Play();

            while (true)
            {
                var line = Console.ReadLine();
                if (line == "1")
                    player.Play();
                else if (line == "2")
                    player.Pause();
                else if (line == "3")
                    player.Stop();
                else if (line == "4")
                    return;
            }
        }
예제 #6
0
파일: PlayerPlay.cs 프로젝트: Raumo0/Labs
 public override void Play(Player player)
 {
 }
예제 #7
0
파일: PlayerStop.cs 프로젝트: Raumo0/Labs
 public override void Stop(Player player)
 {
 }
예제 #8
0
파일: PlayerStop.cs 프로젝트: Raumo0/Labs
 public override void Pause(Player player)
 {
 }