31 |
43 | Spot connected
44 |
45 | Logged in successfully! You may close this window.
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/player/mod.rs:
--------------------------------------------------------------------------------
1 | use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
2 | use librespot::core::spotify_id::SpotifyId;
3 | use std::cell::RefCell;
4 | use std::rc::Rc;
5 | use std::sync::Arc;
6 | use tokio::task;
7 | use url::Url;
8 |
9 | use crate::app::state::{LoginAction, PlaybackAction};
10 | use crate::app::AppAction;
11 | #[allow(clippy::module_inception)]
12 | mod player;
13 | pub use player::*;
14 |
15 | mod oauth2;
16 |
17 | mod token_store;
18 | pub use token_store::*;
19 |
20 | #[derive(Debug, Clone)]
21 | pub enum Command {
22 | Restore,
23 | InitLogin,
24 | CompleteLogin,
25 | RefreshToken,
26 | Logout,
27 | PlayerLoad { track: SpotifyId, resume: bool },
28 | PlayerResume,
29 | PlayerPause,
30 | PlayerStop,
31 | PlayerSeek(u32),
32 | PlayerSetVolume(f64),
33 | PlayerPreload(SpotifyId),
34 | ReloadSettings,
35 | }
36 |
37 | struct AppPlayerDelegate {
38 | sender: RefCell