NoraBar uses a WPF structure that is close to MVVM. Screens are written in XAML, state lives in ViewModels, and Windows integrations are separated into services.
MainWindow
-> MainViewModel
-> MusicViewModel
-> MediaControlService
-> AudioVisualizerService
-> LyricsService
-> SettingsService
-> StartupService
-> LocalizationService
-> DesignAMusicView / DesignBMusicView
MainWindow is a transparent window that stays at the top edge of the screen.
Topmost=Truekeeps it above other windows.ShowInTaskbar=Falsekeeps it out of the taskbar.- While idle, it is a thin
200x2area. - On mouse hover, it enters the
Musicstate and shows the selected design view. - When the mouse leaves, it returns to
Idleand closes the content.
Holds app-wide settings and screen state.
- Current design style
- Current HUD state
- Progress bar visibility
- Synced lyrics visibility
- HUD position
- Display language
- Settings window page
- Update check dialog
- License dialog
When a setting changes, it calls SettingsService.Save to persist the change.
Collects the state required for the music display.
- Track title
- Artist
- Album art
- Playback state
- Playback position
- Total duration
- Progress ratio
- Current lyric
- Waveform data
It also exposes commands for play, pause, previous track, and next track.
Uses Windows GlobalSystemMediaTransportControlsSessionManager to read track information and playback state from the current media session.
Playback position is updated by a timer. When media is playing, the service adjusts the position using elapsed time from LastUpdatedTime.
Captures system audio with CSCore WasapiLoopbackCapture, then converts FFT results into 8 visual bars.
It uses lower-frequency bands, converts them to decibels, and normalizes the values to a 0.0 to 1.0 range.
Fetches synchronized lyrics from the LRCLIB API using track title, artist, album, and duration. It provides the currently active lyric line based on the playback position.
Saves user settings as JSON.
%AppData%\NoraBar\settings.json
The settings directory name is NoraBar, matching the app name.
Creates or removes NoraBar.lnk in the Windows Startup folder. The shortcut includes the --startup argument so the settings window does not open automatically during startup launch.
Manages Japanese and English UI strings in dictionaries. When the setting changes, the ViewModel raises change notifications for related properties so the UI updates.
The HUD has two views.
DesignAMusicView: compact Minimal displayDesignBMusicView: wider Productivity display with more information
Both read MusicViewModel state through MainViewModel.Music.
- [[アーキテクチャ|アーキテクチャ]]