{-# LINE 2 "./Media/Streaming/GStreamer/Core/Event.chs" #-}-- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*----- Author : Peter Gavin-- Created: 1-Apr-2007---- Copyright (c) 2007 Peter Gavin---- This library is free software: you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public License-- as published by the Free Software Foundation, either version 3 of-- the License, or (at your option) any later version.---- This library is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU-- Lesser General Public License for more details.---- You should have received a copy of the GNU Lesser General Public-- License along with this program. If not, see-- <http:---- GStreamer, the C library which this Haskell library depends on, is-- 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)---- An object describing events that are passed up and down a pipeline.moduleMedia.Streaming.GStreamer.Core.Event(-- * Detail-- | An 'Event' is a message that is passed up and down a pipeline.---- There are a number of predefined events and functions returning-- events. To send an event an application will usually use-- 'Media.Streaming.GStreamer.Core.Element.elementSendEvent', and-- elements will use-- 'Media.Streaming.GStreamer.Core.Pad.padSendEvent' or-- 'Media.Streaming.GStreamer.Core.padPushEvent'.------ * TypesEvent,EventClass,EventType(..),SeekFlags(..),SeekType(..),-- * Event OperationseventType,eventNewCustom,eventNewEOS,eventNewFlushStart,eventNewFlushStop,eventNewLatency,eventNewNavigation,eventNewNewSegment,eventNewNewSegmentFull,eventNewQOS,eventNewSeek,eventNewTag,eventParseBufferSize,eventParseLatency,eventParseNewSegment,eventParseNewSegmentFull,eventParseQOS,eventParseSeek,eventParseTag,eventTypeGetName,eventTypeGetFlags,)whereimportControl.Monad(liftM)importMedia.Streaming.GStreamer.Core.Types{-# LINE 86 "./Media/Streaming/GStreamer/Core/Event.chs" #-}importSystem.Glib.FFIimportSystem.Glib.GObjectimportSystem.Glib.UTFStringimportSystem.Glib.GError{-# LINE 92 "./Media/Streaming/GStreamer/Core/Event.chs" #-}eventType::EventClassevent=>event->EventTypeeventTypeevent=cToEnum$unsafePerformIO$withMiniObject(toEventevent)cEventTypeforeignimportccallunsafe"_hs_gst_event_type"cEventType::PtrEvent->IO(CInt){-# LINE 101 "./Media/Streaming/GStreamer/Core/Event.chs" #-}eventNewCustom::EventType->Structure->IOEventeventNewCustomeventTypestructure=(\arg1(Structurearg2)->withForeignPtrarg2$\argPtr2->gst_event_new_customarg1argPtr2)(cFromEnumeventType)structure>>=takeMiniObjecteventNewEOS,eventNewFlushStart,eventNewFlushStop::IOEventeventNewEOS=gst_event_new_eos>>=takeMiniObjecteventNewFlushStart=gst_event_new_flush_start>>=takeMiniObjecteventNewFlushStop=gst_event_new_flush_stop>>=takeMiniObjecteventNewLatency::ClockTime->IOEventeventNewLatencylatency=gst_event_new_latency(fromIntegrallatency)>>=takeMiniObjecteventNewNavigation::Structure->IOEventeventNewNavigationstructure=(\(Structurearg1)->withForeignPtrarg1$\argPtr1->gst_event_new_navigationargPtr1)structure>>=takeMiniObjecteventNewNewSegment::Bool->Double->Format->Int64->Int64->Int64->IOEventeventNewNewSegmentupdaterateformatstartstopposition=gst_event_new_new_segment(fromBoolupdate)(realToFracrate)(fromIntegral$fromFormatformat)(fromIntegralstart)(fromIntegralstop)(fromIntegralposition)>>=takeMiniObjecteventNewNewSegmentFull::Bool->Double->Double->Format->Int64->Int64->Int64->IOEventeventNewNewSegmentFullupdateappliedRaterateformatstartstopposition=gst_event_new_new_segment_full(fromBoolupdate)(realToFracrate)(realToFracappliedRate)(fromIntegral$fromFormatformat)(fromIntegralstart)(fromIntegralstop)(fromIntegralposition)>>=takeMiniObjecteventNewQOS::Double->ClockTimeDiff->ClockTime->IOEventeventNewQOSproportiondifftimestamp=gst_event_new_qos(realToFracproportion)(fromIntegraldiff)(fromIntegraltimestamp)>>=takeMiniObjecteventNewSeek::Double->Format->[SeekFlags]->SeekType->Int64->SeekType->Int64->IOEventeventNewSeekrateformatflagsstartTypestartstopTypestop=gst_event_new_seek(realToFracrate)(fromIntegral$fromFormatformat)(cFromFlagsflags)(cFromEnumstartType)(fromIntegralstart)(cFromEnumstopType)(fromIntegralstop)>>=takeMiniObjecteventNewTag::TagList->IOEventeventNewTagtagList=withTagListtagList(gst_event_new_tag.castPtr)>>=takeMiniObjecteventParseBufferSize::EventClassevent=>event->Maybe(Format,Int64,Int64,Bool)eventParseBufferSizeevent|eventTypeevent==EventBufferSize=Just$unsafePerformIO$alloca$\formatPtr->alloca$\minSizePtr->alloca$\maxSizePtr->alloca$\asyncPtr->do(\(Eventarg1)arg2arg3arg4arg5->withForeignPtrarg1$\argPtr1->gst_event_parse_buffer_sizeargPtr1arg2arg3arg4arg5)(toEventevent)formatPtrminSizePtrmaxSizePtrasyncPtrformat<-liftM(toFormat.fromIntegral)$peekformatPtrminSize<-liftMfromIntegral$peekminSizePtrmaxSize<-liftMfromIntegral$peekmaxSizePtrasync<-liftMtoBool$peekasyncPtrreturn(format,minSize,maxSize,async)|otherwise=NothingeventParseLatency::EventClassevent=>event->MaybeClockTimeeventParseLatencyevent|eventTypeevent==EventLatency=Just$unsafePerformIO$alloca$\latencyPtr->do(\(Eventarg1)arg2->withForeignPtrarg1$\argPtr1->gst_event_parse_latencyargPtr1arg2)(toEventevent)latencyPtrliftMfromIntegral$peeklatencyPtr|otherwise=NothingeventParseNewSegment::EventClassevent=>event->Maybe(Bool,Double,Format,Int64,Int64,Int64)eventParseNewSegmentevent|eventTypeevent==EventNewSegment=Just$unsafePerformIO$alloca$\updatePtr->alloca$\ratePtr->alloca$\formatPtr->alloca$\startPtr->alloca$\stopPtr->alloca$\positionPtr->do(\(Eventarg1)arg2arg3arg4arg5arg6arg7->withForeignPtrarg1$\argPtr1->gst_event_parse_new_segmentargPtr1arg2arg3arg4arg5arg6arg7)(toEventevent)ratePtrupdatePtrformatPtrstartPtrstopPtrpositionPtrupdate<-liftMtoBool$peekupdatePtrrate<-liftMrealToFrac$peekratePtrformat<-liftM(toFormat.fromIntegral)$peekformatPtrstart<-liftMfromIntegral$peekstartPtrstop<-liftMfromIntegral$peekstopPtrposition<-liftMfromIntegral$peekpositionPtrreturn(update,rate,format,start,stop,position)|otherwise=NothingeventParseNewSegmentFull::EventClassevent=>event->Maybe(Bool,Double,Double,Format,Int64,Int64,Int64)eventParseNewSegmentFullevent|eventTypeevent==EventNewSegment=Just$unsafePerformIO$alloca$\updatePtr->alloca$\ratePtr->alloca$\appliedRatePtr->alloca$\formatPtr->alloca$\startPtr->alloca$\stopPtr->alloca$\positionPtr->do(\(Eventarg1)arg2arg3arg4arg5arg6arg7arg8->withForeignPtrarg1$\argPtr1->gst_event_parse_new_segment_fullargPtr1arg2arg3arg4arg5arg6arg7arg8)(toEventevent)ratePtrappliedRatePtrupdatePtrformatPtrstartPtrstopPtrpositionPtrupdate<-liftMtoBool$peekupdatePtrrate<-liftMrealToFrac$peekratePtrappliedRate<-liftMrealToFrac$peekappliedRatePtrformat<-liftM(toFormat.fromIntegral)$peekformatPtrstart<-liftMfromIntegral$peekstartPtrstop<-liftMfromIntegral$peekstopPtrposition<-liftMfromIntegral$peekpositionPtrreturn(update,rate,appliedRate,format,start,stop,position)|otherwise=NothingeventParseQOS::EventClassevent=>event->Maybe(Double,ClockTimeDiff,ClockTime)eventParseQOSevent|eventTypeevent==EventQOS=Just$unsafePerformIO$alloca$\proportionPtr->alloca$\diffPtr->alloca$\timestampPtr->do(\(Eventarg1)arg2arg3arg4->withForeignPtrarg1$\argPtr1->gst_event_parse_qosargPtr1arg2arg3arg4)(toEventevent)proportionPtrdiffPtrtimestampPtrproportion<-liftMrealToFrac$peekproportionPtrdiff<-liftMfromIntegral$peekdiffPtrtimestamp<-liftMfromIntegral$peektimestampPtrreturn(proportion,diff,timestamp)|otherwise=NothingeventParseSeek::EventClassevent=>event->Maybe(Double,Format,[SeekFlags],SeekType,Int64,SeekType,Int64)eventParseSeekevent|eventTypeevent==EventSeek=Just$unsafePerformIO$alloca$\ratePtr->alloca$\formatPtr->alloca$\flagsPtr->alloca$\startTypePtr->alloca$\startPtr->alloca$\stopTypePtr->alloca$\stopPtr->do(\(Eventarg1)arg2arg3arg4arg5arg6arg7arg8->withForeignPtrarg1$\argPtr1->gst_event_parse_seekargPtr1arg2arg3arg4arg5arg6arg7arg8)(toEventevent)ratePtrformatPtrflagsPtrstartTypePtrstartPtrstopTypePtrstopPtrrate<-liftMrealToFrac$peekratePtrformat<-liftM(toFormat.fromIntegral)$peekformatPtrflags<-liftMcToFlags$peekflagsPtrstartType<-liftMcToEnum$peekstartTypePtrstart<-liftMfromIntegral$peekstartPtrstopType<-liftMcToEnum$peekstopTypePtrstop<-liftMfromIntegral$peekstopPtrreturn(rate,format,flags,startType,start,stopType,stop)|otherwise=NothingeventParseTag::EventClassevent=>event->MaybeTagListeventParseTagevent|eventTypeevent==EventTag=Just$unsafePerformIO$alloca$\tagListPtr->do(\(Eventarg1)arg2->withForeignPtrarg1$\argPtr1->gst_event_parse_tagargPtr1arg2)(toEventevent)(castPtrtagListPtr)peektagListPtr>>=peekTagList|otherwise=NothingeventTypeGetName::EventType->StringeventTypeGetNameeventType=unsafePerformIO$gst_event_type_get_name(cFromEnumeventType)>>=peekUTFStringeventTypeGetFlags::EventType->[EventTypeFlags]eventTypeGetFlags=cToFlags.gst_event_type_get_flags.cFromEnumforeignimportccallsafe"gst_event_new_custom"gst_event_new_custom::(CInt->((PtrStructure)->(IO(PtrEvent))))foreignimportccallsafe"gst_event_new_eos"gst_event_new_eos::(IO(PtrEvent))foreignimportccallsafe"gst_event_new_flush_start"gst_event_new_flush_start::(IO(PtrEvent))foreignimportccallsafe"gst_event_new_flush_stop"gst_event_new_flush_stop::(IO(PtrEvent))foreignimportccallsafe"gst_event_new_latency"gst_event_new_latency::(CULLong->(IO(PtrEvent)))foreignimportccallsafe"gst_event_new_navigation"gst_event_new_navigation::((PtrStructure)->(IO(PtrEvent)))foreignimportccallsafe"gst_event_new_new_segment"gst_event_new_new_segment::(CInt->(CDouble->(CInt->(CLLong->(CLLong->(CLLong->(IO(PtrEvent))))))))foreignimportccallsafe"gst_event_new_new_segment_full"gst_event_new_new_segment_full::(CInt->(CDouble->(CDouble->(CInt->(CLLong->(CLLong->(CLLong->(IO(PtrEvent)))))))))foreignimportccallsafe"gst_event_new_qos"gst_event_new_qos::(CDouble->(CLLong->(CULLong->(IO(PtrEvent)))))foreignimportccallsafe"gst_event_new_seek"gst_event_new_seek::(CDouble->(CInt->(CInt->(CInt->(CLLong->(CInt->(CLLong->(IO(PtrEvent)))))))))foreignimportccallsafe"gst_event_new_tag"gst_event_new_tag::((Ptr())->(IO(PtrEvent)))foreignimportccallsafe"gst_event_parse_buffer_size"gst_event_parse_buffer_size::((PtrEvent)->((PtrCInt)->((PtrCLLong)->((PtrCLLong)->((PtrCInt)->(IO()))))))foreignimportccallsafe"gst_event_parse_latency"gst_event_parse_latency::((PtrEvent)->((PtrCULLong)->(IO())))foreignimportccallsafe"gst_event_parse_new_segment"gst_event_parse_new_segment::((PtrEvent)->((PtrCInt)->((PtrCDouble)->((PtrCInt)->((PtrCLLong)->((PtrCLLong)->((PtrCLLong)->(IO()))))))))foreignimportccallsafe"gst_event_parse_new_segment_full"gst_event_parse_new_segment_full::((PtrEvent)->((PtrCInt)->((PtrCDouble)->((PtrCDouble)->((PtrCInt)->((PtrCLLong)->((PtrCLLong)->((PtrCLLong)->(IO())))))))))foreignimportccallsafe"gst_event_parse_qos"gst_event_parse_qos::((PtrEvent)->((PtrCDouble)->((PtrCLLong)->((PtrCULLong)->(IO())))))foreignimportccallsafe"gst_event_parse_seek"gst_event_parse_seek::((PtrEvent)->((PtrCDouble)->((PtrCInt)->((PtrCInt)->((PtrCInt)->((PtrCLLong)->((PtrCInt)->((PtrCLLong)->(IO())))))))))foreignimportccallsafe"gst_event_parse_tag"gst_event_parse_tag::((PtrEvent)->((Ptr(Ptr()))->(IO())))foreignimportccallsafe"gst_event_type_get_name"gst_event_type_get_name::(CInt->(IO(PtrCChar)))foreignimportccallsafe"gst_event_type_get_flags"gst_event_type_get_flags::(CInt->CInt)