taglib-api-0.1.1.3: An FFI layer over TagLib's C bindings

Safe HaskellSafe-Inferred

Audio.TagLib

Synopsis

Documentation

taglib :: TagLib a -> IO aSource

Run a TagLib block. Save and free any files left open when the block is finished, and free all strings produced by taglib.

openFile :: FilePath -> TagLib FileIdSource

Open a file and return a corresponding FileId. Internally, this grabs the Tag and AudioProperties pointers to the TagLib_File.

packStringTag :: SetStringTag -> FileId -> Text -> TagLib ()Source

Given a IO action which expects a Tag pointer and CString, lifts it into an TagLib action, expecting Text.

packIntTag :: SetIntTag -> FileId -> Int -> TagLib ()Source

Given a IO action which expects a Tag pointer and CInt, lifts it into an TagLib action, expecting a Int.

unpackStringTag :: GetStringTag -> FileId -> TagLib TextSource

Given a IO action which expects a Tag pointer and results in a CString, lifts it into a TagLib action, resulting in Text.

unpackIntTag :: GetIntTag -> FileId -> TagLib IntSource

Given a IO action which expects a Tag pointer and results in a CInt, lifts it into a TagLib action, resulting in Int.

unpackIntAP :: GetIntAP -> FileId -> TagLib IntSource

Given a IO action which expects a AudioProperties pointer and results in a CInt, lifts it into a TagLib action, resulting in Int.

type SetStringTag = Ptr Tag -> CString -> IO ()Source

FFI Type Synonyms

type SetIntTag = Ptr Tag -> CInt -> IO ()Source

setTitle :: FileId -> Text -> TagLib ()Source

Set the track title.

setArtist :: FileId -> Text -> TagLib ()Source

Set the artist name.

setAlbum :: FileId -> Text -> TagLib ()Source

Set the album name.

setComment :: FileId -> Text -> TagLib ()Source

Set the comment field.

setGenre :: FileId -> Text -> TagLib ()Source

Set the genre field.

setYear :: FileId -> Int -> TagLib ()Source

Set the release year.

setTrack :: FileId -> Int -> TagLib ()Source

Set the track number.

getTitle :: FileId -> TagLib TextSource

Get the track title.

getArtist :: FileId -> TagLib TextSource

Get the artist name.

getAlbum :: FileId -> TagLib TextSource

Get the album name.

getComment :: FileId -> TagLib TextSource

Get the contents of the comment field.

getGenre :: FileId -> TagLib TextSource

Get the contents of the genre field.

getYear :: FileId -> TagLib IntSource

Get the release year.

getTrack :: FileId -> TagLib IntSource

Get the track number.

getLength :: FileId -> TagLib IntSource

Retrieves the duration of the given file, in seconds.

getBitrate :: FileId -> TagLib IntSource

Retrieves the bitrate of the given file, in kb/s.

getSampleRate :: FileId -> TagLib IntSource

Retrieves the sample rate of the given file, in Hz.

getChannels :: FileId -> TagLib IntSource

Retrieves the number of channels in the given file.

newtype TagLib a Source

Monad for performing TagLib operations

Constructors

TagLib 

data FileId Source

A handle for an open file

Instances

io :: IO a -> TagLib aSource

Embed an IO action in the TagLib context.