Added so much shit

This commit is contained in:
2015-05-29 00:03:01 +02:00
parent 34f5cf8034
commit 4f4b10fd89
14 changed files with 168 additions and 23 deletions
+3
View File
@@ -1 +1,4 @@
JSON Parser
Add the libraries to your build path.
Add all the folders EXCEPT the 'songs' folder to your source.
The 'songs' folder should be in your project root.
+11 -11
View File
@@ -4,39 +4,39 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javafx.scene.media.Media;
public class Song {
private String title;
private String subtitle;
private String author;
private double sample_start;
private double BPM;
private File audio;
private File background;
private File banner;
private File file;
private List<SongInstance> songs;
public Song()
{
public Song() {
title = "";
subtitle = "";
author = "";
sample_start = 0;
BPM = 0.0;
audio = null;
background = null;
banner = null;
file = null;
songs = new ArrayList<SongInstance>();
}
public void addSongInstance(SongInstance s)
{
public void addSongInstance(SongInstance s) {
songs.add(s);
}
+1
View File
@@ -10,6 +10,7 @@ import java.io.InputStream;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonReader;
import model.GameModel;
BIN
View File
Binary file not shown.
-6
View File
@@ -1,11 +1,5 @@
package main;
import java.io.File;
import java.io.IOException;
import audio.Song;
import audio.io.JSONReader;
public class Main {
public static void main(String[] args) {
+9 -6
View File
@@ -4,6 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javazoom.jl.player.Player;
import main.Window;
import audio.Song;
import audio.io.DirScanner;
@@ -16,7 +17,7 @@ public class SongHandler {
private int currentIndex;
private File dir;
public SongHandler()
{
songs = new ArrayList<Song>();
@@ -32,11 +33,6 @@ public class SongHandler {
songs = DirScanner.scanDirectories(dir);
currentSong = songs.get(currentIndex);
for(Song s : songs)
{
System.out.println(s.getTitle());
}
}
public void next()
@@ -44,11 +40,18 @@ public class SongHandler {
currentIndex++;
currentIndex%=songs.size();
currentSong = songs.get(currentIndex);
updatePlayer();
}
public void previous()
{
currentIndex--;
currentIndex%=songs.size();
currentSong = songs.get(currentIndex);
updatePlayer();
}
private void updatePlayer()
{
}
}
+72
View File
@@ -0,0 +1,72 @@
{
"meta": {
"title": "title of song",
"subtitle": "subtitle of song",
"author": "author of song",
"sample_start": 12.00,
"BPM": 0
},
"file": {
"audio": "NAME_OF_SONG.mp3",
"background": "background.png",
"banner": "banner.png"
},
"data": [
{
"difficulty": "easy",
"objects": [
{
"time": 1,
"direction": 1,
"button": 0,
"hold": true,
"length": 1000
},
{
"time": 16,
"direction": 6,
"button": 1
}
],
"button": [
{
"time": 0,
"button": 0,
"color": 0
},
{
"time": 20,
"button": 6,
"color": 1
}
]
},
{
"difficulty": "medium",
"objects": [
{
"time": 4,
"direction": 3,
"button": 3
},
{
"time": 12,
"direction": 5,
"button": 2
}
],
"button": [
{
"time": 0,
"button": 0,
"color": 0
},
{
"time": 20,
"button": 6,
"color": 1
}
]
}
]
}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+72
View File
@@ -0,0 +1,72 @@
{
"meta": {
"title": "Song #2",
"subtitle": "Some song",
"author": "Kenneth",
"sample_start": 136.000,
"BPM": 44.260
},
"file": {
"audio": "NAME_OF_SONG.mp3",
"background": "background.png",
"banner": "banner.png"
},
"data": [
{
"difficulty": "easy",
"objects": [
{
"time": 1,
"direction": 1,
"button": 0,
"hold": true,
"length": 1000
},
{
"time": 16,
"direction": 6,
"button": 1
}
],
"button": [
{
"time": 0,
"button": 0,
"color": 0
},
{
"time": 20,
"button": 6,
"color": 1
}
]
},
{
"difficulty": "medium",
"objects": [
{
"time": 4,
"direction": 3,
"button": 3
},
{
"time": 12,
"direction": 5,
"button": 2
}
],
"button": [
{
"time": 0,
"button": 0,
"color": 0
},
{
"time": 20,
"button": 6,
"color": 1
}
]
}
]
}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB