                        return (update, rate, format, start, stop, position)
                            | otherwise = Nothing
 
-eventParseNewSegmentFull :: Event
+eventParseNewSegmentFull :: EventClass event
+                         => event
                          -> Maybe (Bool, Double, Double, Format, Int64, Int64, Int64)
 eventParseNewSegmentFull event | eventType event == EventNewSegment =
     Just $ unsafePerformIO $ alloca $ \updatePtr ->
         alloca $ \ratePtr -> alloca $ \appliedRatePtr ->
             alloca $ \formatPtr -> alloca $ \startPtr ->
                 alloca $ \stopPtr -> alloca $ \positionPtr ->
-                    do {# call event_parse_new_segment_full #} event
+                    do {# call event_parse_new_segment_full #} (toEvent event)
                                                                ratePtr
                                                                appliedRatePtr
                                                                updatePtr

--  available under LGPL Version 2. The documentation included with
--  this library is based on the original GStreamer documentation.
-- 
-- | Maintainer  : gtk2hs-devel\@lists.sourceforge.net
--   Stability   : alpha
--   Portability : portable (depends on GHC)
module Media.Streaming.GStreamer.Core.Event (
  ) where

import Control.Monad (liftM)
{#import Media.Streaming.GStreamer.Core.Types#}

               return (proportion, diff, timestamp)
                    | otherwise = Nothing

eventParseSeek :: EventClass event
               => event
               -> Maybe (Double, Format, [SeekFlags], SeekType, Int64, SeekType, Int64)
eventParseSeek event | eventType event == EventSeek =
    Just $ unsafePerformIO $ alloca $ \ratePtr ->
        alloca $ \formatPtr -> alloca $ \flagsPtr ->
            alloca $ \startTypePtr -> alloca $ \startPtr ->
                alloca $ \stopTypePtr -> alloca $ \stopPtr ->
                    do {# call event_parse_seek #} (toEvent event)
                                                   ratePtr
                                                   formatPtr
                                                   flagsPtr
