-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A client library for MPD, the Music Player Daemon.
@package libmpd
@version 0.10.0.1


-- | The core datatypes and operations are defined here, including the
--   primary instance of the <a>MonadMPD</a> class, <a>MPD</a>.
module Network.MPD.Core

-- | A typeclass to allow for multiple implementations of a connection to
--   an MPD server.
class (Monad m, MonadError MPDError m) => MonadMPD (m :: Type -> Type)

-- | Open (or re-open) a connection to the MPD server.
open :: MonadMPD m => m ()

-- | Close the connection.
close :: MonadMPD m => m ()

-- | Send a string to the server and return its response.
send :: MonadMPD m => String -> m [ByteString]

-- | Produce a password to send to the server should it ask for one.
getPassword :: MonadMPD m => m Password

-- | Alters password to be sent to the server.
setPassword :: MonadMPD m => Password -> m ()

-- | Get MPD protocol version
getVersion :: MonadMPD m => m (Int, Int, Int)

-- | The main implementation of an MPD client. It actually connects to a
--   server and interacts with it.
--   
--   To use the error throwing/catching capabilities:
--   
--   <pre>
--   import Control.Monad.Except (throwError, catchError)
--   </pre>
--   
--   To run IO actions within the MPD monad:
--   
--   <pre>
--   import Control.Monad.Trans (liftIO)
--   </pre>
data MPD a

-- | The MPDError type is used to signal errors, both from the MPD and
--   otherwise.
data MPDError

-- | MPD not responding
NoMPD :: MPDError

-- | An error occurred while talking to MPD.
ConnectionError :: IOException -> MPDError

-- | MPD returned an unexpected response. This is a bug, either in the
--   library or in MPD itself.
Unexpected :: String -> MPDError

-- | Used for misc. errors
Custom :: String -> MPDError

-- | ACK type and a message from the server
ACK :: ACKType -> String -> MPDError

-- | Represents various MPD errors (aka. ACKs).
data ACKType

-- | Invalid argument passed (ACK 2)
InvalidArgument :: ACKType

-- | Invalid password supplied (ACK 3)
InvalidPassword :: ACKType

-- | Authentication required (ACK 4)
Auth :: ACKType

-- | Unknown command (ACK 5)
UnknownCommand :: ACKType

-- | File or directory not found ACK 50)
FileNotFound :: ACKType

-- | Playlist at maximum size (ACK 51)
PlaylistMax :: ACKType

-- | A system error (ACK 52)
System :: ACKType

-- | Playlist loading failed (ACK 53)
PlaylistLoad :: ACKType

-- | Update already running (ACK 54)
Busy :: ACKType

-- | An operation requiring playback got interrupted (ACK 55)
NotPlaying :: ACKType

-- | File already exists (ACK 56)
FileExists :: ACKType

-- | An unknown ACK (aka. bug)
UnknownACK :: ACKType

-- | A response is either an <a>MPDError</a> or some result.
type Response = Either MPDError
type Host = String
type Port = Integer
type Password = String

-- | The most configurable API for running an MPD action.
withMPDEx :: Host -> Port -> Password -> MPD a -> IO (Response a)

-- | Send a command to the MPD server and return the result.
getResponse :: MonadMPD m => String -> m [ByteString]

-- | Kill the server. Obviously, the connection is then invalid.
kill :: MonadMPD m => m ()
instance GHC.Internal.Base.Applicative Network.MPD.Core.MPD
instance GHC.Internal.Base.Functor Network.MPD.Core.MPD
instance Control.Monad.Error.Class.MonadError Network.MPD.Core.Error.MPDError Network.MPD.Core.MPD
instance GHC.Internal.Control.Monad.IO.Class.MonadIO Network.MPD.Core.MPD
instance GHC.Internal.Base.Monad Network.MPD.Core.MPD
instance Network.MPD.Core.Class.MonadMPD Network.MPD.Core.MPD


-- | Connection settings.
module Network.MPD.Applicative.Connection

-- | Authenticate session. The password is sent in plain text.
password :: Password -> Command ()

-- | Ping daemon.
ping :: Command ()


-- | Controlling playback.
module Network.MPD.Applicative.PlaybackControl

-- | Play next song in the playlist.
next :: Command ()

-- | Pauses playback on True, resumes on False.
pause :: Bool -> Command ()

-- | Toggles playback.
toggle :: Command ()

-- | Begin playback (optionally at a specific position).
play :: Maybe Position -> Command ()

-- | Begin playback at the specified song id.
playId :: Id -> Command ()

-- | Play previous song.
previous :: Command ()

-- | Seek to time in the song at the given position.
seek :: Position -> FractionalSeconds -> Command ()

-- | Seek to time in the song with the given id.
seekId :: Id -> FractionalSeconds -> Command ()

-- | Seek to time in the current song. Absolute time for True in the frist
--   argument, relative time for False.
seekCur :: Bool -> FractionalSeconds -> Command ()

-- | Stop playback.
stop :: Command ()


-- | Audio output devices.
module Network.MPD.Applicative.Output

-- | Turn off output.
disableOutput :: Int -> Command ()

-- | Turn on output.
enableOutput :: Int -> Command ()

-- | Toggle output.
toggleOutput :: Int -> Command ()

-- | Get information about all available output devices.
outputs :: Command [Device]


-- | Stored playlists.
module Network.MPD.Applicative.StoredPlaylists

-- | List song items in the playlist.
listPlaylist :: PlaylistName -> Command [Path]

-- | List song items in the playlist with metadata.
listPlaylistInfo :: PlaylistName -> Command [Song]

-- | Get a list of stored playlists.
listPlaylists :: Command [PlaylistName]

-- | Load playlist into the current queue.
load :: PlaylistName -> Command ()

-- | Add a database path to the named playlist.
playlistAdd :: PlaylistName -> Path -> Command ()

-- | Clear the playlist.
playlistClear :: PlaylistName -> Command ()

-- | Delete the item at the given position from the playlist.
playlistDelete :: PlaylistName -> Position -> Command ()

-- | Move a song to a new position within the playlist.
playlistMove :: PlaylistName -> Id -> Position -> Command ()

-- | Rename the playlist.
rename :: PlaylistName -> PlaylistName -> Command ()

-- | Remove the playlist.
rm :: PlaylistName -> Command ()

-- | Save current queue to the named playlist.
save :: PlaylistName -> Command ()


-- | Stickers.
module Network.MPD.Applicative.Stickers

-- | Read sticker value for the object specified.
stickerGet :: ObjectType -> String -> String -> Command [String]

-- | Add sticker value to the object. Will overwrite existing stickers with
--   the same name.
stickerSet :: ObjectType -> String -> String -> String -> Command ()

-- | Delete a sticker value from the object. If no sticker name is given,
--   all sticker values attached to the object are deleted.
stickerDelete :: ObjectType -> String -> String -> Command ()

-- | List stickers for the object.
stickerList :: ObjectType -> String -> Command [(String, String)]

-- | Search the sticker database for stickers with the specified name,
--   below the specified directory.
stickerFind :: ObjectType -> String -> String -> Command [(String, String)]


-- | Querying MPD's status.
module Network.MPD.Applicative.Status

-- | Clear current error message in status.
clearError :: Command ()

-- | Song metadata for currently playing song, if any.
currentSong :: Command (Maybe Song)

-- | Wait until there is noteworthy change in one or more of MPD's
--   subsystems. When active, only <a>noidle</a> commands are allowed.
idle :: [Subsystem] -> Command [Subsystem]

-- | Cancel an <a>idle</a> request.
noidle :: Command ()

-- | Get the current status of the player.
status :: Command Status

-- | Get database statistics.
stats :: Command Stats


-- | Reflection.
module Network.MPD.Applicative.Reflection

-- | Get a list of available commands.
commands :: Command [String]

-- | Get a list of unavailable commands (i.e., commands that require an
--   authenticated session).
notCommands :: Command [String]

-- | Get a list of available song metadata.
tagTypes :: Command [String]

-- | Get a list of available URL handlers.
urlHandlers :: Command [String]

-- | Get a list of available decoder plugins, with their supported suffixes
--   and MIME types.
decoders :: Command [(String, [(String, String)])]

-- | Get configuration values of interest to a client.
--   
--   Note: only permitted for clients connected via a unix domain socket
--   (aka "local clients").
config :: Command [(String, String)]


-- | Playback options
module Network.MPD.Applicative.PlaybackOptions

-- | Toggle consume mode.
consume :: Bool -> Command ()

-- | Set crossfading between songs.
crossfade :: Seconds -> Command ()

-- | Toggle random mode.
random :: Bool -> Command ()

-- | Toggle repeat mode.
repeat :: Bool -> Command ()

-- | Set volume.
setVolume :: Volume -> Command ()

-- | Toggle single mode.
single :: Bool -> Command ()

-- | Set replay gain mode.
replayGainMode :: ReplayGainMode -> Command ()

-- | Get replay gain status: option name and its value.
replayGainStatus :: Command [(String, String)]

-- | Set MixRamp overlap threshold. 0dB is the normalized maximum value;
--   use negative values to adjust it.
--   
--   Songs must have MixRamp tags set by an external tool for this to work;
--   crossfading is used if no tags are present.
mixrampDb :: Decibels -> Command ()

-- | Additional time subtracted from the overlap calculated by
--   <a>mixrampDb</a>. <a>NaN</a> disables MixRamp overlapping and reverts
--   to crossfading.
mixrampDelay :: Seconds -> Command ()


-- | Mounting remote storage.
module Network.MPD.Applicative.Mount
mount :: String -> String -> Command ()
unmount :: String -> Command ()
listMounts :: Command [(String, String)]
listNeighbors :: Command [(String, String)]


-- | The music database.
module Network.MPD.Applicative.Database

-- | Get a count of songs and their total playtime that exactly match the
--   query.
count :: Query -> Command Count

-- | Find songs matching the query exactly.
find :: Query -> Command [Song]

-- | Like <a>find</a> but adds the results to the current playlist.
findAdd :: Query -> Command ()

-- | List all tags of the specified type of songs that that satisfy the
--   query.
list :: Metadata -> Query -> Command [Value]

-- | List all songs and directories in a database path.
listAll :: Path -> Command [Path]

-- | Same as <a>listAll</a> but also returns metadata.
listAllInfo :: Path -> Command [LsResult]

-- | List the contents of a database directory.
lsInfo :: Path -> Command [LsResult]

-- | Read comments from the file at the specified path.
readComments :: Path -> Command [(String, String)]

-- | Like <a>find</a> but with case insensitive matching.
search :: Query -> Command [Song]

-- | Like <a>search</a> but adds the results to the current playlist.
searchAdd :: Query -> Command ()

-- | Like <a>searchAdd</a> but adds results to the named playlist.
searchAddPl :: PlaylistName -> Query -> Command ()

-- | Update the music database. If no path is supplied, the entire database
--   is updated.
update :: Maybe Path -> Command Integer

-- | Like <a>update</a> but also rescan unmodified files.
rescan :: Maybe Path -> Command Integer


-- | The current playlist.
module Network.MPD.Applicative.CurrentPlaylist

-- | Add a song (or a whole directory) to the current playlist.
add :: Path -> Command ()

-- | Add a song (non-recursively) and return its id.
addId :: Path -> Maybe Position -> Command Id

-- | Clear the current playlist.
clear :: Command ()

-- | Delete song at the given playlist position.
delete :: Position -> Command ()

-- | Delete a range of songs from the playlist.
deleteRange :: Range -> Command ()

-- | Delete song by id.
deleteId :: Id -> Command ()

-- | Move song from one position to another.
move :: Position -> Position -> Command ()

-- | Move song id to position. If the position is negative, it is relative
--   to the current song.
moveId :: Id -> Position -> Command ()

-- | Move a range of songs.
moveRange :: Range -> Position -> Command ()

-- | Find songs in current playlist with strict matching.
playlistFind :: Query -> Command [Song]

-- | Get song metadata for all items in the current playlist. Optionally
--   restrict listing the song at the given position.
playlistInfo :: Maybe Position -> Command [Song]

-- | Like <a>playlistInfo</a> but can restrict listing to a range of songs.
playlistInfoRange :: Maybe Range -> Command [Song]

-- | Get song metadata for all items in the current playlist. Optionally
--   restrict selection to a single song id.
playlistId :: Maybe Id -> Command [Song]

-- | Search case-insensitively for partial matches in current playlist.
playlistSearch :: Query -> Command [Song]

-- | Get song metadata for items that have changed in the playlist since
--   the given playlist version.
plChanges :: Integer -> Command [Song]

-- | Get positions and ids of songs that have changed in the playlist since
--   the given playlist version.
plChangesPosId :: Integer -> Command [(Position, Id)]

-- | Set the priority of the specified songs.
prio :: Priority -> Range -> Command ()

-- | Set priority by song id.
prioId :: Priority -> Id -> Command ()

-- | Shuffle the current playlist. Optionally restrict to a range of songs.
shuffle :: Maybe Range -> Command ()

-- | Swap songs by position.
swap :: Position -> Position -> Command ()

-- | Swap songs by id.
swapId :: Id -> Id -> Command ()

-- | Add tag to specified (remote) song.
addTagId :: Id -> Metadata -> Value -> Command ()

-- | Remove tag from specified (remote) song.
clearTagId :: Id -> Metadata -> Command ()

-- | Specify portion of song that shall be played. Both ends of the range
--   are optional; omitting both plays everything.
--   
--   Since MPD 0.19.
rangeId :: Id -> (Maybe Double, Maybe Double) -> Command ()


-- | Client to client communication.
module Network.MPD.Applicative.ClientToClient
type ChannelName = String
type MessageText = String
subscribe :: ChannelName -> Command ()
unsubscribe :: ChannelName -> Command ()
channels :: Command [ChannelName]
readMessages :: Command [(ChannelName, MessageText)]
sendMessage :: ChannelName -> MessageText -> Command ()


-- | Extensions and shortcuts to the standard MPD command set.
module Network.MPD.Commands.Extensions

-- | Add a list of songs/folders to a playlist. Should be more efficient
--   than running <a>add</a> many times.
addMany :: MonadMPD m => PlaylistName -> [Path] -> m ()

-- | Recursive <a>addId</a>. For directories, it will use the given
--   position for the first file in the directory and use the successor for
--   the remaining files. It returns a list of playlist ids for the songs
--   added.
addIdMany :: MonadMPD m => Path -> Maybe Position -> m [Id]

-- | List the artists in the database.
listArtists :: MonadMPD m => m [Artist]

-- | List the albums in the database, optionally matching a given artist.
listAlbums :: MonadMPD m => Maybe Artist -> m [Album]

-- | List the songs in an album of some artist.
listAlbum :: MonadMPD m => Artist -> Album -> m [Song]

-- | Retrieve the current playlist. Equivalent to <tt>playlistinfo
--   Nothing</tt>.
getPlaylist :: MonadMPD m => m [Song]

-- | Increase or decrease volume by a given percent, e.g. 'volume 10' will
--   increase the volume by 10 percent, while 'volume (-10)' will decrease
--   it by the same amount.
volume :: MonadMPD m => Int -> m ()


-- | An MPD client library. MPD is a daemon for playing music that is
--   controlled over a network socket.
--   
--   To use the library, do:
--   
--   <pre>
--   {-# LANGUAGE OverloadedStrings #-}
--   import qualified Network.MPD as MPD
--   </pre>
module Network.MPD

-- | A typeclass to allow for multiple implementations of a connection to
--   an MPD server.
class (Monad m, MonadError MPDError m) => MonadMPD (m :: Type -> Type)

-- | The main implementation of an MPD client. It actually connects to a
--   server and interacts with it.
--   
--   To use the error throwing/catching capabilities:
--   
--   <pre>
--   import Control.Monad.Except (throwError, catchError)
--   </pre>
--   
--   To run IO actions within the MPD monad:
--   
--   <pre>
--   import Control.Monad.Trans (liftIO)
--   </pre>
data MPD a

-- | The MPDError type is used to signal errors, both from the MPD and
--   otherwise.
data MPDError

-- | MPD not responding
NoMPD :: MPDError

-- | An error occurred while talking to MPD.
ConnectionError :: IOException -> MPDError

-- | MPD returned an unexpected response. This is a bug, either in the
--   library or in MPD itself.
Unexpected :: String -> MPDError

-- | Used for misc. errors
Custom :: String -> MPDError

-- | ACK type and a message from the server
ACK :: ACKType -> String -> MPDError

-- | Represents various MPD errors (aka. ACKs).
data ACKType

-- | Invalid argument passed (ACK 2)
InvalidArgument :: ACKType

-- | Invalid password supplied (ACK 3)
InvalidPassword :: ACKType

-- | Authentication required (ACK 4)
Auth :: ACKType

-- | Unknown command (ACK 5)
UnknownCommand :: ACKType

-- | File or directory not found ACK 50)
FileNotFound :: ACKType

-- | Playlist at maximum size (ACK 51)
PlaylistMax :: ACKType

-- | A system error (ACK 52)
System :: ACKType

-- | Playlist loading failed (ACK 53)
PlaylistLoad :: ACKType

-- | Update already running (ACK 54)
Busy :: ACKType

-- | An operation requiring playback got interrupted (ACK 55)
NotPlaying :: ACKType

-- | File already exists (ACK 56)
FileExists :: ACKType

-- | An unknown ACK (aka. bug)
UnknownACK :: ACKType

-- | A response is either an <a>MPDError</a> or some result.
type Response = Either MPDError
type Host = String
type Port = Integer
type Password = String

-- | A wrapper for <a>withMPDEx</a> that uses localhost:6600 as the default
--   host:port, or whatever is found in the environment variables MPD_HOST
--   and MPD_PORT. If MPD_HOST is of the form "password@host" the password
--   will be supplied as well.
--   
--   Examples:
--   
--   <pre>
--   withMPD $ play Nothing
--   withMPD $ add_ "tool" &gt;&gt; play Nothing &gt;&gt; currentSong
--   </pre>
withMPD :: MPD a -> IO (Response a)

-- | Same as <a>withMPD</a>, but takes optional arguments that override
--   MPD_HOST and MPD_PORT.
--   
--   This is e.g. useful for clients that optionally take <tt>--port</tt>
--   and <tt>--host</tt> as command line arguments, and fall back to
--   <a>withMPD</a>'s defaults if those arguments are not given.
withMPD_ :: Maybe String -> Maybe String -> MPD a -> IO (Response a)

-- | The most configurable API for running an MPD action.
withMPDEx :: Host -> Port -> Password -> MPD a -> IO (Response a)
channels :: MonadMPD m => m [ChannelName]
readMessages :: MonadMPD m => m [(ChannelName, MessageText)]
sendMessage :: MonadMPD m => ChannelName -> MessageText -> m ()
subscribe :: MonadMPD m => ChannelName -> m ()
unsubscribe :: MonadMPD m => ChannelName -> m ()

-- | Send password to server to authenticate session. Password is sent as
--   plain text.
password :: MonadMPD m => String -> m ()

-- | Check that the server is still responding.
ping :: MonadMPD m => m ()

-- | Add a song (or a whole directory) to the current playlist.
add :: MonadMPD m => Path -> m ()

-- | Like <a>add</a>, but returns a playlist id.
addId :: MonadMPD m => Path -> Maybe Position -> m Id

-- | Add tag to (remote) song.
addTagId :: MonadMPD m => Id -> Metadata -> Value -> m ()

-- | Clear the current playlist.
clear :: MonadMPD m => m ()

-- | Remove tag from (remote) song.
clearTagId :: MonadMPD m => Id -> Metadata -> m ()

-- | Remove a song from the current playlist.
delete :: MonadMPD m => Position -> m ()

-- | Remove a song from the current playlist.
deleteId :: MonadMPD m => Id -> m ()

-- | Remove a range of songs from the current playlist.
deleteRange :: MonadMPD m => Range -> m ()

-- | Move a song to a given position in the current playlist.
move :: MonadMPD m => Position -> Position -> m ()

-- | Move a song from (songid) to (playlist index) in the playlist. If to
--   is negative, it is relative to the current song in the playlist (if
--   there is one).
moveId :: MonadMPD m => Id -> Position -> m ()

-- | Move a range of songs to a given position in the current playlist.
moveRange :: MonadMPD m => Range -> Position -> m ()

-- | Retrieve a list of changed songs currently in the playlist since a
--   given playlist version.
plChanges :: MonadMPD m => Integer -> m [Song]

-- | Like <a>plChanges</a> but only returns positions and ids.
plChangesPosId :: MonadMPD m => Integer -> m [(Position, Id)]

-- | Retrieve file paths and positions of songs in the current playlist.
--   Note that this command is only included for completeness sake; it's
--   deprecated and likely to disappear at any time, please use
--   <a>playlistInfo</a> instead.

-- | <i>Warning: this is deprecated; please use <a>playlistInfo</a>
--   instead.</i>
playlist :: MonadMPD m => m [(Position, Path)]

-- | Search for songs in the current playlist with strict matching.
playlistFind :: MonadMPD m => Query -> m [Song]

-- | Displays a list of songs in the playlist. If id is specified, only its
--   info is returned.
playlistId :: MonadMPD m => Maybe Id -> m [Song]

-- | Retrieve metadata for songs in the current playlist.
playlistInfo :: MonadMPD m => Maybe Position -> m [Song]

-- | Like <a>playlistInfo</a> but can restrict to a range of songs.
playlistInfoRange :: MonadMPD m => Maybe Range -> m [Song]

-- | Search case-insensitively with partial matches for songs in the
--   current playlist.
playlistSearch :: MonadMPD m => Query -> m [Song]

-- | Set the priority of the specified songs.
prio :: MonadMPD m => Priority -> Range -> m ()

-- | Set priority by song id.
prioId :: MonadMPD m => Priority -> Id -> m ()

-- | Specify portion of song that shall be played. Both ends of the range
--   are optional; omitting both plays everything.
rangeId :: MonadMPD m => Id -> (Maybe Double, Maybe Double) -> m ()

-- | Shuffle the current playlist. Optionally restrict to a range of songs.
shuffle :: MonadMPD m => Maybe Range -> m ()

-- | Swap the positions of two songs.
swap :: MonadMPD m => Position -> Position -> m ()

-- | Swap the positions of two songs (Id version)
swapId :: MonadMPD m => Id -> Id -> m ()

-- | Count the number of entries matching a query.
count :: MonadMPD m => Query -> m Count

-- | Search the database for entries exactly matching a query.
find :: MonadMPD m => Query -> m [Song]

-- | Adds songs matching a query to the current playlist.
findAdd :: MonadMPD m => Query -> m ()

-- | List all tags of the specified type of songs that that satisfy the
--   query.
list :: MonadMPD m => Metadata -> Query -> m [Value]

-- | List the songs (without metadata) in a database directory recursively.
listAll :: MonadMPD m => Path -> m [Path]

-- | Recursive <a>lsInfo</a>.
listAllInfo :: MonadMPD m => Path -> m [LsResult]

-- | Non-recursively list the contents of a database directory.
lsInfo :: MonadMPD m => Path -> m [LsResult]

-- | Read comments from file at path.
readComments :: MonadMPD m => Path -> m [(String, String)]

-- | Like <a>update</a> but also rescans unmodified files.
rescan :: MonadMPD m => Maybe Path -> m Integer

-- | Search the database using case insensitive matching.
search :: MonadMPD m => Query -> m [Song]

-- | Like <a>search</a> but adds the results to the current playlist.
searchAdd :: MonadMPD m => Query -> m ()

-- | Like <a>searchAdd</a> but adds results to the named playlist.
searchAddPl :: MonadMPD m => PlaylistName -> Query -> m ()

-- | Update the server's database.
--   
--   If no path is given, the whole library will be scanned. Unreadable or
--   non-existent paths are silently ignored.
--   
--   The update job id is returned.
update :: MonadMPD m => Maybe Path -> m Integer
listMounts :: MonadMPD m => m [(String, String)]
listNeighbors :: MonadMPD m => m [(String, String)]
mount :: MonadMPD m => String -> String -> m ()
unmount :: MonadMPD m => String -> m ()

-- | Turn off an output device.
disableOutput :: MonadMPD m => Int -> m ()

-- | Turn on an output device.
enableOutput :: MonadMPD m => Int -> m ()

-- | Retrieve information for all output devices.
outputs :: MonadMPD m => m [Device]

-- | Toggle output device.
toggleOutput :: MonadMPD m => Int -> m ()

-- | Play the next song.
next :: MonadMPD m => m ()

-- | Pauses playback on True, resumes on False.
pause :: MonadMPD m => Bool -> m ()

-- | Begin/continue playing.
play :: MonadMPD m => Maybe Position -> m ()

-- | Play a file with given id.
playId :: MonadMPD m => Id -> m ()

-- | Play the previous song.
previous :: MonadMPD m => m ()

-- | Seek to some point in a song.
seek :: MonadMPD m => Position -> FractionalSeconds -> m ()

-- | Seek to some point in the current song. Absolute time for True in the
--   frist argument, relative time for False.
seekCur :: MonadMPD m => Bool -> FractionalSeconds -> m ()

-- | Seek to some point in a song (id version)
seekId :: MonadMPD m => Id -> FractionalSeconds -> m ()

-- | Stop playing.
stop :: MonadMPD m => m ()

-- | Toggles play/pause. Plays if stopped.
toggle :: MonadMPD m => m ()

-- | Set consume mode
consume :: MonadMPD m => Bool -> m ()

-- | Set crossfading between songs.
crossfade :: MonadMPD m => Seconds -> m ()

-- | Set random playing.
random :: MonadMPD m => Bool -> m ()

-- | Set repeating.
repeat :: MonadMPD m => Bool -> m ()

-- | Set the replay gain mode.
replayGainMode :: MonadMPD m => ReplayGainMode -> m ()

-- | Get the replay gain options.
replayGainStatus :: MonadMPD m => m [(String, String)]

-- | Set the volume.
setVolume :: MonadMPD m => Volume -> m ()

-- | Set single mode
single :: MonadMPD m => Bool -> m ()

-- | Create a query for a tag containing a value.
--   
--   Since MPD 0.21.
(%?) :: Metadata -> Value -> Query

-- | Create a query matching a tag with anything but a value.
--   
--   Since MPD 0.21.
(/=?) :: Metadata -> Value -> Query

-- | Create a query matching a tag with anything but a regexp.
--   
--   Since MPD 0.21.
(/~?) :: Metadata -> Value -> Query

-- | Create a query matching a tag with a value.
(=?) :: Metadata -> Value -> Query

-- | An empty query. Matches anything.
anything :: Query

-- | Limit the query to the given directory, relative to the music
--   directory.
--   
--   Since MPD 0.21.
qBase :: Path -> Query

-- | Create a query for the full song URI relative to the music directory.
--   
--   Since MPD 0.21.
qFile :: Path -> Query

-- | Create a query for songs modified since a date.
--   
--   Since MPD 0.21.
qModSince :: UTCTime -> Query

-- | Negate a Query.
--   
--   Since MPD 0.21.
qNot :: Query -> Query

-- | Create a query matching a tag with regexp.
--   
--   Since MPD 0.21.
(~?) :: Metadata -> Value -> Query

-- | Retrieve a list of available commands.
commands :: MonadMPD m => m [String]

-- | Retrieve configuration keys and values.
config :: MonadMPD m => m [(String, String)]

-- | Retreive a list of decoder plugins with associated suffix and mime
--   types.
decoders :: MonadMPD m => m [(String, [(String, String)])]

-- | Retrieve a list of unavailable (due to access restrictions) commands.
notCommands :: MonadMPD m => m [String]

-- | Retrieve a list of available song metadata.
tagTypes :: MonadMPD m => m [String]

-- | Retrieve a list of supported urlhandlers.
urlHandlers :: MonadMPD m => m [String]

-- | Clear the current error message in status.
clearError :: MonadMPD m => m ()

-- | Get the currently playing song.
currentSong :: MonadMPD m => m (Maybe Song)

-- | Wait until there is a noteworthy change in one or more of MPD's
--   susbystems.
--   
--   The first argument is a list of subsystems that should be considered.
--   An empty list specifies that all subsystems should be considered.
--   
--   A list of subsystems that have noteworthy changes is returned.
--   
--   Note that running this command will block until either <a>idle</a>
--   returns or is cancelled by <a>noidle</a>.
idle :: MonadMPD m => [Subsystem] -> m [Subsystem]

-- | Cancel <a>idle</a>.
noidle :: MonadMPD m => m ()

-- | Get server statistics.
stats :: MonadMPD m => m Stats

-- | Get the server's status.
status :: MonadMPD m => m Status

-- | Delete a sticker value from the specified object.
stickerDelete :: MonadMPD m => ObjectType -> String -> String -> m ()

-- | Searches the sticker database for stickers with the specified name,
--   below the specified path.
stickerFind :: MonadMPD m => ObjectType -> String -> String -> m [(String, String)]

-- | Reads a sticker value for the specified object.
stickerGet :: MonadMPD m => ObjectType -> String -> String -> m [String]

-- | Lists the stickers for the specified object.
stickerList :: MonadMPD m => ObjectType -> String -> m [(String, String)]

-- | Adds a sticker value to the specified object.
stickerSet :: MonadMPD m => ObjectType -> String -> String -> String -> m ()

-- | Retrieve a list of files in a given playlist.
listPlaylist :: MonadMPD m => PlaylistName -> m [Path]

-- | Retrieve metadata for files in a given playlist.
listPlaylistInfo :: MonadMPD m => PlaylistName -> m [Song]

-- | Retreive a list of stored playlists.
listPlaylists :: MonadMPD m => m [PlaylistName]

-- | Load an existing playlist.
load :: MonadMPD m => PlaylistName -> m ()

-- | Add a song (or a whole directory) to a stored playlist. Will create a
--   new playlist if the one specified does not already exist.
playlistAdd :: MonadMPD m => PlaylistName -> Path -> m ()

-- | Clear a playlist. If the specified playlist does not exist, it will be
--   created.
playlistClear :: MonadMPD m => PlaylistName -> m ()

-- | Remove a song from a playlist.
playlistDelete :: MonadMPD m => PlaylistName -> Position -> m ()

-- | Move a song to a given position in the playlist specified.
playlistMove :: MonadMPD m => PlaylistName -> Id -> Position -> m ()

-- | Rename an existing playlist.
rename :: MonadMPD m => PlaylistName -> PlaylistName -> m ()

-- | Delete existing playlist.
rm :: MonadMPD m => PlaylistName -> m ()

-- | Save the current playlist.
save :: MonadMPD m => PlaylistName -> m ()

-- | Add metadata tag value.
sgAddTag :: Metadata -> Value -> Song -> Song

-- | Get list of specific tag type
sgGetTag :: Metadata -> Song -> Maybe [Value]
def :: Default a => a
type ChannelName = String
type MessageText = String

-- | An interface for creating MPD queries.
--   
--   For example, to match any song where the value of artist is "Foo", we
--   use:
--   
--   <pre>
--   Artist =? "Foo"
--   </pre>
--   
--   We can also compose queries, thus narrowing the search. For example,
--   to match any song where the value of artist is "Foo" and the value of
--   album is "Bar", we use:
--   
--   <pre>
--   Artist =? "Foo" &lt;&gt; Album =? "Bar"
--   </pre>
data Query
type Album = Value
type Artist = Value

-- | Represents the result of running <tt>count</tt>.
data Count
Count :: Integer -> Seconds -> Count

-- | Number of songs matching the query
[cSongs] :: Count -> Integer

-- | Total play time of matching songs
[cPlaytime] :: Count -> Seconds
type Decibels = Integer

-- | Represents an output device.
data Device
Device :: Int -> String -> Bool -> Device

-- | Output's ID number
[dOutputID] :: Device -> Int

-- | Output's name as defined in the MPD configuration file
[dOutputName] :: Device -> String
[dOutputEnabled] :: Device -> Bool
type FractionalSeconds = Double
newtype Id
Id :: Int -> Id

-- | Result of the lsInfo operation
data LsResult

-- | Directory
LsDirectory :: Path -> LsResult

-- | Song
LsSong :: Song -> LsResult

-- | Playlist
LsPlaylist :: PlaylistName -> LsResult

-- | Available metadata types/scope modifiers, used for searching the
--   database for entries with certain metadata values.
data Metadata
Artist :: Metadata
ArtistSort :: Metadata
Album :: Metadata

AlbumSort :: Metadata
AlbumArtist :: Metadata
AlbumArtistSort :: Metadata
Title :: Metadata
Track :: Metadata
Name :: Metadata
Genre :: Metadata
Date :: Metadata

OriginalDate :: Metadata
Composer :: Metadata
Performer :: Metadata

Conductor :: Metadata

Work :: Metadata

Grouping :: Metadata
Comment :: Metadata
Disc :: Metadata

Label :: Metadata
MUSICBRAINZ_ARTISTID :: Metadata
MUSICBRAINZ_ALBUMID :: Metadata
MUSICBRAINZ_ALBUMARTISTID :: Metadata
MUSICBRAINZ_TRACKID :: Metadata
MUSICBRAINZ_RELEASETRACKID :: Metadata

MUSICBRAINZ_WORKID :: Metadata

-- | Object types.
data ObjectType
SongObj :: ObjectType

-- | Used for commands which require a path within the database. If empty,
--   the root path is used.
data Path

-- | Represents the different playback states.
data PlaybackState
Playing :: PlaybackState
Stopped :: PlaybackState
Paused :: PlaybackState

-- | Used for commands which require a playlist name. If empty, the current
--   playlist is used.
newtype PlaylistName
PlaylistName :: ByteString -> PlaylistName

-- | The position of a song in a playlist.
type Position = Int
newtype Priority
Priority :: Int -> Priority

-- | A range of songs.
data Range

-- | Start and end of the range, not including the end position.
Range :: Position -> Position -> Range

-- | From the given position until the end of the playlist.
Start :: Position -> Range
data ReplayGainMode

-- | Disable replay gain
Off :: ReplayGainMode

-- | Per track mode
TrackMode :: ReplayGainMode

-- | Per album mode
AlbumMode :: ReplayGainMode

-- | Auto mode
AutoMode :: ReplayGainMode
type Seconds = Integer

-- | Represents a single song item.
data Song
Song :: Path -> Map Metadata [Value] -> Maybe UTCTime -> Seconds -> Maybe Id -> Maybe Position -> Song
[sgFilePath] :: Song -> Path

-- | Map of available tags (multiple occurrences of one tag type allowed)
[sgTags] :: Song -> Map Metadata [Value]

-- | Last modification date
[sgLastModified] :: Song -> Maybe UTCTime

-- | Length of the song in seconds
[sgLength] :: Song -> Seconds

-- | Id in playlist
[sgId] :: Song -> Maybe Id

-- | Position in playlist
[sgIndex] :: Song -> Maybe Position

-- | Container for database statistics.
data Stats
Stats :: Integer -> Integer -> Integer -> Seconds -> Seconds -> Seconds -> Integer -> Stats

-- | Number of artists.
[stsArtists] :: Stats -> Integer

-- | Number of albums.
[stsAlbums] :: Stats -> Integer

-- | Number of songs.
[stsSongs] :: Stats -> Integer

-- | Daemon uptime in seconds.
[stsUptime] :: Stats -> Seconds

-- | Total playing time.
[stsPlaytime] :: Stats -> Seconds

-- | Total play time of all the songs in the database.
[stsDbPlaytime] :: Stats -> Seconds

-- | Last database update in UNIX time.
[stsDbUpdate] :: Stats -> Integer

-- | Container for MPD status.
data Status
Status :: PlaybackState -> Maybe Volume -> Bool -> Bool -> Integer -> Integer -> Maybe Position -> Maybe Id -> Maybe Position -> Maybe Id -> Maybe (FractionalSeconds, FractionalSeconds) -> Maybe Int -> Seconds -> Double -> Double -> (Int, Int, Int) -> Maybe Integer -> Bool -> Bool -> Maybe String -> String -> Status
[stState] :: Status -> PlaybackState

-- | A percentage (0-100).
--   
--   <a>Nothing</a> indicates that the output lacks mixer support.
[stVolume] :: Status -> Maybe Volume
[stRepeat] :: Status -> Bool
[stRandom] :: Status -> Bool

-- | A value that is incremented by the server every time the playlist
--   changes.
[stPlaylistVersion] :: Status -> Integer

-- | The number of items in the current playlist.
[stPlaylistLength] :: Status -> Integer

-- | Current song's position in the playlist.
[stSongPos] :: Status -> Maybe Position

-- | Current song's playlist ID.
[stSongID] :: Status -> Maybe Id

-- | Next song's position in the playlist.
[stNextSongPos] :: Status -> Maybe Position

-- | Next song's playlist ID.
[stNextSongID] :: Status -> Maybe Id

-- | Time elapsed/total time of playing song (if any).
[stTime] :: Status -> Maybe (FractionalSeconds, FractionalSeconds)

-- | Bitrate (in kilobytes per second) of playing song (if any).
[stBitrate] :: Status -> Maybe Int

-- | Crossfade time.
[stXFadeWidth] :: Status -> Seconds

-- | MixRamp threshold in dB
[stMixRampdB] :: Status -> Double

-- | MixRamp extra delay in seconds
[stMixRampDelay] :: Status -> Double

-- | Samplerate/bits/channels for the chosen output device (see mpd.conf).
[stAudio] :: Status -> (Int, Int, Int)

-- | Job ID of currently running update (if any).
[stUpdatingDb] :: Status -> Maybe Integer

-- | If True, MPD will play only one song and stop after finishing it. If
--   single is set to "oneshot" by another client, it's interperted as
--   True.
[stSingle] :: Status -> Bool

-- | If True, a song will be removed after it has been played.
[stConsume] :: Status -> Bool

-- | Last error message (if any).
[stError] :: Status -> Maybe String

-- | The name of MPD partition.
[stPartition] :: Status -> String

-- | Represents the various MPD subsystems.
data Subsystem

-- | The song database
DatabaseS :: Subsystem

-- | Database updates
UpdateS :: Subsystem

-- | Stored playlists
StoredPlaylistS :: Subsystem

-- | The current playlist
PlaylistS :: Subsystem

-- | The player
PlayerS :: Subsystem

-- | The volume mixer
MixerS :: Subsystem

-- | Audio outputs
OutputS :: Subsystem

-- | Playback options
OptionsS :: Subsystem

-- | Partition changes
PartitionS :: Subsystem

-- | Sticker database
StickerS :: Subsystem

-- | Subscription
SubscriptionS :: Subsystem

-- | Message on subscribed channel
MessageS :: Subsystem

-- | finding or losing a neighbor
NeighborS :: Subsystem

-- | Mount list changes
MountS :: Subsystem
type Title = Value

-- | A type class for values that can be converted to <a>String</a>s.
class ToString a

-- | Convert given value to <a>String</a>.
toString :: ToString a => a -> String

-- | Convert given value to <a>Text</a>.
toText :: ToString a => a -> Text

-- | Convert given value to a UTF-8 encoded <a>ByteString</a>.
toUtf8 :: ToString a => a -> ByteString

-- | A metadata value.
data Value

-- | Volume values.
--   
--   Values of this type are always in the range 0-100.
--   
--   Arithmetic on volumes has the property that:
--   
--   <pre>
--   current + new = 100 if current + new &gt; 100
--   </pre>
--   
--   <pre>
--   current - new = 0   if current - new &lt; 0
--   </pre>
--   
--   but <tt>current / 0</tt> still yields a division by zero exception.
data Volume

module Network.MPD.Applicative

-- | A compound command, comprising a parser for the responses and a
--   combined request of an arbitrary number of commands.
data Command a

-- | Execute a <a>Command</a>.
runCommand :: MonadMPD m => Command a -> m a
