diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..7e2a369 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5e82d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0ac215c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..ae064ca --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +## Aula 09 - Classes (exercícios II) + +Código para um reprodutor de músicas (simulador). \ No newline at end of file diff --git a/src/music/App.java b/src/music/App.java new file mode 100644 index 0000000..de95d4e --- /dev/null +++ b/src/music/App.java @@ -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()); + } +}