Adds WhisperX, reworks UI (still needs some work), theoretically usable

This commit is contained in:
Guillaume Tâche
2024-08-17 22:05:04 +02:00
parent 7bddf53bab
commit 3fa51eb95b
204 changed files with 4787 additions and 1321 deletions

View File

@@ -22,7 +22,7 @@
</dependency>
<dependency>
<groupId>com.github.gtache.autosubtitle</groupId>
<artifactId>autosubtitle-whisper</artifactId>
<artifactId>autosubtitle-whisperx</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>

View File

@@ -1,11 +1,14 @@
package com.github.gtache.autosubtitle.run;
package com.github.gtache.autosubtitle.gui.run;
import com.github.gtache.autosubtitle.modules.run.DaggerRunComponent;
import com.github.gtache.autosubtitle.modules.gui.run.DaggerRunComponent;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
* Main GUI class
*/
public final class Main extends Application {
@Override

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.modules.run;
package com.github.gtache.autosubtitle.modules.gui.run;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.Translator;
@@ -9,8 +9,6 @@ import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
/**
* Module for missing components
*/
@@ -22,9 +20,8 @@ public abstract class MissingComponentsModule {
}
@Provides
@Singleton
static Translator providesTranslator() {
return new Translator() {
return new Translator<>() {
@Override
public Language getLanguage(final String text) {
return Language.getDefault();
@@ -41,14 +38,13 @@ public abstract class MissingComponentsModule {
}
@Override
public SubtitleCollection translate(final SubtitleCollection collection, final Language to) {
return collection;
public SubtitleCollection<Subtitle> translate(final SubtitleCollection<?> collection, final Language to) {
return (SubtitleCollection<Subtitle>) collection;
}
};
}
@Provides
@Singleton
@TranslatorSetup
static SetupManager providesTranslatorSetupManager() {
return new NoOpSetupManager();

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.modules.run;
package com.github.gtache.autosubtitle.modules.gui.run;
import com.github.gtache.autosubtitle.setup.SetupException;
import com.github.gtache.autosubtitle.setup.SetupListener;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.autosubtitle.modules.run;
package com.github.gtache.autosubtitle.modules.gui.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.whisper.WhisperModule;
import com.github.gtache.autosubtitle.modules.whisperx.WhisperXModule;
import dagger.Component;
import javafx.fxml.FXMLLoader;
@@ -15,7 +15,7 @@ import javax.inject.Singleton;
*/
@Singleton
@Component(modules = {CoreModule.class, GuiCoreModule.class, FXModule.class, FFmpegModule.class,
WhisperModule.class, MissingComponentsModule.class})
WhisperXModule.class, MissingComponentsModule.class})
public interface RunComponent {
/**

View File

@@ -4,7 +4,9 @@
module com.github.gtache.autosubtitle.run {
requires com.github.gtache.autosubtitle.ffmpeg;
requires com.github.gtache.autosubtitle.gui.fx;
requires com.github.gtache.autosubtitle.whisper;
requires com.github.gtache.autosubtitle.whisperx;
requires javafx.fxml;
requires javafx.graphics;
opens com.github.gtache.autosubtitle.run to javafx.graphics;
opens com.github.gtache.autosubtitle.gui.run to javafx.graphics;
}