{-# LANGUAGE OverloadedStrings #-}

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

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

Audio output devices.
-}

module Network.MPD.Commands.Output
    ( disableOutput
    , enableOutput
    , toggleOutput
    , outputs
    ) where

import qualified Network.MPD.Applicative.Internal as A
import qualified Network.MPD.Applicative.Output as A
import           Network.MPD.Core
import           Network.MPD.Commands.Types

-- | Turn off an output device.
disableOutput :: MonadMPD m => Int -> m ()
disableOutput :: Int -> m ()
disableOutput = Command () -> m ()
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand (Command () -> m ()) -> (Int -> Command ()) -> Int -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Command ()
A.disableOutput

-- | Turn on an output device.
enableOutput :: MonadMPD m => Int -> m ()
enableOutput :: Int -> m ()
enableOutput = Command () -> m ()
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand (Command () -> m ()) -> (Int -> Command ()) -> Int -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Command ()
A.enableOutput

-- | Toggle output device.
toggleOutput :: MonadMPD m => Int -> m ()
toggleOutput :: Int -> m ()
toggleOutput = Command () -> m ()
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand (Command () -> m ()) -> (Int -> Command ()) -> Int -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Command ()
A.toggleOutput

-- | Retrieve information for all output devices.
outputs :: MonadMPD m => m [Device]
outputs :: m [Device]
outputs = Command [Device] -> m [Device]
forall (m :: * -> *) a. MonadMPD m => Command a -> m a
A.runCommand Command [Device]
A.outputs