Portability | not portable |
---|---|
Stability | unstable |
Maintainer | Joachim Fasting <joachim.fasting@gmail.com> |
A simple binding to xine-lib.
Example usage:
import qualified Xine
main = do
h <- Xine.open
sid <- Xine.openStream h "track.mp3"
Xine.play h sid
- data XineConf = XineConf {
- audioDriver :: !(Maybe String)
- videoDriver :: !(Maybe String)
- visualType :: !VisualType
- data VisualType
- defaultConf :: XineConf
- data XineHandle
- open :: IO XineHandle
- openWith :: XineConf -> IO XineHandle
- close :: XineHandle -> IO ()
- isClosed :: XineHandle -> IO Bool
- type MRL = String
- type StreamId = Int
- openStream :: XineHandle -> MRL -> IO StreamId
- closeStream :: XineHandle -> StreamId -> IO ()
- getCurrent :: XineHandle -> IO (Maybe StreamId)
- data SeekArg
- play :: XineHandle -> StreamId -> IO ()
- seek :: XineHandle -> StreamId -> SeekArg -> IO ()
- stop :: XineHandle -> StreamId -> IO ()
- pause :: XineHandle -> StreamId -> IO ()
- data EngineStatus
- data MetaType
- = MetaTitle
- | MetaComment
- | MetaArtist
- | MetaGenre
- | MetaAlbum
- | MetaYear
- | MetaVideoCodec
- | MetaAudioCodec
- | MetaSystemLayer
- | MetaInputPlugin
- | MetaDiscId
- | MetaTrackNumber
- | MetaComposer
- | MetaPublisher
- | MetaLicense
- | MetaArranger
- | MetaLyricist
- | MetaConductor
- | MetaPerformer
- | MetaEnsemble
- | MetaOpus
- | MetaPart
- | MetaPartNumber
- | MetaLocation
- getStatus :: XineHandle -> IO EngineStatus
- getMetadata :: XineHandle -> StreamId -> MetaType -> IO String
Configuration
Xine configuration.
XineConf | |
|
data VisualType Source
Valid visual types
Default configuration. Audio only.
Handle
data XineHandle Source
A xine-lib handle.
Open a new Xine handle using defaultConf
.
close :: XineHandle -> IO ()Source
Close Xine handle. The handle is invalid after this.
isClosed :: XineHandle -> IO BoolSource
Test whether the handle is closed.
Streams
You may open multiple streams for playback. Beware, though, that new streams cannot be added once playback has started, so open your streams before using them.
Media Resource Locator. Describes the media to read from. Valid MRLs may be plain file names or one of the following:
- Filesystem:
file:<path>
fifo:<path>
stdin:/
- CD and DVD:
dvd:/[device_name][/title[.part]]
dvd:/DVD_image_file[/title[.part]]
dvd:/DVD_directory[/title[.part]]
vcd://[CD_image_or_device_name][@[letter]number]
vcdo://track_number
cdda:/[device][/track_number]
- Video devices:
v4l://[tuner_device/frequency
v4l2://tuner_device
dvb://channel_number
dvb://channel_name
dvbc://channel_name:tuning_parameters
dvbs://channel_name:tuning_parameters
dvbt://channel_name:tuning_parameters
dvba://channel_name:tuning_parameters
pvr:/tmp_files_path!saved_files_path!max_page_age
- Network:
http://host
tcp://host[:port]
udp://host[:port[?iface=interface]]
rtp://host[:port[?iface=interface]]
smb://
mms://host
pnm://host
rtsp://host
openStream :: XineHandle -> MRL -> IO StreamIdSource
Open a new stream for the given MRL.
closeStream :: XineHandle -> StreamId -> IO ()Source
Close the specified stream.
getCurrent :: XineHandle -> IO (Maybe StreamId)Source
Get the current stream, if any.
Playback
seek :: XineHandle -> StreamId -> SeekArg -> IO ()Source
Seek to a position or time in the stream.
Warning: this will crash if xine_trick_mode
is not implemented.
Information retrieval
data EngineStatus Source
Engine status codes.
The different kinds of metadata
getStatus :: XineHandle -> IO EngineStatusSource
Get current engine status.
getMetadata :: XineHandle -> StreamId -> MetaType -> IO StringSource
Get meta data about the given stream.