Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
santanamartins authored Jul 22, 2024
0 parents commit 2354b1f
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
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"
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
7 changes: 7 additions & 0 deletions .vscode/settings.json
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"
]
}
3 changes: 3 additions & 0 deletions README.md
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).
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 2354b1f

Please sign in to comment.