xine-0.0.0.2: Bindings to xine-lib

Portabilitynot portable
Stabilityunstable
MaintainerJoachim Fasting <joachim.fasting@gmail.com>

Xine

Contents

Description

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

Synopsis

Configuration

data XineConf Source

Xine configuration.

Constructors

XineConf 

Fields

audioDriver :: !(Maybe String)

Audio driver. Use Nothing for auto-detection.

videoDriver :: !(Maybe String)

Video driver. Use Nothing for auto-detection.

visualType :: !VisualType

Video output type. Use None to disable video output.

data VisualType Source

Valid visual types

Constructors

None 
X11 
X11_2 
AA 
FB 
GTK 
DFB 
PM 
DirectX 
CACA 
MacOSX 
XCB 
Raw 

defaultConf :: XineConfSource

Default configuration. Audio only.

Handle

data XineHandle Source

A xine-lib handle.

open :: IO XineHandleSource

Open a new Xine handle using defaultConf.

openWith :: XineConf -> IO XineHandleSource

Open a new Xine handle using the supplied XineConf.

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.

type MRL = StringSource

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

type StreamId = IntSource

Identifies an open stream.

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

data SeekArg Source

Argument for seek.

Constructors

SeekTime Int 
SeekPos Int 

Instances

play :: XineHandle -> StreamId -> IO ()Source

Start 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.

stop :: XineHandle -> StreamId -> IO ()Source

Stop playback.

pause :: XineHandle -> StreamId -> IO ()Source

Toggle pause.

Information retrieval

data EngineStatus Source

Engine status codes.

Constructors

Idle 
Stopped 
Playing 
Quitting 

getStatus :: XineHandle -> IO EngineStatusSource

Get current engine status.

getMetadata :: XineHandle -> StreamId -> MetaType -> IO StringSource

Get meta data about the given stream.