xmonad-extras-0.17.0: Third party extensions for xmonad with wacky dependencies
CopyrightDaniel Schoepe <daniel.schoepe@googlemail.com>
LicenseBSD3-style (see LICENSE)
MaintainerDaniel Schoepe <daniel.schoepe@googlemail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

XMonad.Prompt.MPD

Contents

Description

This module lets the user select songs and have MPD add/play them by filtering them by user-supplied criteria(E.g. ask for an artist, then for the album..)

Synopsis

Usage

To use this, import the following modules:

import XMonad.Prompt.MPD
import qualified Network.MPD as MPD

You can then use this in a keybinding, to filter first by artist, then by album and add the matching songs:

addMatching MPD.withMPD defaultXPConfig [MPD.Artist, MPD.Album] >> return ()

That way you will first be asked for an artist name, then for an album by that artist etc..

If you need a password to connect to your MPD or need a different host/port, you can pass a partially applied withMPDEx to the function:

addMatching (MPD.withMPDEx "your.host" 4242 "very secret") ..

findMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Song] Source #

Lets the user filter out non-matching songs. For example, if given [Artist, Album] as third argument, this will prompt the user for an artist(with tab-completion), then for an album by that artist and then returns the songs from that album.

findMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Song] Source #

Lets the user filter out non-matching songs. For example, if given [Artist, Album] as third argument, this will prompt the user for an artist(with tab-completion), then for an album by that artist and then returns the songs from that album.

Since: 0.13.2

addMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Int] Source #

Add all selected songs to the playlist if they are not in it.

addMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Int] Source #

Add all selected songs to the playlist if they are not in it.

Since: 0.13.2

addAndPlay :: RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add matching songs and play the first one.

addAndPlayWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add matching songs and play the first one.

Since: 0.13.2

loadPlaylist :: RunMPD -> XPConfig -> X () Source #

Load an existing playlist and play it.

loadPlaylistWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> X () Source #

Load an existing playlist and play it.

Since: 0.13.2

addAndPlayAny :: RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add songs which match all of the given words with regard to any of the metadata.

Since: 0.13.2

pickPlayListItem :: RunMPD -> XPConfig -> X () Source #

Pick a song from the current playlist.

Since: 0.13.2

type RunMPD = forall a. MPD a -> IO (Response a) Source #

Allows the user to supply a custom way to connect to MPD (e.g. partially applied withMPDEx).

findOrAdd :: Song -> MPD Int Source #

Determine playlist position of the song and add it, if it isn't present.