hum-0.2.0.0: A TUI MPD client, inspired by ncmpcpp
Copyright(c) Itai Y. Efrat 2020-2021
LicenseGPLv2-or-later (see LICENSE)
MaintainerItai Y. Efrat <itai3397@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Hum.Utils

Description

 
Synopsis

Documentation

(?) :: (a -> b) -> (b -> c) -> a -> c infixl 8 Source #

A backwards function composition operator that I love with my whole heart.

meta :: Text -> Metadata -> Song -> Text Source #

Get comma seperated metedata from tag.

mmeta :: Metadata -> Song -> Maybe Text Source #

Like meta, but returns a Maybe for future use.

secondsToTime :: Integer -> Text Source #

Formats seconds to %M:%S.

deleteHighlightedfromQ :: MonadMPD m => SongList -> m () Source #

Deletes highlighted songs in list from queue, does not rebuild queue.

deleteBulkfromQ :: MonadMPD m => SongList -> m () Source #

Deletes list of songs from queue in MPD, does not rebuild queue.

pasteSongstoQ :: MonadMPD m => SongList -> SongList -> m () Source #

Adds songs to queue under the selected item in it in MPD, does not rebuild queue.

getHighlighted :: (Filterable t, Traversable t) => GenericList n t (e, Highlight) -> GenericList n t (e, Highlight) Source #

Produce list of highligted elements (and selected element) in input list.

listPaste Source #

Arguments

:: (Splittable t, Semigroup (t e)) 
=> GenericList n t e

List pasted into

-> GenericList n t e

Pasted list

-> GenericList n t e 

Paste one list into another under the selected item.

deleteHighlighted Source #

Arguments

:: HumState 
-> Lens' HumState SongList

Lens that leads to list

-> HumState 

Delete highlighted element (and selected element) from list.

yankHighlighted Source #

Arguments

:: HumState 
-> Lens' HumState SongList

Lens that leads to list

-> HumState 

Copy highlighted element (and selected element) from list to Clipboard.

listToggleHighlight :: Traversable t => GenericList n t (e, Highlight) -> GenericList n t (e, Highlight) Source #

Toggle selected items highlight status.

listHighlightSelected :: Traversable t => GenericList n t (e, Highlight) -> GenericList n t (e, Highlight) Source #

Highlight selcted item.

listUnhighlightAll :: Traversable t => GenericList n t (e, Highlight) -> GenericList n t (e, Highlight) Source #

Unhighlight selcted item.

saveListToPl Source #

Arguments

:: MonadMPD m 
=> SongList 
-> Text

Name of playlist to save to

-> m () 

Save list of songs to a stored playlist. If exists does nothing.

overwriteListToPl :: MonadMPD m => SongList -> Text -> m () Source #

Overwrite stored playlist with new song list.

saveEditedPl :: Bool -> HumState -> EventM n HumState Source #

Save edited playlist in Playlist view to disk.

deleteSelectedPl :: Bool -> HumState -> EventM n HumState Source #

Deletes selected playlist in Playlist view from disk.

unusedPlName :: PlaylistName -> IO PlaylistName Source #

Appends smallest number possible to playlist name for it to not be taken. Does nothing if name is untaken.

duplicatePlaylist :: PlaylistName -> HumState -> EventM n HumState Source #

Duplicates stored playlist on disk (with nonconflicting name).

pastePlaylist :: HumState -> EventM n HumState Source #

Pastes playlist in clipboard to disk (with nonconflicting name).

songBulkAddtoQ Source #

Arguments

:: Bool

If true plays first song added

-> Vector Song 
-> HumState 
-> EventM n HumState 

Adds list of songs to queue in MPD. Does not rebuild state.

songBulkAddtoPl Source #

Arguments

:: String

Playlist Name

-> Vector Song

Songs to add

-> HumState 
-> EventM n HumState 

Adds list of songs to stored playlist in MPD. Does not rebuild state.