{-# LANGUAGE OverloadedStrings #-}

{- |
Module      : Network.MPD.Commands.Reflection
Copyright   : (c) Ben Sinclair 2005-2009, Joachim Fasting 2012
License     : MIT (see LICENSE)

Maintainer  : joachifm@fastmail.fm
Stability   : stable
Portability : unportable

Reflection.
-}

module Network.MPD.Commands.Reflection
    ( commands
    , notCommands
    , tagTypes
    , urlHandlers
    , decoders
    , config
    ) where

import qualified Network.MPD.Applicative.Internal as A
import qualified Network.MPD.Applicative.Reflection as A
import           Network.MPD.Core

-- | Retrieve a list of available commands.
commands :: MonadMPD m => m [String]
commands :: forall (m :: * -> *). MonadMPD m => m [String]
commands = Command [String] -> m [String]
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand Command [String]
A.commands

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

-- | Retrieve a list of available song metadata.
tagTypes :: MonadMPD m => m [String]
tagTypes :: forall (m :: * -> *). MonadMPD m => m [String]
tagTypes = Command [String] -> m [String]
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand Command [String]
A.tagTypes

-- | Retrieve a list of supported urlhandlers.
urlHandlers :: MonadMPD m => m [String]
urlHandlers :: forall (m :: * -> *). MonadMPD m => m [String]
urlHandlers = Command [String] -> m [String]
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand Command [String]
A.urlHandlers

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

-- | Retrieve configuration keys and values.
config :: MonadMPD m => m [(String, String)]
config :: forall (m :: * -> *). MonadMPD m => m [(String, String)]
config = Command [(String, String)] -> m [(String, String)]
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand Command [(String, String)]
A.config