It works
This commit is contained in:
+13
-1
@@ -14,7 +14,7 @@ use furumi_application::{
|
||||
use furumi_backend::BackendHandle;
|
||||
use furumi_backend_api::{
|
||||
BackendCommand, DevicePlaybackRole, DevicePresence, DeviceTrust, FederationOperation,
|
||||
PlaybackStatus, RemoteData,
|
||||
PlaybackRepeat, PlaybackStatus, RemoteData,
|
||||
};
|
||||
use furumi_domain::{
|
||||
Artist, ArtistKey, ArtistRef, AudioSource, CatalogSource, ContentId, LocalTrackId, QueueItemId,
|
||||
@@ -364,6 +364,18 @@ fn bind_player_callbacks(
|
||||
let backend = backend.clone();
|
||||
move || dispatch_action(&window, &state, &backend, UiAction::Previous)
|
||||
});
|
||||
window.on_toggle_shuffle({
|
||||
let window = window.as_weak();
|
||||
let state = Arc::clone(state);
|
||||
let backend = backend.clone();
|
||||
move || dispatch_action(&window, &state, &backend, UiAction::ToggleShuffle)
|
||||
});
|
||||
window.on_cycle_repeat({
|
||||
let window = window.as_weak();
|
||||
let state = Arc::clone(state);
|
||||
let backend = backend.clone();
|
||||
move || dispatch_action(&window, &state, &backend, UiAction::CycleRepeat)
|
||||
});
|
||||
window.on_seek({
|
||||
let window = window.as_weak();
|
||||
let state = Arc::clone(state);
|
||||
|
||||
@@ -770,6 +770,12 @@ pub(super) fn render_playback(window: &AppWindow, state: &AppState) {
|
||||
window.set_duration(player.duration.into());
|
||||
window.set_progress(player.progress);
|
||||
window.set_volume(player.volume);
|
||||
window.set_shuffle_enabled(player.shuffle);
|
||||
window.set_repeat_mode(match player.repeat {
|
||||
PlaybackRepeat::Off => 0,
|
||||
PlaybackRepeat::One => 1,
|
||||
PlaybackRepeat::All => 2,
|
||||
});
|
||||
}
|
||||
|
||||
pub(super) fn render_current_track(window: &AppWindow, state: &AppState) {
|
||||
|
||||
Reference in New Issue
Block a user