libmpd-0.10.0.1: An MPD client library.

Copyright | (c) Joachim Fasting Simon Hengel 2012
License | MIT
Maintainer | Joachim Fasting <joachifm@fastmail.fm>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

Network.MPD

Contents

- Basic data types
- Connections

Description

An MPD client library. MPD is a daemon for playing music that is controlled over a network socket.

To use the library, do:

    {-# LANGUAGE OverloadedStrings #-}
    import qualified Network.MPD as MPD

Synopsis

- class (Monad m, MonadError MPDError m) => MonadMPD (m :: Type -> Type)
- data MPD a
- data MPDError
  - = NoMPD
  - | ConnectionError IOException
  - | Unexpected String
  - | Custom String
  - | ACK ACKType String
- data ACKType
  - = InvalidArgument
  - | InvalidPassword
  - | Auth
  - | UnknownCommand
  - | FileNotFound
  - | PlaylistMax
  - | System
  - | PlaylistLoad
  - | Busy
  - | NotPlaying
  - | FileExists
  - | UnknownACK
- type Response = Either MPDError
- type Host = String
- type Port = Integer
- type Password = String
- withMPD :: MPD a -> IO (Response a)
- withMPD_ :: Maybe String -> Maybe String -> MPD a -> IO (Response a)
- withMPDEx :: Host -> Port -> Password -> MPD a -> IO (Response a)
- random :: MonadMPD m => Bool -> m ()
- count :: MonadMPD m => Query -> m Count
- swap :: MonadMPD m => Position -> Position -> m ()
- repeat :: MonadMPD m => Bool -> m ()
- list :: MonadMPD m => Metadata -> Query -> m [Value]
- find :: MonadMPD m => Query -> m [Song]
- delete :: MonadMPD m => Position -> m ()
- seek :: MonadMPD m => Position -> FractionalSeconds -> m ()
- update :: MonadMPD m => Maybe Path -> m Integer
- def :: Default a => a
- data Metadata
  - = Artist
  - | ArtistSort
  - | Album
  - | AlbumSort
  - | AlbumArtist
  - | AlbumArtistSort
  - | Title
  - | Track
  - | Name
  - | Genre
  - | Date
  - | OriginalDate
  - | Composer
  - | Performer
  - | Conductor
  - | Work
  - | Grouping
  - | Comment
  - | Disc
  - | Label
  - | MUSICBRAINZ_ARTISTID
  - | MUSICBRAINZ_ALBUMID
  - | MUSICBRAINZ_ALBUMARTISTID
  - | MUSICBRAINZ_TRACKID
  - | MUSICBRAINZ_RELEASETRACKID
  - | MUSICBRAINZ_WORKID
- prio :: MonadMPD m => Priority -> Range -> m ()
- clear :: MonadMPD m => m ()
- add :: MonadMPD m => Path -> m ()
- data Range
  - = Range Position Position
  - | Start Position
- class ToString a where
  - toString :: a -> String
  - toText :: a -> Text
  - toUtf8 :: a -> ByteString
- rename :: MonadMPD m => PlaylistName -> PlaylistName -> m ()
- data PlaybackState
  - = Playing
  - | Stopped
  - | Paused
- data Status = Status {
  - stState :: PlaybackState
  - stVolume :: Maybe Volume
  - stRepeat :: Bool
  - stRandom :: Bool
  - stPlaylistVersion :: Integer
  - stPlaylistLength :: Integer
  - stSongPos :: Maybe Position
  - stSongID :: Maybe Id
  - stNextSongPos :: Maybe Position
  - stNextSongID :: Maybe Id
  - stTime :: Maybe (FractionalSeconds, FractionalSeconds)
  - stBitrate :: Maybe Int
  - stXFadeWidth :: Seconds
  - stMixRampdB :: Double
  - stMixRampDelay :: Double
  - stAudio :: (Int, Int, Int)
  - stUpdatingDb :: Maybe Integer
  - stSingle :: Bool
  - stConsume :: Bool
  - stError :: Maybe String
  - stPartition :: 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 ()
- password :: MonadMPD m => String -> m ()
- ping :: MonadMPD m => m ()
- addId :: MonadMPD m => Path -> Maybe Position -> m Id
- deleteRange :: MonadMPD m => Range -> m ()
- deleteId :: MonadMPD m => Id -> m ()
- move :: MonadMPD m => Position -> Position -> m ()
- moveId :: MonadMPD m => Id -> Position -> m ()
- moveRange :: MonadMPD m => Range -> Position -> m ()
- playlistFind :: MonadMPD m => Query -> m [Song]
- playlistInfo :: MonadMPD m => Maybe Position -> m [Song]
- playlistInfoRange :: MonadMPD m => Maybe Range -> m [Song]
- playlistId :: MonadMPD m => Maybe Id -> m [Song]
- playlistSearch :: MonadMPD m => Query -> m [Song]
- plChanges :: MonadMPD m => Integer -> m [Song]
- plChangesPosId :: MonadMPD m => Integer -> m [(Position, Id)]
- prioId :: MonadMPD m => Priority -> Id -> m ()
- shuffle :: MonadMPD m => Maybe Range -> m ()
- swapId :: MonadMPD m => Id -> Id -> m ()
- addTagId :: MonadMPD m => Id -> Metadata -> Value -> m ()
- clearTagId :: MonadMPD m => Id -> Metadata -> m ()
- rangeId :: MonadMPD m => Id -> (Maybe Double, Maybe Double) -> m ()
- data Query
- findAdd :: MonadMPD m => Query -> m ()
- listAll :: MonadMPD m => Path -> m [Path]
- listAllInfo :: MonadMPD m => Path -> m [LsResult]
- lsInfo :: MonadMPD m => Path -> m [LsResult]
- readComments :: MonadMPD m => Path -> m [(String, String)]
- search :: MonadMPD m => Query -> m [Song]
- searchAdd :: MonadMPD m => Query -> m ()
- searchAddPl :: MonadMPD m => PlaylistName -> Query -> m ()
- rescan :: MonadMPD m => Maybe Path -> m Integer
- mount :: MonadMPD m => String -> String -> m ()
- unmount :: MonadMPD m => String -> m ()
- listMounts :: MonadMPD m => m [(String, String)]
- listNeighbors :: MonadMPD m => m [(String, String)]
- disableOutput :: MonadMPD m => Int -> m ()
- enableOutput :: MonadMPD m => Int -> m ()
- toggleOutput :: MonadMPD m => Int -> m ()
- outputs :: MonadMPD m => m [Device]
- next :: MonadMPD m => m ()
- pause :: MonadMPD m => Bool -> m ()
- toggle :: MonadMPD m => m ()
- play :: MonadMPD m => Maybe Position -> m ()
- playId :: MonadMPD m => Id -> m ()
- previous :: MonadMPD m => m ()
- seekId :: MonadMPD m => Id -> FractionalSeconds -> m ()
- seekCur :: MonadMPD m => Bool -> FractionalSeconds -> m ()
- stop :: MonadMPD m => m ()
- consume :: MonadMPD m => Bool -> m ()
- crossfade :: MonadMPD m => Seconds -> m ()
- setVolume :: MonadMPD m => Volume -> m ()
- single :: MonadMPD m => Bool -> m ()
- replayGainMode :: MonadMPD m => ReplayGainMode -> m ()
- replayGainStatus :: MonadMPD m => m [(String, String)]
- commands :: MonadMPD m => m [String]
- notCommands :: MonadMPD m => m [String]
- tagTypes :: MonadMPD m => m [String]
- urlHandlers :: MonadMPD m => m [String]
- decoders :: MonadMPD m => m [(String, [(String, String)])]
- config :: MonadMPD m => m [(String, String)]
- clearError :: MonadMPD m => m ()
- currentSong :: MonadMPD m => m (Maybe Song)
- idle :: MonadMPD m => [Subsystem] -> m [Subsystem]
- noidle :: MonadMPD m => m ()
- status :: MonadMPD m => m Status
- stats :: MonadMPD m => m Stats
- stickerGet :: MonadMPD m => ObjectType -> String -> String -> m [String]
- stickerSet :: MonadMPD m => ObjectType -> String -> String -> String -> m ()
- stickerDelete :: MonadMPD m => ObjectType -> String -> String -> m ()
- stickerList :: MonadMPD m => ObjectType -> String -> m [(String, String)]
- stickerFind :: MonadMPD m => ObjectType -> String -> String -> m [(String, String)]
- listPlaylist :: MonadMPD m => PlaylistName -> m [Path]
- listPlaylistInfo :: MonadMPD m => PlaylistName -> m [Song]
- listPlaylists :: MonadMPD m => m [PlaylistName]
- load :: MonadMPD m => PlaylistName -> m ()
- playlistAdd :: MonadMPD m => PlaylistName -> Path -> m ()
- playlistClear :: MonadMPD m => PlaylistName -> m ()
- playlistDelete :: MonadMPD m => PlaylistName -> Position -> m ()
- playlistMove :: MonadMPD m => PlaylistName -> Id -> Position -> m ()
- rm :: MonadMPD m => PlaylistName -> m ()
- save :: MonadMPD m => PlaylistName -> m ()
- type Artist = Value
- type Album = Value
- type Title = Value
- newtype PlaylistName = PlaylistName ByteString
- data Path
- data Value
- data ObjectType = SongObj
- type Seconds = Integer
- type FractionalSeconds = Double
- type Decibels = Integer
- data Subsystem
  - = DatabaseS
  - | UpdateS
  - | StoredPlaylistS
  - | PlaylistS
  - | PlayerS
  - | MixerS
  - | OutputS
  - | OptionsS
  - | PartitionS
  - | StickerS
  - | SubscriptionS
  - | MessageS
  - | NeighborS
  - | MountS
- data ReplayGainMode
  - = Off
  - | TrackMode
  - | AlbumMode
  - | AutoMode
- data Count = Count {
  - cSongs :: Integer
  - cPlaytime :: Seconds
  }
- data LsResult
  - = LsDirectory Path
  - | LsSong Song
  - | LsPlaylist PlaylistName
- data Device = Device {
  - dOutputID :: Int
  - dOutputName :: String
  - dOutputEnabled :: Bool
  }
- data Song = Song {
  - sgFilePath :: Path
  - sgTags :: Map Metadata [Value]
  - sgLastModified :: Maybe UTCTime
  - sgLength :: Seconds
  - sgId :: Maybe Id
  - sgIndex :: Maybe Position
  }
- newtype Priority = Priority Int
- type Position = Int
- data Volume
- newtype Id = Id Int
- sgGetTag :: Metadata -> Song -> Maybe [Value]
- sgAddTag :: Metadata -> Value -> Song -> Song
- data Stats = Stats {
  - stsArtists :: Integer
  - stsAlbums :: Integer
  - stsSongs :: Integer
  - stsUptime :: Seconds
  - stsPlaytime :: Seconds
  - stsDbPlaytime :: Seconds
  - stsDbUpdate :: Integer
  }
- (=?) :: Metadata -> Value -> Query
- (/=?) :: Metadata -> Value -> Query
- (%?) :: Metadata -> Value -> Query
- (~?) :: Metadata -> Value -> Query
- (/~?) :: Metadata -> Value -> Query
- qNot :: Query -> Query
- qModSince :: UTCTime -> Query
- qFile :: Path -> Query
- qBase :: Path -> Query
- anything :: Query
- playlist :: MonadMPD m => m [(Position, Path)]

# Basic data types

class (Monad m, MonadError MPDError m) => MonadMPD (m :: Type -> Type) Source #

A typeclass to allow for multiple implementations of a connection to an MPD server.

Minimal complete definition

open, close, send, getPassword, setPassword, getVersion

#### Instances

Instances details

MonadMPD MPD Source # |
Instance details Defined in Network.MPD.Core Methods open :: MPD () Source # close :: MPD () Source # send :: String -> MPD [ByteString] Source # getPassword :: MPD Password Source # setPassword :: Password -> MPD () Source # getVersion :: MPD (Int, Int, Int) Source #

data MPD a Source #

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.Except (throwError, catchError)

To run IO actions within the MPD monad:

    import Control.Monad.Trans (liftIO)

#### Instances

Instances details

MonadIO MPD Source # |
Instance details Defined in Network.MPD.Core Methods liftIO :: IO a -> MPD a Source #
Applicative MPD Source # |
Instance details Defined in Network.MPD.Core Methods pure :: a -> MPD a Source # (<*>) :: MPD (a -> b) -> MPD a -> MPD b Source # liftA2 :: (a -> b -> c) -> MPD a -> MPD b -> MPD c Source # (*>) :: MPD a -> MPD b -> MPD b Source # (<*) :: MPD a -> MPD b -> MPD a Source #
Functor MPD Source # |
Instance details Defined in Network.MPD.Core Methods fmap :: (a -> b) -> MPD a -> MPD b Source # (<$) :: a -> MPD b -> MPD a Source #
Monad MPD Source # |
Instance details Defined in Network.MPD.Core Methods (>>=) :: MPD a -> (a -> MPD b) -> MPD b Source # (>>) :: MPD a -> MPD b -> MPD b Source # return :: a -> MPD a Source #
MonadMPD MPD Source # |
Instance details Defined in Network.MPD.Core Methods open :: MPD () Source # close :: MPD () Source # send :: String -> MPD [ByteString] Source # getPassword :: MPD Password Source # setPassword :: Password -> MPD () Source # getVersion :: MPD (Int, Int, Int) Source #
MonadError MPDError MPD Source # |
Instance details Defined in Network.MPD.Core Methods throwError :: MPDError -> MPD a Source # catchError :: MPD a -> (MPDError -> MPD a) -> MPD a Source #

data MPDError Source #

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

Constructors

NoMPD | MPD not responding
ConnectionError IOException | An error occurred while talking to MPD.
Unexpected String | MPD returned an unexpected response. This is a bug, either in the library or in MPD itself.
Custom String | Used for misc. errors
ACK ACKType String | ACK type and a message from the server

#### Instances

Instances details

Exception MPDError Source # |
Instance details Defined in Network.MPD.Core.Error Methods toException :: MPDError -> SomeException Source # fromException :: SomeException -> Maybe MPDError Source # displayException :: MPDError -> String Source # backtraceDesired :: MPDError -> Bool Source #
Show MPDError Source # |
Instance details Defined in Network.MPD.Core.Error Methods showsPrec :: Int -> MPDError -> ShowS Source # show :: MPDError -> String Source # showList :: [MPDError] -> ShowS Source #
Eq MPDError Source # |
Instance details Defined in Network.MPD.Core.Error Methods (==) :: MPDError -> MPDError -> Bool Source # (/=) :: MPDError -> MPDError -> Bool Source #
MonadError MPDError MPD Source # |
Instance details Defined in Network.MPD.Core Methods throwError :: MPDError -> MPD a Source # catchError :: MPD a -> (MPDError -> MPD a) -> MPD a Source #

data ACKType Source #

Represents various MPD errors (aka. ACKs).

Constructors

InvalidArgument | Invalid argument passed (ACK 2)
InvalidPassword | Invalid password supplied (ACK 3)
Auth | Authentication required (ACK 4)
UnknownCommand | Unknown command (ACK 5)
FileNotFound | File or directory not found ACK 50)
PlaylistMax | Playlist at maximum size (ACK 51)
System | A system error (ACK 52)
PlaylistLoad | Playlist loading failed (ACK 53)
Busy | Update already running (ACK 54)
NotPlaying | An operation requiring playback got interrupted (ACK 55)
FileExists | File already exists (ACK 56)
UnknownACK | An unknown ACK (aka. bug)

#### Instances

Instances details

Eq ACKType Source # |
Instance details Defined in Network.MPD.Core.Error Methods (==) :: ACKType -> ACKType -> Bool Source # (/=) :: ACKType -> ACKType -> Bool Source #

type Response = Either MPDError Source #

A response is either an `MPDError` or some result.

type Host = String Source #

type Port = Integer Source #

type Password = String Source #

# Connections

withMPD :: MPD a -> IO (Response a) Source #

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_ Source #

Arguments

:: Maybe String | optional override for MPD_HOST
-> Maybe String | optional override for MPD_PORT
-> 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.

withMPDEx :: Host -> Port -> Password -> MPD a -> IO (Response a) Source #

The most configurable API for running an MPD action.

random :: MonadMPD m => Bool -> m () Source #

Set random playing.

count :: MonadMPD m => Query -> m Count Source #

Count the number of entries matching a query.

swap :: MonadMPD m => Position -> Position -> m () Source #

Swap the positions of two songs.

repeat :: MonadMPD m => Bool -> m () Source #

Set repeating.

list Source #

Arguments

:: MonadMPD m |
=> Metadata | Metadata to list
-> Query |
-> m [Value] |

List all tags of the specified type of songs that that satisfy the query.

Since: 0.10.0.0

find :: MonadMPD m => Query -> m [Song] Source #

Search the database for entries exactly matching a query.

delete :: MonadMPD m => Position -> m () Source #

Remove a song from the current playlist.

seek :: MonadMPD m => Position -> FractionalSeconds -> m () Source #

Seek to some point in a song.

update :: MonadMPD m => Maybe Path -> m Integer Source #

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.

def :: Default a => a #

data Metadata Source #

Available metadata types/scope modifiers, used for searching the database for entries with certain metadata values.

Constructors

Artist |
ArtistSort |
Album |
AlbumSort | Since: 0.10.0.0
AlbumArtist |
AlbumArtistSort |
Title |
Track |
Name |
Genre |
Date |
OriginalDate | Since: 0.10.0.0
Composer |
Performer |
Conductor | Since: 0.10.0.0
Work | Since: 0.10.0.0
Grouping | Since: 0.10.0.0
Comment |
Disc |
Label | Since: 0.10.0.0
MUSICBRAINZ_ARTISTID |
MUSICBRAINZ_ALBUMID |
MUSICBRAINZ_ALBUMARTISTID |
MUSICBRAINZ_TRACKID |
MUSICBRAINZ_RELEASETRACKID |
MUSICBRAINZ_WORKID | Since: 0.10.0.0

#### Instances

Instances details

Bounded Metadata Source # |
Instance details Defined in Network.MPD.Commands.Types Methods minBound :: Metadata Source # maxBound :: Metadata Source #
Enum Metadata Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

succ :: Metadata -> Metadata Source #

pred :: Metadata -> Metadata Source #

toEnum :: Int -> Metadata Source #

fromEnum :: Metadata -> Int Source #

enumFrom :: Metadata -> [Metadata] Source #

enumFromThen :: Metadata -> Metadata -> [Metadata] Source #

enumFromTo :: Metadata -> Metadata -> [Metadata] Source #

enumFromThenTo :: Metadata -> Metadata -> Metadata -> [Metadata] Source #

Show Metadata Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Metadata -> ShowS Source # show :: Metadata -> String Source # showList :: [Metadata] -> ShowS Source #
Eq Metadata Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Metadata -> Metadata -> Bool Source # (/=) :: Metadata -> Metadata -> Bool Source #
Ord Metadata Source # |
Instance details Defined in Network.MPD.Commands.Types Methods compare :: Metadata -> Metadata -> Ordering Source # (<) :: Metadata -> Metadata -> Bool Source # (<=) :: Metadata -> Metadata -> Bool Source # (>) :: Metadata -> Metadata -> Bool Source # (>=) :: Metadata -> Metadata -> Bool Source # max :: Metadata -> Metadata -> Metadata Source # min :: Metadata -> Metadata -> Metadata Source #

prio :: MonadMPD m => Priority -> Range -> m () Source #

Set the priority of the specified songs.

Since: 0.10.0.0

clear :: MonadMPD m => m () Source #

Clear the current playlist.

add :: MonadMPD m => Path -> m () Source #

Add a song (or a whole directory) to the current playlist.

data Range Source #

A range of songs.

Constructors

Range Position Position | Start and end of the range, not including the end position.
Start Position | From the given position until the end of the playlist.

#### Instances

Instances details

Show Range Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Range -> ShowS Source # show :: Range -> String Source # showList :: [Range] -> ShowS Source #
Eq Range Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Range -> Range -> Bool Source # (/=) :: Range -> Range -> Bool Source #

class ToString a where Source #

A type class for values that can be converted to `String`s.

Methods

toString :: a -> String Source #

Convert given value to `String`.

toText :: a -> Text Source #

Convert given value to `Text`.

toUtf8 :: a -> ByteString Source #

Convert given value to a UTF-8 encoded `ByteString`.

#### Instances

Instances details

ToString Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: Path -> String Source # toText :: Path -> Text Source # toUtf8 :: Path -> ByteString Source #
ToString PlaylistName Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: PlaylistName -> String Source # toText :: PlaylistName -> Text Source # toUtf8 :: PlaylistName -> ByteString Source #
ToString Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: Value -> String Source # toText :: Value -> Text Source # toUtf8 :: Value -> ByteString Source #

rename Source #

Arguments

:: MonadMPD m |
=> PlaylistName | Original playlist
-> PlaylistName | New playlist name
-> m () |

Rename an existing playlist.

data PlaybackState Source #

Represents the different playback states.

Constructors

Playing |
Stopped |
Paused |

#### Instances

Instances details

Bounded PlaybackState Source # |
Instance details Defined in Network.MPD.Commands.Types Methods minBound :: PlaybackState Source # maxBound :: PlaybackState Source #
Enum PlaybackState Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

succ :: PlaybackState -> PlaybackState Source #

pred :: PlaybackState -> PlaybackState Source #

toEnum :: Int -> PlaybackState Source #

fromEnum :: PlaybackState -> Int Source #

enumFrom :: PlaybackState -> [PlaybackState] Source #

enumFromThen :: PlaybackState -> PlaybackState -> [PlaybackState] Source #

enumFromTo :: PlaybackState -> PlaybackState -> [PlaybackState] Source #

enumFromThenTo :: PlaybackState -> PlaybackState -> PlaybackState -> [PlaybackState] Source #

Show PlaybackState Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> PlaybackState -> ShowS Source # show :: PlaybackState -> String Source # showList :: [PlaybackState] -> ShowS Source #
Eq PlaybackState Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: PlaybackState -> PlaybackState -> Bool Source # (/=) :: PlaybackState -> PlaybackState -> Bool Source #
Ord PlaybackState Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

compare :: PlaybackState -> PlaybackState -> Ordering Source #

(<) :: PlaybackState -> PlaybackState -> Bool Source #

(<=) :: PlaybackState -> PlaybackState -> Bool Source #

(>) :: PlaybackState -> PlaybackState -> Bool Source #

(>=) :: PlaybackState -> PlaybackState -> Bool Source #

max :: PlaybackState -> PlaybackState -> PlaybackState Source #

min :: PlaybackState -> PlaybackState -> PlaybackState Source #

data Status Source #

Container for MPD status.

Constructors

Status |

Fields

- stState :: PlaybackState
- stVolume :: Maybe Volume

  A percentage (0-100).

  `Nothing` indicates that the output lacks mixer support.

- stRepeat :: Bool
- stRandom :: Bool
- stPlaylistVersion :: Integer

  A value that is incremented by the server every time the playlist changes.

- stPlaylistLength :: Integer

  The number of items in the current playlist.

- stSongPos :: Maybe Position

  Current song's position in the playlist.

- stSongID :: Maybe Id

  Current song's playlist ID.

- stNextSongPos :: Maybe Position

  Next song's position in the playlist.

- stNextSongID :: Maybe Id

  Next song's playlist ID.

- stTime :: Maybe (FractionalSeconds, FractionalSeconds)

  Time elapsed/total time of playing song (if any).

- stBitrate :: Maybe Int

  Bitrate (in kilobytes per second) of playing song (if any).

- stXFadeWidth :: Seconds

  Crossfade time.

- stMixRampdB :: Double

  MixRamp threshold in dB

- stMixRampDelay :: Double

  MixRamp extra delay in seconds

- stAudio :: (Int, Int, Int)

  Samplerate/bits/channels for the chosen output device (see mpd.conf).

- stUpdatingDb :: Maybe Integer

  Job ID of currently running update (if any).

- stSingle :: Bool

  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.

- stConsume :: Bool

  If True, a song will be removed after it has been played.

- stError :: Maybe String

  Last error message (if any).

- stPartition :: String

  The name of MPD partition.

#### Instances

Instances details

Default Status Source # |
Instance details Defined in Network.MPD.Commands.Types Methods def :: Status #
Show Status Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
Eq Status Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #

type ChannelName = String Source #

type MessageText = String Source #

subscribe :: MonadMPD m => ChannelName -> m () Source #

unsubscribe :: MonadMPD m => ChannelName -> m () Source #

channels :: MonadMPD m => m [ChannelName] Source #

readMessages :: MonadMPD m => m [(ChannelName, MessageText)] Source #

sendMessage :: MonadMPD m => ChannelName -> MessageText -> m () Source #

password :: MonadMPD m => String -> m () Source #

Send password to server to authenticate session. Password is sent as plain text.

ping :: MonadMPD m => m () Source #

Check that the server is still responding.

addId :: MonadMPD m => Path -> Maybe Position -> m Id Source #

Like `add`, but returns a playlist id.

deleteRange :: MonadMPD m => Range -> m () Source #

Remove a range of songs from the current playlist.

Since: 0.10.0.0

deleteId :: MonadMPD m => Id -> m () Source #

Remove a song from the current playlist.

move :: MonadMPD m => Position -> Position -> m () Source #

Move a song to a given position in the current playlist.

moveId :: MonadMPD m => Id -> Position -> m () Source #

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).

moveRange :: MonadMPD m => Range -> Position -> m () Source #

Move a range of songs to a given position in the current playlist.

Since: 0.10.0.0

playlistFind :: MonadMPD m => Query -> m [Song] Source #

Search for songs in the current playlist with strict matching.

playlistInfo :: MonadMPD m => Maybe Position -> m [Song] Source #

Retrieve metadata for songs in the current playlist.

playlistInfoRange :: MonadMPD m => Maybe Range -> m [Song] Source #

Like `playlistInfo` but can restrict to a range of songs.

Since: 0.10.0.0

playlistId :: MonadMPD m => Maybe Id -> m [Song] Source #

Displays a list of songs in the playlist. If id is specified, only its info is returned.

playlistSearch :: MonadMPD m => Query -> m [Song] Source #

Search case-insensitively with partial matches for songs in the current playlist.

plChanges :: MonadMPD m => Integer -> m [Song] Source #

Retrieve a list of changed songs currently in the playlist since a given playlist version.

plChangesPosId :: MonadMPD m => Integer -> m [(Position, Id)] Source #

Like `plChanges` but only returns positions and ids.

prioId :: MonadMPD m => Priority -> Id -> m () Source #

Set priority by song id.

shuffle :: MonadMPD m => Maybe Range -> m () Source #

Shuffle the current playlist. Optionally restrict to a range of songs.

Since: 0.10.0.0

swapId :: MonadMPD m => Id -> Id -> m () Source #

Swap the positions of two songs (Id version)

addTagId :: MonadMPD m => Id -> Metadata -> Value -> m () Source #

Add tag to (remote) song.

clearTagId :: MonadMPD m => Id -> Metadata -> m () Source #

Remove tag from (remote) song.

rangeId :: MonadMPD m => Id -> (Maybe Double, Maybe Double) -> m () Source #

Specify portion of song that shall be played. Both ends of the range are optional; omitting both plays everything.

data Query Source #

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"

#### Instances

Instances details

Monoid Query Source # |
Instance details Defined in Network.MPD.Commands.Query Methods mempty :: Query Source # mappend :: Query -> Query -> Query Source # mconcat :: [Query] -> Query Source #
Semigroup Query Source # |
Instance details Defined in Network.MPD.Commands.Query Methods (<>) :: Query -> Query -> Query Source # sconcat :: NonEmpty Query -> Query Source # stimes :: Integral b => b -> Query -> Query Source #
Show Query Source # |
Instance details Defined in Network.MPD.Commands.Query Methods showsPrec :: Int -> Query -> ShowS Source # show :: Query -> String Source # showList :: [Query] -> ShowS Source #

findAdd :: MonadMPD m => Query -> m () Source #

Adds songs matching a query to the current playlist.

listAll :: MonadMPD m => Path -> m [Path] Source #

List the songs (without metadata) in a database directory recursively.

listAllInfo :: MonadMPD m => Path -> m [LsResult] Source #

Recursive `lsInfo`.

lsInfo :: MonadMPD m => Path -> m [LsResult] Source #

Non-recursively list the contents of a database directory.

readComments :: MonadMPD m => Path -> m [(String, String)] Source #

Read comments from file at path.

search :: MonadMPD m => Query -> m [Song] Source #

Search the database using case insensitive matching.

searchAdd :: MonadMPD m => Query -> m () Source #

Like `search` but adds the results to the current playlist.

Since: 0.10.0.0

searchAddPl :: MonadMPD m => PlaylistName -> Query -> m () Source #

Like `searchAdd` but adds results to the named playlist.

Since: 0.10.0.0

rescan :: MonadMPD m => Maybe Path -> m Integer Source #

Like `update` but also rescans unmodified files.

mount :: MonadMPD m => String -> String -> m () Source #

unmount :: MonadMPD m => String -> m () Source #

listMounts :: MonadMPD m => m [(String, String)] Source #

listNeighbors :: MonadMPD m => m [(String, String)] Source #

disableOutput :: MonadMPD m => Int -> m () Source #

Turn off an output device.

enableOutput :: MonadMPD m => Int -> m () Source #

Turn on an output device.

toggleOutput :: MonadMPD m => Int -> m () Source #

Toggle output device.

outputs :: MonadMPD m => m [Device] Source #

Retrieve information for all output devices.

next :: MonadMPD m => m () Source #

Play the next song.

pause :: MonadMPD m => Bool -> m () Source #

Pauses playback on True, resumes on False.

toggle :: MonadMPD m => m () Source #

Toggles play/pause. Plays if stopped.

Since: 0.10.0.0

play :: MonadMPD m => Maybe Position -> m () Source #

Begin/continue playing.

playId :: MonadMPD m => Id -> m () Source #

Play a file with given id.

previous :: MonadMPD m => m () Source #

Play the previous song.

seekId :: MonadMPD m => Id -> FractionalSeconds -> m () Source #

Seek to some point in a song (id version)

seekCur :: MonadMPD m => Bool -> FractionalSeconds -> m () Source #

Seek to some point in the current song. Absolute time for True in the frist argument, relative time for False.

Since: 0.9.2.0

stop :: MonadMPD m => m () Source #

Stop playing.

consume :: MonadMPD m => Bool -> m () Source #

Set consume mode

crossfade :: MonadMPD m => Seconds -> m () Source #

Set crossfading between songs.

setVolume :: MonadMPD m => Volume -> m () Source #

Set the volume.

single :: MonadMPD m => Bool -> m () Source #

Set single mode

replayGainMode :: MonadMPD m => ReplayGainMode -> m () Source #

Set the replay gain mode.

replayGainStatus :: MonadMPD m => m [(String, String)] Source #

Get the replay gain options.

commands :: MonadMPD m => m [String] Source #

Retrieve a list of available commands.

notCommands :: MonadMPD m => m [String] Source #

Retrieve a list of unavailable (due to access restrictions) commands.

tagTypes :: MonadMPD m => m [String] Source #

Retrieve a list of available song metadata.

urlHandlers :: MonadMPD m => m [String] Source #

Retrieve a list of supported urlhandlers.

decoders :: MonadMPD m => m [(String, [(String, String)])] Source #

Retreive a list of decoder plugins with associated suffix and mime types.

config :: MonadMPD m => m [(String, String)] Source #

Retrieve configuration keys and values.

clearError :: MonadMPD m => m () Source #

Clear the current error message in status.

currentSong :: MonadMPD m => m (Maybe Song) Source #

Get the currently playing song.

idle :: MonadMPD m => [Subsystem] -> m [Subsystem] Source #

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`.

noidle :: MonadMPD m => m () Source #

Cancel `idle`.

status :: MonadMPD m => m Status Source #

Get the server's status.

stats :: MonadMPD m => m Stats Source #

Get server statistics.

stickerGet Source #

Arguments

:: MonadMPD m |
=> ObjectType |
-> String | Object URI
-> String | Sticker name
-> m [String] |

Reads a sticker value for the specified object.

stickerSet Source #

Arguments

:: MonadMPD m |
=> ObjectType |
-> String | Object URI
-> String | Sticker name
-> String | Sticker value
-> m () |

Adds a sticker value to the specified object.

stickerDelete Source #

Arguments

:: MonadMPD m |
=> ObjectType |
-> String | Object URI
-> String | Sticker name
-> m () |

Delete a sticker value from the specified object.

stickerList Source #

Arguments

:: MonadMPD m |
=> ObjectType |
-> String | Object URI
-> m [(String, String)] | Sticker name/sticker value

Lists the stickers for the specified object.

stickerFind Source #

Arguments

:: MonadMPD m |
=> ObjectType |
-> String | Path
-> String | Sticker name
-> m [(String, String)] | URI/sticker value

Searches the sticker database for stickers with the specified name, below the specified path.

listPlaylist :: MonadMPD m => PlaylistName -> m [Path] Source #

Retrieve a list of files in a given playlist.

listPlaylistInfo :: MonadMPD m => PlaylistName -> m [Song] Source #

Retrieve metadata for files in a given playlist.

listPlaylists :: MonadMPD m => m [PlaylistName] Source #

Retreive a list of stored playlists.

load :: MonadMPD m => PlaylistName -> m () Source #

Load an existing playlist.

playlistAdd :: MonadMPD m => PlaylistName -> Path -> m () Source #

Add a song (or a whole directory) to a stored playlist. Will create a new playlist if the one specified does not already exist.

playlistClear :: MonadMPD m => PlaylistName -> m () Source #

Clear a playlist. If the specified playlist does not exist, it will be created.

playlistDelete :: MonadMPD m => PlaylistName -> Position -> m () Source #

Remove a song from a playlist.

playlistMove :: MonadMPD m => PlaylistName -> Id -> Position -> m () Source #

Move a song to a given position in the playlist specified.

rm :: MonadMPD m => PlaylistName -> m () Source #

Delete existing playlist.

save :: MonadMPD m => PlaylistName -> m () Source #

Save the current playlist.

type Artist = Value Source #

type Album = Value Source #

type Title = Value Source #

newtype PlaylistName Source #

Used for commands which require a playlist name. If empty, the current playlist is used.

Constructors

PlaylistName ByteString |

#### Instances

Instances details

IsString PlaylistName Source # |
Instance details Defined in Network.MPD.Commands.Types Methods fromString :: String -> PlaylistName Source #
Show PlaylistName Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> PlaylistName -> ShowS Source # show :: PlaylistName -> String Source # showList :: [PlaylistName] -> ShowS Source #
Eq PlaylistName Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: PlaylistName -> PlaylistName -> Bool Source # (/=) :: PlaylistName -> PlaylistName -> Bool Source #
Ord PlaylistName Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

compare :: PlaylistName -> PlaylistName -> Ordering Source #

(<) :: PlaylistName -> PlaylistName -> Bool Source #

(<=) :: PlaylistName -> PlaylistName -> Bool Source #

(>) :: PlaylistName -> PlaylistName -> Bool Source #

(>=) :: PlaylistName -> PlaylistName -> Bool Source #

max :: PlaylistName -> PlaylistName -> PlaylistName Source #

min :: PlaylistName -> PlaylistName -> PlaylistName Source #

ToString PlaylistName Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: PlaylistName -> String Source # toText :: PlaylistName -> Text Source # toUtf8 :: PlaylistName -> ByteString Source #

data Path Source #

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

#### Instances

Instances details

IsString Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods fromString :: String -> Path Source #
Show Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Path -> ShowS Source # show :: Path -> String Source # showList :: [Path] -> ShowS Source #
Eq Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Path -> Path -> Bool Source # (/=) :: Path -> Path -> Bool Source #
Ord Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods compare :: Path -> Path -> Ordering Source # (<) :: Path -> Path -> Bool Source # (<=) :: Path -> Path -> Bool Source # (>) :: Path -> Path -> Bool Source # (>=) :: Path -> Path -> Bool Source # max :: Path -> Path -> Path Source # min :: Path -> Path -> Path Source #
ToString Path Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: Path -> String Source # toText :: Path -> Text Source # toUtf8 :: Path -> ByteString Source #

data Value Source #

A metadata value.

#### Instances

Instances details

IsString Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods fromString :: String -> Value Source #
Show Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Value -> ShowS Source # show :: Value -> String Source # showList :: [Value] -> ShowS Source #
Eq Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Value -> Value -> Bool Source # (/=) :: Value -> Value -> Bool Source #
Ord Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods compare :: Value -> Value -> Ordering Source # (<) :: Value -> Value -> Bool Source # (<=) :: Value -> Value -> Bool Source # (>) :: Value -> Value -> Bool Source # (>=) :: Value -> Value -> Bool Source # max :: Value -> Value -> Value Source # min :: Value -> Value -> Value Source #
ToString Value Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toString :: Value -> String Source # toText :: Value -> Text Source # toUtf8 :: Value -> ByteString Source #

data ObjectType Source #

Object types.

Constructors

SongObj |

#### Instances

Instances details

Show ObjectType Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> ObjectType -> ShowS Source # show :: ObjectType -> String Source # showList :: [ObjectType] -> ShowS Source #
Eq ObjectType Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: ObjectType -> ObjectType -> Bool Source # (/=) :: ObjectType -> ObjectType -> Bool Source #

type Seconds = Integer Source #

type FractionalSeconds = Double Source #

type Decibels = Integer Source #

data Subsystem Source #

Represents the various MPD subsystems.

Constructors

DatabaseS | The song database
UpdateS | Database updates
StoredPlaylistS | Stored playlists
PlaylistS | The current playlist
PlayerS | The player
MixerS | The volume mixer
OutputS | Audio outputs
OptionsS | Playback options
PartitionS | Partition changes Since: 0.10.0.0
StickerS | Sticker database
SubscriptionS | Subscription
MessageS | Message on subscribed channel
NeighborS | finding or losing a neighbor Since: 0.10.0.0
MountS | Mount list changes Since: 0.10.0.0

#### Instances

Instances details

Bounded Subsystem Source # |
Instance details Defined in Network.MPD.Commands.Types Methods minBound :: Subsystem Source # maxBound :: Subsystem Source #
Enum Subsystem Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

succ :: Subsystem -> Subsystem Source #

pred :: Subsystem -> Subsystem Source #

toEnum :: Int -> Subsystem Source #

fromEnum :: Subsystem -> Int Source #

enumFrom :: Subsystem -> [Subsystem] Source #

enumFromThen :: Subsystem -> Subsystem -> [Subsystem] Source #

enumFromTo :: Subsystem -> Subsystem -> [Subsystem] Source #

enumFromThenTo :: Subsystem -> Subsystem -> Subsystem -> [Subsystem] Source #

Show Subsystem Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Subsystem -> ShowS Source # show :: Subsystem -> String Source # showList :: [Subsystem] -> ShowS Source #
Eq Subsystem Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Subsystem -> Subsystem -> Bool Source # (/=) :: Subsystem -> Subsystem -> Bool Source #
Ord Subsystem Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

compare :: Subsystem -> Subsystem -> Ordering Source #

(<) :: Subsystem -> Subsystem -> Bool Source #

(<=) :: Subsystem -> Subsystem -> Bool Source #

(>) :: Subsystem -> Subsystem -> Bool Source #

(>=) :: Subsystem -> Subsystem -> Bool Source #

max :: Subsystem -> Subsystem -> Subsystem Source #

min :: Subsystem -> Subsystem -> Subsystem Source #

data ReplayGainMode Source #

Constructors

Off | Disable replay gain
TrackMode | Per track mode
AlbumMode | Per album mode
AutoMode | Auto mode Since: 0.10.0.0

#### Instances

Instances details

Bounded ReplayGainMode Source # |
Instance details Defined in Network.MPD.Commands.Types Methods minBound :: ReplayGainMode Source # maxBound :: ReplayGainMode Source #
Enum ReplayGainMode Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

succ :: ReplayGainMode -> ReplayGainMode Source #

pred :: ReplayGainMode -> ReplayGainMode Source #

toEnum :: Int -> ReplayGainMode Source #

fromEnum :: ReplayGainMode -> Int Source #

enumFrom :: ReplayGainMode -> [ReplayGainMode] Source #

enumFromThen :: ReplayGainMode -> ReplayGainMode -> [ReplayGainMode] Source #

enumFromTo :: ReplayGainMode -> ReplayGainMode -> [ReplayGainMode] Source #

enumFromThenTo :: ReplayGainMode -> ReplayGainMode -> ReplayGainMode -> [ReplayGainMode] Source #

Show ReplayGainMode Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> ReplayGainMode -> ShowS Source # show :: ReplayGainMode -> String Source # showList :: [ReplayGainMode] -> ShowS Source #
Eq ReplayGainMode Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: ReplayGainMode -> ReplayGainMode -> Bool Source # (/=) :: ReplayGainMode -> ReplayGainMode -> Bool Source #
Ord ReplayGainMode Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

compare :: ReplayGainMode -> ReplayGainMode -> Ordering Source #

(<) :: ReplayGainMode -> ReplayGainMode -> Bool Source #

(<=) :: ReplayGainMode -> ReplayGainMode -> Bool Source #

(>) :: ReplayGainMode -> ReplayGainMode -> Bool Source #

(>=) :: ReplayGainMode -> ReplayGainMode -> Bool Source #

max :: ReplayGainMode -> ReplayGainMode -> ReplayGainMode Source #

min :: ReplayGainMode -> ReplayGainMode -> ReplayGainMode Source #

data Count Source #

Represents the result of running `count`.

Constructors

Count |

Fields

- cSongs :: Integer

  Number of songs matching the query

- cPlaytime :: Seconds

  Total play time of matching songs

#### Instances

Instances details

Default Count Source # |
Instance details Defined in Network.MPD.Commands.Types Methods def :: Count #
Show Count Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Count -> ShowS Source # show :: Count -> String Source # showList :: [Count] -> ShowS Source #
Eq Count Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Count -> Count -> Bool Source # (/=) :: Count -> Count -> Bool Source #

data LsResult Source #

Result of the lsInfo operation

Constructors

LsDirectory Path | Directory
LsSong Song | Song
LsPlaylist PlaylistName | Playlist

#### Instances

Instances details

Show LsResult Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> LsResult -> ShowS Source # show :: LsResult -> String Source # showList :: [LsResult] -> ShowS Source #
Eq LsResult Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: LsResult -> LsResult -> Bool Source # (/=) :: LsResult -> LsResult -> Bool Source #

data Device Source #

Represents an output device.

Constructors

Device |

Fields

- dOutputID :: Int

  Output's ID number

- dOutputName :: String

  Output's name as defined in the MPD configuration file

- dOutputEnabled :: Bool

#### Instances

Instances details

Default Device Source # |
Instance details Defined in Network.MPD.Commands.Types Methods def :: Device #
Show Device Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Device -> ShowS Source # show :: Device -> String Source # showList :: [Device] -> ShowS Source #
Eq Device Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Device -> Device -> Bool Source # (/=) :: Device -> Device -> Bool Source #

data Song Source #

Represents a single song item.

Constructors

Song |

Fields

- sgFilePath :: Path
- sgTags :: Map Metadata [Value]

  Map of available tags (multiple occurrences of one tag type allowed)

- sgLastModified :: Maybe UTCTime

  Last modification date

- sgLength :: Seconds

  Length of the song in seconds

- sgId :: Maybe Id

  Id in playlist

- sgIndex :: Maybe Position

  Position in playlist

#### Instances

Instances details

Show Song Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Song -> ShowS Source # show :: Song -> String Source # showList :: [Song] -> ShowS Source #
Eq Song Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Song -> Song -> Bool Source # (/=) :: Song -> Song -> Bool Source #

newtype Priority Source #

Constructors

Priority Int |

#### Instances

Instances details

Show Priority Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Priority -> ShowS Source # show :: Priority -> String Source # showList :: [Priority] -> ShowS Source #
Eq Priority Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Priority -> Priority -> Bool Source # (/=) :: Priority -> Priority -> Bool Source #

type Position = Int Source #

The position of a song in a playlist.

data Volume Source #

Volume values.

Values of this type are always in the range 0-100.

Arithmetic on volumes has the property that:

    current + new = 100 if current + new > 100

    current - new = 0   if current - new < 0

but `current / 0` still yields a division by zero exception.

#### Instances

Instances details

Bounded Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods minBound :: Volume Source # maxBound :: Volume Source #
Enum Volume Source # |

Instance details

Defined in Network.MPD.Commands.Types

Methods

succ :: Volume -> Volume Source #

pred :: Volume -> Volume Source #

toEnum :: Int -> Volume Source #

fromEnum :: Volume -> Int Source #

enumFrom :: Volume -> [Volume] Source #

enumFromThen :: Volume -> Volume -> [Volume] Source #

enumFromTo :: Volume -> Volume -> [Volume] Source #

enumFromThenTo :: Volume -> Volume -> Volume -> [Volume] Source #

Num Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (+) :: Volume -> Volume -> Volume Source # (-) :: Volume -> Volume -> Volume Source # (*) :: Volume -> Volume -> Volume Source # negate :: Volume -> Volume Source # abs :: Volume -> Volume Source # signum :: Volume -> Volume Source # fromInteger :: Integer -> Volume Source #
Integral Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods quot :: Volume -> Volume -> Volume Source # rem :: Volume -> Volume -> Volume Source # div :: Volume -> Volume -> Volume Source # mod :: Volume -> Volume -> Volume Source # quotRem :: Volume -> Volume -> (Volume, Volume) Source # divMod :: Volume -> Volume -> (Volume, Volume) Source # toInteger :: Volume -> Integer Source #
Real Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods toRational :: Volume -> Rational Source #
Show Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Volume -> ShowS Source # show :: Volume -> String Source # showList :: [Volume] -> ShowS Source #
Eq Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Volume -> Volume -> Bool Source # (/=) :: Volume -> Volume -> Bool Source #
Ord Volume Source # |
Instance details Defined in Network.MPD.Commands.Types Methods compare :: Volume -> Volume -> Ordering Source # (<) :: Volume -> Volume -> Bool Source # (<=) :: Volume -> Volume -> Bool Source # (>) :: Volume -> Volume -> Bool Source # (>=) :: Volume -> Volume -> Bool Source # max :: Volume -> Volume -> Volume Source # min :: Volume -> Volume -> Volume Source #

newtype Id Source #

Constructors

Id Int |

#### Instances

Instances details

Show Id Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Id -> ShowS Source # show :: Id -> String Source # showList :: [Id] -> ShowS Source #
Eq Id Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Id -> Id -> Bool Source # (/=) :: Id -> Id -> Bool Source #

sgGetTag :: Metadata -> Song -> Maybe [Value] Source #

Get list of specific tag type

sgAddTag :: Metadata -> Value -> Song -> Song Source #

Add metadata tag value.

data Stats Source #

Container for database statistics.

Constructors

Stats |

Fields

- stsArtists :: Integer

  Number of artists.

- stsAlbums :: Integer

  Number of albums.

- stsSongs :: Integer

  Number of songs.

- stsUptime :: Seconds

  Daemon uptime in seconds.

- stsPlaytime :: Seconds

  Total playing time.

- stsDbPlaytime :: Seconds

  Total play time of all the songs in the database.

- stsDbUpdate :: Integer

  Last database update in UNIX time.

#### Instances

Instances details

Default Stats Source # |
Instance details Defined in Network.MPD.Commands.Types Methods def :: Stats #
Show Stats Source # |
Instance details Defined in Network.MPD.Commands.Types Methods showsPrec :: Int -> Stats -> ShowS Source # show :: Stats -> String Source # showList :: [Stats] -> ShowS Source #
Eq Stats Source # |
Instance details Defined in Network.MPD.Commands.Types Methods (==) :: Stats -> Stats -> Bool Source # (/=) :: Stats -> Stats -> Bool Source #

(=?) :: Metadata -> Value -> Query Source #

Create a query matching a tag with a value.

(/=?) :: Metadata -> Value -> Query Source #

Create a query matching a tag with anything but a value.

Since MPD 0.21.

Since: 0.9.3.0

(%?) :: Metadata -> Value -> Query Source #

Create a query for a tag containing a value.

Since MPD 0.21.

Since: 0.9.3.0

(~?) :: Metadata -> Value -> Query Source #

Create a query matching a tag with regexp.

Since MPD 0.21.

Since: 0.9.3.0

(/~?) :: Metadata -> Value -> Query Source #

Create a query matching a tag with anything but a regexp.

Since MPD 0.21.

Since: 0.9.3.0

qNot :: Query -> Query Source #

Negate a Query.

Since MPD 0.21.

Since: 0.9.3.0

qModSince :: UTCTime -> Query Source #

Create a query for songs modified since a date.

Since MPD 0.21.

Since: 0.9.3.0

qFile :: Path -> Query Source #

Create a query for the full song URI relative to the music directory.

Since MPD 0.21.

Since: 0.9.3.0

qBase :: Path -> Query Source #

Limit the query to the given directory, relative to the music directory.

Since MPD 0.21.

Since: 0.9.3.0

anything :: Query Source #

An empty query. Matches anything.

playlist :: MonadMPD m => m [(Position, Path)] Source #

Warning: this is deprecated; please use `playlistInfo` instead.

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.