working on song media player
added gd server api request working on player
This commit is contained in:
parent
e2729417fa
commit
c0ff5b7c82
13 changed files with 50 additions and 58 deletions
|
@ -1,4 +0,0 @@
|
||||||
Manifest-Version: 1.0
|
|
||||||
Build-Jdk-Spec: 17
|
|
||||||
Created-By: Maven Integration for Eclipse
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#Generated by Maven Integration for Eclipse
|
|
||||||
#Sun Mar 03 02:06:38 CET 2024
|
|
||||||
m2e.projectLocation=C\:\\Users\\jansc\\eclipse-workspace\\ExtremeDemonList
|
|
||||||
m2e.projectName=ExtremeDemonList
|
|
||||||
groupId=ExtremeDemonList
|
|
||||||
artifactId=ExtremeDemonList
|
|
||||||
version=0.0.1-SNAPSHOT
|
|
|
@ -1,39 +0,0 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>ExtremeDemonList</groupId>
|
|
||||||
<artifactId>ExtremeDemonList</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.json/json -->
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20140107</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
<version>2.8.6</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<directory>${project.basedir}/builds</directory>
|
|
||||||
<sourceDirectory>src</sourceDirectory>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.10.1</version> <!-- Stelle sicher, dass diese Version Java 17 unterstützt -->
|
|
||||||
<configuration>
|
|
||||||
<release>17</release> <!-- Setze dies auf die gewünschte Java-Version -->
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
5
pom.xml
5
pom.xml
|
@ -31,6 +31,11 @@
|
||||||
<groupId>com.formdev</groupId>
|
<groupId>com.formdev</groupId>
|
||||||
<artifactId>flatlaf</artifactId>
|
<artifactId>flatlaf</artifactId>
|
||||||
<version>3.4</version>
|
<version>3.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alex1304.jdash</groupId>
|
||||||
|
<artifactId>jdash-client</artifactId>
|
||||||
|
<version>4.0.5</version> <!-- replace with latest version -->
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
|
|
20
src/api/GetApiData.java
Normal file
20
src/api/GetApiData.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package api;
|
||||||
|
|
||||||
|
import jdash.client.GDClient;
|
||||||
|
import jdash.common.entity.GDLevel;
|
||||||
|
|
||||||
|
public class GetApiData {
|
||||||
|
|
||||||
|
public String getGDSongID(int id) {
|
||||||
|
|
||||||
|
GDClient client = GDClient.create();
|
||||||
|
|
||||||
|
GDLevel level = client.findLevelById(id).block();
|
||||||
|
|
||||||
|
String songID = level.song().get().downloadUrl() + "";
|
||||||
|
songID = songID.substring(songID.indexOf("[") + 1, songID.length() - 1);
|
||||||
|
|
||||||
|
return songID;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -25,10 +25,6 @@ public class GuiData {
|
||||||
|
|
||||||
private FetchData data = new FetchData();
|
private FetchData data = new FetchData();
|
||||||
|
|
||||||
public void setId(ArrayList<String> id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int localLength;
|
private int localLength;
|
||||||
|
|
||||||
public int getLocalLength() {
|
public int getLocalLength() {
|
||||||
|
|
|
@ -28,7 +28,6 @@ public class ManageFiles {
|
||||||
fetch.getGithubString();
|
fetch.getGithubString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < fetch.allLevels().size(); i++) {
|
for(int i = 0; i < fetch.allLevels().size(); i++) {
|
||||||
|
|
||||||
File file = new File("C:\\ExtremeDemonList\\levels\\" + fetch.allLevels().get(i) + ".json");
|
File file = new File("C:\\ExtremeDemonList\\levels\\" + fetch.allLevels().get(i) + ".json");
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class CreateFileStructure {
|
||||||
|
|
||||||
File file = new File("C:\\ExtremeDemonList\\levels");
|
File file = new File("C:\\ExtremeDemonList\\levels");
|
||||||
File file2 = new File("C:\\ExtremeDemonList\\completed");
|
File file2 = new File("C:\\ExtremeDemonList\\completed");
|
||||||
|
File file3 = new File("C:\\ExtremeDemonList\\index");
|
||||||
|
|
||||||
if(!file.isDirectory()) {
|
if(!file.isDirectory()) {
|
||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
|
@ -17,6 +18,10 @@ public class CreateFileStructure {
|
||||||
file2.mkdirs();
|
file2.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!file3.exists()) {
|
||||||
|
file3.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class MainGUI {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
String url = data.getYoutubeLink().get(index);
|
String url = data.getYoutubeLink().get(index);
|
||||||
VerifyInfo ver = VerifyInfo.getInstance();
|
VerifyInfo ver = VerifyInfo.getInstance();
|
||||||
ver.showInfo(url);
|
ver.showInfo(url, Integer.parseInt(data.getId().get(index)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import java.awt.Button;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -10,12 +11,15 @@ import javax.swing.ImageIcon;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
|
||||||
|
import api.GetApiData;
|
||||||
|
|
||||||
public class VerifyInfo {
|
public class VerifyInfo {
|
||||||
|
|
||||||
private static VerifyInfo instance = null;
|
private static VerifyInfo instance = null;
|
||||||
|
|
||||||
private JFrame frame;
|
private JFrame frame;
|
||||||
private JLabel ytthumbnail;
|
private JLabel ytthumbnail;
|
||||||
|
private Button playsong;
|
||||||
|
|
||||||
private VerifyInfo() {
|
private VerifyInfo() {
|
||||||
frame = new JFrame("Verifikationsinfos");
|
frame = new JFrame("Verifikationsinfos");
|
||||||
|
@ -34,7 +38,7 @@ public class VerifyInfo {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showInfo(String url) {
|
public void showInfo(String url, int id) {
|
||||||
frame.getContentPane().removeAll(); // Clear previous content
|
frame.getContentPane().removeAll(); // Clear previous content
|
||||||
|
|
||||||
ytthumbnail.setBounds(90, 70, 200, 110);
|
ytthumbnail.setBounds(90, 70, 200, 110);
|
||||||
|
@ -70,5 +74,10 @@ public class VerifyInfo {
|
||||||
|
|
||||||
frame.add(ytthumbnail);
|
frame.add(ytthumbnail);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
|
||||||
|
GetApiData data = new GetApiData();
|
||||||
|
|
||||||
|
System.out.println(data.getGDSongID(id));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
|
|
||||||
|
import api.GetApiData;
|
||||||
import data.FetchData;
|
import data.FetchData;
|
||||||
import data.ManageFiles;
|
import data.ManageFiles;
|
||||||
import filestructure.CreateFileStructure;
|
import filestructure.CreateFileStructure;
|
||||||
|
@ -29,7 +30,7 @@ public class Main {
|
||||||
load.updateBar("Liste wird auf Updates geprüft...");
|
load.updateBar("Liste wird auf Updates geprüft...");
|
||||||
|
|
||||||
ManageFiles manager = new ManageFiles();
|
ManageFiles manager = new ManageFiles();
|
||||||
manager.compareArrays();
|
manager.compareArrays();
|
||||||
|
|
||||||
load.updateBar("Ladevorgang abgeschlossen");
|
load.updateBar("Ladevorgang abgeschlossen");
|
||||||
load.close();
|
load.close();
|
||||||
|
|
5
src/media/PlaySong.java
Normal file
5
src/media/PlaySong.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package media;
|
||||||
|
|
||||||
|
public class PlaySong {
|
||||||
|
|
||||||
|
}
|
|
@ -10,4 +10,6 @@
|
||||||
requires org.apache.commons.io;
|
requires org.apache.commons.io;
|
||||||
requires java.datatransfer;
|
requires java.datatransfer;
|
||||||
requires com.formdev.flatlaf;
|
requires com.formdev.flatlaf;
|
||||||
|
requires jdash.client;
|
||||||
|
requires jdash.common;
|
||||||
}
|
}
|
Loading…
Reference in a new issue