-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server: Make the config better and more extensible.
- Loading branch information
Showing
10 changed files
with
119 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,72 @@ | ||
package xyz.e3ndr.athena; | ||
|
||
import java.io.File; | ||
|
||
import co.casterlabs.rakurai.json.annotating.JsonClass; | ||
import lombok.Getter; | ||
import co.casterlabs.rakurai.json.annotating.JsonField; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public class Config { | ||
private boolean debug = false; | ||
private boolean disableColoredConsole = false; | ||
public ConsoleConfig console = new ConsoleConfig(); | ||
public ServiceConfig services = new ServiceConfig(); | ||
public SessionConfig sessions = new SessionConfig(); | ||
public TranscodeConfig transcoding = new TranscodeConfig(); | ||
|
||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class ConsoleConfig { | ||
public boolean debug = false; | ||
public @JsonField("disable_color") boolean disableColor = false; | ||
} | ||
|
||
private String mediaDirectory = "./Media"; | ||
private String cacheDirectory = "./Cache"; | ||
private String ingestDirectory = "./Ingest"; | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class ServiceConfig { | ||
public HttpServiceConfig http = new HttpServiceConfig(); | ||
public FtpServiceConfig ftp = new FtpServiceConfig(); | ||
public @JsonField("simple_ui") SimpleUIConfig simpleUI = new SimpleUIConfig(); | ||
public @JsonField("wii_mc") WiiMCServiceConfig wiimc = new WiiMCServiceConfig(); | ||
|
||
private boolean enableCudaAcceleration; | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class HttpServiceConfig { | ||
public boolean enable = true; | ||
public int port = 8125; | ||
} | ||
|
||
// -1 to disable. | ||
private int webUiPort = 8127; | ||
private int httpPort = 8125; | ||
private int ftpPort = 8126; | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class FtpServiceConfig { | ||
public boolean enable = true; | ||
public int port = 8126; | ||
} | ||
|
||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class SimpleUIConfig { | ||
public boolean enable = true; | ||
public int port = 8127; | ||
} | ||
|
||
public File getMediaDirectory() { | ||
return new File(this.mediaDirectory); | ||
} | ||
|
||
public File getCacheDirectory() { | ||
return new File(this.cacheDirectory); | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class SessionConfig { | ||
} | ||
|
||
public File getIngestDirectory() { | ||
return new File(this.ingestDirectory); | ||
@ToString | ||
@JsonClass(exposeAll = true) | ||
public static class TranscodeConfig { | ||
public TranscodeAcceleration acceleration = TranscodeAcceleration.SOFTWARE_ONLY; | ||
|
||
public static enum TranscodeAcceleration { | ||
SOFTWARE_ONLY, | ||
NVIDIA_PREFERRED, | ||
// TODO AMD & Intel encoders. | ||
// TODO Implement hardware decoding to speed up the transcode pipeline. | ||
// https://trac.ffmpeg.org/wiki/HWAccelIntro | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
server/src/main/java/xyz/e3ndr/athena/server/AthenaServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
package xyz.e3ndr.athena.server; | ||
|
||
import xyz.e3ndr.athena.Config; | ||
|
||
public interface AthenaServer { | ||
|
||
public void start(Config config); | ||
public void start(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.