Moves some modules and files, adds save subtitles
This commit is contained in:
37
gui/run/pom.xml
Normal file
37
gui/run/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.github.gtache.autosubtitle</groupId>
|
||||
<artifactId>autosubtitle-gui</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>autosubtitle-gui-run</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.gtache.autosubtitle</groupId>
|
||||
<artifactId>autosubtitle-ffmpeg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gtache.autosubtitle</groupId>
|
||||
<artifactId>autosubtitle-fx</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gtache.autosubtitle</groupId>
|
||||
<artifactId>autosubtitle-whisper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>info.picocli</groupId>
|
||||
<artifactId>picocli</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.github.gtache.autosubtitle.modules.run;
|
||||
|
||||
import com.github.gtache.autosubtitle.Language;
|
||||
import com.github.gtache.autosubtitle.Translator;
|
||||
import com.github.gtache.autosubtitle.modules.setup.impl.TranslatorSetup;
|
||||
import com.github.gtache.autosubtitle.setup.SetupManager;
|
||||
import com.github.gtache.autosubtitle.subtitle.Subtitle;
|
||||
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* Module for missing components
|
||||
*/
|
||||
@Module
|
||||
public abstract class MissingComponentsModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
static Translator providesTranslator() {
|
||||
return new Translator() {
|
||||
@Override
|
||||
public Language getLanguage(final String text) {
|
||||
return Language.getDefault();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String translate(final String text, final Language to) {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Subtitle translate(final Subtitle subtitle, final Language to) {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubtitleCollection translate(final SubtitleCollection collection, final Language to) {
|
||||
return collection;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@TranslatorSetup
|
||||
static SetupManager providesTranslatorSetupManager() {
|
||||
return new NoOpSetupManager();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.github.gtache.autosubtitle.modules.run;
|
||||
|
||||
import com.github.gtache.autosubtitle.setup.SetupException;
|
||||
import com.github.gtache.autosubtitle.setup.SetupListener;
|
||||
import com.github.gtache.autosubtitle.setup.SetupManager;
|
||||
import com.github.gtache.autosubtitle.setup.SetupStatus;
|
||||
|
||||
class NoOpSetupManager implements SetupManager {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "NoOpSetupManager";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SetupStatus status() {
|
||||
return SetupStatus.NOT_INSTALLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstalled() throws SetupException {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void install() throws SetupException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstall() throws SetupException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reinstall() throws SetupException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpdateAvailable() throws SetupException {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() throws SetupException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(final SetupListener listener) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(final SetupListener listener) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListeners() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.github.gtache.autosubtitle.modules.run;
|
||||
|
||||
import com.github.gtache.autosubtitle.modules.ffmpeg.FFmpegModule;
|
||||
import com.github.gtache.autosubtitle.modules.gui.fx.FXModule;
|
||||
import com.github.gtache.autosubtitle.modules.gui.impl.GuiCoreModule;
|
||||
import com.github.gtache.autosubtitle.modules.impl.CoreModule;
|
||||
import com.github.gtache.autosubtitle.modules.setup.ffmpeg.FFmpegSetupModule;
|
||||
import com.github.gtache.autosubtitle.modules.setup.whisper.WhisperSetupModule;
|
||||
import com.github.gtache.autosubtitle.modules.subtitle.impl.SubtitleModule;
|
||||
import com.github.gtache.autosubtitle.modules.whisper.WhisperModule;
|
||||
import dagger.Component;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* Main component
|
||||
*/
|
||||
@Singleton
|
||||
@Component(modules = {CoreModule.class, GuiCoreModule.class, FXModule.class, FFmpegModule.class, FFmpegSetupModule.class,
|
||||
SubtitleModule.class, WhisperModule.class, WhisperSetupModule.class, MissingComponentsModule.class})
|
||||
public interface RunComponent {
|
||||
|
||||
/**
|
||||
* @return The main FXML loader
|
||||
*/
|
||||
FXMLLoader getMainLoader();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.github.gtache.autosubtitle.run;
|
||||
|
||||
import com.github.gtache.autosubtitle.modules.run.DaggerRunComponent;
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public final class Main extends Application {
|
||||
|
||||
@Override
|
||||
public void start(final Stage primaryStage) throws Exception {
|
||||
final var component = DaggerRunComponent.create();
|
||||
final var loader = component.getMainLoader();
|
||||
final Parent root = loader.load();
|
||||
final var scene = new Scene(root);
|
||||
final var stage = new Stage();
|
||||
stage.setScene(scene);
|
||||
stage.sizeToScene();
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(final String[] args) {
|
||||
Application.launch(args);
|
||||
}
|
||||
}
|
||||
10
gui/run/src/main/java/module-info.java
Normal file
10
gui/run/src/main/java/module-info.java
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Main module for auto-subtitle
|
||||
*/
|
||||
module com.github.gtache.autosubtitle.run {
|
||||
requires com.github.gtache.autosubtitle.ffmpeg;
|
||||
requires com.github.gtache.autosubtitle.fx;
|
||||
requires com.github.gtache.autosubtitle.whisper;
|
||||
|
||||
opens com.github.gtache.autosubtitle.run to javafx.graphics;
|
||||
}
|
||||
13
gui/run/src/main/resources/log4j2.xml
Normal file
13
gui/run/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="INFO">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Reference in New Issue
Block a user