Skip to content

feat: Add album view and fix volume slider#6

Merged
devohmycode merged 3 commits intomainfrom
0.0.6
Mar 16, 2026
Merged

feat: Add album view and fix volume slider#6
devohmycode merged 3 commits intomainfrom
0.0.6

Conversation

@devohmycode
Copy link
Owner

@devohmycode devohmycode commented Mar 16, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Albums browsing view with album artwork display and detail navigation
    • 10-band graphic equalizer with adjustable gains, presets, and preamp control
    • Custom accent color customization with 24 presets and hex input
  • Refactor

    • Improved volume control consistency across playback modes

@devohmycode devohmycode merged commit 1a500ce into main Mar 16, 2026
1 check was pending
@qodo-code-review
Copy link

Review Summary by Qodo

Add album view and fix volume slider with NAudio routing

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Add album browsing view with grid display and album detail pages
• Fix volume slider by routing all playback through NAudio with proper volume tracking
• Update installer version to 0.0.6
• Improve audio engine documentation and add equalizer/accent color features to README
Diagram
flowchart LR
  A["ViewMode Enum"] -->|"Add Albums, AlbumDetail"| B["Navigation System"]
  B -->|"NavAlbums_Click"| C["BuildAlbumsGrid"]
  C -->|"Display album cards"| D["AlbumsGridView"]
  D -->|"ItemClick"| E["AlbumDetail View"]
  E -->|"Filter tracks by album"| F["TrackListView"]
  G["AudioPlayerService"] -->|"Track volume state"| H["Volume Property"]
  H -->|"Set AudioFileReader.Volume"| I["NAudio Playback"]
  I -->|"Apply mute/unmute"| J["WasapiOut"]
Loading

Grey Divider

File Changes

1. Audiomatic/MainWindow.xaml.cs ✨ Enhancement +223/-13

Implement album browsing with grid view and detail pages

• Add Albums and AlbumDetail view modes to ViewMode enum
• Implement NavAlbums_Click() and BuildAlbumsGrid() to display album grid with artwork loading
• Add AlbumGrid_ItemClick() handler to navigate to album detail view
• Add AlbumBack_Click() to return from album detail to albums grid
• Update ApplyFilterAndSort() to handle album detail filtering by album name
• Update UpdateNavigation() to show/hide album header and grid based on view mode
• Update AnimateViewTransition() to target AlbumsGridView for animation
• Add Albums button to NavMore flyout menu
• Update visibility logic in ToggleCollapse() and AnimTick() for album views
• Add _currentAlbumName field to track selected album
• Add LoadAlbumCardArtAsync() to load album artwork from tags or cover files

Audiomatic/MainWindow.xaml.cs


2. Audiomatic/Services/AudioPlayerService.cs 🐞 Bug fix +10/-8

Fix volume slider by routing through NAudio

• Add _volume field to track volume state independently from MediaPlayer
• Change Volume property getter to return _volume instead of _mediaPlayer.Volume
• Update Volume property setter to apply volume to both _mediaPlayer and _audioReader
• Update IsMuted property to apply mute state to _audioReader.Volume instead of _waveOut.Volume
• Set _audioReader.Volume in PlayTrackAsync() before initializing WasapiOut
• Update stream playback to use _volume instead of _mediaPlayer.Volume

Audiomatic/Services/AudioPlayerService.cs


3. Audiomatic/MainWindow.xaml ✨ Enhancement +28/-0

Add XAML UI for album view and header

• Add AlbumHeader StackPanel with back button and album name TextBlock
• Add AlbumsGridView GridView control with item click handler and styling
• Configure GridView with proper item container style for album card layout

Audiomatic/MainWindow.xaml


View more (2)
4. installer.iss ⚙️ Configuration changes +1/-1

Bump installer version to 0.0.6

• Update AppVersion from 0.0.5 to 0.0.6

installer.iss


5. README.md 📝 Documentation +13/-1

Document album view, audio engine, and equalizer features

• Update audio engine description to clarify NAudio (WASAPI) is primary for file playback with
 equalizer, MediaPlayer for radio streams
• Add Equalizer section documenting 10-band EQ, presets, preamp control, and persistent settings
• Add custom accent colors feature to UI/UX section
• Add Equalizer to features table
• Add equalizer configuration and custom accent color picker to Settings section

README.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 16, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Wrong theme brush lookup 🐞 Bug ✓ Correctness
Description
BuildAlbumsGrid reads CardBackgroundFillColorSecondaryBrush via Application.Current.Resources, which
(per ThemeHelper) resolves using the system theme rather than the app’s current RequestedTheme, so
album cards can render with the wrong background when the app theme differs from the OS theme. This
makes the Albums UI inconsistent with the rest of the app’s theme-aware styling.
Code

Audiomatic/MainWindow.xaml.cs[R2526-2532]

+            var artGrid = new Grid
+            {
+                Width = 142,
+                Height = 142,
+                CornerRadius = new CornerRadius(8),
+                Background = (Brush)Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"]
+            };
Evidence
ThemeHelper explicitly exists to avoid Application.Current.Resources lookups (which use the system
theme) and to correctly resolve theme dictionary brushes; BuildAlbumsGrid bypasses this and directly
indexes Application.Current.Resources for the album-card background brush.

Audiomatic/ThemeHelper.cs[6-27]
Audiomatic/MainWindow.xaml.cs[2525-2532]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`BuildAlbumsGrid()` uses `Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"]` directly, which bypasses the repo’s `ThemeHelper.Brush()` logic and can render with the system theme instead of the app’s current theme.

## Issue Context
`ThemeHelper` documents that `Application.Current.Resources` lookups use the system theme, and the codebase generally uses `ThemeHelper.Brush(...)` to resolve theme-dictionary brushes correctly.

## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[2525-2532]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Albums grid not refreshed 🐞 Bug ✓ Correctness
Description
ApplyFilterAndSort returns early in Albums mode, so LoadTracks (invoked after scans and metadata
edits) won’t rebuild AlbumsGridView and the Albums view can become stale. NavAlbums_Click also
returns when already in Albums, preventing an in-place rebuild/refresh while staying in Albums view.
Code

Audiomatic/MainWindow.xaml.cs[R317-318]

+        if (_viewMode == ViewMode.Visualizer || _viewMode == ViewMode.Albums)
            return;
Evidence
LoadTracks is the standard refresh path and is called after metadata edits and library scans; it
always calls ApplyFilterAndSort. ApplyFilterAndSort now no-ops when the view mode is Albums, and
NavAlbums_Click early-returns when already in Albums, so AlbumsGridView is not rebuilt as part of
those refresh flows.

Audiomatic/MainWindow.xaml.cs[296-301]
Audiomatic/MainWindow.xaml.cs[317-318]
Audiomatic/MainWindow.xaml.cs[1668-1678]
Audiomatic/MainWindow.xaml.cs[3806-3813]
Audiomatic/MainWindow.xaml.cs[2485-2494]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Albums view does not refresh after library changes because `LoadTracks()` calls `ApplyFilterAndSort()`, but `ApplyFilterAndSort()` returns early for `ViewMode.Albums` and never calls `BuildAlbumsGrid()`. Additionally, `NavAlbums_Click()` returns immediately when `_viewMode == ViewMode.Albums`, preventing an in-place rebuild.

## Issue Context
`LoadTracks()` is invoked after metadata edits and after scanning folders, so this impacts real user flows.

## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[296-318]
- Audiomatic/MainWindow.xaml.cs[2485-2495]
- Audiomatic/MainWindow.xaml.cs[1668-1678]
- Audiomatic/MainWindow.xaml.cs[3806-3813]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3620413-cba9-4c33-8b47-3a3cf007d8f9

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4e690 and 342c2e0.

📒 Files selected for processing (5)
  • Audiomatic/MainWindow.xaml
  • Audiomatic/MainWindow.xaml.cs
  • Audiomatic/Services/AudioPlayerService.cs
  • README.md
  • installer.iss

📝 Walkthrough

Walkthrough

This PR introduces album browsing and detail views to the UI with asynchronous artwork loading, refactors volume state management in the audio service to use an internal source of truth, and updates documentation and version information.

Changes

Cohort / File(s) Summary
Album Navigation & Views
Audiomatic/MainWindow.xaml, Audiomatic/MainWindow.xaml.cs
Added Albums and AlbumDetail view modes with UI elements (AlbumHeader, AlbumsGridView). Implemented BuildAlbumsGrid to group tracks by album with async artwork loading via LoadAlbumCardArtAsync. Added album navigation routing (NavAlbums_Click, AlbumGrid_ItemClick, AlbumBack_Click) and visibility toggling across navigation flows. Updated ApplyFilterAndSort to filter tracks by selected album with custom ordering.
Audio Service Volume Refactoring
Audiomatic/Services/AudioPlayerService.cs
Introduced internal _volume field as single source of truth for volume state. Refactored Volume property setter to clamp, store, and apply changes consistently across _mediaPlayer and _audioReader. Updated IsMuted setter and PlayTrackAsync/PlayStreamAsync to respect _volume state during playback initialization.
Documentation & Version
README.md, installer.iss
Updated README to describe NAudio-powered audio engine and documented new Equalizer feature (10-band EQ, presets, preamp) and custom accent color customization. Bumped version from 0.0.5 to 0.0.6 in installer.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MainWindow
    participant TrackData
    participant ArtworkLoader
    participant UI as GridView

    User->>MainWindow: Click Albums in Navigation
    MainWindow->>MainWindow: Switch to Albums ViewMode
    MainWindow->>TrackData: Group tracks by Album<br/>(case-insensitive)
    loop For Each Album
        MainWindow->>ArtworkLoader: LoadAlbumCardArtAsync()
        ArtworkLoader->>ArtworkLoader: Fetch embedded art<br/>or fallback cover
        ArtworkLoader->>UI: Update album card image
    end
    MainWindow->>UI: Render album cards<br/>(title, artist, count)
    
    User->>UI: Click album card
    UI->>MainWindow: AlbumGrid_ItemClick()
    MainWindow->>MainWindow: Switch to AlbumDetail<br/>ViewMode
    MainWindow->>TrackData: Filter tracks to album<br/>Sort by TrackNumber, Title
    MainWindow->>MainWindow: Show AlbumHeader<br/>with album name
    MainWindow->>UI: Display album tracks
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hops through albums with glee,
Volume flows as steady as can be,
With artwork loaded, organized with care,
Album browsing now beyond compare! 🎵

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 0.0.6
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

Comment on lines +2526 to +2532
var artGrid = new Grid
{
Width = 142,
Height = 142,
CornerRadius = new CornerRadius(8),
Background = (Brush)Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"]
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Wrong theme brush lookup 🐞 Bug ✓ Correctness

BuildAlbumsGrid reads CardBackgroundFillColorSecondaryBrush via Application.Current.Resources, which
(per ThemeHelper) resolves using the system theme rather than the app’s current RequestedTheme, so
album cards can render with the wrong background when the app theme differs from the OS theme. This
makes the Albums UI inconsistent with the rest of the app’s theme-aware styling.
Agent Prompt
## Issue description
`BuildAlbumsGrid()` uses `Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"]` directly, which bypasses the repo’s `ThemeHelper.Brush()` logic and can render with the system theme instead of the app’s current theme.

## Issue Context
`ThemeHelper` documents that `Application.Current.Resources` lookups use the system theme, and the codebase generally uses `ThemeHelper.Brush(...)` to resolve theme-dictionary brushes correctly.

## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[2525-2532]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +317 to 318
if (_viewMode == ViewMode.Visualizer || _viewMode == ViewMode.Albums)
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Albums grid not refreshed 🐞 Bug ✓ Correctness

ApplyFilterAndSort returns early in Albums mode, so LoadTracks (invoked after scans and metadata
edits) won’t rebuild AlbumsGridView and the Albums view can become stale. NavAlbums_Click also
returns when already in Albums, preventing an in-place rebuild/refresh while staying in Albums view.
Agent Prompt
## Issue description
Albums view does not refresh after library changes because `LoadTracks()` calls `ApplyFilterAndSort()`, but `ApplyFilterAndSort()` returns early for `ViewMode.Albums` and never calls `BuildAlbumsGrid()`. Additionally, `NavAlbums_Click()` returns immediately when `_viewMode == ViewMode.Albums`, preventing an in-place rebuild.

## Issue Context
`LoadTracks()` is invoked after metadata edits and after scanning folders, so this impacts real user flows.

## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[296-318]
- Audiomatic/MainWindow.xaml.cs[2485-2495]
- Audiomatic/MainWindow.xaml.cs[1668-1678]
- Audiomatic/MainWindow.xaml.cs[3806-3813]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant