Copyright | © 2015 Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov@opmbx.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Low-level interaction with underlying C API. You don't want to use this, see Sound.HTagLib instead.
- data FileId
- data FileType
- data ID3v2Encoding
- data HTagLibException
- withFile :: FilePath -> Maybe FileType -> (FileId -> IO a) -> IO a
- saveFile :: FilePath -> FileId -> IO ()
- getTitle :: FileId -> IO Title
- getArtist :: FileId -> IO Artist
- getAlbum :: FileId -> IO Album
- getComment :: FileId -> IO Comment
- getGenre :: FileId -> IO Genre
- getYear :: FileId -> IO (Maybe Year)
- getTrackNumber :: FileId -> IO (Maybe TrackNumber)
- setTitle :: Title -> FileId -> IO ()
- setArtist :: Artist -> FileId -> IO ()
- setAlbum :: Album -> FileId -> IO ()
- setComment :: Comment -> FileId -> IO ()
- setGenre :: Genre -> FileId -> IO ()
- setYear :: Maybe Year -> FileId -> IO ()
- setTrackNumber :: Maybe TrackNumber -> FileId -> IO ()
- getDuration :: FileId -> IO Duration
- getBitRate :: FileId -> IO BitRate
- getSampleRate :: FileId -> IO SampleRate
- getChannels :: FileId -> IO Channels
- id3v2SetEncoding :: ID3v2Encoding -> IO ()
Data types
This is an abstraction representing opened file. Other modules can pass it around and treat it like a black box.
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 ID3v2Encoding Source
Encoding for ID3v2 frames that are written to tags.
data HTagLibException Source
The data type represents exceptions specific to the library. The following constructors are defined:
OpeningFailed
means that attempt to open audio file to read its tags failed.InvalidFile
means that file can be opened, but it doesn't contain any information that can be interpreted by the library.SavingFailed
is thrown when well… saving failed.
File API
:: FilePath | Path to audio file |
-> Maybe FileType | Type of file (or it will be guessed) |
-> (FileId -> IO a) | Computation depending of |
-> IO a | Result value |
Open audio file located at specified path, execute some actions given
its FileId
and then free the file.
Tag API
getComment :: FileId -> IO Comment Source
Get comment tag associated with file.
getTrackNumber :: FileId -> IO (Maybe TrackNumber) Source
Get track number associated with file.
setComment :: Comment -> FileId -> IO () Source
Set comment of track associated with file.
setTrackNumber :: Maybe TrackNumber -> FileId -> IO () Source
Set track number of track associated with file.
Audio properties API
getDuration :: FileId -> IO Duration Source
Get duration of track associated with file.
getBitRate :: FileId -> IO BitRate Source
Get bit rate of track associated with file.
getSampleRate :: FileId -> IO SampleRate Source
Get sample rate of track associated with file.
getChannels :: FileId -> IO Channels Source
Get number of channels in track associated with file.
Special convenience ID3v2 functions
id3v2SetEncoding :: ID3v2Encoding -> IO () Source
Set the default encoding for ID3v2 frames that are written to tags.