     withTagList tagList ({# call event_new_tag #} . castPtr) >>=
         takeMiniObject
 
-eventParseBufferSize :: Event
+eventParseBufferSize :: EventClass event
+                     => event
                      -> Maybe (Format, Int64, Int64, Bool)
 eventParseBufferSize event | eventType event == EventBufferSize =
     Just $ unsafePerformIO $ alloca $ \formatPtr -> alloca $ \minSizePtr ->
         alloca $ \maxSizePtr -> alloca $ \asyncPtr ->
-            do {# call event_parse_buffer_size #} event
+            do {# call event_parse_buffer_size #} (toEvent event)
                                                   formatPtr
                                                   minSizePtr
                                                   maxSizePtr

                       return (rate, format, flags, startType, start, stopType, stop)
                     | otherwise = Nothing

eventParseTag :: Event
              -> Maybe TagList
eventParseTag event | eventType event == EventTag =
    Just $ unsafePerformIO $ alloca $ \tagListPtr ->
        do {# call event_parse_tag #} event (castPtr tagListPtr)
           peek tagListPtr >>= peekTagList

eventTypeGetName :: EventType
                 -> String

                       return (update, rate, format, start, stop, position)
                           | otherwise = Nothing

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 #} (toEvent event)
                                                               ratePtr
                                                               appliedRatePtr
                                                               updatePtr
