Skip to content

Commit

Permalink
Merge pull request #115 from CodeDead/release/v1.3.0
Browse files Browse the repository at this point in the history
Release/v1.3.0
  • Loading branch information
CodeDead authored Oct 24, 2023
2 parents a5f3650 + a7145b9 commit 487464e
Show file tree
Hide file tree
Showing 25 changed files with 122 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '20.0.1'
java-version: '21'
distribution: 'temurin'

- name: Build
Expand Down Expand Up @@ -66,10 +66,10 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '20.0.1'
java-version: '21'
distribution: 'temurin'

- name: Switch portable flag (Linux)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '20.0.1'
java-version: '21'
distribution: 'temurin'

- name: Test
Expand Down
34 changes: 16 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ plugins {
id 'idea'
id 'eclipse'
id 'application'
id 'org.beryx.jlink' version '2.26.0'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'org.beryx.jlink' version '3.0.0'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

group 'com.codedead'
version '1.2.0'
version '1.3.0'

def currentOS = DefaultNativePlatform.currentOperatingSystem

java {
targetCompatibility = JavaVersion.VERSION_20
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}

application {
Expand All @@ -25,13 +25,13 @@ application {
}

javafx {
version = '20.0.1'
version = '21.0.1'
configuration = 'implementation'
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.media']
}

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
options = ['--strip-debug', '--compress', 'zip-9', '--no-header-files', '--no-man-pages']
forceMerge('log4j-api', 'jackson')
launcher {
name = 'Opal'
Expand All @@ -40,8 +40,6 @@ jlink {
mergedModule {
additive = true
uses 'org.apache.logging.log4j.util.PropertySource'
uses 'org.apache.logging.log4j.core.util.ContextDataProvider'
uses 'org.apache.logging.log4j.core.util.WatchEventService'
uses 'org.apache.logging.log4j.spi.Provider'
uses 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory'
}
Expand Down Expand Up @@ -105,20 +103,20 @@ tasks.register('AppImage') {
doLast {
copy {
from '.AppImage/.AppDir'
into "${buildDir}/AppImage/Opal.AppDir"
into layout.buildDirectory.dir("AppImage/Opal.AppDir")
}
copy {
from "${buildDir}/jpackage/Opal/"
into "${buildDir}/AppImage/Opal.AppDir/usr/"
from layout.buildDirectory.dir("jpackage/Opal/")
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/")
}
copy {
from '.AppImage/.AppDir/Opal.png'
into "${buildDir}/AppImage/Opal.AppDir/usr/lib"
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/lib")
}
exec {
commandLine 'sh', "${project.rootDir}/.AppImage/createAppImage.sh", "${project.version.toString()}"
}
delete "${buildDir}/AppImage/Opal.AppDir"
delete layout.buildDirectory.dir("AppImage/Opal.AppDir")
}
}

Expand All @@ -142,11 +140,11 @@ repositories {
}

dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation 'org.apache.logging.log4j:log4j-core:2.21.1'
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}

tasks.named('test') {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,22 @@ private void saveSoundPresetAction() {
}
}

/**
* Play or pause all media
*/
@FXML
private void playPauseAction() {
logger.info("Play / pause all media");
try {
for (final SoundPane soundPane : getAllSoundPanes(grpControls)) {
soundPane.playPause();
}
} catch (final MediaPlayerException ex) {
logger.error("Unable to play / pause MediaPlayer", ex);
FxUtils.showErrorAlert(translationBundle.getString("PlayPauseError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
}
}

/**
* Method that is called when all players should be reset
*/
Expand Down Expand Up @@ -408,6 +424,8 @@ private void settingsAction() {

logger.info("Showing the SettingsWindow");
primaryStage.show();
primaryStage.setWidth(450);
primaryStage.setHeight(320);
} catch (final IOException ex) {
logger.error("Unable to open the SettingsWindow", ex);
FxUtils.showErrorAlert(translationBundle.getString("SettingsWindowError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
Expand Down Expand Up @@ -491,6 +509,8 @@ private void aboutAction() {

logger.info("Showing the AboutWindow");
primaryStage.show();
primaryStage.setWidth(450);
primaryStage.setHeight(250);
} catch (final IOException ex) {
logger.error("Unable to open the AboutWindow", ex);
FxUtils.showErrorAlert(translationBundle.getString("AboutWindowError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/codedead/opal/domain/SoundPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ private void initializeMediaPlayer(final String value) throws URISyntaxException
disposeMediaPlayer();

mediaPlayer = new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource(value)).toURI().toString()));
mediaPlayer.currentTimeProperty().addListener((observableValue, oldDuration, newDuration) -> {
// Quality of life improvement to reduce audio lag when restarting the media
if (mediaPlayer != null && newDuration.toSeconds() >= mediaPlayer.getMedia().getDuration().toSeconds() - 0.5) {
mediaPlayer.seek(Duration.ZERO);
}
});
mediaPlayer.setOnEndOfMedia(() -> {
if (mediaPlayer != null) {
mediaPlayer.seek(Duration.ZERO);
Expand Down Expand Up @@ -275,10 +269,10 @@ public void pause() {
* @throws MediaPlayerException When the {@link MediaPlayer} object could not be initialized
*/
@FXML
private void playPause() throws MediaPlayerException {
public void playPause() throws MediaPlayerException {
if (mediaPlayer != null && mediaPlayer.getStatus() == MediaPlayer.Status.PLAYING) {
pause();
} else {
} else if (mediaPlayer != null && mediaPlayer.getVolume() != 0) {
play();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/codedead/opal/utils/SharedVariables.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public final class SharedVariables {

public static final String ICON_URL = "/images/opal.png";
public static final String CURRENT_VERSION = "1.2.0.0";
public static final String CURRENT_VERSION = "1.3.0.0";
public static final boolean PORTABLE = false;
public static final String DEFAULT_LOCALE = "en-US";

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
requires javafx.controls;
requires javafx.fxml;
requires java.desktop;
requires java.compiler;
requires java.naming;
requires javafx.media;
//noinspection Java9RedundantRequiresStatement
requires jdk.crypto.ec; // Added for SSL handshakes
Expand Down
Binary file added src/main/resources/audio/metronome.mp3
Binary file not shown.
Binary file added src/main/resources/audio/metronomefast.mp3
Binary file not shown.
Binary file added src/main/resources/images/metronome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/images/playpause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/main/resources/translations/OpalApplication.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=About
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=Unable to open the About Window!
AboutWindowTitle=Opal - About
AutoUpdate=Automatically check for updates
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Audio balance
Advanced=Advanced
Seagulls=Seagulls
Belltower=Bell tower
SlowMetronome=Metronome (slow)
FastMetronome=Metronome (fast)
PlayPause=Play / Pause
PlayPauseError=Unable to play / pause!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=Über
AboutText=Opal wurde erstellt von: DeadLine\n\nAudio: ZapSplat.com\nBilder: Remix Icon\nDesign: AtlantaFX\nÜbersetzung: github.com/uDEV2019\nVersion: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal wurde erstellt von: DeadLine\n\nAudio: ZapSplat.com\nBilder: Remix Icon\nDesign: AtlantaFX\nÜbersetzung: github.com/uDEV2019\nVersion: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=Über-Dialog konnte nicht geöffnet werden!
AboutWindowTitle=Opal - Über
AutoUpdate=Automatisch auf Aktualisierungen prüfen
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Audiobalance
Advanced=Erweitert
Seagulls=Möwen
Belltower=Glockenturm
SlowMetronome=Langsames Metronom
FastMetronome=Schnelles Metronom
PlayPause=Abspielen / Pause
PlayPauseError=Abspielen / Pause konnte nicht ausgeführt werden!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=About
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=Unable to open the About Window!
AboutWindowTitle=Opal - About
AutoUpdate=Automatically check for updates
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Audio balance
Advanced=Advanced
Seagulls=Seagulls
Belltower=Bell tower
SlowMetronome=Metronome (slow)
FastMetronome=Metronome (fast)
PlayPause=Play / Pause
PlayPauseError=Unable to play / pause!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=Acerca de
AboutText=Opal fue creado por DeadLine\n\nAudio: ZapSplat.com\nImágenes: Remix Icon\nTema: AtlantaFX\nVersión: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal fue creado por DeadLine\n\nAudio: ZapSplat.com\nImágenes: Remix Icon\nTema: AtlantaFX\nVersión: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=¡No se puede abrir la ventana Acerca de!
AboutWindowTitle=Opal - Acerca de
AutoUpdate=Buscar actualizaciones automáticamente
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Balance de audio
Advanced=Avanzado
Seagulls=Gaviotas
Belltower=Campanario
SlowMetronome=Metronomo lento
FastMetronome=Metronomo rápido
PlayPause=Reproducir / Pausa
PlayPauseError=¡No se puede reproducir / pausar el sonido!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=À propos
AboutText=Opal a été créé par DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nThème: AtlantaFX\nVersion: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal a été créé par DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nThème: AtlantaFX\nVersion: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=Impossible d'ouvrir la fenêtre À propos!
AboutWindowTitle=Opal - À propos
AutoUpdate=Rechercher automatiquement les mises à jour
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Balance audio
Advanced=Avancé
Seagulls=Mouettes
Belltower=Clocher
SlowMetronome=Métronome lent
FastMetronome=Métronome rapide
PlayPause=Lecture / Pause
PlayPauseError=Impossible de lire / mettre en pause!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=このアプリについて
AboutText=Opal は DeadLine によって作成されました\n\nオーディオ: ZapSplat.com\n画像: リミックス アイコン\nテーマ: AtlantaFX\nバージョン: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal は DeadLine によって作成されました\n\nオーディオ: ZapSplat.com\n画像: リミックス アイコン\nテーマ: AtlantaFX\nバージョン: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=バージョン情報ウィンドウを開けません!
AboutWindowTitle=Opal - このアプリについて
AutoUpdate=アップデートを自動的に確認する
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=オーディオ バランス
Advanced=高度な設定
Seagulls=カモメ
Belltower=ベルタワー
SlowMetronome=遅いメトロノーム
FastMetronome=速いメトロノーム
PlayPause=再生/一時停止
PlayPauseError=再生/一時停止できません!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=Over
AboutText=Opal is gemaakt door DeadLine\n\nAudio: ZapSplat.com\nAfbeeldingen: Remix Icon\nThema: AtlantaFX\nVersie: 1.2.0\n\nCopyright © 2023 CodeDead
AboutText=Opal is gemaakt door DeadLine\n\nAudio: ZapSplat.com\nAfbeeldingen: Remix Icon\nThema: AtlantaFX\nVersie: 1.3.0\n\nCopyright © 2023 CodeDead
AboutWindowError=Kan het Over venster niet openen!
AboutWindowTitle=Opal - Over
AutoUpdate=Automatisch controleren op updates
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Audio balans
Advanced=Geavanceerd
Seagulls=Meeuwen
Belltower=Klokkentoren
SlowMetronome=Metronoom (langzaam)
FastMetronome=Metronoom (snel)
PlayPause=Afspelen / Pauzeren
PlayPauseError=Kan niet afspelen / pauzeren!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About
AboutText=Opal был создан DeadLine\n\nАудио: ZapSplat.com\nИзображения: Remix Icon\nТема: AtlantaFX\nВерсия: 1.2.0\n\nАвторские права © 2023 CodeDead
AboutText=Opal был создан DeadLine\n\nАудио: ZapSplat.com\nИзображения: Remix Icon\nТема: AtlantaFX\nВерсия: 1.3.0\n\nАвторские права © 2023 CodeDead
AboutWindowError=Не удается открыть окно «О программе»!
AboutWindowTitle=Opal - О компании
AutoUpdate=Автоматически проверять наличие обновлений
Expand Down Expand Up @@ -94,3 +94,7 @@ AudioBalance=Баланс аудио
Advanced=Дополнительно
Seagulls=Чайки
Belltower=Колокольня
SlowMetronome=Медленный метроном
FastMetronome=Быстрый метроном
PlayPause=Воспроизведение / Пауза
PlayPauseError=Невозможно воспроизвести / приостановить воспроизведение!
Loading

0 comments on commit 487464e

Please sign in to comment.