@@ -16,8 +16,9 @@ pub enum Command {
1616 Repeat ,
1717 ToggleFakeTrackRepeatMode ,
1818 Shuffle ,
19- VolumeUp ,
20- VolumeDown ,
19+ VolumeChange {
20+ offset : i32 ,
21+ } ,
2122 Mute ,
2223 SeekForward ,
2324 SeekBackward ,
@@ -284,7 +285,11 @@ pub fn construct_episode_actions(episode: &Episode, _data: &DataReadGuard) -> Ve
284285}
285286
286287impl Command {
287- pub fn desc ( self ) -> & ' static str {
288+ pub fn desc ( self ) -> String {
289+ if let Self :: VolumeChange { offset } = self {
290+ return format ! ( "change playback volume by {offset}" ) ;
291+ }
292+
288293 match self {
289294 Self :: None => "do nothing" ,
290295 Self :: NextTrack => "next track" ,
@@ -294,8 +299,6 @@ impl Command {
294299 Self :: Repeat => "cycle the repeat mode" ,
295300 Self :: ToggleFakeTrackRepeatMode => "toggle fake track repeat mode" ,
296301 Self :: Shuffle => "toggle the shuffle mode" ,
297- Self :: VolumeUp => "increase playback volume by 5%" ,
298- Self :: VolumeDown => "decrease playback volume by 5%" ,
299302 Self :: Mute => "toggle playback volume between 0% and previous level" ,
300303 Self :: SeekForward => "seek forward by 5s" ,
301304 Self :: SeekBackward => "seek backward by 5s" ,
@@ -355,6 +358,8 @@ impl Command {
355358 Self :: MovePlaylistItemUp => "move playlist item up one position" ,
356359 Self :: MovePlaylistItemDown => "move playlist item down one position" ,
357360 Self :: CreatePlaylist => "create a new playlist" ,
361+ Self :: VolumeChange { offset : _ } => unreachable ! ( ) ,
358362 }
363+ . to_string ( )
359364 }
360365}
0 commit comments