monky-2.2.0.0: A system state collecting library and application

Maintainerongy
Stabilitytesting
PortabilityLinux
Safe HaskellNone
LanguageHaskell2010

Monky.MPD

Description

This module creates a persistant connection to an mpd server and allows to query information or react to events waited for with MPDs idle

Synopsis

Documentation

data MPDSocket Source #

A type safe socket for this module, basically a handle

data State Source #

The current state of the MPD player submodule

Constructors

Playing

Playing

Stopped

Stopped

Paused

Paused

Instances

Eq State Source # 

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

Show State Source # 

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

data TagCollection Source #

Collection of tags MPD supports

Constructors

TagCollection 

Fields

data Status Source #

Haskell type for the data returned by MPDs status command

Instances

getMPDStatus :: MPDSocket -> IO (Either String Status) Source #

Get the current status or an error from the MPD server

getMPDSong :: MPDSocket -> IO (Either String SongInfo) Source #

Get the information about the song currently beeing player from the MPD server

getMPDSocket Source #

Arguments

:: String

The host the server is on

-> String

The port the server listens on

-> IO (Either String MPDSocket) 

Get a new MPDSocket

closeMPDSocket :: MPDSocket -> IO () Source #

Close the MPDSocket when it is no longer required

getMPDFd :: MPDSocket -> IO Fd Source #

Get the raw Fd from the MPDSocket for eventing api

readOk :: MPDSocket -> IO (Either String ()) Source #

Get the OK sent by mpd after idle out of the pipe

goIdle Source #

Arguments

:: MPDSocket 
-> String

The string that should be send with idle (list of subsystems)

-> IO (Either String ()) 

Go into MPDs idle mode, this does return, but MPD wont time us out and will notify us if something happens

doQuery :: MPDSocket -> String -> ExceptT String IO [Text] Source #

Send a query to the MPD server and return a list of answers (line by line)

This does not filter out errors, error checking has to be done by the user. This does filter out the last OK though