toAssocList ) $ getResponse1 ( "addid" p pos ) - | Like 'add_' but returns a list of the files added. addId :: MonadMPD m => Path -> Maybe Integer - ^ Optional playlist position -> m Id addId p pos = liftM ( parse parseNum Id ( Id 0 ). | Like 'add', but returns a playlist id. stop :: MonadMPD m => m () stop = getResponse_ "stop" - The current playlist - This might do better to throw an exception than silently return 0. seek :: MonadMPD m => Int -> Seconds -> m () seek pos time = getResponse_ ( "seek" pos time ) - | Seek to some point in a song (id version) seekId :: MonadMPD m => Id -> Seconds -> m () seekId id' time = getResponse_ ( "seekid" id' time ) - | Stop playing. previous :: MonadMPD m => m () previous = getResponse_ "previous" - | Seek to some point in a song. playId :: MonadMPD m => Id -> m () playId id' = getResponse_ ( "playid" id' ) - | Play the previous song. play :: MonadMPD m => Maybe Int -> m () play ( Just pos ) = getResponse_ ( "play" pos ) play _ = getResponse_ "play" - | Play a file with given id. pause :: MonadMPD m => Bool -> m () pause = getResponse_. next :: MonadMPD m => m () next = getResponse_ "next" - | Pause playing. replayGainStatus :: MonadMPD m => m replayGainStatus = getResponse "replay_gain_status" - Controlling playback - | Play the next song. ( "replay_gain_mode" ) - | Get the replay gain options. replayGainMode :: MonadMPD m => ReplayGainMode -> m () replayGainMode = getResponse_. ![]() ![]() ( "single" ) - | Set the replay gain mode. ( "setvol" ) - | Set single mode single :: MonadMPD m => Bool -> m () single = getResponse_. setVolume :: MonadMPD m => Int -> m () setVolume = getResponse_. ( "repeat" ) - | Set the volume (0-100 percent). repeat :: MonadMPD m => Bool -> m () repeat = getResponse_. random :: MonadMPD m => Bool -> m () random = getResponse_. crossfade :: MonadMPD m => Seconds -> m () crossfade secs = getResponse_ ( "crossfade" secs ) - | Set random playing. ( "consume" ) - | Set crossfading between songs. status :: MonadMPD m => m Status status = getResponse "status" >= runParser parseStatus - Playback options - | Set consume mode consume :: MonadMPD m => Bool -> m () consume = getResponse_. stats :: MonadMPD m => m Stats stats = getResponse "stats" >= runParser parseStats - | Get the server's status. idle :: MonadMPD m => m idle = mapM ( \ ( "changed", system ) -> case system of "database" -> return DatabaseS "update" -> return UpdateS "stored_playlist" -> return StoredPlaylistS "playlist" -> return PlaylistS "player" -> return PlayerS "mixer" -> return MixerS "output" -> return OutputS "options" -> return OptionsS k -> fail ( "Unknown subsystem: " ++ k ) ) = m () noidle = getResponse_ "noidle" - | Get server statistics. Note that running this command will block until either 'idle' - returns or is cancelled by 'noidle'. toAssocList - | Wait until there is a noteworthy change in one or more of MPD's - susbystems. currentSong :: ( Functor m, MonadMPD m ) => m ( Maybe Song ) currentSong = do cs >= fmap Just. clearError :: MonadMPD m => m () clearError = getResponse_ "clearerror" - | Get the currently playing song. Error ( throwError ) import Prelude hiding ( repeat ) - Querying MPD's status - | Clear the current error message in status. Query, - * Querying MPD's status clearError, currentSong, idle, noidle, status, stats, - * Playback options consume, crossfade, random, repeat, setVolume, single, replayGainMode, replayGainStatus, - * Controlling playback next, pause, play, playId, previous, seek, seekId, stop, - * The current playlist add, add_, addId, clear, delete, deleteId, move, moveId, playlist, playlistId, playlistFind, playlistInfo, playlistSearch, plChanges, plChangesPosId, shuffle, swap, swapId, - * Stored playlist listPlaylist, listPlaylistInfo, listPlaylists, load, playlistAdd, playlistAdd_, playlistClear, playlistDelete, playlistMove, rename, rm, save, - * The music database count, find, findAdd, list, listAll, listAllInfo, lsInfo, search, update, rescan, - * Stickers stickerGet, stickerSet, stickerDelete, stickerList, stickerFind, - * Connection close, kill, password, ping, - * Audio output devices disableOutput, enableOutput, outputs, - * Reflection commands, notCommands, tagTypes, urlHandlers, decoders, ) where import Network. Types, - * Query interface module Network. Commands ( - * Command related data types module Network. Network/MPD/Commands.hs - | Module : - Copyright : (c) Ben Sinclair 2005-2009, Joachim Fasting 2010 - License : LGPL (see LICENSE) - Maintainer : Joachim Fasting - Stability : alpha - Interface to the user commands supported by MPD.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |