12 Commits
Author SHA1 Message Date
Marc Froehlich 3c7e20a6f8 Reduced opentopo api calls // added 4 char locator new-filter // added new band and tropo filter and priority sorter // decreased map load 2026-06-28 09:24:47 +02:00
Rsclub2_2 a3fbaa57f0 delete not needed files from repo 2026-06-27 20:04:19 +02:00
Marc Froehlich 0bb0b49c40 Fixed worked-23cm-tag when working with dxlog/n1mm logger 2026-06-27 14:31:14 +02:00
Marc Froehlich 1c75fda622 Added filters and sorters for Tropo reachability, AS availability and new big fields / locators. Added reachability band selector for tropo calculation based on a choosen band 2026-06-27 13:35:06 +02:00
Rsclub2_2 23b0fb5a62 Docs added for new Features 2026-06-24 21:56:41 +02:00
Marc Froehlich 3518516e50 changed UI design to save some space. Made the UI more reactive for smaller screens. Maximized resolution at startup to the possible maximum of the current display of the user 2026-06-24 17:34:48 +02:00
Rsclub2_2 d9b0073144 Merge branch 'main' into feature/MapViewAndFilters 2026-06-23 01:10:31 +02:00
Rsclub2_2 6a24c517e7 fix Pipeline Modules n map Linux 2026-06-23 00:33:25 +02:00
Marc Froehlich 7cf0ff2294 debugging map failure 2026-06-22 23:54:06 +02:00
Marc Froehlich af4edca4a7 debugging map failure 2026-06-22 23:31:10 +02:00
Marc Froehlich 4ed8ca6e84 debugging map failure 2026-06-22 22:45:07 +02:00
Marc Froehlich bf6f04c910 Added a map to show where other stn are // refactored message adding to tables for performance, max 30.000 msg now 2026-06-22 22:00:53 +02:00
8 changed files with 254 additions and 492 deletions
+38 -150
View File
@@ -12,7 +12,7 @@ env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions: permissions:
contents: write contents: read
packages: write packages: write
jobs: jobs:
@@ -34,11 +34,11 @@ jobs:
Add-Content -Path $env:GITHUB_ENV -Value "SHORT_SHA=$shortSha" Add-Content -Path $env:GITHUB_ENV -Value "SHORT_SHA=$shortSha"
Add-Content -Path $env:GITHUB_ENV -Value "ASSET_BASENAME=praktiKST-$version-$shortSha" Add-Content -Path $env:GITHUB_ENV -Value "ASSET_BASENAME=praktiKST-$version-$shortSha"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install WiX Toolset - name: Install WiX Toolset
shell: pwsh shell: pwsh
@@ -89,11 +89,11 @@ jobs:
SHORT_SHA="${GITHUB_SHA::7}" SHORT_SHA="${GITHUB_SHA::7}"
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
@@ -169,11 +169,11 @@ jobs:
SHORT_SHA="${GITHUB_SHA::7}" SHORT_SHA="${GITHUB_SHA::7}"
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -199,7 +199,6 @@ jobs:
--main-class kst4contest.view.Kst4ContestApplication \ --main-class kst4contest.view.Kst4ContestApplication \
--module-path target/dist-libs \ --module-path target/dist-libs \
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \ --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
--dest dist --dest dist
DEB="$(ls dist/*.deb | head -n 1)" DEB="$(ls dist/*.deb | head -n 1)"
if [ -z "$DEB" ]; then if [ -z "$DEB" ]; then
@@ -228,11 +227,11 @@ jobs:
SHORT_SHA="${GITHUB_SHA::7}" SHORT_SHA="${GITHUB_SHA::7}"
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -258,7 +257,6 @@ jobs:
--main-class kst4contest.view.Kst4ContestApplication \ --main-class kst4contest.view.Kst4ContestApplication \
--module-path target/dist-libs \ --module-path target/dist-libs \
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \ --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
--dest dist --dest dist
RPM="$(ls dist/*.rpm | head -n 1)" RPM="$(ls dist/*.rpm | head -n 1)"
if [ -z "$RPM" ]; then if [ -z "$RPM" ]; then
@@ -289,11 +287,11 @@ jobs:
echo "SHORT_SHA=$SHORT_SHA" >> "$GITHUB_ENV" echo "SHORT_SHA=$SHORT_SHA" >> "$GITHUB_ENV"
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -348,42 +346,21 @@ jobs:
if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then
cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png" cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png"
fi fi
INSTALLED_SIZE=$(du -sb "$PKGROOT" | cut -f1) INSTALLED_SIZE=$(du -sk "$PKGROOT" | cut -f1)
BUILDDATE=$(date +%s) cat > "$PKGROOT/.PKGINFO" << EOF
WORKFLOW_SHA256=$(sha256sum "$GITHUB_WORKSPACE/.github/workflows/nightly-artifacts.yml" | awk '{print $1}') pkgname = kst4contest
{ pkgbase = kst4contest
echo "pkgname = kst4contest" pkgver = ${PKGVER}-1
echo "pkgbase = kst4contest" pkgdesc = KST4Contest amateur radio contest logger
echo "xdata = pkgtype=pkg" url = https://github.com/${{ github.repository }}
echo "pkgver = ${PKGVER}-1" builddate = $(date +%s)
echo "pkgdesc = KST4Contest amateur radio contest logger" packager = GitHub Actions
echo "url = https://github.com/${{ github.repository }}" size = ${INSTALLED_SIZE}
echo "builddate = ${BUILDDATE}" arch = ${ARCH}
echo "packager = GitHub Actions" license = custom
echo "size = ${INSTALLED_SIZE}" depend = java-runtime
echo "arch = ${ARCH}" EOF
echo "license = custom" tar --zstd -cf "dist/${ASSET_BASENAME}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
echo "depend = java-runtime"
echo "depend = gst-plugins-base"
echo "depend = gst-plugins-good"
} > "$PKGROOT/.PKGINFO"
{
echo "format = 2"
echo "pkgname = kst4contest"
echo "pkgbase = kst4contest"
echo "pkgver = ${PKGVER}-1"
echo "pkgarch = ${ARCH}"
echo "pkgbuild_sha256sum = ${WORKFLOW_SHA256}"
echo "packager = GitHub Actions"
echo "builddate = ${BUILDDATE}"
echo "builddir = /build"
echo "startdir = /build"
echo "buildtool = makepkg"
echo "buildtoolver = 7.0.0-1-x86_64"
echo "buildenv = !distcc !color !ccache check !sign"
echo "options = !strip docs libtool staticlibs emptydirs zipman purge !debug !lto"
} > "$PKGROOT/.BUILDINFO"
tar --zstd --transform 's|^\./||' -cf "dist/${ASSET_BASENAME}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
- name: Upload Arch Linux artifact - name: Upload Arch Linux artifact
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -408,11 +385,11 @@ jobs:
echo "SHORT_SHA=$SHORT_SHA" >> "$GITHUB_ENV" echo "SHORT_SHA=$SHORT_SHA" >> "$GITHUB_ENV"
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
@@ -451,18 +428,14 @@ jobs:
finish-args: finish-args:
- --socket=wayland - --socket=wayland
- --socket=x11 - --socket=x11
- --socket=pulseaudio
- --share=network - --share=network
- --share=ipc - --share=ipc
- --device=dri - --device=dri
- --filesystem=~/.praktiKST
- --env=ALSA_CONFIG_PATH=/app/share/alsa/asound.conf
modules: modules:
- name: kst4contest - name: kst4contest
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- install -d /app/lib/KST4Contest /app/bin /app/share/applications /app/share/alsa - install -d /app/lib/KST4Contest /app/bin /app/share/applications
- printf '@include /usr/share/alsa/alsa.conf\npcm.!default { type pulse }\nctl.!default { type pulse }\n' > /app/share/alsa/asound.conf
- cp -a . /app/lib/KST4Contest/ - cp -a . /app/lib/KST4Contest/
- printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest - printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest
- chmod 755 /app/bin/KST4Contest - chmod 755 /app/bin/KST4Contest
@@ -480,103 +453,18 @@ jobs:
path: flatpak-src/KST4Contest path: flatpak-src/KST4Contest
EOF EOF
- name: Import Flatpak signing key - name: Build Flatpak bundle
run: |
echo "${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}" | gpg --batch --import
FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')
echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV"
- name: Build Flatpak repo (nightly)
run: | run: |
flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml
flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build nightly flatpak build-export target/flatpak-repo target/flatpak-build
flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo flatpak build-bundle target/flatpak-repo "dist/${ASSET_BASENAME}-linux-x86_64.flatpak" de.x08.KST4Contest
- name: Create flatpakref (nightly) - name: Upload Flatpak artifact
run: |
REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > "dist/de.x08.KST4Contest.nightly.flatpakref" << EOF
[Flatpak Ref]
Name=de.x08.KST4Contest
Branch=nightly
Title=KST4Contest (Nightly) ON4KST Chat Client
Url=${PAGES_URL}
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
GPGKey=${GPG_KEY_B64}
IsRuntime=false
EOF
- name: Upload flatpakref
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
with: with:
name: flatpakref name: linux-flatpak
path: dist/de.x08.KST4Contest.nightly.flatpakref path: dist/KST4Contest-*-linux-x86_64.flatpak
retention-days: 14
- name: Upload Flatpak OSTree repo
uses: actions/upload-artifact@v4.3.4
with:
name: flatpak-ostree-repo
path: target/flatpak-repo/
publish-flatpak-repo:
name: Publish Flatpak OSTree Repo (nightly)
runs-on: ubuntu-latest
needs: build-flatpak
steps:
- name: Install Flatpak tooling
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends flatpak
- name: Import Flatpak signing key
run: |
echo "${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}" | gpg --batch --import
echo "FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')" >> "$GITHUB_ENV"
- name: Download OSTree repo artifact
uses: actions/download-artifact@v4.1.3
with:
name: flatpak-ostree-repo
path: flatpak-ostree-repo/
- name: Checkout existing flatpak-repo branch
uses: actions/checkout@v4.1.7
with:
ref: flatpak-repo
path: existing-flatpak-repo
- name: Merge nightly build into flatpak-repo
run: |
cd existing-flatpak-repo
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# Copy the new OSTree build into the repo
rsync -a ../flatpak-ostree-repo/ ./
# Regenerate summary with all branches
flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" .
# Generate .flatpakrepo with embedded GPG key so users can do remote-add without errors
REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > kst4contest.flatpakrepo << EOF
[Flatpak Repo]
Title=KST4Contest
Url=${PAGES_URL}
Homepage=https://github.com/${GITHUB_REPOSITORY}
Comment=KST4Contest ON4KST Chat Client for VHF/UHF contests
GPGKey=${GPG_KEY_B64}
EOF
# Stage all changes (new/updated refs, summary, objects in OSTree)
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Nightly flatpak: $(echo ${{ github.sha }} | cut -c1-7)"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo
fi
build-macos-dmg: build-macos-dmg:
name: Build macOS DMG (${{ matrix.os }}) name: Build macOS DMG (${{ matrix.os }})
@@ -599,11 +487,11 @@ jobs:
echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV" echo "ASSET_BASENAME=KST4Contest-${VERSION}-${SHORT_SHA}" >> "$GITHUB_ENV"
echo "ARCH=$ARCH" >> "$GITHUB_ENV" echo "ARCH=$ARCH" >> "$GITHUB_ENV"
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
+3 -3
View File
@@ -11,18 +11,18 @@ env:
jobs: jobs:
compile: compile:
name: Compile (Java 21) name: Compile (Java 17)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
+45 -108
View File
@@ -22,11 +22,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install WiX Toolset - name: Install WiX Toolset
shell: pwsh shell: pwsh
@@ -70,11 +70,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
@@ -143,11 +143,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -173,7 +173,6 @@ jobs:
--main-class kst4contest.view.Kst4ContestApplication \ --main-class kst4contest.view.Kst4ContestApplication \
--module-path target/dist-libs \ --module-path target/dist-libs \
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \ --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
--dest dist --dest dist
DEB="$(ls dist/*.deb | head -n 1)" DEB="$(ls dist/*.deb | head -n 1)"
if [ -z "$DEB" ]; then if [ -z "$DEB" ]; then
@@ -195,11 +194,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -225,7 +224,6 @@ jobs:
--main-class kst4contest.view.Kst4ContestApplication \ --main-class kst4contest.view.Kst4ContestApplication \
--module-path target/dist-libs \ --module-path target/dist-libs \
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \ --add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
--dest dist --dest dist
RPM="$(ls dist/*.rpm | head -n 1)" RPM="$(ls dist/*.rpm | head -n 1)"
if [ -z "$RPM" ]; then if [ -z "$RPM" ]; then
@@ -247,11 +245,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Install packaging dependencies - name: Install packaging dependencies
run: | run: |
@@ -306,42 +304,21 @@ jobs:
if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then if [ -f "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" ]; then
cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png" cp "$PKGROOT/usr/lib/KST4Contest/lib/KST4Contest.png" "$PKGROOT/usr/share/icons/hicolor/256x256/apps/KST4Contest.png"
fi fi
INSTALLED_SIZE=$(du -sb "$PKGROOT" | cut -f1) INSTALLED_SIZE=$(du -sk "$PKGROOT" | cut -f1)
BUILDDATE=$(date +%s) cat > "$PKGROOT/.PKGINFO" << EOF
WORKFLOW_SHA256=$(sha256sum "$GITHUB_WORKSPACE/.github/workflows/tagged-release.yml" | awk '{print $1}') pkgname = kst4contest
{ pkgbase = kst4contest
echo "pkgname = kst4contest" pkgver = ${PKGVER}-1
echo "pkgbase = kst4contest" pkgdesc = KST4Contest amateur radio contest logger
echo "xdata = pkgtype=pkg" url = https://github.com/${{ github.repository }}
echo "pkgver = ${PKGVER}-1" builddate = $(date +%s)
echo "pkgdesc = KST4Contest amateur radio contest logger" packager = GitHub Actions
echo "url = https://github.com/${{ github.repository }}" size = ${INSTALLED_SIZE}
echo "builddate = ${BUILDDATE}" arch = ${ARCH}
echo "packager = GitHub Actions" license = custom
echo "size = ${INSTALLED_SIZE}" depend = java-runtime
echo "arch = ${ARCH}" EOF
echo "license = custom" tar --zstd -cf "dist/KST4Contest-${{ github.ref_name }}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
echo "depend = java-runtime"
echo "depend = gst-plugins-base"
echo "depend = gst-plugins-good"
} > "$PKGROOT/.PKGINFO"
{
echo "format = 2"
echo "pkgname = kst4contest"
echo "pkgbase = kst4contest"
echo "pkgver = ${PKGVER}-1"
echo "pkgarch = ${ARCH}"
echo "pkgbuild_sha256sum = ${WORKFLOW_SHA256}"
echo "packager = GitHub Actions"
echo "builddate = ${BUILDDATE}"
echo "builddir = /build"
echo "startdir = /build"
echo "buildtool = makepkg"
echo "buildtoolver = 7.0.0-1-x86_64"
echo "buildenv = !distcc !color !ccache check !sign"
echo "options = !strip docs libtool staticlibs emptydirs zipman purge !debug !lto"
} > "$PKGROOT/.BUILDINFO"
tar --zstd --transform 's|^\./||' -cf "dist/KST4Contest-${{ github.ref_name }}-archlinux-${ARCH}.pkg.tar.zst" -C "$PKGROOT" .
- name: Upload Arch Linux artifact - name: Upload Arch Linux artifact
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -357,11 +334,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
@@ -400,18 +377,14 @@ jobs:
finish-args: finish-args:
- --socket=wayland - --socket=wayland
- --socket=x11 - --socket=x11
- --socket=pulseaudio
- --share=network - --share=network
- --share=ipc - --share=ipc
- --device=dri - --device=dri
- --filesystem=~/.praktiKST
- --env=ALSA_CONFIG_PATH=/app/share/alsa/asound.conf
modules: modules:
- name: kst4contest - name: kst4contest
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- install -d /app/lib/KST4Contest /app/bin /app/share/applications /app/share/alsa - install -d /app/lib/KST4Contest /app/bin /app/share/applications
- printf '@include /usr/share/alsa/alsa.conf\npcm.!default { type pulse }\nctl.!default { type pulse }\n' > /app/share/alsa/asound.conf
- cp -a . /app/lib/KST4Contest/ - cp -a . /app/lib/KST4Contest/
- printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest - printf '#!/bin/sh\nexec /app/lib/KST4Contest/bin/KST4Contest "$@"\n' > /app/bin/KST4Contest
- chmod 755 /app/bin/KST4Contest - chmod 755 /app/bin/KST4Contest
@@ -435,18 +408,10 @@ jobs:
FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}') FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')
echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV" echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV"
- name: Determine OSTree branch
run: |
if [[ "${{ github.ref_name }}" == beta-* ]]; then
echo "OSTREE_BRANCH=beta" >> "$GITHUB_ENV"
else
echo "OSTREE_BRANCH=stable" >> "$GITHUB_ENV"
fi
- name: Build Flatpak repo - name: Build Flatpak repo
run: | run: |
flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml
flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build "$OSTREE_BRANCH" flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build stable
flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo
- name: Create flatpakref - name: Create flatpakref
@@ -454,11 +419,11 @@ jobs:
REPO_NAME="${GITHUB_REPOSITORY#*/}" REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/" PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0) GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > "dist/de.x08.KST4Contest.${OSTREE_BRANCH}.flatpakref" << EOF cat > "dist/de.x08.KST4Contest.flatpakref" << EOF
[Flatpak Ref] [Flatpak Ref]
Name=de.x08.KST4Contest Name=de.x08.KST4Contest
Branch=${OSTREE_BRANCH} Branch=stable
Title=KST4Contest (${{ startsWith(github.ref_name, 'beta-') && 'Beta' || 'Release' }}) ON4KST Chat Client Title=KST4Contest ON4KST Chat Client
Url=${PAGES_URL} Url=${PAGES_URL}
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
GPGKey=${GPG_KEY_B64} GPGKey=${GPG_KEY_B64}
@@ -469,7 +434,7 @@ jobs:
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
with: with:
name: flatpakref name: flatpakref
path: dist/de.x08.KST4Contest.*.flatpakref path: dist/de.x08.KST4Contest.flatpakref
- name: Upload Flatpak OSTree repo - name: Upload Flatpak OSTree repo
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -488,11 +453,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
- name: Set up Java 21 - name: Set up Java 17
uses: actions/setup-java@v4.1.0 uses: actions/setup-java@v4.1.0
with: with:
distribution: temurin distribution: temurin
java-version: "21" java-version: "17"
- name: Ensure mvnw is executable - name: Ensure mvnw is executable
run: chmod +x mvnw run: chmod +x mvnw
@@ -611,60 +576,32 @@ jobs:
path: dist/KST4Contest-${{ github.ref_name }}-manual-*.pdf path: dist/KST4Contest-${{ github.ref_name }}-manual-*.pdf
publish-flatpak-repo: publish-flatpak-repo:
name: Publish Flatpak OSTree Repo (${{ github.ref_name }}) name: Publish Flatpak OSTree Repo to GitHub Pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build-flatpak needs: build-flatpak
steps: steps:
- name: Install Flatpak tooling
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends flatpak
- name: Import Flatpak signing key
run: |
echo "${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}" | gpg --batch --import
echo "FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')" >> "$GITHUB_ENV"
- name: Download OSTree repo artifact - name: Download OSTree repo artifact
uses: actions/download-artifact@v4.1.3 uses: actions/download-artifact@v4.1.3
with: with:
name: flatpak-ostree-repo name: flatpak-ostree-repo
path: flatpak-ostree-repo/ path: flatpak-ostree-repo/
- name: Checkout existing flatpak-repo branch - name: Download flatpakref
uses: actions/checkout@v4.1.7 uses: actions/download-artifact@v4.1.3
with: with:
ref: flatpak-repo name: flatpakref
path: existing-flatpak-repo path: flatpak-ostree-repo/
- name: Merge build into flatpak-repo - name: Push to flatpak-repo branch
run: | run: |
cd existing-flatpak-repo cd flatpak-ostree-repo
git init
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
rsync -a ../flatpak-ostree-repo/ ./
# Regenerate summary with all branches (not just the one just built)
flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" .
# Generate .flatpakrepo with embedded GPG key so users can do remote-add without errors
REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > kst4contest.flatpakrepo << EOF
[Flatpak Repo]
Title=KST4Contest
Url=${PAGES_URL}
Homepage=https://github.com/${GITHUB_REPOSITORY}
Comment=KST4Contest ON4KST Chat Client for VHF/UHF contests
GPGKey=${GPG_KEY_B64}
EOF
git add -A git add -A
if git diff --cached --quiet; then git commit -m "Flatpak repo: ${{ github.ref_name }}"
echo "No changes to commit" git push --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo
else
git commit -m "Flatpak repo: ${{ github.ref_name }}"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo
fi
release-tag: release-tag:
name: Publish Tagged Release name: Publish Tagged Release
+2 -37
View File
@@ -116,47 +116,12 @@ Die Datei `de.x08.KST4Contest.flatpakref` aus dem [aktuellen Release](https://gi
flatpak install de.x08.KST4Contest.flatpakref flatpak install de.x08.KST4Contest.flatpakref
``` ```
Oder den Remote manuell hinzufügen (empfohlen für Nightly/Beta-Zugriff): Oder den Remote manuell hinzufügen:
```bash ```bash
flatpak remote-add --if-not-exists kst4contest https://praktimarc.github.io/kst4contest/kst4contest.flatpakrepo flatpak remote-add kst4contest https://praktimarc.github.io/kst4contest/
flatpak install kst4contest de.x08.KST4Contest flatpak install kst4contest de.x08.KST4Contest
``` ```
#### Flatpak-Kanäle (nightly / beta / stable)
Das Flatpak-Repository enthält drei Kanäle, die alle im selben Remote liegen:
| Kanal | Inhalt | Wird gebaut bei |
|---|---|---|
| `stable` | Aktuelle stabile Version | Jedem normalen Release-Tag |
| `beta` | Vorab-Version | Tags mit `beta-` Präfix |
| `nightly` | Entwicklungsstand (main-Branch) | Täglich / jedem Push auf main |
Remote einmalig hinzufügen, dann den gewünschten Kanal installieren:
```bash
flatpak remote-add --if-not-exists kst4contest https://praktimarc.github.io/kst4contest/kst4contest.flatpakrepo
# Stable (Standard)
flatpak install kst4contest de.x08.KST4Contest
# Beta
flatpak install kst4contest de.x08.KST4Contest//beta
# Nightly
flatpak install kst4contest de.x08.KST4Contest//nightly
```
> **Hinweis:** Flatpak erlaubt nur eine installierte Version pro App-ID gleichzeitig. Um den Kanal zu wechseln, zuerst die aktuelle Version deinstallieren:
> ```bash
> flatpak uninstall de.x08.KST4Contest
> flatpak install kst4contest de.x08.KST4Contest//nightly
> ```
Updates erfolgen wie gewohnt mit `flatpak update`.
Die `flatpakref`-Dateien für Beta und Stable liegen jeweils im entsprechenden [GitHub-Release](https://github.com/praktimarc/kst4contest/releases). Das Nightly-`flatpakref` (`de.x08.KST4Contest.nightly.flatpakref`) ist als Artifact im [GitHub Actions](https://github.com/praktimarc/kst4contest/actions)-Tab verfügbar (wird 14 Tage aufbewahrt) der Remote-Weg oben ist für Nightly daher meist einfacher.
### macOS ### macOS
1. DMG-Datei für die eigene Architektur herunterladen (Apple Silicon oder Intel). 1. DMG-Datei für die eigene Architektur herunterladen (Apple Silicon oder Intel).
2. DMG-Datei öffnen. 2. DMG-Datei öffnen.
+2 -37
View File
@@ -116,47 +116,12 @@ Download `de.x08.KST4Contest.flatpakref` from the [latest release](https://githu
flatpak install de.x08.KST4Contest.flatpakref flatpak install de.x08.KST4Contest.flatpakref
``` ```
Or add the remote manually (recommended for nightly/beta access): Or add the remote manually:
```bash ```bash
flatpak remote-add --if-not-exists kst4contest https://praktimarc.github.io/kst4contest/kst4contest.flatpakrepo flatpak remote-add kst4contest https://praktimarc.github.io/kst4contest/
flatpak install kst4contest de.x08.KST4Contest flatpak install kst4contest de.x08.KST4Contest
``` ```
#### Flatpak Channels (nightly / beta / stable)
The Flatpak repository provides three channels, all served from the same remote:
| Channel | Content | Built on |
|---|---|---|
| `stable` | Current stable version | Every normal release tag |
| `beta` | Pre-release version | Tags prefixed with `beta-` |
| `nightly` | Development build (main branch) | Every push to main / daily |
Add the remote once, then install the channel you want:
```bash
flatpak remote-add --if-not-exists kst4contest https://praktimarc.github.io/kst4contest/kst4contest.flatpakrepo
# Stable (default)
flatpak install kst4contest de.x08.KST4Contest
# Beta
flatpak install kst4contest de.x08.KST4Contest//beta
# Nightly
flatpak install kst4contest de.x08.KST4Contest//nightly
```
> **Note:** Flatpak only allows one installed version per App-ID at a time. To switch channels, uninstall the current version first:
> ```bash
> flatpak uninstall de.x08.KST4Contest
> flatpak install kst4contest de.x08.KST4Contest//nightly
> ```
Updates work as usual with `flatpak update`.
The `flatpakref` files for beta and stable are attached to their respective [GitHub Releases](https://github.com/praktimarc/kst4contest/releases). The nightly `flatpakref` (`de.x08.KST4Contest.nightly.flatpakref`) is available as an artifact on the [GitHub Actions](https://github.com/praktimarc/kst4contest/actions) tab (kept for 14 days) — for nightly builds, the manual remote approach above is usually more convenient.
### macOS ### macOS
1. Download the DMG file for your architecture (Apple Silicon or Intel). 1. Download the DMG file for your architecture (Apple Silicon or Intel).
2. Open the DMG file. 2. Open the DMG file.
+27 -12
View File
@@ -24,12 +24,12 @@
<launcher>${project.artifactId}</launcher> <launcher>${project.artifactId}</launcher>
<appName>${project.artifactId}</appName> <appName>${project.artifactId}</appName>
<main.class>kst4contest.view.Kst4ContestApplication</main.class> <main.class>kst4contest.view.Kst4ContestApplication</main.class>
<java.version>21</java.version> <java.version>17</java.version>
<required.maven.version>3.6.3</required.maven.version> <required.maven.version>3.6.3</required.maven.version>
<jar.filename>${project.artifactId}-${project.version}</jar.filename> <jar.filename>${project.artifactId}-${project.version}</jar.filename>
<!-- Dependency versions --> <!-- Dependency versions -->
<javafx.version>21.0.5</javafx.version> <javafx.version>19.0.2.1</javafx.version>
<jetbrains.annotations.version>24.0.1</jetbrains.annotations.version> <jetbrains.annotations.version>24.0.1</jetbrains.annotations.version>
<junit.version>5.10.1</junit.version> <junit.version>5.10.1</junit.version>
<lombok.version>1.18.44</lombok.version> <lombok.version>1.18.44</lombok.version>
@@ -50,8 +50,8 @@
<maven.wrapper.plugin>3.2.0</maven.wrapper.plugin> <maven.wrapper.plugin>3.2.0</maven.wrapper.plugin>
<moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin> <moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin>
<jpackage.maven.plugin>0.1.3</jpackage.maven.plugin> <jpackage.maven.plugin>0.1.3</jpackage.maven.plugin>
<maven.pmd.version>3.28.0</maven.pmd.version> <maven.pmd.version>3.21.2</maven.pmd.version>
<pmd.version>7.17.0</pmd.version> <pmd.version>6.55.0</pmd.version>
<codehaus.version.plugin>2.16.1</codehaus.version.plugin> <codehaus.version.plugin>2.16.1</codehaus.version.plugin>
<javafx.maven.plugin>0.0.8</javafx.maven.plugin> <javafx.maven.plugin>0.0.8</javafx.maven.plugin>
<spotbugs.maven.plugin>4.9.8.2</spotbugs.maven.plugin> <spotbugs.maven.plugin>4.9.8.2</spotbugs.maven.plugin>
@@ -93,13 +93,6 @@
<version>${javafx.version}</version> <version>${javafx.version}</version>
</dependency> </dependency>
<!-- JLayer: pure-Java MP3 decoder, used instead of JavaFX Media for Flatpak audio compatibility -->
<dependency>
<groupId>javazoom</groupId>
<artifactId>jlayer</artifactId>
<version>1.0.1</version>
</dependency>
<!-- SQLite --> <!-- SQLite -->
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
@@ -287,7 +280,30 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId> <artifactId>maven-pmd-plugin</artifactId>
<version>${maven.pmd.version}</version> <version>${maven.pmd.version}</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>${pmd.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>${pmd.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-javascript</artifactId>
<version>${pmd.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-jsp</artifactId>
<version>${pmd.version}</version>
</dependency>
</dependencies>
<configuration> <configuration>
<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
<minimumTokens>100</minimumTokens> <minimumTokens>100</minimumTokens>
<targetJdk>${java.version}</targetJdk> <targetJdk>${java.version}</targetJdk>
<linkXRef>false</linkXRef> <linkXRef>false</linkXRef>
@@ -420,7 +436,6 @@
<addmodule>javafx.graphics</addmodule> <addmodule>javafx.graphics</addmodule>
<addmodule>javafx.fxml</addmodule> <addmodule>javafx.fxml</addmodule>
<addmodule>javafx.web</addmodule> <addmodule>javafx.web</addmodule>
<addmodule>javafx.media</addmodule>
<addmodule>java.sql</addmodule> <addmodule>java.sql</addmodule>
<addmodule>java.net.http</addmodule> <addmodule>java.net.http</addmodule>
<addmodule>jdk.crypto.ec</addmodule> <addmodule>jdk.crypto.ec</addmodule>
@@ -1,18 +1,13 @@
package kst4contest.utils; package kst4contest.utils;
import javazoom.jl.decoder.JavaLayerException; import javafx.scene.media.Media;
import javazoom.jl.player.Player; import javafx.scene.media.MediaPlayer;
import kst4contest.ApplicationConstants; import kst4contest.ApplicationConstants;
import java.io.BufferedInputStream; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* This part of the client drives the sounds. Its a singleton instance. All audio outs are directed to this instance.<br> * This part of the client drives the sounds. Its a singleton instance. All audio outs are directed to this instance.<br>
@@ -118,16 +113,8 @@ public class PlayAudioUtils {
} }
private final Queue<String> musicList = new ConcurrentLinkedQueue<>(); private Queue<Media> musicList = new LinkedList<Media>();
/** True once audio fails; prevents repeated error logs and further play attempts. */ private MediaPlayer mediaPlayer ;
private final AtomicBoolean audioUnavailable = new AtomicBoolean(false);
/** True while the drain loop is running; prevents duplicate concurrent drains. */
private final AtomicBoolean playing = new AtomicBoolean(false);
private final ExecutorService audioThread = Executors.newSingleThreadExecutor(r -> {
Thread t = new Thread(r, "audio-player");
t.setDaemon(true);
return t;
});
/** /**
* Plays notification sounds out of the windws 95 box by given action character<br/> * Plays notification sounds out of the windws 95 box by given action character<br/>
@@ -144,31 +131,40 @@ public class PlayAudioUtils {
*/ */
public void playNoiseLauncher(char actionChar) { public void playNoiseLauncher(char actionChar) {
switch (actionChar){
case '-':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/tick.mp3"));
break;
case '!':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISESTARTUP.mp3"));
break;
case 'C':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISECQWINDOW.mp3"));
break;
case 'P':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISEPMWINDOW.mp3"));
break;
case 'E':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISEERROR.mp3"));
break;
case 'N':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISENOTIFY.mp3"));
break;
default:
System.out.println("[KST4ContestApp, warning, letter not defined!]"); // ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISESTARTUP.mp3");
switch (actionChar){
case '-':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/tick.mp3")).toURI().toString()));
break;
case '!':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISESTARTUP.mp3")).toURI().toString()));
break;
case 'C':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISECQWINDOW.mp3")).toURI().toString()));
break;
case 'P':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISEPMWINDOW.mp3")).toURI().toString()));
break;
case 'E':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISEERROR.mp3")).toURI().toString()));
break;
case 'N':
musicList.add(new Media(new File (ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/NOISENOTIFY.mp3")).toURI().toString()));
break;
// case 'M':
// musicList.add(new Media(new File ("VOICE.mp3").toURI().toString()));
// break;
default:
System.out.println("[KST4ContestApp, warning, letter not defined!]");
} }
playMusic(); playMusic();
// mediaPlayer.dispose();
} }
@@ -187,124 +183,125 @@ public class PlayAudioUtils {
for (char letterToPlay: playThisInCW){ for (char letterToPlay: playThisInCW){
switch (letterToPlay){ switch (letterToPlay){
case 'A': case 'A':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRA.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRA.mp3")).toURI().toString()));
break; break;
case 'B': case 'B':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRB.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRB.mp3")).toURI().toString()));
break; break;
case 'C': case 'C':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRC.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRC.mp3")).toURI().toString()));
break; break;
case 'D': case 'D':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRD.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRD.mp3")).toURI().toString()));
break; break;
case 'E': case 'E':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRE.mp3")).toURI().toString()));
break; break;
case 'F': case 'F':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRF.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRF.mp3")).toURI().toString()));
break; break;
case 'G': case 'G':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRG.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRG.mp3")).toURI().toString()));
break; break;
case 'H': case 'H':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRH.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRH.mp3")).toURI().toString()));
break; break;
case 'I': case 'I':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRI.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRI.mp3")).toURI().toString()));
break; break;
case 'J': case 'J':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRJ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRJ.mp3")).toURI().toString()));
break; break;
case 'K': case 'K':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRK.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRK.mp3")).toURI().toString()));
break; break;
case 'L': case 'L':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRL.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRL.mp3")).toURI().toString()));
break; break;
case 'M': case 'M':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRM.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRM.mp3")).toURI().toString()));
break; break;
case 'N': case 'N':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRN.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRN.mp3")).toURI().toString()));
break; break;
case 'O': case 'O':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRO.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRO.mp3")).toURI().toString()));
break; break;
case 'P': case 'P':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRP.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRP.mp3")).toURI().toString()));
break; break;
case 'Q': case 'Q':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRQ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRQ.mp3")).toURI().toString()));
break; break;
case 'R': case 'R':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRR.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRR.mp3")).toURI().toString()));
break; break;
case 'S': case 'S':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRS.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRS.mp3")).toURI().toString()));
break; break;
case 'T': case 'T':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRT.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRT.mp3")).toURI().toString()));
break; break;
case 'U': case 'U':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRU.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRU.mp3")).toURI().toString()));
break; break;
case 'V': case 'V':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRV.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRV.mp3")).toURI().toString()));
break; break;
case 'W': case 'W':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRW.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRW.mp3")).toURI().toString()));
break; break;
case 'X': case 'X':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRX.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRX.mp3")).toURI().toString()));
break; break;
case 'Y': case 'Y':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRY.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRY.mp3")).toURI().toString()));
break; break;
case 'Z': case 'Z':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRZ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRZ.mp3")).toURI().toString()));
break; break;
case '1': case '1':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR1.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR1.mp3")).toURI().toString()));
break; break;
case '2': case '2':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR2.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR2.mp3")).toURI().toString()));
break; break;
case '3': case '3':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR3.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR3.mp3")).toURI().toString()));
break; break;
case '4': case '4':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR4.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR4.mp3")).toURI().toString()));
break; break;
case '5': case '5':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR5.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR5.mp3")).toURI().toString()));
break; break;
case '6': case '6':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR6.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR6.mp3")).toURI().toString()));
break; break;
case '7': case '7':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR7.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR7.mp3")).toURI().toString()));
break; break;
case '8': case '8':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR8.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR8.mp3")).toURI().toString()));
break; break;
case '9': case '9':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR9.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR9.mp3")).toURI().toString()));
break; break;
case '0': case '0':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR0.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTR0.mp3")).toURI().toString()));
break; break;
case '/': case '/':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRSTROKE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRSTROKE.mp3")).toURI().toString()));
break; break;
case ' ': case ' ':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRSPACE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/LTTRSPACE.mp3")).toURI().toString()));
break; break;
default: default:
System.out.println("[KST4ContestApp, warning, letter not defined:] cwLetters = " + Arrays.toString(playThisInCW)); System.out.println("[KST4ContestApp, warning, letter not defined:] cwLetters = " + Arrays.toString(playThisInCW));
} }
} }
playMusic(); playMusic();
// mediaPlayer.dispose();
} }
@@ -326,166 +323,162 @@ public class PlayAudioUtils {
for (char letterToPlay: spellThisWithVoice){ for (char letterToPlay: spellThisWithVoice){
switch (letterToPlay){ switch (letterToPlay){
case '!': case '!':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEBELL.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEBELL.mp3")).toURI().toString()));
break; break;
case '?': case '?':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEYOUGOTMAIL.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEYOUGOTMAIL.mp3")).toURI().toString()));
break; break;
case '#': case '#':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEHELLO.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEHELLO.mp3")).toURI().toString()));
break; break;
case '*': case '*':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE73.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE73.mp3")).toURI().toString()));
break; break;
case '$': case '$':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICESTROKEPORTABLE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICESTROKEPORTABLE.mp3")).toURI().toString()));
break; break;
case 'A': case 'A':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEA.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEA.mp3")).toURI().toString()));
break; break;
case 'B': case 'B':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEB.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEB.mp3")).toURI().toString()));
break; break;
case 'C': case 'C':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEC.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEC.mp3")).toURI().toString()));
break; break;
case 'D': case 'D':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICED.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICED.mp3")).toURI().toString()));
break; break;
case 'E': case 'E':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEE.mp3")).toURI().toString()));
break; break;
case 'F': case 'F':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEF.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEF.mp3")).toURI().toString()));
break; break;
case 'G': case 'G':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEG.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEG.mp3")).toURI().toString()));
break; break;
case 'H': case 'H':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEH.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEH.mp3")).toURI().toString()));
break; break;
case 'I': case 'I':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEI.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEI.mp3")).toURI().toString()));
break; break;
case 'J': case 'J':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEJ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEJ.mp3")).toURI().toString()));
break; break;
case 'K': case 'K':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEK.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEK.mp3")).toURI().toString()));
break; break;
case 'L': case 'L':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEL.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEL.mp3")).toURI().toString()));
break; break;
case 'M': case 'M':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEM.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEM.mp3")).toURI().toString()));
break; break;
case 'N': case 'N':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEN.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEN.mp3")).toURI().toString()));
break; break;
case 'O': case 'O':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEO.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEO.mp3")).toURI().toString()));
break; break;
case 'P': case 'P':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEP.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEP.mp3")).toURI().toString()));
break; break;
case 'Q': case 'Q':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEQ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEQ.mp3")).toURI().toString()));
break; break;
case 'R': case 'R':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICER.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICER.mp3")).toURI().toString()));
break; break;
case 'S': case 'S':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICES.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICES.mp3")).toURI().toString()));
break; break;
case 'T': case 'T':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICET.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICET.mp3")).toURI().toString()));
break; break;
case 'U': case 'U':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEU.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEU.mp3")).toURI().toString()));
break; break;
case 'V': case 'V':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEV.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEV.mp3")).toURI().toString()));
break; break;
case 'W': case 'W':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEW.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEW.mp3")).toURI().toString()));
break; break;
case 'X': case 'X':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEX.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEX.mp3")).toURI().toString()));
break; break;
case 'Y': case 'Y':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEY.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEY.mp3")).toURI().toString()));
break; break;
case 'Z': case 'Z':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEZ.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICEZ.mp3")).toURI().toString()));
break; break;
case '1': case '1':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE1.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE1.mp3")).toURI().toString()));
break; break;
case '2': case '2':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE2.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE2.mp3")).toURI().toString()));
break; break;
case '3': case '3':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE3.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE3.mp3")).toURI().toString()));
break; break;
case '4': case '4':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE4.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE4.mp3")).toURI().toString()));
break; break;
case '5': case '5':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE5.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE5.mp3")).toURI().toString()));
break; break;
case '6': case '6':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE6.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE6.mp3")).toURI().toString()));
break; break;
case '7': case '7':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE7.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE7.mp3")).toURI().toString()));
break; break;
case '8': case '8':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE8.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE8.mp3")).toURI().toString()));
break; break;
case '9': case '9':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE9.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE9.mp3")).toURI().toString()));
break; break;
case '0': case '0':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE0.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICE0.mp3")).toURI().toString()));
break; break;
case '/': case '/':
musicList.add(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICESTROKE.mp3")); musicList.add(new Media(new File(ApplicationFileUtils.getFilePath(ApplicationConstants.APPLICATION_NAME, "/VOICESTROKE.mp3")).toURI().toString()));
break; break;
// case ' ':
// musicList.add(new Media(new File ("VOICESPACE.mp3").toURI().toString()));
// break;
default: default:
System.out.println("[KST4ContestApp, warning, letter not defined:] cwLetters = " + Arrays.toString(spellThisWithVoice)); System.out.println("[KST4ContestApp, warning, letter not defined:] cwLetters = " + Arrays.toString(spellThisWithVoice));
} }
} }
playMusic(); playMusic();
// mediaPlayer.dispose();
} }
private void playMusic() { private void playMusic() {
if (audioUnavailable.get()) {
musicList.clear(); // System.out.println("Kst4ContestApplication.playMusic");
if(musicList.peek() == null)
{
return; return;
} }
// Only start a drain loop if none is running; the running loop will pick up new items itself. mediaPlayer = new MediaPlayer(musicList.poll());
if (!playing.compareAndSet(false, true)) return; mediaPlayer.setRate(1.0);
audioThread.submit(() -> {
String path; mediaPlayer.setOnReady(() -> {
while ((path = musicList.poll()) != null) { mediaPlayer.play();
if (audioUnavailable.get()) break; mediaPlayer.setOnEndOfMedia(() -> {
try (FileInputStream fis = new FileInputStream(path); // mediaPlayer.dispose();
BufferedInputStream bis = new BufferedInputStream(fis)) {
new Player(bis).play();
} catch (IOException | JavaLayerException e) {
audioUnavailable.set(true);
musicList.clear();
System.out.println("[KST4ContestApp, warning, audio playback disabled (could not create media player): " + e + "]");
break;
}
}
playing.set(false);
// Items may have been enqueued between the last poll() and playing.set(false);
// restart the drain loop if so.
if (!musicList.isEmpty() && !audioUnavailable.get()) {
playMusic(); playMusic();
} if (musicList.isEmpty()) {
// mediaPlayer.dispose();
}
});
}); });
} }
} }
-1
View File
@@ -6,7 +6,6 @@ module praktiKST {
requires java.sql; requires java.sql;
requires javafx.media; requires javafx.media;
requires jdk.jsobject; requires jdk.jsobject;
requires jlayer;
requires java.net.http; requires java.net.http;
requires java.desktop; requires java.desktop;
requires jdk.crypto.ec; requires jdk.crypto.ec;