-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An MPD client library. -- @package libmpd @version 0.9.0.2 -- | The core datatypes and operations are defined here, including the -- primary instance of the MonadMPD class, MPD. 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 open :: MonadMPD m => m () close :: MonadMPD m => m () send :: MonadMPD m => String -> m [ByteString] getPassword :: MonadMPD m => m Password setPassword :: MonadMPD m => Password -> m () 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: -- --
--   import Control.Monad.Error (throwError, catchError)
--   
-- -- To run IO actions within the MPD monad: -- --
--   import Control.Monad.Trans (liftIO)
--   
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 MPDError 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 Functor MPD instance Monad MPD instance MonadIO MPD instance MonadError MPDError MPD instance MonadMPD MPD instance Applicative MPD -- | 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 noidle commands are allowed. idle :: [Subsystem] -> Command [Subsystem] -- | Cancel an idle request. noidle :: Command () -- | Get the current status of the player. status :: Command Status -- | Get database statistics. stats :: Command Stats -- | 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 in percent. setVolume :: Int -> 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 -- mixrampDb. NaN disables MixRamp overlapping and reverts -- to crossfading. mixrampDelay :: Seconds -> Command () -- | Controlling playback. module Network.MPD.Applicative.PlaybackControl -- | Play next song in the playlist. next :: Command () -- | Toggle pause. pause :: Bool -> 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 -> Seconds -> Command () -- | Seek to time in the song with the given id. seekId :: Id -> Seconds -> Command () -- | Stop playback. stop :: Command () -- | 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 :: (Position, Position) -> 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 :: (Position, Position) -> 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 playlistInfo but can restrict listing to a range of songs. playlistInfoRange :: Maybe (Position, Position) -> 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)] -- | Shuffle the current playlist. Optionally restrict to a range of songs. shuffle :: Maybe (Position, Position) -> Command () -- | Swap songs by position. swap :: Position -> Position -> Command () -- | Swap songs by id. swapId :: Id -> Id -> Command () -- | 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 () -- | 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 find but adds the results to the current playlist. findAdd :: Query -> Command () -- | Lists all tags of the specified type. -- -- Note that the optional artist value is only ever used if the metadata -- type is Album, and is then taken to mean that the albums by -- that artist be listed. list :: Metadata -> Maybe Artist -> Command [Value] -- | List all songs and directories in a database path. listAll :: Path -> Command [Path] lsInfo' :: Command -> Path -> Command [LsResult] -- | Same as listAll but also returns metadata. listAllInfo :: Path -> Command [LsResult] -- | List the contents of a database directory. lsInfo :: Path -> Command [LsResult] -- | Like find but with inexact matching. search :: Query -> Command [Song] -- | Like search but adds the results to the current playlist. -- -- Since MPD 0.17. searchAdd :: Query -> Command () -- | Like searchAdd but adds results to the named playlist. -- -- Since MPD 0.17. searchAddPl :: PlaylistName -> Query -> Command () -- | Update the music database. If no path is supplied, the entire database -- is updated. update :: Maybe Path -> Command Integer -- | Like update but also rescan unmodified files. rescan :: Maybe Path -> Command Integer update_ :: Command -> Maybe Path -> Command Integer -- | 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)] -- | Connection settings. module Network.MPD.Applicative.Connection -- | Authenticate session. The password is sent in plain text. password :: Password -> Command () -- | Ping daemon. ping :: Command () -- | Audio output devices. module Network.MPD.Applicative.Output -- | Turn off output. disableOutput :: Int -> Command () -- | Turn on output. enableOutput :: Int -> Command () -- | Get information about all available output devices. outputs :: Command [Device] -- | 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)] 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 Command. runCommand :: MonadMPD m => Command a -> m a -- | 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 -- | This is exactly the same as update. -- | Deprecated: use update instead updateId :: MonadMPD m => Maybe Path -> m Integer -- | Toggles play/pause. Plays if stopped. toggle :: MonadMPD m => m () -- | Add a list of songs/folders to a playlist. Should be more efficient -- than running add many times. addMany :: MonadMPD m => PlaylistName -> [Path] -> m () -- | Recursive addId. 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] -- | Like add but returns a list of the files added. -- | Deprecated: will be removed in a future version addList :: MonadMPD m => Path -> m [Path] -- | Like playlistAdd but returns a list of the files added. -- | Deprecated: will be removed in a future version playlistAddList :: MonadMPD m => PlaylistName -> Path -> m [Path] -- | 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 playlistinfo -- Nothing. 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: -- --
--   import qualified Network.MPD as MPD
--   
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 -- | The main implementation of an MPD client. It actually connects to a -- server and interacts with it. -- -- To use the error throwing/catching capabilities: -- --
--   import Control.Monad.Error (throwError, catchError)
--   
-- -- To run IO actions within the MPD monad: -- --
--   import Control.Monad.Trans (liftIO)
--   
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 MPDError or some result. type Response = Either MPDError type Host = String type Port = Integer type Password = String -- | A wrapper for withMPDEx 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: -- --
--   withMPD $ play Nothing
--   withMPD $ add_ "tool" >> play Nothing >> currentSong
--   
withMPD :: MPD a -> IO (Response a) -- | Same as withMPD, but takes optional arguments that override -- MPD_HOST and MPD_PORT. -- -- This is e.g. useful for clients that optionally take --port -- and --host as command line arguments, and fall back to -- withMPD'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) -- | An interface for creating MPD queries. -- -- For example, to match any song where the value of artist is "Foo", we -- use: -- --
--   Artist =? "Foo"
--   
-- -- 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: -- --
--   Artist =? "Foo" <&> Album =? "Bar"
--   
data Query -- | Create a query. (=?) :: Metadata -> Value -> Query -- | Combine queries. (<&>) :: Query -> Query -> Query -- | An empty query. Matches anything. anything :: Query -- | A type class for values that can be converted to Strings. class ToString a toString :: ToString a => a -> String toText :: ToString a => a -> Text toUtf8 :: ToString a => a -> ByteString type Artist = Value type Album = Value type Title = Value -- | Used for commands which require a playlist name. If empty, the current -- playlist is used. newtype PlaylistName PlaylistName :: ByteString -> PlaylistName -- | Used for commands which require a path within the database. If empty, -- the root path is used. data Path -- | Available metadata types/scope modifiers, used for searching the -- database for entries with certain metadata values. data Metadata Artist :: Metadata ArtistSort :: Metadata Album :: Metadata AlbumArtist :: Metadata AlbumArtistSort :: Metadata Title :: Metadata Track :: Metadata Name :: Metadata Genre :: Metadata Date :: Metadata Composer :: Metadata Performer :: Metadata Comment :: Metadata Disc :: Metadata MUSICBRAINZ_ARTISTID :: Metadata MUSICBRAINZ_ALBUMID :: Metadata MUSICBRAINZ_ALBUMARTISTID :: Metadata MUSICBRAINZ_TRACKID :: Metadata MUSICBRAINZ_RELEASETRACKID :: Metadata -- | A metadata value. data Value -- | Object types. data ObjectType SongObj :: ObjectType type Seconds = Integer type Decibels = Integer -- | Represents the different playback states. data State Playing :: State Stopped :: State Paused :: State -- | 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 -- | Sticker database StickerS :: Subsystem -- | Subscription SubscriptionS :: Subsystem -- | Message on subscribed channel MessageS :: Subsystem data ReplayGainMode -- | Disable replay gain Off :: ReplayGainMode -- | Per track mode TrackMode :: ReplayGainMode -- | Per album mode AlbumMode :: ReplayGainMode -- | Represents the result of running count. data Count Count :: Integer -> Seconds -> Count -- | Number of songs matching the query cSongs :: Count -> Integer -- | Total play time of matching songs cPlaytime :: Count -> Seconds -- | Result of the lsInfo operation data LsResult -- | Directory LsDirectory :: Path -> LsResult -- | Song LsSong :: Song -> LsResult -- | Playlist LsPlaylist :: PlaylistName -> LsResult -- | 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 -- | 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 -- | The position of a song in a playlist. type Position = Int newtype Id Id :: Int -> Id -- | Get list of specific tag type sgGetTag :: Metadata -> Song -> Maybe [Value] -- | Add metadata tag value. sgAddTag :: Metadata -> Value -> Song -> Song -- | 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 :: State -> Maybe Int -> Bool -> Bool -> Integer -> Integer -> Maybe Position -> Maybe Id -> Maybe Position -> Maybe Id -> Maybe (Double, Seconds) -> Maybe Int -> Seconds -> Double -> Double -> (Int, Int, Int) -> Maybe Integer -> Bool -> Bool -> Maybe String -> Status stState :: Status -> State -- | A percentage (0-100). -- -- Nothing indicates that the output lacks mixer support. stVolume :: Status -> Maybe Int 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 (Double, Seconds) -- | 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. 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 default value for this type. def :: Default a => a -- | 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 idle -- returns or is cancelled by noidle. idle :: MonadMPD m => [Subsystem] -> m [Subsystem] -- | Cancel idle. noidle :: MonadMPD m => m () -- | Get server statistics. stats :: MonadMPD m => m Stats -- | Get the server's status. status :: MonadMPD m => m Status -- | 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 volume (0-100 percent). setVolume :: MonadMPD m => Int -> m () -- | Set single mode single :: 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)] -- | Play the next song. next :: MonadMPD m => m () -- | Pause playing. 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 -> Seconds -> m () -- | Seek to some point in a song (id version) seekId :: MonadMPD m => Id -> Seconds -> m () -- | Stop playing. stop :: MonadMPD m => m () -- | Like add, but returns a playlist id. addId :: MonadMPD m => Path -> Maybe Position -> m Id -- | Add a song (or a whole directory) to the current playlist. add :: MonadMPD m => Path -> m () -- | Clear the current playlist. clear :: MonadMPD m => 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 () -- | 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 () -- | 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 -- playlistInfo instead. -- | Warning: this is deprecated; please use playlistInfo -- instead. playlist :: MonadMPD m => m [(Position, Path)] -- | Search for songs in the current playlist with strict matching. playlistFind :: MonadMPD m => Query -> m [Song] -- | Retrieve metadata for songs in the current playlist. playlistInfo :: MonadMPD m => Maybe Position -> m [Song] -- | Like playlistInfo but can restrict to a range of songs. playlistInfoRange :: MonadMPD m => Maybe (Position, Position) -> 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] -- | Search case-insensitively with partial matches for songs in the -- current playlist. playlistSearch :: MonadMPD m => Query -> m [Song] -- | Retrieve a list of changed songs currently in the playlist since a -- given playlist version. plChanges :: MonadMPD m => Integer -> m [Song] -- | Like plChanges but only returns positions and ids. plChangesPosId :: MonadMPD m => Integer -> m [(Position, Id)] -- | Shuffle the playlist. shuffle :: MonadMPD m => Maybe (Position, Position) -> 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 () -- | 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 () -- | 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. list :: MonadMPD m => Metadata -> Maybe Artist -> m [Value] -- | List the songs (without metadata) in a database directory recursively. listAll :: MonadMPD m => Path -> m [Path] -- | Recursive lsInfo. listAllInfo :: MonadMPD m => Path -> m [LsResult] -- | Non-recursively list the contents of a database directory. lsInfo :: MonadMPD m => Path -> m [LsResult] -- | Search the database using case insensitive matching. search :: MonadMPD m => Query -> m [Song] -- | 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 -- | Like update but also rescans unmodified files. rescan :: MonadMPD m => Maybe Path -> m Integer -- | Reads a sticker value for the specified object. stickerGet :: MonadMPD m => ObjectType -> String -> String -> m [String] -- | Adds a sticker value to the specified object. stickerSet :: MonadMPD m => ObjectType -> String -> String -> String -> m () -- | Delete a sticker value from the specified object. stickerDelete :: MonadMPD m => ObjectType -> String -> String -> m () -- | Lists the stickers for the specified object. stickerList :: MonadMPD m => ObjectType -> String -> m [(String, String)] -- | Searches the sticker database for stickers with the specified name, -- below the specified path. stickerFind :: MonadMPD m => ObjectType -> String -> String -> m [(String, String)] -- | 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 () -- | 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] -- | Retrieve a list of available commands. commands :: MonadMPD m => m [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] -- | Retreive a list of decoder plugins with associated suffix and mime -- types. decoders :: MonadMPD m => m [(String, [(String, String)])] -- | Retrieve configuration keys and values. config :: MonadMPD m => m [(String, String)] type ChannelName = String type MessageText = String subscribe :: MonadMPD m => ChannelName -> m () unsubscribe :: MonadMPD m => ChannelName -> m () channels :: MonadMPD m => m [ChannelName] readMessages :: MonadMPD m => m [(ChannelName, MessageText)] sendMessage :: MonadMPD m => ChannelName -> MessageText -> m ()