mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
34b4445c13
Two independent user-facing fixes rolled together. ── Lyrics: YouLyPlus provider (issue #172) ── Adds word-by-word synced (karaoke) lyrics as an alternative lyrics mode. Backed by the public lyricsplus aggregator (Apple Music / Spotify / Musixmatch / QQ Music) — no API keys on our side, subscription costs are borne by the backend operator. Five mirrors are tried on network failure. Settings → Lyrics now exposes a mode radio (Standard vs YouLyPlus) plus a static-only toggle. YouLyPlus misses silently fall back to the existing server + LRCLIB + Netease pipeline so obscure tracks still resolve. The drag-to-reorder source list is hidden in YouLyPlus mode since the external aggregator manages its own source priority. Rendering: per-word spans on each line, active word highlighted with accent-tinted glow. Subscribed imperatively via usePlayerStore.subscribe so 500 ms progress ticks do not re-render the whole lyrics block. The Fullscreen Player reuses the same pattern; the 5-line rail layout is unchanged. white-space: pre on .fs-lyric-word preserves the trailing spaces the API embeds in each syllabus token (flex context would otherwise collapse them). i18n: new keys in all 8 locales (de, en, fr, nl, nb, ru, es, zh). ── macOS mic-prompt suppression ── Ships a vendored cpal 0.15.3 at patches/cpal-0.15.3/ wired via [patch.crates-io]. The only change is in src/host/coreaudio/macos/mod.rs: audio_unit_from_device now unconditionally uses IOType::DefaultOutput for output streams instead of conditionally choosing HalOutput. AUHAL (HalOutput) is classified as input-capable by macOS TCC and triggers the microphone-permission dialog at first launch / after each update even for playback-only apps. Previous attempts (removing NSMicrophoneUsageDescription, setting com.apple.security.device.audio-input false in Entitlements.plist) did not suppress the prompt because TCC fires at AudioUnit instantiation, not at plist level. The upstream fix in cpal PR #1070 / cpal 0.17 only helps when the pinned device equals the system default; always-DefaultOutput covers all cases. Tradeoff: per-device output selection is a no-op on macOS — the stream always follows the system default. Settings.tsx surfaces this via audioOutputDeviceMacNotice (hides the CustomSelect on macOS) and skips audio_list_devices + device-watcher effects there. Matches the behaviour of Apple Music / Spotify on macOS. Also removes the now-obsolete com.apple.security.device.audio-input entitlement (sandbox is disabled anyway, so it was ignored). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
266 lines
8.2 KiB
YAML
266 lines
8.2 KiB
YAML
name: cpal
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
clippy-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Update apt
|
|
run: sudo apt update
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Install libjack
|
|
run: sudo apt-get install libjack-jackd2-dev libjack-jackd2-0
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
target: armv7-linux-androideabi
|
|
- name: Run clippy
|
|
run: cargo clippy --all --all-features
|
|
- name: Run clippy for Android target
|
|
run: cargo clippy --all --features asio --features oboe/fetch-prebuilt --target armv7-linux-androideabi
|
|
|
|
rustfmt-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- name: Run rustfmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
cargo-publish:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- name: Update apt
|
|
run: sudo apt update
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Verify publish crate
|
|
uses: katyo/publish-crates@v2
|
|
with:
|
|
dry-run: true
|
|
ignore-unpublished-changes: true
|
|
- name: Publish crate
|
|
uses: katyo/publish-crates@v2
|
|
with:
|
|
ignore-unpublished-changes: true
|
|
registry-token: ${{ secrets.CRATESIO_TOKEN }}
|
|
|
|
ubuntu-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Update apt
|
|
run: sudo apt update
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Install libjack
|
|
run: sudo apt-get install libjack-jackd2-dev libjack-jackd2-0
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- name: Run without features
|
|
run: cargo test --all --no-default-features --verbose
|
|
- name: Run all features
|
|
run: cargo test --all --all-features --verbose
|
|
|
|
linux-check-and-test-armv7:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install stable toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: armv7-unknown-linux-gnueabihf
|
|
|
|
- name: Build image
|
|
run: docker build -t cross/cpal_armv7:v1 ./
|
|
|
|
- name: Install cross
|
|
run: cargo install cross
|
|
|
|
- name: Check without features for armv7
|
|
run: cross check --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
|
|
|
|
- name: Test without features for armv7
|
|
run: cross test --target armv7-unknown-linux-gnueabihf --workspace --no-default-features --verbose
|
|
|
|
- name: Check all features for armv7
|
|
run: cross check --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
|
|
|
|
- name: Test all features for armv7
|
|
run: cross test --target armv7-unknown-linux-gnueabihf --workspace --all-features --verbose
|
|
|
|
asmjs-wasm32-test:
|
|
strategy:
|
|
matrix:
|
|
target: [wasm32-unknown-emscripten]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Emscripten toolchain
|
|
uses: mymindstorm/setup-emsdk@v14
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
- name: Build beep example
|
|
run: cargo build --example beep --release --target ${{ matrix.target }}
|
|
|
|
wasm32-bindgen-test:
|
|
|
|
strategy:
|
|
matrix:
|
|
target: [wasm32-unknown-unknown]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
- name: Build beep example
|
|
run: cargo build --example beep --target ${{ matrix.target }} --features=wasm-bindgen
|
|
|
|
wasm32-wasi-test:
|
|
|
|
strategy:
|
|
matrix:
|
|
target: [wasm32-wasi]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
- name: Build beep example
|
|
run: cargo build --example beep --target ${{ matrix.target }}
|
|
|
|
windows-test:
|
|
strategy:
|
|
matrix:
|
|
version: [x86_64, i686]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install ASIO SDK
|
|
env:
|
|
LINK: https://www.steinberg.net/asiosdk
|
|
run: |
|
|
curl -L -o asio.zip $env:LINK
|
|
7z x -oasio asio.zip
|
|
move asio\*\* asio\
|
|
- name: Install ASIO4ALL
|
|
run: choco install asio4all
|
|
- name: Install llvm and clang
|
|
run: choco install llvm
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.version }}-pc-windows-msvc
|
|
- name: Run without features
|
|
run: cargo test --all --no-default-features --verbose
|
|
- name: Run all features
|
|
run: |
|
|
$Env:CPAL_ASIO_DIR = "$Env:GITHUB_WORKSPACE\asio"
|
|
cargo test --all --all-features --verbose
|
|
|
|
macos-test:
|
|
runs-on: macOS-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install llvm and clang
|
|
run: brew install llvm
|
|
- name: Install stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- name: Build beep example
|
|
run: cargo build --example beep
|
|
- name: Run without features
|
|
run: cargo test --all --no-default-features --verbose
|
|
- name: Run all features
|
|
run: cargo test --all --all-features --verbose
|
|
|
|
android-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable (Android target)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: armv7-linux-androideabi
|
|
- name: Check android
|
|
run: cargo check --example android --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
|
|
- name: Check beep
|
|
run: cargo check --example beep --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
|
|
- name: Check enumerate
|
|
run: cargo check --example enumerate --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
|
|
- name: Check feedback
|
|
run: cargo check --example feedback --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
|
|
- name: Check record_wav
|
|
run: cargo check --example record_wav --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
|
|
|
|
android-apk-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable (Android targets)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android
|
|
- name: Set Up Android tools
|
|
run: |
|
|
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-30"
|
|
- name: Install Cargo APK
|
|
run: cargo install cargo-apk
|
|
- name: Build APK
|
|
run: cargo apk build --example android
|
|
|
|
ios-build:
|
|
runs-on: macOS-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install llvm and clang
|
|
run: brew install llvm
|
|
- name: Install stable (iOS targets)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-apple-ios,x86_64-apple-ios
|
|
- name: Install cargo lipo
|
|
run: cargo install cargo-lipo
|
|
- name: Build iphonesimulator feedback example
|
|
run: cd examples/ios-feedback && xcodebuild -scheme cpal-ios-example -configuration Debug -derivedDataPath build -sdk iphonesimulator
|
|
|
|
wasm-beep-build:
|
|
# this only confirms that the Rust source builds
|
|
# and checks to prevent regressions like #721.
|
|
#
|
|
# It does not test the javascript/web integration
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install stable (wasm32 target)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-unknown-unknown
|
|
- name: Cargo Build
|
|
working-directory: ./examples/wasm-beep
|
|
run: cargo build --target wasm32-unknown-unknown
|
|
|