 ------------------------------------------------------------------------------
 -- Global engine handling
 ------------------------------------------------------------------------------
+
+-- | An opaque type, never dereferenced on the Haskell side
+-- XXX: document me
+{#pointer *xine_t as Engine foreign newtype#}
+
+peekEngine = liftM Engine . newForeignPtr_
+{-# INLINE peekEngine #-}
 
 -- | Valid visual types
 {#enum define VisualType {XINE_VISUAL_TYPE_NONE as None

-- | Value for XINE_PARAM_FINE_SPEED
{#enum define NormalSpeed
           {XINE_FINE_SPEED_NORMAL as NormalSpeed}#}
-- | Values for XINE_PARAM_VO_ZOOM_
{#enum define Zoom
           {XINE_VO_ZOOM_STEP as ZoomStep

------------------------------------------------------------------------------
-- Stream handling
------------------------------------------------------------------------------

-- | An opaque type, never dereferenced on the Haskell side
{#pointer *xine_stream_t as Stream foreign newtype#}

peekStream = maybeForeignPtr_ Stream
{-# INLINE peekStream #-}

-- | 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 MRL = String

-- | Engine parameter enumeration.
{#enum define EngineParam
