aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/musichub/business
diff options
context:
space:
mode:
authorClyhtsuriva <61652557+clyhtsuriva@users.noreply.github.com>2021-06-28 18:36:50 +0000
committerGitHub <noreply@github.com>2021-06-28 18:36:50 +0000
commite45539bd4b071e41d681dd5946e131de24c07d82 (patch)
tree4e74dd2fd311bebdc92ccf9fea57eef7b5e7db9c /src/main/java/musichub/business
parentd9e5505c6a283c7e576e7c77172221d7cb153351 (diff)
parent0572c31567b386f0845fdaa7d595ceeef01b24b7 (diff)
Merge pull request #22 from Said-Belhadj/STZ-0015
STZ-0015 : Added logs a little bit everywhere and fixed the r feature.
Diffstat (limited to 'src/main/java/musichub/business')
-rw-r--r--src/main/java/musichub/business/AudioElement.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/musichub/business/AudioElement.java b/src/main/java/musichub/business/AudioElement.java
index fa410d8..80a649a 100644
--- a/src/main/java/musichub/business/AudioElement.java
+++ b/src/main/java/musichub/business/AudioElement.java
@@ -1,5 +1,6 @@
package musichub.business;
+import musichub.util.LogHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -107,12 +108,21 @@ public abstract class AudioElement {
action = action.toUpperCase();
switch (action) {
- case "S", "Q" -> clip.stop();
- case "P" -> clip.start();
- case "R" -> clip.setMicrosecondPosition(0);
+ case "S", "Q" -> {
+ clip.stop();
+ LogHandler.write("Music stopped", "INFO");
+ }
+ case "P" -> {
+ clip.start();
+ LogHandler.write("Music started", "INFO");
+ }
+ case "R" -> {
+ clip.setMicrosecondPosition(0);
+ LogHandler.write("Music reseted", "INFO");
+ }
default -> System.out.println("try again");
}
- System.out.println("You stoped the Audio element");
+ System.out.println("You stopped the Audio element");
}
clip.close();