Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Pre-commit hook: runs cargo fmt and clippy checks.
# Install with: git config core.hooksPath .githooks

set -e

echo "Running cargo fmt --check..."
cargo fmt --all -- --check
echo "Running cargo clippy..."
cargo clippy --all-targets -- -D warnings
echo "All checks passed."
19 changes: 19 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !github.ref_protected }}

jobs:
build:
name: Build and Test
Expand Down Expand Up @@ -61,7 +65,22 @@ jobs:
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build
if: matrix.os != 'macos-latest'
run: cargo build --release --verbose

- name: Add macOS targets
if: matrix.os == 'macos-latest'
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin

- name: Build universal binary (macOS)
if: matrix.os == 'macos-latest'
run: |
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
lipo -create \
target/x86_64-apple-darwin/release/audioleaf \
target/aarch64-apple-darwin/release/audioleaf \
-output target/release/audioleaf-universal

- name: Run tests
run: cargo test --verbose
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,44 @@ All notable changes to this fork of audioleaf are documented in this file.

This fork focuses on macOS compatibility, support for all Nanoleaf device types, and enhanced color palette features.

## [3.5.0] - 2026-03-17

### Added

- **Album art visualizer**: Press `N` in the visualizer view to extract colors from the currently playing track's album artwork
- Spotify: artwork URL fetched via ScriptingBridge (`SBApplication`), downloaded via reqwest
- Apple Music: raw artwork bytes read directly from `MusicArtwork.rawData` via ScriptingBridge
- Falls back to osascript if ScriptingBridge is unavailable
- Apple Music osascript fallback uses iTunes Search API for artwork URL
- Background watcher thread polls every 3 seconds and auto-updates colors on song change
- Press any number key (`1`-`0`) to switch back to a named palette and stop the watcher

- **Now playing display in TUI**: Visualizer view shows track title and color swatches
- "Now playing: *track title*" line appears when album art mode is active
- Color swatch bar shows the active palette colors as colored blocks
- Both update automatically when the watcher detects a song change
- Shared state between watcher thread and TUI via `Arc<Mutex<VizState>>`

- **Universal macOS binary**: Build a fat binary supporting both Intel and Apple Silicon
- `make universal` runs `cargo build` for both `x86_64-apple-darwin` and `aarch64-apple-darwin`, then combines with `lipo`
- CI updated to build universal binary on macOS runners
- `make build` for single-arch release, `make clean` for cleanup

- **Pre-commit hook**: `.githooks/pre-commit` runs `cargo fmt --check` and `cargo clippy -D warnings`
- Activate with `git config core.hooksPath .githooks`
- Prevents formatting and lint issues from reaching CI

### Changed

- **Even color distribution across panels**: `colors_from_rgb` now spreads palette colors evenly instead of padding with the last color
- 4 colors across 12 panels: each color covers 3 panels (was 1-1-1-9)
- Works correctly for all palette sizes

- **Color extraction**: Switched from `color-thief` to `auto-palette` crate
- Native Oklch color space support (`to_oklch()`, `lightness()`, `is_dark()`)
- Extracts the 4 most dominant colors sorted by pixel population
- Filters out near-black colors using Oklch lightness (`l > 0.15`) since they can't be represented on LED panels

## [3.2.0] - 2025-12-05

### Added
Expand Down
Loading
Loading