{-# LANGUAGE OverloadedStrings #-}
module Network.MPD.Applicative.PlaybackControl
( next
, pause
, toggle
, play
, playId
, previous
, seek
, seekId
, seekCur
, stop
) where
import Network.MPD.Applicative.Internal
import Network.MPD.Commands.Arg hiding (Command)
import Network.MPD.Commands.Types
next :: Command ()
next :: Command ()
next = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [String
"next"]
pause :: Bool -> Command ()
pause :: Bool -> Command ()
pause Bool
f = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"pause" forall a. MPDArg a => Command -> a -> String
<@> Bool
f]
toggle :: Command ()
toggle :: Command ()
toggle = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [String
"pause"]
play :: Maybe Position -> Command ()
play :: Maybe Position -> Command ()
play Maybe Position
mbPos = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [String]
c
where
c :: [String]
c = forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall b a. b -> (a -> b) -> Maybe a -> b
maybe String
"play" (Command
"play" forall a. MPDArg a => Command -> a -> String
<@>) Maybe Position
mbPos
playId :: Id -> Command ()
playId :: Id -> Command ()
playId Id
id' = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"playid" forall a. MPDArg a => Command -> a -> String
<@> Id
id']
previous :: Command ()
previous :: Command ()
previous = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [String
"previous"]
seek :: Position -> FractionalSeconds -> Command ()
seek :: Position -> FractionalSeconds -> Command ()
seek Position
pos FractionalSeconds
time = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"seek" forall a. MPDArg a => Command -> a -> String
<@> Position
pos forall a b. (MPDArg a, MPDArg b) => a -> b -> Args
<++> FractionalSeconds
time]
seekId :: Id -> FractionalSeconds -> Command ()
seekId :: Id -> FractionalSeconds -> Command ()
seekId Id
id' FractionalSeconds
time = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"seekid" forall a. MPDArg a => Command -> a -> String
<@> Id
id' forall a b. (MPDArg a, MPDArg b) => a -> b -> Args
<++> FractionalSeconds
time]
seekCur :: Bool -> FractionalSeconds -> Command ()
seekCur :: Bool -> FractionalSeconds -> Command ()
seekCur Bool
bool FractionalSeconds
time
| Bool
bool = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"seekcur" forall a. MPDArg a => Command -> a -> String
<@> FractionalSeconds
time]
| Bool
otherwise = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [Command
"seekcur" forall a. MPDArg a => Command -> a -> String
<@> (forall a. a -> Sign a
Sign FractionalSeconds
time)]
stop :: Command ()
stop :: Command ()
stop = forall a. Parser a -> [String] -> Command a
Command Parser ()
emptyResponse [String
"stop"]