aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/.gitignore1
-rw-r--r--bin/musichub/business/Album.classbin0 -> 5577 bytes
-rw-r--r--bin/musichub/business/AudioBook.classbin0 -> 3968 bytes
-rw-r--r--bin/musichub/business/AudioElement.classbin0 -> 5105 bytes
-rw-r--r--bin/musichub/business/Category.classbin0 -> 1442 bytes
-rw-r--r--bin/musichub/business/Genre.classbin0 -> 1453 bytes
-rw-r--r--bin/musichub/business/Language.classbin0 -> 1440 bytes
-rw-r--r--bin/musichub/business/MusicHub.classbin0 -> 11575 bytes
-rw-r--r--bin/musichub/business/NoAlbumFoundException.classbin0 -> 387 bytes
-rw-r--r--bin/musichub/business/NoElementFoundException.classbin0 -> 393 bytes
-rw-r--r--bin/musichub/business/NoPlayListFoundException.classbin0 -> 396 bytes
-rw-r--r--bin/musichub/business/PlayList.classbin0 -> 3905 bytes
-rw-r--r--bin/musichub/business/Song.classbin0 -> 2907 bytes
-rw-r--r--bin/musichub/business/SortByAuthor.classbin0 -> 891 bytes
-rw-r--r--bin/musichub/business/SortByDate.classbin0 -> 844 bytes
-rw-r--r--bin/musichub/business/SortByGenre.classbin0 -> 848 bytes
-rw-r--r--bin/musichub/main/Main.classbin0 -> 9528 bytes
-rw-r--r--bin/musichub/util/XMLHandler.classbin0 -> 2909 bytes
-rw-r--r--out/production/spoteezer/musichub/business/Album.classbin0 -> 5606 bytes
-rw-r--r--out/production/spoteezer/musichub/business/AudioBook.classbin0 -> 4278 bytes
-rw-r--r--out/production/spoteezer/musichub/business/AudioElement.classbin0 -> 3752 bytes
-rw-r--r--out/production/spoteezer/musichub/business/Category.classbin0 -> 1476 bytes
-rw-r--r--out/production/spoteezer/musichub/business/Genre.classbin0 -> 1487 bytes
-rw-r--r--out/production/spoteezer/musichub/business/Language.classbin0 -> 1474 bytes
-rw-r--r--out/production/spoteezer/musichub/business/MusicHub.classbin0 -> 11031 bytes
-rw-r--r--out/production/spoteezer/musichub/business/NoAlbumFoundException.classbin0 -> 387 bytes
-rw-r--r--out/production/spoteezer/musichub/business/NoElementFoundException.classbin0 -> 393 bytes
-rw-r--r--out/production/spoteezer/musichub/business/NoPlayListFoundException.classbin0 -> 396 bytes
-rw-r--r--out/production/spoteezer/musichub/business/PlayList.classbin0 -> 3926 bytes
-rw-r--r--out/production/spoteezer/musichub/business/Song.classbin0 -> 3217 bytes
-rw-r--r--out/production/spoteezer/musichub/business/SortByAuthor.classbin0 -> 901 bytes
-rw-r--r--out/production/spoteezer/musichub/business/SortByDate.classbin0 -> 854 bytes
-rw-r--r--out/production/spoteezer/musichub/business/SortByGenre.classbin0 -> 858 bytes
-rw-r--r--out/production/spoteezer/musichub/main/Main.classbin0 -> 9322 bytes
-rw-r--r--out/production/spoteezer/musichub/util/XMLHandler.classbin0 -> 2921 bytes
-rw-r--r--spoteezer.iml11
-rw-r--r--src/main/java/musichub/business/AudioElement.java68
-rw-r--r--src/main/java/musichub/business/MusicHub.java7
-rw-r--r--src/main/java/musichub/business/Song.java2
-rw-r--r--src/main/java/musichub/main/Main.java11
40 files changed, 62 insertions, 38 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
new file mode 100644
index 0000000..0076c39
--- /dev/null
+++ b/bin/.gitignore
@@ -0,0 +1 @@
+/musichub/
diff --git a/bin/musichub/business/Album.class b/bin/musichub/business/Album.class
new file mode 100644
index 0000000..e2e5b03
--- /dev/null
+++ b/bin/musichub/business/Album.class
Binary files differ
diff --git a/bin/musichub/business/AudioBook.class b/bin/musichub/business/AudioBook.class
new file mode 100644
index 0000000..6ab9f2a
--- /dev/null
+++ b/bin/musichub/business/AudioBook.class
Binary files differ
diff --git a/bin/musichub/business/AudioElement.class b/bin/musichub/business/AudioElement.class
new file mode 100644
index 0000000..9f6e12a
--- /dev/null
+++ b/bin/musichub/business/AudioElement.class
Binary files differ
diff --git a/bin/musichub/business/Category.class b/bin/musichub/business/Category.class
new file mode 100644
index 0000000..85ff126
--- /dev/null
+++ b/bin/musichub/business/Category.class
Binary files differ
diff --git a/bin/musichub/business/Genre.class b/bin/musichub/business/Genre.class
new file mode 100644
index 0000000..db6f5d7
--- /dev/null
+++ b/bin/musichub/business/Genre.class
Binary files differ
diff --git a/bin/musichub/business/Language.class b/bin/musichub/business/Language.class
new file mode 100644
index 0000000..dd87891
--- /dev/null
+++ b/bin/musichub/business/Language.class
Binary files differ
diff --git a/bin/musichub/business/MusicHub.class b/bin/musichub/business/MusicHub.class
new file mode 100644
index 0000000..40e09b2
--- /dev/null
+++ b/bin/musichub/business/MusicHub.class
Binary files differ
diff --git a/bin/musichub/business/NoAlbumFoundException.class b/bin/musichub/business/NoAlbumFoundException.class
new file mode 100644
index 0000000..7cee1f4
--- /dev/null
+++ b/bin/musichub/business/NoAlbumFoundException.class
Binary files differ
diff --git a/bin/musichub/business/NoElementFoundException.class b/bin/musichub/business/NoElementFoundException.class
new file mode 100644
index 0000000..e8118b9
--- /dev/null
+++ b/bin/musichub/business/NoElementFoundException.class
Binary files differ
diff --git a/bin/musichub/business/NoPlayListFoundException.class b/bin/musichub/business/NoPlayListFoundException.class
new file mode 100644
index 0000000..15a3811
--- /dev/null
+++ b/bin/musichub/business/NoPlayListFoundException.class
Binary files differ
diff --git a/bin/musichub/business/PlayList.class b/bin/musichub/business/PlayList.class
new file mode 100644
index 0000000..9403ae5
--- /dev/null
+++ b/bin/musichub/business/PlayList.class
Binary files differ
diff --git a/bin/musichub/business/Song.class b/bin/musichub/business/Song.class
new file mode 100644
index 0000000..7790568
--- /dev/null
+++ b/bin/musichub/business/Song.class
Binary files differ
diff --git a/bin/musichub/business/SortByAuthor.class b/bin/musichub/business/SortByAuthor.class
new file mode 100644
index 0000000..232d4a1
--- /dev/null
+++ b/bin/musichub/business/SortByAuthor.class
Binary files differ
diff --git a/bin/musichub/business/SortByDate.class b/bin/musichub/business/SortByDate.class
new file mode 100644
index 0000000..68e775b
--- /dev/null
+++ b/bin/musichub/business/SortByDate.class
Binary files differ
diff --git a/bin/musichub/business/SortByGenre.class b/bin/musichub/business/SortByGenre.class
new file mode 100644
index 0000000..78295f9
--- /dev/null
+++ b/bin/musichub/business/SortByGenre.class
Binary files differ
diff --git a/bin/musichub/main/Main.class b/bin/musichub/main/Main.class
new file mode 100644
index 0000000..9528e6f
--- /dev/null
+++ b/bin/musichub/main/Main.class
Binary files differ
diff --git a/bin/musichub/util/XMLHandler.class b/bin/musichub/util/XMLHandler.class
new file mode 100644
index 0000000..04ba597
--- /dev/null
+++ b/bin/musichub/util/XMLHandler.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/Album.class b/out/production/spoteezer/musichub/business/Album.class
new file mode 100644
index 0000000..c08b1be
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/Album.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/AudioBook.class b/out/production/spoteezer/musichub/business/AudioBook.class
new file mode 100644
index 0000000..3ad965d
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/AudioBook.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/AudioElement.class b/out/production/spoteezer/musichub/business/AudioElement.class
new file mode 100644
index 0000000..ab20d50
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/AudioElement.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/Category.class b/out/production/spoteezer/musichub/business/Category.class
new file mode 100644
index 0000000..51a68d1
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/Category.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/Genre.class b/out/production/spoteezer/musichub/business/Genre.class
new file mode 100644
index 0000000..66a7d69
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/Genre.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/Language.class b/out/production/spoteezer/musichub/business/Language.class
new file mode 100644
index 0000000..31b17c2
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/Language.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/MusicHub.class b/out/production/spoteezer/musichub/business/MusicHub.class
new file mode 100644
index 0000000..e1a0961
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/MusicHub.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/NoAlbumFoundException.class b/out/production/spoteezer/musichub/business/NoAlbumFoundException.class
new file mode 100644
index 0000000..03aff87
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/NoAlbumFoundException.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/NoElementFoundException.class b/out/production/spoteezer/musichub/business/NoElementFoundException.class
new file mode 100644
index 0000000..6ba1c87
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/NoElementFoundException.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/NoPlayListFoundException.class b/out/production/spoteezer/musichub/business/NoPlayListFoundException.class
new file mode 100644
index 0000000..54319de
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/NoPlayListFoundException.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/PlayList.class b/out/production/spoteezer/musichub/business/PlayList.class
new file mode 100644
index 0000000..ea68021
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/PlayList.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/Song.class b/out/production/spoteezer/musichub/business/Song.class
new file mode 100644
index 0000000..c3bdeb7
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/Song.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/SortByAuthor.class b/out/production/spoteezer/musichub/business/SortByAuthor.class
new file mode 100644
index 0000000..fb8ee7a
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/SortByAuthor.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/SortByDate.class b/out/production/spoteezer/musichub/business/SortByDate.class
new file mode 100644
index 0000000..c52e870
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/SortByDate.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/business/SortByGenre.class b/out/production/spoteezer/musichub/business/SortByGenre.class
new file mode 100644
index 0000000..2016012
--- /dev/null
+++ b/out/production/spoteezer/musichub/business/SortByGenre.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/main/Main.class b/out/production/spoteezer/musichub/main/Main.class
new file mode 100644
index 0000000..419fb9c
--- /dev/null
+++ b/out/production/spoteezer/musichub/main/Main.class
Binary files differ
diff --git a/out/production/spoteezer/musichub/util/XMLHandler.class b/out/production/spoteezer/musichub/util/XMLHandler.class
new file mode 100644
index 0000000..4ab0064
--- /dev/null
+++ b/out/production/spoteezer/musichub/util/XMLHandler.class
Binary files differ
diff --git a/spoteezer.iml b/spoteezer.iml
new file mode 100644
index 0000000..c90834f
--- /dev/null
+++ b/spoteezer.iml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/src/main/java/musichub/business/AudioElement.java b/src/main/java/musichub/business/AudioElement.java
index 0a51c16..0c1e9e4 100644
--- a/src/main/java/musichub/business/AudioElement.java
+++ b/src/main/java/musichub/business/AudioElement.java
@@ -3,12 +3,17 @@ package musichub.business;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import javax.sound.sampled.*;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.UUID;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
public abstract class AudioElement {
protected String title;
protected String artist;
@@ -88,35 +93,40 @@ public abstract class AudioElement {
parentElement.appendChild(contentElement);
}
-
+
public void manageAudioElement() throws UnsupportedAudioFileException, IOException, LineUnavailableException {
-
- Scanner scanner = new Scanner(System.in);
-
- File file = new File(this.content);
- AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
- Clip clip = AudioSystem.getClip();
- clip.open(audioStream);
-
- String action = "";
-
- while (!action.equals("Q")) {
- System.out.println("P = Play \b S = Stop \b R = Reset \b Q = Quit");
- System.out.println("Enter your choice");
- action = scanner.next();
- action = action.toUpperCase();
-
- switch (action) {
- case "S", "Q" -> clip.stop();
- case "P" -> clip.start();
- case "R" -> clip.setMicrosecondPosition(0);
- default -> System.out.println("try again");
- }
- System.out.println("You stopped the Audio element");
- }
-
- clip.close();
-
+
+ Scanner scanner = new Scanner(System.in);
+
+ File file = new File(this.content);
+ AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
+ Clip clip = AudioSystem.getClip();
+ clip.open(audioStream);
+
+ String action = "";
+
+ while(!action.equals("Q")) {
+ System.out.println("P = Play \b S = Stop \b R = Reset \b Q = Quit");
+ System.out.println("Enter your choice");
+ action = scanner.next();
+ action = action.toUpperCase();
+
+ switch(action) {
+ case "S" : clip.stop();
+ break;
+ case "P" : clip.start();
+ break;
+ case "R" : clip.setMicrosecondPosition(0);
+ break;
+ case "Q" : clip.stop();
+ break;
+ default : System.out.println("try again");
+ }
+ System.out.println("You stoped the Audio element");
+ }
+
+ clip.close();
+
}
} \ No newline at end of file
diff --git a/src/main/java/musichub/business/MusicHub.java b/src/main/java/musichub/business/MusicHub.java
index f289f1a..f7cf137 100644
--- a/src/main/java/musichub/business/MusicHub.java
+++ b/src/main/java/musichub/business/MusicHub.java
@@ -6,11 +6,12 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import javax.sound.sampled.LineUnavailableException;
-import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.IOException;
import java.util.*;
+import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
class SortByDate implements Comparator<Album> {
public int compare(Album a1, Album a2) {
return a1.getDate().compareTo(a2.getDate());
@@ -329,7 +330,7 @@ public class MusicHub {
}
xmlHandler.createXMLFile(document, ELEMENTS_FILE_PATH);
}
-
+
public void getAudioElement(List<AudioElement> audios, String elementTitle) throws NoAlbumFoundException, UnsupportedAudioFileException, IOException, LineUnavailableException {
for (AudioElement el : audios) {
if (el.getTitle().equalsIgnoreCase(elementTitle)) {
diff --git a/src/main/java/musichub/business/Song.java b/src/main/java/musichub/business/Song.java
index 5d044a9..564b7c5 100644
--- a/src/main/java/musichub/business/Song.java
+++ b/src/main/java/musichub/business/Song.java
@@ -53,6 +53,6 @@ public class Song extends AudioElement {
parentElement.appendChild(song);
}
-
+
} \ No newline at end of file
diff --git a/src/main/java/musichub/main/Main.java b/src/main/java/musichub/main/Main.java
index c820b5d..2876734 100644
--- a/src/main/java/musichub/main/Main.java
+++ b/src/main/java/musichub/main/Main.java
@@ -2,13 +2,14 @@ package musichub.main;
import musichub.business.*;
-import javax.sound.sampled.LineUnavailableException;
-import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
+import javax.sound.sampled.LineUnavailableException;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
public class Main {
public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException {
@@ -45,8 +46,8 @@ public class Main {
albumTitle = scan.nextLine();
try {
- List<Song> songs = theHub.getAlbumSongsSortedByGenre(albumTitle);
- System.out.println(songs);
+ List<Song> songs = theHub.getAlbumSongsSortedByGenre(albumTitle);
+ System.out.println(songs);;
} catch (NoAlbumFoundException ex) {
System.out.println("No album found with the requested title " + ex.getMessage());
}
@@ -60,7 +61,7 @@ public class Main {
albumTitle = scan.nextLine();
try {
- List<AudioElement> songs = theHub.getAlbumSongs(albumTitle);
+ List<AudioElement> songs = theHub.getAlbumSongs(albumTitle);
System.out.println(theHub.getAlbumSongs(albumTitle));
String song = scan.nextLine();
theHub.getAudioElement(songs, song);