From 9c44a251a2744a082168173dfbabc01a87bd6ec6 Mon Sep 17 00:00:00 2001 From: Masfehico Date: Mon, 23 Nov 2020 17:35:02 +0100 Subject: Minor testing changes --- Album.java | 11 ++++++++++- Item.class | Bin 0 -> 185 bytes MusicalElement.class | Bin 0 -> 621 bytes MusicalElement.java | 12 +++++++++++- README.md | 41 ----------------------------------------- jMusicHub.java | 12 ++++++++++++ script.js | 30 ++++++++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 43 deletions(-) create mode 100644 Item.class create mode 100644 MusicalElement.class create mode 100644 script.js 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 songs = new ArrayList(); + 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 Binary files /dev/null and b/Item.class differ diff --git a/MusicalElement.class b/MusicalElement.class new file mode 100644 index 0000000..2cabec5 Binary files /dev/null and b/MusicalElement.class 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 = "" + tabs[value][1] + ""; + } + } +} -- cgit v1.2.3