-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bindings to TagLib, audio meta-data library -- -- Bindings to TagLib, audio meta-data library. @package htaglib @version 0.1.0 -- | Definitions of types used to represent various tags and audio -- properties. module Sound.HTagLib.Type -- | Title tag. data Title -- | Construction of Title type, null bytes are converted to spaces. mkTitle :: String -> Title -- | Convert Title to String. getTitle :: Title -> String -- | Artist tag. data Artist -- | Construction of Artist type, null bytes are converted to -- spaces. mkArtist :: String -> Artist -- | Convert Artist to String. getArtist :: Artist -> String -- | Album tag. data Album -- | Construction of Album type, null bytes are converted to spaces. mkAlbum :: String -> Album -- | Convert Album to String. getAlbum :: Album -> String -- | Comment tag. data Comment -- | Construction of Comment type, null bytes are converted to -- spaces. mkComment :: String -> Comment -- | Convert Comment to String. getComment :: Comment -> String -- | Genre tag. data Genre -- | Construction of Genre type, null bytes are converted to spaces. mkGenre :: String -> Genre -- | Convert Genre to String. getGenre :: Genre -> String -- | Year tag. data Year -- | Construction of Year type, non-positive values result in -- Nothing. mkYear :: Int -> Maybe Year -- | Convert Year to Int. getYear :: Year -> Int -- | Track number tag. data TrackNumber -- | Construction of TrackNumber type, non-positive values result in -- Nothing. mkTrackNumber :: Int -> Maybe TrackNumber -- | Convert TrackNumber to Int. getTrackNumber :: TrackNumber -> Int -- | Duration in seconds. data Duration -- | Construction of Duration values, negative values result in -- Nothing. mkDuration :: Int -> Maybe Duration -- | Convert Duration to Int. getDuration :: Duration -> Int -- | Bit rate in kb/s. data BitRate -- | Construction of BitRate values, negative values result in -- Nothing. mkBitRate :: Int -> Maybe BitRate -- | Convert BitRate to Int. getBitRate :: BitRate -> Int -- | Sample rate in Hz. data SampleRate -- | Construction of SampleRate values, non-positive values result -- in Nothing. mkSampleRate :: Int -> Maybe SampleRate -- | Convert SampleRate to Int. getSampleRate :: SampleRate -> Int -- | Number of channels in the audio stream. data Channels -- | Construction of Channels values, non-positive values result in -- Nothing. mkChannels :: Int -> Maybe Channels -- | Convert Channels to Int. getChannels :: Channels -> Int instance GHC.Classes.Ord Sound.HTagLib.Type.Channels instance GHC.Classes.Eq Sound.HTagLib.Type.Channels instance GHC.Show.Show Sound.HTagLib.Type.Channels instance GHC.Classes.Ord Sound.HTagLib.Type.SampleRate instance GHC.Classes.Eq Sound.HTagLib.Type.SampleRate instance GHC.Show.Show Sound.HTagLib.Type.SampleRate instance GHC.Classes.Ord Sound.HTagLib.Type.BitRate instance GHC.Classes.Eq Sound.HTagLib.Type.BitRate instance GHC.Show.Show Sound.HTagLib.Type.BitRate instance GHC.Classes.Ord Sound.HTagLib.Type.Duration instance GHC.Classes.Eq Sound.HTagLib.Type.Duration instance GHC.Show.Show Sound.HTagLib.Type.Duration instance GHC.Classes.Ord Sound.HTagLib.Type.TrackNumber instance GHC.Classes.Eq Sound.HTagLib.Type.TrackNumber instance GHC.Show.Show Sound.HTagLib.Type.TrackNumber instance GHC.Classes.Ord Sound.HTagLib.Type.Year instance GHC.Classes.Eq Sound.HTagLib.Type.Year instance GHC.Show.Show Sound.HTagLib.Type.Year instance GHC.Classes.Ord Sound.HTagLib.Type.Genre instance GHC.Classes.Eq Sound.HTagLib.Type.Genre instance GHC.Show.Show Sound.HTagLib.Type.Genre instance GHC.Classes.Ord Sound.HTagLib.Type.Comment instance GHC.Classes.Eq Sound.HTagLib.Type.Comment instance GHC.Show.Show Sound.HTagLib.Type.Comment instance GHC.Classes.Ord Sound.HTagLib.Type.Album instance GHC.Classes.Eq Sound.HTagLib.Type.Album instance GHC.Show.Show Sound.HTagLib.Type.Album instance GHC.Classes.Ord Sound.HTagLib.Type.Artist instance GHC.Classes.Eq Sound.HTagLib.Type.Artist instance GHC.Show.Show Sound.HTagLib.Type.Artist instance GHC.Classes.Ord Sound.HTagLib.Type.Title instance GHC.Classes.Eq Sound.HTagLib.Type.Title instance GHC.Show.Show Sound.HTagLib.Type.Title instance Data.String.IsString Sound.HTagLib.Type.Title instance Data.String.IsString Sound.HTagLib.Type.Artist instance Data.String.IsString Sound.HTagLib.Type.Album instance Data.String.IsString Sound.HTagLib.Type.Comment instance Data.String.IsString Sound.HTagLib.Type.Genre -- | Low-level interaction with underlying C API. You don't want to use -- this, see Sound.HTagLib instead. module Sound.HTagLib.Internal -- | This is an abstraction representing opened file. Other modules can -- pass it around and treat it like a black box. data FileId -- | Types of files TagLib can work with. This may be used to explicitly -- specify type of file rather than relying on TagLib ability to guess -- type of file from its extension. data FileType MPEG :: FileType OggVorbis :: FileType FLAC :: FileType MPC :: FileType OggFlac :: FileType WavPack :: FileType Speex :: FileType TrueAudio :: FileType MP4 :: FileType ASF :: FileType -- | Encoding for ID3v2 frames that are written to tags. data ID3v2Encoding ID3v2Latin1 :: ID3v2Encoding ID3v2UTF16 :: ID3v2Encoding ID3v2UTF16BE :: ID3v2Encoding ID3v2UTF8 :: ID3v2Encoding -- | The data type represents exceptions specific to the library. The -- following constructors are defined: -- -- data HTagLibException OpeningFailed :: FilePath -> HTagLibException InvalidFile :: FilePath -> HTagLibException SavingFailed :: FilePath -> HTagLibException -- | Open audio file located at specified path, execute some actions given -- its FileId and then free the file. withFile :: FilePath -> Maybe FileType -> (FileId -> IO a) -> IO a -- | Save file given its ID. Given FilePath just tells what to put -- into exception if the action fails, it doesn't specify where to save -- the file (it's determined by FileId). saveFile :: FilePath -> FileId -> IO () -- | Get title tag associated with file. getTitle :: FileId -> IO Title -- | Get artist tag associated with file. getArtist :: FileId -> IO Artist -- | Get album tag associated with file. getAlbum :: FileId -> IO Album -- | Get comment tag associated with file. getComment :: FileId -> IO Comment -- | Get genre tag associated with file. getGenre :: FileId -> IO Genre -- | Get year tag associated with file. getYear :: FileId -> IO (Maybe Year) -- | Get track number associated with file. getTrackNumber :: FileId -> IO (Maybe TrackNumber) -- | Set title of track associated with file. setTitle :: Title -> FileId -> IO () -- | Set artist of track associated with file. setArtist :: Artist -> FileId -> IO () -- | Set album of track associated with file. setAlbum :: Album -> FileId -> IO () -- | Set comment of track associated with file. setComment :: Comment -> FileId -> IO () -- | Set genre of track associated with file. setGenre :: Genre -> FileId -> IO () -- | Set year of track associated with file. setYear :: Maybe Year -> FileId -> IO () -- | Set track number of track associated with file. setTrackNumber :: Maybe TrackNumber -> FileId -> IO () -- | Get duration of track associated with file. getDuration :: FileId -> IO Duration -- | Get bit rate of track associated with file. getBitRate :: FileId -> IO BitRate -- | Get sample rate of track associated with file. getSampleRate :: FileId -> IO SampleRate -- | Get number of channels in track associated with file. getChannels :: FileId -> IO Channels -- | Set the default encoding for ID3v2 frames that are written to tags. id3v2SetEncoding :: ID3v2Encoding -> IO () instance GHC.Show.Show Sound.HTagLib.Internal.HTagLibException instance GHC.Classes.Eq Sound.HTagLib.Internal.HTagLibException instance GHC.Enum.Enum Sound.HTagLib.Internal.ID3v2Encoding instance GHC.Classes.Eq Sound.HTagLib.Internal.ID3v2Encoding instance GHC.Show.Show Sound.HTagLib.Internal.ID3v2Encoding instance GHC.Enum.Enum Sound.HTagLib.Internal.FileType instance GHC.Classes.Eq Sound.HTagLib.Internal.FileType instance GHC.Show.Show Sound.HTagLib.Internal.FileType instance GHC.Exception.Exception Sound.HTagLib.Internal.HTagLibException -- | High-level interface for writing audio meta data. You don't need to -- import this module directly, import Sound.HTagLib instead. module Sound.HTagLib.Setter -- | Composable entity that can be used together with setTags or -- setTags' to write meta data to audio file. data TagSetter -- | Set tags in specified file using given setter. -- -- In case of trouble HTagLibException will be thrown. setTags :: FilePath -> Maybe ID3v2Encoding -> TagSetter -> IO () -- | Similar to setTags, but you can also specify type of audio file -- explicitly (otherwise it's guessed from file extension). setTags' :: FilePath -> Maybe ID3v2Encoding -> FileType -> TagSetter -> IO () -- | Setter for track title. titleSetter :: Title -> TagSetter -- | Setter for track artist. artistSetter :: Artist -> TagSetter -- | Setter for track album. albumSetter :: Album -> TagSetter -- | Setter for track comment. commentSetter :: Comment -> TagSetter -- | Setter for track genre. genreSetter :: Genre -> TagSetter -- | Setter for year tag, use Nothing to clear the field. yearSetter :: Maybe Year -> TagSetter -- | Setter for track number, use Nothing to clear the field. trackNumberSetter :: Maybe TrackNumber -> TagSetter instance GHC.Base.Monoid Sound.HTagLib.Setter.TagSetter -- | High-level applicative interface for reading of audio meta data. You -- don't need to import this module directly, import Sound.HTagLib -- instead. module Sound.HTagLib.Getter -- | This type represents composable entity that can be used with -- getTags or getTags' functions to read batch of meta -- parameters. data TagGetter a -- | getTags path g will try to read file located at path -- and read meta data of the file using getter g. Type of file -- will be guessed from its extension. If this is not satisfactory and -- you want to explicitly specify file type, see getTags' -- variation of this function. -- -- In case of trouble HTagLibException will be thrown. getTags :: FilePath -> TagGetter a -> IO a -- | This is essentially the same as getTags, but allows to -- explicitly choose file type (see FileType). getTags' :: FilePath -> FileType -> TagGetter a -> IO a -- | Getter to retrieve track title. titleGetter :: TagGetter Title -- | Getter to retrieve track artist. artistGetter :: TagGetter Artist -- | Getter to retrieve track album. albumGetter :: TagGetter Album -- | Getter to retrieve track comment. commentGetter :: TagGetter Comment -- | Getter to retrieve genre of the track. genreGetter :: TagGetter Genre -- | Getter to retrieve year to the track (returns Nothing if the -- data is missing). yearGetter :: TagGetter (Maybe Year) -- | Getter to retrieve track number (returns Nothing if the data is -- missing). trackNumberGetter :: TagGetter (Maybe TrackNumber) -- | Getter to retrieve duration in seconds. durationGetter :: TagGetter Duration -- | Getter to retrieve bit rate. bitRateGetter :: TagGetter BitRate -- | Getter to retrieve sample rate. sampleRateGetter :: TagGetter SampleRate -- | Getter to retrieve number of channels in audio data. channelsGetter :: TagGetter Channels instance GHC.Base.Functor Sound.HTagLib.Getter.TagGetter instance GHC.Base.Applicative Sound.HTagLib.Getter.TagGetter -- | This module includes complete high-level interface to TagLib. This is -- the module you should import to use in your projects. module Sound.HTagLib -- | Title tag. data Title -- | Construction of Title type, null bytes are converted to spaces. mkTitle :: String -> Title -- | Convert Title to String. getTitle :: Title -> String -- | Artist tag. data Artist -- | Construction of Artist type, null bytes are converted to -- spaces. mkArtist :: String -> Artist -- | Convert Artist to String. getArtist :: Artist -> String -- | Album tag. data Album -- | Construction of Album type, null bytes are converted to spaces. mkAlbum :: String -> Album -- | Convert Album to String. getAlbum :: Album -> String -- | Comment tag. data Comment -- | Construction of Comment type, null bytes are converted to -- spaces. mkComment :: String -> Comment -- | Convert Comment to String. getComment :: Comment -> String -- | Genre tag. data Genre -- | Construction of Genre type, null bytes are converted to spaces. mkGenre :: String -> Genre -- | Convert Genre to String. getGenre :: Genre -> String -- | Year tag. data Year -- | Construction of Year type, non-positive values result in -- Nothing. mkYear :: Int -> Maybe Year -- | Convert Year to Int. getYear :: Year -> Int -- | Track number tag. data TrackNumber -- | Construction of TrackNumber type, non-positive values result in -- Nothing. mkTrackNumber :: Int -> Maybe TrackNumber -- | Convert TrackNumber to Int. getTrackNumber :: TrackNumber -> Int -- | Duration in seconds. data Duration -- | Construction of Duration values, negative values result in -- Nothing. mkDuration :: Int -> Maybe Duration -- | Convert Duration to Int. getDuration :: Duration -> Int -- | Bit rate in kb/s. data BitRate -- | Construction of BitRate values, negative values result in -- Nothing. mkBitRate :: Int -> Maybe BitRate -- | Convert BitRate to Int. getBitRate :: BitRate -> Int -- | Sample rate in Hz. data SampleRate -- | Construction of SampleRate values, non-positive values result -- in Nothing. mkSampleRate :: Int -> Maybe SampleRate -- | Convert SampleRate to Int. getSampleRate :: SampleRate -> Int -- | Number of channels in the audio stream. data Channels -- | Construction of Channels values, non-positive values result in -- Nothing. mkChannels :: Int -> Maybe Channels -- | Convert Channels to Int. getChannels :: Channels -> Int -- | Types of files TagLib can work with. This may be used to explicitly -- specify type of file rather than relying on TagLib ability to guess -- type of file from its extension. data FileType MPEG :: FileType OggVorbis :: FileType FLAC :: FileType MPC :: FileType OggFlac :: FileType WavPack :: FileType Speex :: FileType TrueAudio :: FileType MP4 :: FileType ASF :: FileType -- | Encoding for ID3v2 frames that are written to tags. data ID3v2Encoding ID3v2Latin1 :: ID3v2Encoding ID3v2UTF16 :: ID3v2Encoding ID3v2UTF16BE :: ID3v2Encoding ID3v2UTF8 :: ID3v2Encoding -- | The data type represents exceptions specific to the library. The -- following constructors are defined: -- -- data HTagLibException OpeningFailed :: FilePath -> HTagLibException InvalidFile :: FilePath -> HTagLibException SavingFailed :: FilePath -> HTagLibException -- | This type represents composable entity that can be used with -- getTags or getTags' functions to read batch of meta -- parameters. data TagGetter a -- | getTags path g will try to read file located at path -- and read meta data of the file using getter g. Type of file -- will be guessed from its extension. If this is not satisfactory and -- you want to explicitly specify file type, see getTags' -- variation of this function. -- -- In case of trouble HTagLibException will be thrown. getTags :: FilePath -> TagGetter a -> IO a -- | This is essentially the same as getTags, but allows to -- explicitly choose file type (see FileType). getTags' :: FilePath -> FileType -> TagGetter a -> IO a -- | Getter to retrieve track title. titleGetter :: TagGetter Title -- | Getter to retrieve track artist. artistGetter :: TagGetter Artist -- | Getter to retrieve track album. albumGetter :: TagGetter Album -- | Getter to retrieve track comment. commentGetter :: TagGetter Comment -- | Getter to retrieve genre of the track. genreGetter :: TagGetter Genre -- | Getter to retrieve year to the track (returns Nothing if the -- data is missing). yearGetter :: TagGetter (Maybe Year) -- | Getter to retrieve track number (returns Nothing if the data is -- missing). trackNumberGetter :: TagGetter (Maybe TrackNumber) -- | Getter to retrieve duration in seconds. durationGetter :: TagGetter Duration -- | Getter to retrieve bit rate. bitRateGetter :: TagGetter BitRate -- | Getter to retrieve sample rate. sampleRateGetter :: TagGetter SampleRate -- | Getter to retrieve number of channels in audio data. channelsGetter :: TagGetter Channels -- | Composable entity that can be used together with setTags or -- setTags' to write meta data to audio file. data TagSetter -- | Set tags in specified file using given setter. -- -- In case of trouble HTagLibException will be thrown. setTags :: FilePath -> Maybe ID3v2Encoding -> TagSetter -> IO () -- | Similar to setTags, but you can also specify type of audio file -- explicitly (otherwise it's guessed from file extension). setTags' :: FilePath -> Maybe ID3v2Encoding -> FileType -> TagSetter -> IO () -- | Setter for track title. titleSetter :: Title -> TagSetter -- | Setter for track artist. artistSetter :: Artist -> TagSetter -- | Setter for track album. albumSetter :: Album -> TagSetter -- | Setter for track comment. commentSetter :: Comment -> TagSetter -- | Setter for track genre. genreSetter :: Genre -> TagSetter -- | Setter for year tag, use Nothing to clear the field. yearSetter :: Maybe Year -> TagSetter -- | Setter for track number, use Nothing to clear the field. trackNumberSetter :: Maybe TrackNumber -> TagSetter