Skip to content

Commit 487464e

Browse files
authored
Merge pull request #115 from CodeDead/release/v1.3.0
Release/v1.3.0
2 parents a5f3650 + a7145b9 commit 487464e

25 files changed

+122
-52
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
if: ${{ matrix.os == 'ubuntu-latest' }}
2424
run: sudo apt-get install -y fuse libfuse2
2525

26-
- name: Set up JDK 20
26+
- name: Set up JDK 21
2727
uses: actions/setup-java@v3
2828
with:
29-
java-version: '20.0.1'
29+
java-version: '21'
3030
distribution: 'temurin'
3131

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

69-
- name: Set up JDK 20
69+
- name: Set up JDK 21
7070
uses: actions/setup-java@v3
7171
with:
72-
java-version: '20.0.1'
72+
java-version: '21'
7373
distribution: 'temurin'
7474

7575
- name: Switch portable flag (Linux)

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
if: ${{ matrix.os == 'ubuntu-latest' }}
2424
run: sudo apt-get install -y fuse libfuse2
2525

26-
- name: Set up JDK 20
26+
- name: Set up JDK 21
2727
uses: actions/setup-java@v3
2828
with:
29-
java-version: '20.0.1'
29+
java-version: '21'
3030
distribution: 'temurin'
3131

3232
- name: Test

build.gradle

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ plugins {
55
id 'idea'
66
id 'eclipse'
77
id 'application'
8-
id 'org.beryx.jlink' version '2.26.0'
9-
id 'org.openjfx.javafxplugin' version '0.0.14'
8+
id 'org.beryx.jlink' version '3.0.0'
9+
id 'org.openjfx.javafxplugin' version '0.1.0'
1010
}
1111

1212
group 'com.codedead'
13-
version '1.2.0'
13+
version '1.3.0'
1414

1515
def currentOS = DefaultNativePlatform.currentOperatingSystem
1616

1717
java {
18-
targetCompatibility = JavaVersion.VERSION_20
19-
sourceCompatibility = JavaVersion.VERSION_20
18+
targetCompatibility = JavaVersion.VERSION_21
19+
sourceCompatibility = JavaVersion.VERSION_21
2020
}
2121

2222
application {
@@ -25,13 +25,13 @@ application {
2525
}
2626

2727
javafx {
28-
version = '20.0.1'
28+
version = '21.0.1'
2929
configuration = 'implementation'
3030
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.media']
3131
}
3232

3333
jlink {
34-
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
34+
options = ['--strip-debug', '--compress', 'zip-9', '--no-header-files', '--no-man-pages']
3535
forceMerge('log4j-api', 'jackson')
3636
launcher {
3737
name = 'Opal'
@@ -40,8 +40,6 @@ jlink {
4040
mergedModule {
4141
additive = true
4242
uses 'org.apache.logging.log4j.util.PropertySource'
43-
uses 'org.apache.logging.log4j.core.util.ContextDataProvider'
44-
uses 'org.apache.logging.log4j.core.util.WatchEventService'
4543
uses 'org.apache.logging.log4j.spi.Provider'
4644
uses 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory'
4745
}
@@ -105,20 +103,20 @@ tasks.register('AppImage') {
105103
doLast {
106104
copy {
107105
from '.AppImage/.AppDir'
108-
into "${buildDir}/AppImage/Opal.AppDir"
106+
into layout.buildDirectory.dir("AppImage/Opal.AppDir")
109107
}
110108
copy {
111-
from "${buildDir}/jpackage/Opal/"
112-
into "${buildDir}/AppImage/Opal.AppDir/usr/"
109+
from layout.buildDirectory.dir("jpackage/Opal/")
110+
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/")
113111
}
114112
copy {
115113
from '.AppImage/.AppDir/Opal.png'
116-
into "${buildDir}/AppImage/Opal.AppDir/usr/lib"
114+
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/lib")
117115
}
118116
exec {
119117
commandLine 'sh', "${project.rootDir}/.AppImage/createAppImage.sh", "${project.version.toString()}"
120118
}
121-
delete "${buildDir}/AppImage/Opal.AppDir"
119+
delete layout.buildDirectory.dir("AppImage/Opal.AppDir")
122120
}
123121
}
124122

@@ -142,11 +140,11 @@ repositories {
142140
}
143141

144142
dependencies {
145-
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
143+
implementation 'org.apache.logging.log4j:log4j-core:2.21.1'
146144
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
147-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
148-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
149-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
145+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
146+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
147+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
150148
}
151149

152150
tasks.named('test') {

gradle/wrapper/gradle-wrapper.jar

346 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum
@@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -201,11 +202,11 @@ fi
201202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203204

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

210211
set -- \
211212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

src/main/java/com/codedead/opal/controller/MainWindowController.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,22 @@ private void saveSoundPresetAction() {
364364
}
365365
}
366366

367+
/**
368+
* Play or pause all media
369+
*/
370+
@FXML
371+
private void playPauseAction() {
372+
logger.info("Play / pause all media");
373+
try {
374+
for (final SoundPane soundPane : getAllSoundPanes(grpControls)) {
375+
soundPane.playPause();
376+
}
377+
} catch (final MediaPlayerException ex) {
378+
logger.error("Unable to play / pause MediaPlayer", ex);
379+
FxUtils.showErrorAlert(translationBundle.getString("PlayPauseError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
380+
}
381+
}
382+
367383
/**
368384
* Method that is called when all players should be reset
369385
*/
@@ -408,6 +424,8 @@ private void settingsAction() {
408424

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

492510
logger.info("Showing the AboutWindow");
493511
primaryStage.show();
512+
primaryStage.setWidth(450);
513+
primaryStage.setHeight(250);
494514
} catch (final IOException ex) {
495515
logger.error("Unable to open the AboutWindow", ex);
496516
FxUtils.showErrorAlert(translationBundle.getString("AboutWindowError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));

src/main/java/com/codedead/opal/domain/SoundPane.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ private void initializeMediaPlayer(final String value) throws URISyntaxException
9292
disposeMediaPlayer();
9393

9494
mediaPlayer = new MediaPlayer(new Media(Objects.requireNonNull(getClass().getResource(value)).toURI().toString()));
95-
mediaPlayer.currentTimeProperty().addListener((observableValue, oldDuration, newDuration) -> {
96-
// Quality of life improvement to reduce audio lag when restarting the media
97-
if (mediaPlayer != null && newDuration.toSeconds() >= mediaPlayer.getMedia().getDuration().toSeconds() - 0.5) {
98-
mediaPlayer.seek(Duration.ZERO);
99-
}
100-
});
10195
mediaPlayer.setOnEndOfMedia(() -> {
10296
if (mediaPlayer != null) {
10397
mediaPlayer.seek(Duration.ZERO);
@@ -275,10 +269,10 @@ public void pause() {
275269
* @throws MediaPlayerException When the {@link MediaPlayer} object could not be initialized
276270
*/
277271
@FXML
278-
private void playPause() throws MediaPlayerException {
272+
public void playPause() throws MediaPlayerException {
279273
if (mediaPlayer != null && mediaPlayer.getStatus() == MediaPlayer.Status.PLAYING) {
280274
pause();
281-
} else {
275+
} else if (mediaPlayer != null && mediaPlayer.getVolume() != 0) {
282276
play();
283277
}
284278
}

src/main/java/com/codedead/opal/utils/SharedVariables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public final class SharedVariables {
44

55
public static final String ICON_URL = "/images/opal.png";
6-
public static final String CURRENT_VERSION = "1.2.0.0";
6+
public static final String CURRENT_VERSION = "1.3.0.0";
77
public static final boolean PORTABLE = false;
88
public static final String DEFAULT_LOCALE = "en-US";
99

src/main/java/module-info.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
requires javafx.controls;
44
requires javafx.fxml;
55
requires java.desktop;
6+
requires java.compiler;
7+
requires java.naming;
68
requires javafx.media;
79
//noinspection Java9RedundantRequiresStatement
810
requires jdk.crypto.ec; // Added for SSL handshakes

0 commit comments

Comments
 (0)