generated from poo-2024-q2/aula09-classes-exercises-ii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2354b1f
Showing
6 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/java | ||
{ | ||
"name": "Java", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye", | ||
|
||
"features": { | ||
"ghcr.io/devcontainers/features/java:1": { | ||
"version": "none", | ||
"installMaven": "false", | ||
"installGradle": "false" | ||
} | ||
} | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "java -version", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"java.project.sourcePaths": ["src"], | ||
"java.project.outputPath": "bin", | ||
"java.project.referencedLibraries": [ | ||
"lib/**/*.jar" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Aula 09 - Classes (exercícios II) | ||
|
||
Código para um reprodutor de músicas (simulador). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |