diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-05 23:29:39 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-05 23:29:39 +0200 |
| commit | 5f2d1897b245fbee12d17b5910eaf5233ca6802b (patch) | |
| tree | 551b8855ade2f31e0f24539504b0f9b66cdba75f /src/playback.rs | |
| parent | Add dev/release config separation and volume query command (diff) | |
| download | rsplayer-5f2d1897b245fbee12d17b5910eaf5233ca6802b.tar.gz rsplayer-5f2d1897b245fbee12d17b5910eaf5233ca6802b.zip | |
Add unit tests in /tests directory for config, database, playback, and scrobbler modules
Diffstat (limited to '')
| -rw-r--r-- | src/playback.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/playback.rs b/src/playback.rs index 76c0f44..d9dd1f9 100644 --- a/src/playback.rs +++ b/src/playback.rs | |||
| @@ -18,7 +18,7 @@ pub struct Track { | |||
| 18 | pub duration: Option<u64>, | 18 | pub duration: Option<u64>, |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | #[derive(Debug, Clone)] | 21 | #[derive(Debug, Clone, PartialEq)] |
| 22 | #[allow(dead_code)] | 22 | #[allow(dead_code)] |
| 23 | pub enum ShuffleMode { | 23 | pub enum ShuffleMode { |
| 24 | None, | 24 | None, |
| @@ -28,14 +28,15 @@ pub enum ShuffleMode { | |||
| 28 | 28 | ||
| 29 | #[allow(dead_code)] | 29 | #[allow(dead_code)] |
| 30 | pub struct Player { | 30 | pub struct Player { |
| 31 | state: PlaybackState, | 31 | pub state: PlaybackState, |
| 32 | current_track: Option<Track>, | 32 | pub current_track: Option<Track>, |
| 33 | queue: Vec<Track>, | 33 | pub queue: Vec<Track>, |
| 34 | volume: u8, | 34 | pub volume: u8, |
| 35 | shuffle: ShuffleMode, | 35 | pub shuffle: ShuffleMode, |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | #[allow(dead_code)] | 38 | #[allow(dead_code)] |
| 39 | #[allow(clippy::new_without_default)] | ||
| 39 | impl Player { | 40 | impl Player { |
| 40 | pub fn new() -> Self { | 41 | pub fn new() -> Self { |
| 41 | Player { | 42 | Player { |
