Skip to content

Commit

Permalink
código-base
Browse files Browse the repository at this point in the history
  • Loading branch information
santanamartins committed Jul 21, 2024
1 parent ab59b41 commit 4600349
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 12 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
## Template para projetos Java no GitHub Codespaces
## Aula 09 - Classes (exercícios II)

Esse repositório contém um template para projetos Java no GitHub Codespaces.

Procedimento sugerido para gerar um novo projeto:

1. Crie um novo repositório a partir desse template (por exemplo, crie um "fork" desse repositório).
2. A partir do repositório criado, clique em "Code", aba "Codespaces" e depois em "New codespace".
Código para um reprodutor de músicas (simulador).
5 changes: 0 additions & 5 deletions src/App.java

This file was deleted.

68 changes: 68 additions & 0 deletions src/music/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package music;

public class App {

// public static void simulatePlayer(Player player) {
// while (player.isPlaying()) {
// System.out.println("Tocando: " + player.getCurrentTrack().toString());
// try {
// Thread.sleep(player.getCurrentTrack().getDuration() * 10);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// if (player.getQueuePlaylist().getNumberOfTracks() == 0) {
// player.stop();
// } else {
// player.nextTrack();
// }
// }
// }
public static void main(String[] args) {
// Player player = new Player();
// Playlist playlist = new Playlist("Top 20 Hits Ever");

// playlist.addTrack(new Track("Bohemian Rhapsody", "Queen", "A Night at the Opera", 1975, 555));
// playlist.addTrack(new Track("Imagine", "John Lennon", "Imagine", 1971, 217)); // Duration in seconds
// playlist.addTrack(new Track("What a Wonderful World", "Louis Armstrong", "Satchmo Sings Darin", 1968, 128));
// playlist.addTrack(new Track("Hallelujah", "Leonard Cohen", "Various Positions", 1984, 240));
// playlist.addTrack(new Track("Singin' in the Rain", "Gene Kelly", "Singin' in the Rain", 1952, 208));
// playlist.addTrack(new Track("Back in Black", "AC/DC", "Back in Black", 1980, 255));
// playlist.addTrack(new Track("Billie Jean", "Michael Jackson", "Thriller", 1982, 334));
// playlist.addTrack(new Track("Clair de Lune", "Claude Debussy", "Unknown", 1890, 280));
// playlist.addTrack(new Track("Hey Jude", "The Beatles", "Hey Jude", 1968, 431));
// playlist.addTrack(new Track("Hotel California", "Eagles", "Hotel California", 1976, 390));
// playlist.addTrack(new Track("Lose Yourself", "Eminem", "The Eminem Show", 2002, 300));
// playlist.addTrack(new Track("Respect", "Aretha Franklin", "I Never Loved a Man the Way I Love You", 1967, 157));
// playlist.addTrack(new Track("Light My Fire", "The Doors", "The Doors", 1967, 428));
// playlist.addTrack(new Track("A Whiter Shade of Pale", "Procol Harum", "Procol Harum", 1967, 249));
// playlist.addTrack(new Track("Liège Concerto", "Saint-Saëns", "Unknown", 1913, 917));
// playlist.addTrack(new Track("Somebody That I Used to Know", "Gotye ft. Kimbra", "Making Mirrors", 2011, 248));
// playlist.addTrack(new Track("Can't Stop the Feeling!", "Justin Timberlake", "Trolls", 2016, 230));
// playlist.addTrack(new Track("The Sound of Silence", "Simon & Garfunkel", "Wednesday Morning, 3 A.M.", 1964, 189));
// playlist.addTrack(new Track("The Boxer", "Simon & Garfunkel", "Bridge over Troubled Water", 1970, 316));
// playlist.addTrack(new Track("The Sound of Silence", "Disturbed", "Immortalized", 2015, 248));

// player.addPlaylist(playlist);

// System.out.println("Fila de reprodução: ");
// System.out.println(player.getQueuePlaylist());

// player.shuffle();

// System.out.println("Fila de reprodução: ");
// System.out.println(player.getQueuePlaylist());

// player.play();

// System.out.println("Música atual: " + player.getCurrentTrack().toString());

// player.nextTrack();
// System.out.println("Próxima música: " + player.getCurrentTrack().toString());
// player.nextTrack();
// player.nextTrack();
// player.nextTrack();
// System.out.println("Próxima música: " + player.getCurrentTrack().toString());
// player.previousTrack();
// System.out.println("Música anterior: " + player.getCurrentTrack().toString());
}
}

0 comments on commit 4600349

Please sign in to comment.