Example #1
0
        static void Main(string[] args)
        {
            ColorSkin   ColorSkn   = new ColorSkin(ConsoleColor.DarkYellow);
            ClassicSkin ClassicSkn = new ClassicSkin();
            Player      player     = new Player(ColorSkn);

            player.Items = new  List <Song>();
            for (int i = 0; i < 25; i++)
            {
                player.Items.Add(new Song {
                    Title = i + "sssssssssss", IsNext = false, Duration = 540, Genre = Genres.Pop
                });

                if (i == 8 || i == 7 || i == 23 || i == 24)
                {
                    player.Items[i].Genre = Genres.Rock | Genres.Pop;
                }
                if (i == 1 || i == 2 || i == 20 || i == 13)
                {
                    player.Items[i].Genre = Genres.Rock | Genres.Pop | Genres.Electro;
                }
                if (i == 3 || i == 5 || i == 15 || i == 22)
                {
                    player.Items[i].Genre = Genres.Rock | Genres.Metal;
                }

                if (i == 3 || i == 7 || i == 23)
                {
                    player.Items[i].LikeMethod();
                }
                if (i == 5 || i == 8 || i == 22 || i == 21)
                {
                    player.Items[i].DislikeMethod();
                }
            }
            Genres      testfilter      = Genres.Rock | Genres.Pop;
            List <Song> ListAfterFilter = player.FilterByGenres(player.Items, testfilter);

            player.ListItem(ListAfterFilter);

            WriteLine("Now we try to use your keyboard");


            while (true)
            {
                switch (ReadLine())
                {
                case "a":
                {
                    player.VolumeUp();
                    break;
                }

                case "s":
                {
                    player.VolumeDown();
                    break;
                }

                case "d":
                {
                    player.Play();
                    break;
                }

                case "q":
                {
                    player.Lock();
                    break;
                }

                case "w":
                {
                    player.UnLock();
                    break;
                }

                case "e":
                {
                    player.Start();
                    break;
                }

                case "r":
                {
                    player.Stop();
                    break;
                }
                }
            }



            ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            ColorSkin   ColorSkn   = new ColorSkin(ConsoleColor.Blue);
            ClassicSkin ClassicSkn = new ClassicSkin();
            Player      player     = new Player(ColorSkn);

            player.songs = new List <Song>();
            for (int i = 0; i < 25; i++)
            {
                player.songs.Add(new Song {
                    title = i + "sssssssssss", IsNext = false, duration = 540, songGenre = Genres.Pop
                });

                if (i == 8 || i == 7 || i == 23 || i == 24)
                {
                    player.songs[i].songGenre = Genres.Rock | Genres.Pop;
                }
                if (i == 1 || i == 2 || i == 20 || i == 13)
                {
                    player.songs[i].songGenre = Genres.Rock | Genres.Pop | Genres.Electro;
                }
                if (i == 3 || i == 5 || i == 15 || i == 22)
                {
                    player.songs[i].songGenre = Genres.Rock | Genres.Metal;
                }

                if (i == 3 || i == 7 || i == 23)
                {
                    player.songs[i].LikeMethod();
                }
                if (i == 5 || i == 8 || i == 22 || i == 21)
                {
                    player.songs[i].DislikeMethod();
                }
            }
            Genres      testfilter      = Genres.Rock | Genres.Pop;
            List <Song> ListAfterFilter = FilterByGenres(player.songs, testfilter);

            player.ListSong(ListAfterFilter);
            // B5-Player2/10. Fields.
            Song song1 = new Song();

            song1.duration = 300;
            song1.title    = "Cvet nastroenia sinii";
            //song1.songGenre = "Metal";
            song1.lyrics = "lalala";
            song1.artist = new Artist {
                name = "Kirkorov"
            };

            // B5-Player2/10. Fields.
            Song song2 = new Song();

            song2.duration = 300;
            song2.title    = "Anaconda";
            //song2.songGenre = "Pop";
            song2.lyrics = "lalala";
            song2.artist = new Artist
            {
                name = "Minaj",
                band = new Band
                {
                    bandYear = 1988,
                    isExist  = true
                }
            };
            song2.album = new Album
            {
                name = "MinajAlbum",
                path = "pathAlbum",
                year = 1988
            };

            song2.artist.band.bandTitle = "MinajBand";


            WriteLine("Now we try to use your keyboard");


            while (true)
            {
                switch (ReadLine())
                {
                case "a":
                {
                    player.VolumeUp();
                    break;
                }

                case "s":
                {
                    player.VolumeDown();
                    break;
                }

                case "d":
                {
                    player.Play();
                    break;
                }

                case "q":
                {
                    player.Lock();
                    break;
                }

                case "w":
                {
                    player.UnLock();
                    break;
                }

                case "e":
                {
                    player.Start();
                    break;
                }

                case "r":
                {
                    player.Stop();
                    break;
                }
                }
            }



            ReadLine();
        }