                        return (update, rate, appliedRate, format, start, stop, position)
                            | otherwise = Nothing
 
-eventParseQOS :: Event
+eventParseQOS :: EventClass event
+              => event
               -> Maybe (Double, ClockTimeDiff, ClockTime)
 eventParseQOS event | eventType event == EventQOS =
     Just $ unsafePerformIO $ alloca $ \proportionPtr ->
         alloca $ \diffPtr -> alloca $ \timestampPtr ->
-            do {# call event_parse_qos #} event
+            do {# call event_parse_qos #} (toEvent event)
                                           proportionPtr
                                           diffPtr
                                           timestampPtr


{# context lib = "gstreamer" prefix = "gst" #}

eventType :: Event
          -> EventType
eventType event =
    cToEnum $ unsafePerformIO $ withMiniObject event cEventType
foreign import ccall unsafe "_hs_gst_event_type"
    cEventType :: Ptr Event
               -> IO {# type GstEventType #}

               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
