feat(slint): add queue sidebar controller
QueueController owns the sidebar-local view state — active tab, search query, paginator page — and the cached favorite-track IDs. It pulls a full queue snapshot via QbzCore::get_queue_state_full, applies the search filter, slices out the current 40-track page, and pushes the result onto QueueState. Every queue mutation refreshes it. The four footer actions: clear-queue calls core clear_queue (wiping the now-playing slot only when nothing is audible, matching Tauri); save-as-playlist resolves the queue track set (name-input modal pending); infinite-play toggles the persisted AutoplayMode; search filters the upcoming list client-side. play paths route through after_track_change, extracted from the per-call duplication in playback.rs. cc
This commit is contained in:
4 files changed
+843
-186
No files matched your search
@@ -105,6 +105,16 @@ impl SettingsCtx {
|
||||
maps: Mutex::new(SettingsMaps::default()),
|
||||
})
|
||||
}
|
||||
|
||||
/// A handle to the playback-preferences store sharing the same
|
||||
/// underlying SQLite connection. The Queue controller uses it to read
|
||||
/// and toggle the autoplay (infinite-play) mode so the sidebar's
|
||||
/// infinite-play button stays in step with the Playback settings.
|
||||
pub fn playback_prefs(&self) -> PlaybackPreferencesState {
|
||||
PlaybackPreferencesState {
|
||||
store: std::sync::Arc::clone(&self.playback.store),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Plain, `Send` settings data built off the UI thread.
|
||||
|
||||
Reference in new issue
Block a user