ajouts listeners
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 322 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
-1
@@ -1,21 +1,39 @@
|
||||
package main;
|
||||
import view.*;
|
||||
|
||||
import view.*;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.Clip;
|
||||
import javax.swing.*;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Classe principale du programme qui initialise l'interface utilisateur
|
||||
* et joue un fichier audio en boucle.
|
||||
*/
|
||||
public class Main {
|
||||
|
||||
/**
|
||||
* Point d'entrée du programme. Initialise l'interface utilisateur
|
||||
* et démarre la lecture en boucle de la musique de fond.
|
||||
*
|
||||
* @param args les arguments de ligne de commande (non utilisés)
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
MenuView menuView = new MenuView();
|
||||
App.addView(menuView, App.MENU_VIEW);
|
||||
App.showView(App.MENU_VIEW);
|
||||
String filepath = "/java/Music/audio.wav";
|
||||
PlayMusic(filepath);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Joue un fichier audio en boucle.
|
||||
*
|
||||
* @param location le chemin d'accès au fichier audio à jouer
|
||||
*/
|
||||
public static void PlayMusic(String location) {
|
||||
try {
|
||||
URL url = Main.class.getResource(location);
|
||||
@@ -24,6 +42,7 @@ public class Main {
|
||||
Clip clip = AudioSystem.getClip();
|
||||
clip.open(audioInput);
|
||||
clip.start();
|
||||
clip.loop(Clip.LOOP_CONTINUOUSLY); // Boucle en continu
|
||||
} else {
|
||||
System.out.println("Fichier audio introuvable");
|
||||
}
|
||||
|
||||
+8
-2
@@ -107,6 +107,10 @@ java/controller/AllScore.class: java/controller/AllScore.java
|
||||
|
||||
### RÈGLE POUR COPIER LES IMAGES ###
|
||||
|
||||
Music:
|
||||
mkdir -p classes/java/Music
|
||||
if [ -d java/Music ]; then cp -r java/Music/* classes/java/Music/; else echo "Le répertoire java/Music n'existe pas."; fi
|
||||
|
||||
copy-images:
|
||||
mkdir -p classes/java/view/img
|
||||
if [ -d java/view/img ]; then cp -r java/view/img/* classes/java/view/img/; else echo "Le répertoire java/view/img n'existe pas."; fi
|
||||
@@ -119,7 +123,8 @@ $(MANIFEST_FILE):
|
||||
|
||||
### ARCHIVE JAR ###
|
||||
|
||||
Main.jar: Main.class copy-images $(MANIFEST_FILE)
|
||||
Main.jar: Main.class copy-images Music $(MANIFEST_FILE)
|
||||
mkdir -p classes/java/Music/
|
||||
mkdir -p classes/java/view/img
|
||||
jar cfm Main.jar $(MANIFEST_FILE) -C classes .
|
||||
|
||||
@@ -131,9 +136,10 @@ run: Main.class copy-images
|
||||
clean:
|
||||
-rm -f classes/**/*.class
|
||||
-rm -rf classes/java/view/img
|
||||
-rm -rf classes/Music
|
||||
|
||||
### BUTS FACTICES ###
|
||||
|
||||
.PHONY: run clean copy-images
|
||||
|
||||
### FIN ###
|
||||
### FIN ###
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user