-- 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 1.1.1


-- | Definitions of types used to represent various tags and audio
--   properties.
module Sound.HTagLib.Type

-- | Title tag.
data Title

-- | Construction of <a>Title</a> type, null bytes are converted to spaces.
mkTitle :: Text -> Title

-- | Convert <a>Title</a> to <a>Text</a>.
unTitle :: Title -> Text

-- | Artist tag.
data Artist

-- | Construction of <a>Artist</a> type, null bytes are converted to
--   spaces.
mkArtist :: Text -> Artist

-- | Convert <a>Artist</a> to <a>Text</a>.
unArtist :: Artist -> Text

-- | Album tag.
data Album

-- | Construction of <a>Album</a> type, null bytes are converted to spaces.
mkAlbum :: Text -> Album

-- | Convert <a>Album</a> to <a>Text</a>.
unAlbum :: Album -> Text

-- | Comment tag.
data Comment

-- | Construction of <a>Comment</a> type, null bytes are converted to
--   spaces.
mkComment :: Text -> Comment

-- | Convert <a>Comment</a> to <a>Text</a>.
unComment :: Comment -> Text

-- | Genre tag.
data Genre

-- | Construction of <a>Genre</a> type, null bytes are converted to spaces.
mkGenre :: Text -> Genre

-- | Convert <a>Genre</a> to <a>Text</a>.
unGenre :: Genre -> Text

-- | Year tag.
data Year

-- | Construction of <a>Year</a> type, non-positive values result in
--   <a>Nothing</a>.
mkYear :: Int -> Maybe Year

-- | Convert <a>Year</a> to <a>Int</a>.
unYear :: Year -> Int

-- | Track number tag.
data TrackNumber

-- | Construction of <a>TrackNumber</a> type, non-positive values result in
--   <a>Nothing</a>.
mkTrackNumber :: Int -> Maybe TrackNumber

-- | Convert <a>TrackNumber</a> to <a>Int</a>.
unTrackNumber :: TrackNumber -> Int

-- | Duration in seconds.
data Duration

-- | Construction of <a>Duration</a> values, negative values result in
--   <a>Nothing</a>.
mkDuration :: Int -> Maybe Duration

-- | Convert <a>Duration</a> to <a>Int</a>.
unDuration :: Duration -> Int

-- | Bit rate in kb/s.
data BitRate

-- | Construction of <a>BitRate</a> values, negative values result in
--   <a>Nothing</a>.
mkBitRate :: Int -> Maybe BitRate

-- | Convert <a>BitRate</a> to <a>Int</a>.
unBitRate :: BitRate -> Int

-- | Sample rate in Hz.
data SampleRate

-- | Construction of <a>SampleRate</a> values, non-positive values result
--   in <a>Nothing</a>.
mkSampleRate :: Int -> Maybe SampleRate

-- | Convert <a>SampleRate</a> to <a>Int</a>.
unSampleRate :: SampleRate -> Int

-- | Number of channels in the audio stream.
data Channels

-- | Construction of <a>Channels</a> values, non-positive values result in
--   <a>Nothing</a>.
mkChannels :: Int -> Maybe Channels

-- | Convert <a>Channels</a> to <a>Int</a>.
unChannels :: Channels -> Int

-- | Types of files TagLib can work with. This may be used to explicitly
--   specify type of file instead of relying on the TagLib's ability to
--   guess type of file from its extension.
data FileType

-- | MPEG
MPEG :: FileType

-- | Ogg vorbis
OggVorbis :: FileType

-- | FLAC
FLAC :: FileType

-- | MPC
MPC :: FileType

-- | Ogg FLAC
OggFlac :: FileType

-- | Wav pack
WavPack :: FileType

-- | Speex
Speex :: FileType

-- | True audio
TrueAudio :: FileType

-- | MP4
MP4 :: FileType

-- | ASF
ASF :: FileType

-- | Encoding for ID3v2 frames that are written to tags.
data ID3v2Encoding

-- | Latin1
ID3v2Latin1 :: ID3v2Encoding

-- | UTF-16
ID3v2UTF16 :: ID3v2Encoding

-- | UTF-16 big endian
ID3v2UTF16BE :: ID3v2Encoding

-- | UTF-8
ID3v2UTF8 :: ID3v2Encoding

-- | The data type represents exceptions specific to the library.
data HTagLibException

-- | Attempt to open audio file to read its tags failed
OpeningFailed :: FilePath -> HTagLibException

-- | File can be opened, but it doesn't contain any information that can be
--   interpreted by the library
InvalidFile :: FilePath -> HTagLibException

-- | Saving failed
SavingFailed :: FilePath -> HTagLibException
instance GHC.Show.Show Sound.HTagLib.Type.HTagLibException
instance GHC.Classes.Eq Sound.HTagLib.Type.HTagLibException
instance GHC.Enum.Enum Sound.HTagLib.Type.ID3v2Encoding
instance GHC.Classes.Eq Sound.HTagLib.Type.ID3v2Encoding
instance GHC.Show.Show Sound.HTagLib.Type.ID3v2Encoding
instance GHC.Enum.Enum Sound.HTagLib.Type.FileType
instance GHC.Classes.Eq Sound.HTagLib.Type.FileType
instance GHC.Show.Show Sound.HTagLib.Type.FileType
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
instance GHC.Exception.Exception Sound.HTagLib.Type.HTagLibException


-- | A high-level interface for writing audio meta data. You don't need to
--   import this module directly, import <a>Sound.HTagLib</a> instead.
module Sound.HTagLib.Setter

-- | A composable entity that can be used together with the <a>setTags</a>
--   or the <a>setTags'</a> functions to write meta data to an audio file.
--   
--   Note that in case of (for example):
--   
--   <pre>
--   titleSetter "foo" &lt;&gt; titleSetter "bar"
--   </pre>
--   
--   The first value wins.
data TagSetter

-- | Set tags in specified file using the given setter.
--   
--   In the case of trouble <a>HTagLibException</a> will be thrown.
setTags :: MonadIO m => FilePath -> Maybe ID3v2Encoding -> TagSetter -> m ()

-- | Similar to <a>setTags</a>, but you can also specify type of audio file
--   explicitly (otherwise it's guessed from file extension).
setTags' :: MonadIO m => FilePath -> Maybe ID3v2Encoding -> FileType -> TagSetter -> m ()

-- | 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 <a>Nothing</a> to clear the field.
yearSetter :: Maybe Year -> TagSetter

-- | Setter for track number, use <a>Nothing</a> to clear the field.
trackNumberSetter :: Maybe TrackNumber -> TagSetter
instance GHC.Base.Monoid Sound.HTagLib.Setter.TagSetter


-- | A high-level applicative interface for reading of audio meta data. You
--   don't need to import this module directly, import <a>Sound.HTagLib</a>
--   instead.
module Sound.HTagLib.Getter

-- | A composable entity that can be used with <a>getTags</a> or
--   <a>getTags'</a> functions to read batch of meta parameters.
data TagGetter a

-- | <tt>getTags path g</tt> will try to read file located at <tt>path</tt>
--   and read meta data of the file using getter <tt>g</tt>. Type of file
--   will be guessed from its extension. If this is not satisfactory and
--   you want to explicitly specify the file type, see <a>getTags'</a>
--   variation of this function.
--   
--   In the case of trouble <a>HTagLibException</a> will be thrown.
getTags :: MonadIO m => FilePath -> TagGetter a -> m a

-- | This is essentially the same as <a>getTags</a>, but allows to
--   explicitly choose file type (see <a>FileType</a>).
getTags' :: MonadIO m => FilePath -> FileType -> TagGetter a -> m 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 <a>Nothing</a> if the
--   data is missing).
yearGetter :: TagGetter (Maybe Year)

-- | Getter to retrieve track number (returns <a>Nothing</a> 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 provides a complete high-level interface to TagLib. This
--   is the module you should import to use in your projects.
module Sound.HTagLib

-- | <tt>getTags path g</tt> will try to read file located at <tt>path</tt>
--   and read meta data of the file using getter <tt>g</tt>. Type of file
--   will be guessed from its extension. If this is not satisfactory and
--   you want to explicitly specify the file type, see <a>getTags'</a>
--   variation of this function.
--   
--   In the case of trouble <a>HTagLibException</a> will be thrown.
getTags :: MonadIO m => FilePath -> TagGetter a -> m a

-- | This is essentially the same as <a>getTags</a>, but allows to
--   explicitly choose file type (see <a>FileType</a>).
getTags' :: MonadIO m => FilePath -> FileType -> TagGetter a -> m 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 <a>Nothing</a> if the
--   data is missing).
yearGetter :: TagGetter (Maybe Year)

-- | Getter to retrieve track number (returns <a>Nothing</a> 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

-- | Set tags in specified file using the given setter.
--   
--   In the case of trouble <a>HTagLibException</a> will be thrown.
setTags :: MonadIO m => FilePath -> Maybe ID3v2Encoding -> TagSetter -> m ()

-- | Similar to <a>setTags</a>, but you can also specify type of audio file
--   explicitly (otherwise it's guessed from file extension).
setTags' :: MonadIO m => FilePath -> Maybe ID3v2Encoding -> FileType -> TagSetter -> m ()

-- | 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 <a>Nothing</a> to clear the field.
yearSetter :: Maybe Year -> TagSetter

-- | Setter for track number, use <a>Nothing</a> to clear the field.
trackNumberSetter :: Maybe TrackNumber -> TagSetter

-- | Title tag.
data Title

-- | Construction of <a>Title</a> type, null bytes are converted to spaces.
mkTitle :: Text -> Title

-- | Convert <a>Title</a> to <a>Text</a>.
unTitle :: Title -> Text

-- | Artist tag.
data Artist

-- | Construction of <a>Artist</a> type, null bytes are converted to
--   spaces.
mkArtist :: Text -> Artist

-- | Convert <a>Artist</a> to <a>Text</a>.
unArtist :: Artist -> Text

-- | Album tag.
data Album

-- | Construction of <a>Album</a> type, null bytes are converted to spaces.
mkAlbum :: Text -> Album

-- | Convert <a>Album</a> to <a>Text</a>.
unAlbum :: Album -> Text

-- | Comment tag.
data Comment

-- | Construction of <a>Comment</a> type, null bytes are converted to
--   spaces.
mkComment :: Text -> Comment

-- | Convert <a>Comment</a> to <a>Text</a>.
unComment :: Comment -> Text

-- | Genre tag.
data Genre

-- | Construction of <a>Genre</a> type, null bytes are converted to spaces.
mkGenre :: Text -> Genre

-- | Convert <a>Genre</a> to <a>Text</a>.
unGenre :: Genre -> Text

-- | Year tag.
data Year

-- | Construction of <a>Year</a> type, non-positive values result in
--   <a>Nothing</a>.
mkYear :: Int -> Maybe Year

-- | Convert <a>Year</a> to <a>Int</a>.
unYear :: Year -> Int

-- | Track number tag.
data TrackNumber

-- | Construction of <a>TrackNumber</a> type, non-positive values result in
--   <a>Nothing</a>.
mkTrackNumber :: Int -> Maybe TrackNumber

-- | Convert <a>TrackNumber</a> to <a>Int</a>.
unTrackNumber :: TrackNumber -> Int

-- | Duration in seconds.
data Duration

-- | Construction of <a>Duration</a> values, negative values result in
--   <a>Nothing</a>.
mkDuration :: Int -> Maybe Duration

-- | Convert <a>Duration</a> to <a>Int</a>.
unDuration :: Duration -> Int

-- | Bit rate in kb/s.
data BitRate

-- | Construction of <a>BitRate</a> values, negative values result in
--   <a>Nothing</a>.
mkBitRate :: Int -> Maybe BitRate

-- | Convert <a>BitRate</a> to <a>Int</a>.
unBitRate :: BitRate -> Int

-- | Sample rate in Hz.
data SampleRate

-- | Construction of <a>SampleRate</a> values, non-positive values result
--   in <a>Nothing</a>.
mkSampleRate :: Int -> Maybe SampleRate

-- | Convert <a>SampleRate</a> to <a>Int</a>.
unSampleRate :: SampleRate -> Int

-- | Number of channels in the audio stream.
data Channels

-- | Construction of <a>Channels</a> values, non-positive values result in
--   <a>Nothing</a>.
mkChannels :: Int -> Maybe Channels

-- | Convert <a>Channels</a> to <a>Int</a>.
unChannels :: Channels -> Int

-- | Types of files TagLib can work with. This may be used to explicitly
--   specify type of file instead of relying on the TagLib's ability to
--   guess type of file from its extension.
data FileType

-- | MPEG
MPEG :: FileType

-- | Ogg vorbis
OggVorbis :: FileType

-- | FLAC
FLAC :: FileType

-- | MPC
MPC :: FileType

-- | Ogg FLAC
OggFlac :: FileType

-- | Wav pack
WavPack :: FileType

-- | Speex
Speex :: FileType

-- | True audio
TrueAudio :: FileType

-- | MP4
MP4 :: FileType

-- | ASF
ASF :: FileType

-- | Encoding for ID3v2 frames that are written to tags.
data ID3v2Encoding

-- | Latin1
ID3v2Latin1 :: ID3v2Encoding

-- | UTF-16
ID3v2UTF16 :: ID3v2Encoding

-- | UTF-16 big endian
ID3v2UTF16BE :: ID3v2Encoding

-- | UTF-8
ID3v2UTF8 :: ID3v2Encoding

-- | A composable entity that can be used with <a>getTags</a> or
--   <a>getTags'</a> functions to read batch of meta parameters.
data TagGetter a

-- | A composable entity that can be used together with the <a>setTags</a>
--   or the <a>setTags'</a> functions to write meta data to an audio file.
--   
--   Note that in case of (for example):
--   
--   <pre>
--   titleSetter "foo" &lt;&gt; titleSetter "bar"
--   </pre>
--   
--   The first value wins.
data TagSetter

-- | The data type represents exceptions specific to the library.
data HTagLibException

-- | Attempt to open audio file to read its tags failed
OpeningFailed :: FilePath -> HTagLibException

-- | File can be opened, but it doesn't contain any information that can be
--   interpreted by the library
InvalidFile :: FilePath -> HTagLibException

-- | Saving failed
SavingFailed :: FilePath -> HTagLibException
