aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Album.java11
-rw-r--r--Item.classbin0 -> 185 bytes
-rw-r--r--MusicalElement.classbin0 -> 621 bytes
-rw-r--r--MusicalElement.java12
-rw-r--r--README.md41
-rw-r--r--jMusicHub.java12
-rw-r--r--script.js30
7 files changed, 63 insertions, 43 deletions
diff --git a/Album.java b/Album.java
index cdd39db..b48cf8e 100644
--- a/Album.java
+++ b/Album.java
@@ -3,7 +3,7 @@ import java.util.ArrayList;
public class Album {
private int id, duration, date;
private String title, artist;
- private ArrayList<String> songs = new ArrayList<String>();
+ private ArrayList songs = new ArrayList();
public Album(int id, String title, int duration, String artist, int date, ArrayList songs) {
this.id=id;
this.title=title;
@@ -13,6 +13,15 @@ public class Album {
this.songs=songs;
}
+ public int getId(){return id;}
+ public String getTitle(){return title;}
+ public int getDuration(){
+
+
+ return duration;
+
+ }
+
}
diff --git a/Item.class b/Item.class
new file mode 100644
index 0000000..6ab5078
--- /dev/null
+++ b/Item.class
Binary files differ
diff --git a/MusicalElement.class b/MusicalElement.class
new file mode 100644
index 0000000..2cabec5
--- /dev/null
+++ b/MusicalElement.class
Binary files differ
diff --git a/MusicalElement.java b/MusicalElement.java
index 878eee7..c409ce7 100644
--- a/MusicalElement.java
+++ b/MusicalElement.java
@@ -1,4 +1,10 @@
-class MusicalElement {
+interface Item {
+ int getId();
+ String getTitle();
+ int getDuration();
+ }
+
+class MusicalElement implements Item {
private int id, duration;
private String title, content;
public MusicalElement(int id, String title, int duration, String content) {
@@ -8,6 +14,10 @@ class MusicalElement {
this.content=content;
}
+ public int getId(){return id;}
+ public String getTitle(){return title;}
+ public int getDuration(){return duration;}
+
}
diff --git a/README.md b/README.md
index 398489e..c98ba9f 100644
--- a/README.md
+++ b/README.md
@@ -1,42 +1 @@
OOP project in Java done in my first year, first semester at ESIEA.
-
-#Personal notes
-At the end, I'll be using an extraction of my Ampache (ampache.adjutor.xyz) MySQL DB for my CSV files.
-Resulting in many musics.
-The genres have been added randomly to the songs.
-
-##Commands used on my DB
-Albums :
-```
-SELECT
- al.id as "ID",
- al.name as "Title",
- ar.name as "Artist",
- al.original_year as "Release Year",
- SUM(s.time) as "Duration"
-FROM album al
-JOIN artist ar ON ar.id=al.album_artist
-JOIN song s ON s.album=al.id
-GROUP BY al.id;
-```
-
-Songs:
-```
-SELECT
- s.id as "ID",
- s.title as "Title",
- ar.name as "Artist",
- s.time as "Duration",
- s.file as "Content"
-FROM song s
-JOIN artist ar ON ar.id=s.artist;
-```
-
-Playlists :
-SELECT
- p.id as "ID",
- p.name as "Name",
- s.title as "Song"
-FROM playlist_data pd
-JOIN playlist p ON p.id=pd.playlist
-JOIN song s ON s.id=pd.object_id;
diff --git a/jMusicHub.java b/jMusicHub.java
index 99e8342..c95e1e6 100644
--- a/jMusicHub.java
+++ b/jMusicHub.java
@@ -35,6 +35,18 @@ public class jMusicHub {
case "q" :
System.out.println("Goodbye !");
break;
+ case "c":
+ break;
+ case "a":
+ break;
+ case "+":
+ break;
+ case "l":
+ break;
+ case "p":
+ break;
+ case "-":
+ break;
default :
System.out.println("Unknown command. Type h for help.");
diff --git a/script.js b/script.js
new file mode 100644
index 0000000..b346356
--- /dev/null
+++ b/script.js
@@ -0,0 +1,30 @@
+function show(type)
+{
+ count = 0;
+ for (var key in methods) {
+ var row = document.getElementById(key);
+ if ((methods[key] & type) != 0) {
+ row.style.display = '';
+ row.className = (count++ % 2) ? rowColor : altColor;
+ }
+ else
+ row.style.display = 'none';
+ }
+ updateTabs(type);
+}
+
+function updateTabs(type)
+{
+ for (var value in tabs) {
+ var sNode = document.getElementById(tabs[value][0]);
+ var spanNode = sNode.firstChild;
+ if (value == type) {
+ sNode.className = activeTableTab;
+ spanNode.innerHTML = tabs[value][1];
+ }
+ else {
+ sNode.className = tableTab;
+ spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
+ }
+ }
+}