File: Constants.hsc

package info (click to toggle)
haskell-gstreamer 0.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 720 kB
  • sloc: haskell: 635; ansic: 116; makefile: 11; sh: 7
file content (395 lines) | stat: -rw-r--r-- 21,641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
{-# OPTIONS_HADDOCK hide #-}
--  GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*-

#include "hsgstreamer.h"
#include "template-hsc-gtk2hs.h"

--
--  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://www.gnu.org/licenses/>.
--  
--  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.

-- #hide
  
-- | Maintainer  : gtk2hs-devel@lists.sourceforge.net
--   Stability   : alpha
--   Portability : portable (depends on GHC)
module Media.Streaming.GStreamer.Core.Constants where

import Data.Int
import Data.Word
import System.Glib.Flags

-- | A time value in nanoseconds.
type ClockTime = Word64

-- | The undefined 'ClockTime' value.
clockTimeNone :: ClockTime
clockTimeNone = #{const GST_CLOCK_TIME_NONE}

second, msecond, usecond, nsecond :: ClockTime
-- | One second as a 'ClockTime' value.
second  = #{const GST_SECOND}
-- | One millisecond as a 'ClockTime' value.
msecond = #{const GST_MSECOND}
-- | One microsecond as a 'ClockTime' value.
usecond = #{const GST_USECOND}
-- | One nanosecond as a 'ClockTime' value.
nsecond = #{const GST_NSECOND}

-- | The type for buffer offsets.
type BufferOffset = Word64
-- | The undefined 'BufferOffset' value.
bufferOffsetNone :: BufferOffset
bufferOffsetNone = #{const GST_BUFFER_OFFSET_NONE}

-- | A format identifier.
newtype FormatId = FormatId #{gtk2hs_type GstFormat}
    deriving (Eq, Ord, Show)

-- | An enumeration of standard predefined formats.
data Format = FormatUndefined     -- ^ no format
            | FormatDefault       -- ^ the default format of the pad or element; this can be, e.g., samples for raw audio
            | FormatBytes         -- ^ bytes
            | FormatTime          -- ^ time in nanoseconds
            | FormatBuffers       -- ^ buffers
            | FormatPercent       -- ^ percentage of stream
            | FormatUser FormatId -- ^ a user defined format
              deriving (Eq, Ord, Show)
toFormat :: #{gtk2hs_type GstFormat} -> Format
toFormat n | n == #{const GST_FORMAT_UNDEFINED} = FormatUndefined
           | n == #{const GST_FORMAT_DEFAULT}   = FormatDefault
           | n == #{const GST_FORMAT_BYTES}     = FormatBytes
           | n == #{const GST_FORMAT_TIME}      = FormatTime
           | n == #{const GST_FORMAT_BUFFERS}   = FormatBuffers
           | n == #{const GST_FORMAT_PERCENT}   = FormatPercent
           | otherwise                          = FormatUser (FormatId n)
fromFormat :: Format -> #{gtk2hs_type GstFormat}
fromFormat FormatUndefined = #{const GST_FORMAT_UNDEFINED}
fromFormat FormatDefault   = #{const GST_FORMAT_DEFAULT}
fromFormat FormatBytes     = #{const GST_FORMAT_BYTES}
fromFormat FormatTime      = #{const GST_FORMAT_TIME}
fromFormat FormatBuffers   = #{const GST_FORMAT_BUFFERS}
fromFormat FormatPercent   = #{const GST_FORMAT_PERCENT}
fromFormat (FormatUser (FormatId id)) = id

-- | The format value for 'FormatPercent' is between 0 and this value.
formatPercentMax :: Int64
formatPercentMax = #{const GST_FORMAT_PERCENT_MAX}

-- | The value used to scale down the reported 'FormatPercent' format
--   value to its real value.
formatPercentScale :: Int64
formatPercentScale = #{const GST_FORMAT_PERCENT_SCALE}

-- | The flags that an 'Object' may have.
data ObjectFlags = ObjectDisposing  -- ^ The object has been
                                    --   destroyed, don't use it any
                                    --   more.
                   deriving (Bounded, Show)
instance Enum ObjectFlags where
    toEnum n | n == #{const GST_OBJECT_DISPOSING} = ObjectDisposing
    fromEnum ObjectDisposing = #{const GST_OBJECT_DISPOSING}
instance Flags ObjectFlags

-- | The flags that a 'Pad' may have.
data PadFlags = PadBlocked   -- ^ dataflow on the pad is blocked
              | PadFlushing  -- ^ the pad is refusing buffers
              | PadInGetCaps -- ^ 'padGetCaps' is executing
              | PadInSetCaps -- ^ 'padSetCaps' is executing
#if GST_CHECK_VERSION(0,10,11)
              | PadBlocking  -- ^ the pad is blocking on a buffer or event
#endif
                deriving (Eq, Bounded, Show)
instance Enum PadFlags where
    toEnum n | n == #{const GST_PAD_BLOCKED}    = PadBlocked
             | n == #{const GST_PAD_FLUSHING}   = PadFlushing
             | n == #{const GST_PAD_IN_GETCAPS} = PadInGetCaps
             | n == #{const GST_PAD_IN_SETCAPS} = PadInSetCaps
#if GST_CHECK_VERSION(0,10,11)
             | n == #{const GST_PAD_BLOCKING}   = PadBlocking
#endif
    fromEnum PadBlocked   = #{const GST_PAD_BLOCKED}
    fromEnum PadFlushing  = #{const GST_PAD_FLUSHING}
    fromEnum PadInGetCaps = #{const GST_PAD_IN_GETCAPS}
    fromEnum PadInSetCaps = #{const GST_PAD_IN_SETCAPS}
#if GST_CHECK_VERSION(0,10,11)
    fromEnum PadBlocking  = #{const GST_PAD_BLOCKING}
#endif
instance Flags PadFlags

-- | The flags that an 'Element' may have.
data ElementFlags = ElementLockedState -- ^ parent state changes are ignored
                  | ElementIsSink      -- ^ the element is a sink
                  | ElementUnparenting -- ^ child is being removed
                                       --   from the parent bin
                    deriving (Eq, Bounded, Show)
instance Enum ElementFlags where
    toEnum n | n == #{const GST_ELEMENT_LOCKED_STATE} = ElementLockedState
             | n == #{const GST_ELEMENT_IS_SINK}      = ElementIsSink
             | n == #{const GST_ELEMENT_UNPARENTING}  = ElementUnparenting
    fromEnum ElementLockedState = #{const GST_ELEMENT_LOCKED_STATE}
    fromEnum ElementIsSink      = #{const GST_ELEMENT_IS_SINK}
    fromEnum ElementUnparenting = #{const GST_ELEMENT_UNPARENTING}
instance Flags ElementFlags

-- | The different state changes that are passed to the state change
--   functions of 'Element's.
data StateChange = StateChangeNullToReady     -- ^ state change from 'StateNull' to 'StateReady'
                 | StateChangeReadyToPaused   -- ^ state change from 'StateReady' to 'StatePaused'
                 | StateChangePausedToPlaying -- ^ state change from 'StatePaused' to 'StatePlaying'
                 | StateChangePlayingToPaused -- ^ state change from 'StatePlaying' to 'StatePaused'
                 | StateChangePausedToReady   -- ^ state change from 'StatePaused' to 'StateReady'
                 | StateChangeReadyToNull     -- ^ state change from 'StateReady' to 'StateNull'
                   deriving (Eq, Show)
instance Enum StateChange where
    toEnum n | n == #{const GST_STATE_CHANGE_NULL_TO_READY}     = StateChangeNullToReady
             | n == #{const GST_STATE_CHANGE_READY_TO_PAUSED}   = StateChangeReadyToPaused
             | n == #{const GST_STATE_CHANGE_PAUSED_TO_PLAYING} = StateChangePausedToPlaying
             | n == #{const GST_STATE_CHANGE_PLAYING_TO_PAUSED} = StateChangePlayingToPaused
             | n == #{const GST_STATE_CHANGE_PAUSED_TO_READY}   = StateChangePausedToReady
             | n == #{const GST_STATE_CHANGE_READY_TO_NULL}     = StateChangeReadyToNull
    
    fromEnum StateChangeNullToReady     = #{const GST_STATE_CHANGE_NULL_TO_READY}
    fromEnum StateChangeReadyToPaused   = #{const GST_STATE_CHANGE_READY_TO_PAUSED}
    fromEnum StateChangePausedToPlaying = #{const GST_STATE_CHANGE_PAUSED_TO_PLAYING}
    fromEnum StateChangePlayingToPaused = #{const GST_STATE_CHANGE_PLAYING_TO_PAUSED}
    fromEnum StateChangePausedToReady   = #{const GST_STATE_CHANGE_PAUSED_TO_READY}
    fromEnum StateChangeReadyToNull     = #{const GST_STATE_CHANGE_READY_TO_NULL}

-- | The flags that a 'Bus' may have.
data BusFlags = BusFlushing -- ^ the bus is currently dropping all messages
                deriving (Eq, Bounded, Show)
instance Enum BusFlags where
    toEnum n | n == #{const GST_BUS_FLUSHING} = BusFlushing
    fromEnum BusFlushing = #{const GST_BUS_FLUSHING}
instance Flags BusFlags

-- | The flags that a 'Clock' may have.
data ClockFlags = ClockCanDoSingleSync    -- ^ the clock can do a single sync timeout request
                | ClockCanDoSingleAsync   -- ^ the clock can do a single async timeout request
                | ClockCanDoPeriodicSync  -- ^ the clock can do periodic sync timeout requests
                | ClockCanDoPeriodicAsync -- ^ the clock can do periodic async timeout requests
                | ClockCanSetResolution   -- ^ the clock's resolution can be changed
                | ClockCanSetMaster       -- ^ the clock can be slaved to a master clock
                  deriving (Eq, Bounded, Show)
instance Enum ClockFlags where
    toEnum n | n == #{const GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC}    = ClockCanDoSingleSync
             | n == #{const GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC}   = ClockCanDoSingleAsync
             | n == #{const GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC}  = ClockCanDoPeriodicSync
             | n == #{const GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC} = ClockCanDoPeriodicAsync
             | n == #{const GST_CLOCK_FLAG_CAN_SET_RESOLUTION}    = ClockCanSetResolution
             | n == #{const GST_CLOCK_FLAG_CAN_SET_MASTER}        = ClockCanSetMaster
    
    fromEnum ClockCanDoSingleSync    = #{const GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC}
    fromEnum ClockCanDoSingleAsync   = #{const GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC}
    fromEnum ClockCanDoPeriodicSync  = #{const GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC}
    fromEnum ClockCanDoPeriodicAsync = #{const GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC}
    fromEnum ClockCanSetResolution   = #{const GST_CLOCK_FLAG_CAN_SET_RESOLUTION}
    fromEnum ClockCanSetMaster       = #{const GST_CLOCK_FLAG_CAN_SET_MASTER}
instance Flags ClockFlags

-- | The flags an 'Index' may have.
data IndexFlags = IndexWritable -- ^ the index is writable
                | IndexReadable -- ^ the index is readable
                  deriving (Eq, Bounded, Show)
instance Enum IndexFlags where
    toEnum n | n == #{const GST_INDEX_WRITABLE} = IndexWritable
             | n == #{const GST_INDEX_READABLE} = IndexReadable
    fromEnum IndexWritable = #{const GST_INDEX_WRITABLE}
    fromEnum IndexReadable = #{const GST_INDEX_READABLE}
instance Flags IndexFlags

-- | The flags a 'MiniObject' may have.
data MiniObjectFlags = MiniObjectReadOnly -- ^ the object is not writable
                       deriving (Eq, Bounded, Show)
instance Enum MiniObjectFlags where
    toEnum n | n == #{const GST_MINI_OBJECT_FLAG_READONLY} = MiniObjectReadOnly
    fromEnum MiniObjectReadOnly = #{const GST_MINI_OBJECT_FLAG_READONLY}
instance Flags MiniObjectFlags

-- | The flags a 'Buffer' may have.
data BufferFlags = BufferPreroll   -- ^ the buffer is part of a preroll and should not be displayed
                 | BufferDiscont   -- ^ the buffer marks a discontinuity in the stream
                 | BufferInCaps    -- ^ the buffer has been added as a field in a 'Caps'
                 | BufferGap       -- ^ the buffer has been created to fill a gap in the stream
                 | BufferDeltaUnit -- ^ the buffer cannot be decoded independently
                   deriving (Eq, Bounded, Show)
instance Enum BufferFlags where
    toEnum n | n == #{const GST_BUFFER_FLAG_PREROLL}    = BufferPreroll
             | n == #{const GST_BUFFER_FLAG_DISCONT}    = BufferDiscont
             | n == #{const GST_BUFFER_FLAG_IN_CAPS}    = BufferInCaps
             | n == #{const GST_BUFFER_FLAG_GAP}        = BufferGap
             | n == #{const GST_BUFFER_FLAG_DELTA_UNIT} = BufferDeltaUnit
    fromEnum BufferPreroll   = #{const GST_BUFFER_FLAG_PREROLL}
    fromEnum BufferDiscont   = #{const GST_BUFFER_FLAG_DISCONT}
    fromEnum BufferInCaps    = #{const GST_BUFFER_FLAG_IN_CAPS}
    fromEnum BufferGap       = #{const GST_BUFFER_FLAG_GAP}
    fromEnum BufferDeltaUnit = #{const GST_BUFFER_FLAG_DELTA_UNIT}
instance Flags BufferFlags

-- | The event types that may occur in a pipeline.
data EventType = EventUnknown             -- ^ an unknown event
               | EventFlushStart          -- ^ start a flush operation
               | EventFlushStop           -- ^ stop a flush operation
               | EventEOS                 -- ^ end of stream
               | EventNewSegment          -- ^ a new segment follows in the dataflow
               | EventTag                 -- ^ a new set of metadata tags has been found
               | EventBufferSize          -- ^ notification of buffering requirements
               | EventQOS                 -- ^ quality of service notification
               | EventSeek                -- ^ a request for a new playback position and rate
               | EventNavigation          -- ^ notification of user request
#if GST_CHECK_VERSION(0, 10, 12)
               | EventLatency             -- ^ notification of latency adjustment
#endif
               | EventCustomUpstream      -- ^ custom upstream event
               | EventCustomDownstream    -- ^ custom downstream event
               | EventCustomDownstreamOOB -- ^ custom downstream out-of-band event
               | EventCustomBoth          -- ^ custom bidirectional event
               | EventCustomBothOOB       -- ^ custom bidirectional out-of-band event
                 deriving (Eq, Bounded, Show)
instance Enum EventType where
    toEnum n | n == #{const GST_EVENT_UNKNOWN} = EventUnknown
             | n == #{const GST_EVENT_FLUSH_START} = EventFlushStart
             | n == #{const GST_EVENT_FLUSH_STOP} = EventFlushStop
             | n == #{const GST_EVENT_EOS} = EventEOS
             | n == #{const GST_EVENT_NEWSEGMENT} = EventNewSegment
             | n == #{const GST_EVENT_TAG} = EventTag
             | n == #{const GST_EVENT_BUFFERSIZE} = EventBufferSize
             | n == #{const GST_EVENT_QOS} = EventQOS
             | n == #{const GST_EVENT_SEEK} = EventSeek
             | n == #{const GST_EVENT_NAVIGATION} = EventNavigation
#if GST_CHECK_VERSION(0, 10, 12)
             | n == #{const GST_EVENT_LATENCY} = EventLatency
#endif
             | n == #{const GST_EVENT_CUSTOM_UPSTREAM} = EventCustomUpstream
             | n == #{const GST_EVENT_CUSTOM_DOWNSTREAM} = EventCustomDownstream
             | n == #{const GST_EVENT_CUSTOM_DOWNSTREAM_OOB} = EventCustomDownstreamOOB
             | n == #{const GST_EVENT_CUSTOM_BOTH} = EventCustomBoth
             | n == #{const GST_EVENT_CUSTOM_BOTH_OOB} = EventCustomBothOOB

    fromEnum EventUnknown             = #{const GST_EVENT_UNKNOWN}
    fromEnum EventFlushStart          = #{const GST_EVENT_FLUSH_START}
    fromEnum EventFlushStop           = #{const GST_EVENT_FLUSH_STOP}
    fromEnum EventEOS                 = #{const GST_EVENT_EOS}
    fromEnum EventNewSegment          = #{const GST_EVENT_NEWSEGMENT}
    fromEnum EventTag                 = #{const GST_EVENT_TAG}
    fromEnum EventBufferSize          = #{const GST_EVENT_BUFFERSIZE}
    fromEnum EventQOS                 = #{const GST_EVENT_QOS}
    fromEnum EventSeek                = #{const GST_EVENT_SEEK}
    fromEnum EventNavigation          = #{const GST_EVENT_NAVIGATION}
#if GST_CHECK_VERSION(0, 10, 12)
    fromEnum EventLatency             = #{const GST_EVENT_LATENCY}
#endif
    fromEnum EventCustomUpstream      = #{const GST_EVENT_CUSTOM_UPSTREAM}
    fromEnum EventCustomDownstream    = #{const GST_EVENT_CUSTOM_DOWNSTREAM}
    fromEnum EventCustomDownstreamOOB = #{const GST_EVENT_CUSTOM_DOWNSTREAM_OOB}
    fromEnum EventCustomBoth          = #{const GST_EVENT_CUSTOM_BOTH}
    fromEnum EventCustomBothOOB       = #{const GST_EVENT_CUSTOM_BOTH_OOB}

-- | The messages types that may be sent by a pipeline.
data MessageType = MessageEOS             -- ^ end-of-stream
                 | MessageError           -- ^ an error message
                 | MessageWarning         -- ^ a warning message
                 | MessageInfo            -- ^ an informational message
                 | MessageTag             -- ^ a metadata tag
                 | MessageBuffering       -- ^ the pipeline is buffering
                 | MessageStateChanged    -- ^ the pipeline changed state
                 | MessageStepDone        -- ^ a framestep finished
                 | MessageClockProvide    -- ^ an element is able to provide a clock
                 | MessageClockLost       -- ^ the current clock has become unusable
                 | MessageNewClock        -- ^ a new clock was selected by the pipeline
                 | MessageStructureChange -- ^ the structure of the pipeline has changed
                 | MessageStreamStatus    -- ^ a stream status message
                 | MessageApplication     -- ^ a message posted by the application
                 | MessageElement         -- ^ an element specific message
                 | MessageSegmentStart    -- ^ the pipeline started playback of a segment
                 | MessageSegmentDone     -- ^ the pipeline finished playback of a segment
                 | MessageDuration        -- ^ the duration of the pipeline changed
#if GST_CHECK_VERSION(0, 10, 12)
                 | MessageLatency         -- ^ an element's latency has changed
#endif
#if GST_CHECK_VERSION(0, 10, 13)
                 | MessageAsyncStart      -- ^ an element has started an async state change; used internally
                 | MessageAsyncDone       -- ^ an element has completed an async state change; used internally
#endif
                   deriving (Eq, Bounded, Show)
instance Enum MessageType where
    toEnum n | n == #{const GST_MESSAGE_EOS}               = MessageEOS
             | n == #{const GST_MESSAGE_ERROR}             = MessageError
             | n == #{const GST_MESSAGE_WARNING}           = MessageWarning
             | n == #{const GST_MESSAGE_INFO}              = MessageInfo
             | n == #{const GST_MESSAGE_TAG}               = MessageTag
             | n == #{const GST_MESSAGE_BUFFERING}         = MessageBuffering
             | n == #{const GST_MESSAGE_STATE_CHANGED}     = MessageStateChanged
             | n == #{const GST_MESSAGE_STEP_DONE}         = MessageStepDone
             | n == #{const GST_MESSAGE_CLOCK_PROVIDE}     = MessageClockProvide
             | n == #{const GST_MESSAGE_CLOCK_LOST}        = MessageClockLost
             | n == #{const GST_MESSAGE_NEW_CLOCK}         = MessageNewClock
             | n == #{const GST_MESSAGE_STRUCTURE_CHANGE}  = MessageStructureChange
             | n == #{const GST_MESSAGE_STREAM_STATUS}     = MessageStreamStatus
             | n == #{const GST_MESSAGE_APPLICATION}       = MessageApplication
             | n == #{const GST_MESSAGE_ELEMENT}           = MessageElement
             | n == #{const GST_MESSAGE_SEGMENT_START}     = MessageSegmentStart
             | n == #{const GST_MESSAGE_SEGMENT_DONE}      = MessageSegmentDone
             | n == #{const GST_MESSAGE_DURATION}          = MessageDuration
#if GST_CHECK_VERSION(0, 10, 12)
             | n == #{const GST_MESSAGE_LATENCY}           = MessageLatency
#endif
#if GST_CHECK_VERSION(0, 10, 13)
             | n == #{const GST_MESSAGE_ASYNC_START}       = MessageAsyncStart
             | n == #{const GST_MESSAGE_ASYNC_DONE}        = MessageAsyncDone
#endif
    fromEnum MessageEOS             = #{const GST_MESSAGE_EOS}
    fromEnum MessageError           = #{const GST_MESSAGE_ERROR}
    fromEnum MessageWarning         = #{const GST_MESSAGE_WARNING}
    fromEnum MessageInfo            = #{const GST_MESSAGE_INFO}
    fromEnum MessageTag             = #{const GST_MESSAGE_TAG}
    fromEnum MessageBuffering       = #{const GST_MESSAGE_BUFFERING}
    fromEnum MessageStateChanged    = #{const GST_MESSAGE_STATE_CHANGED}
    fromEnum MessageStepDone        = #{const GST_MESSAGE_STEP_DONE}
    fromEnum MessageClockProvide    = #{const GST_MESSAGE_CLOCK_PROVIDE}
    fromEnum MessageClockLost       = #{const GST_MESSAGE_CLOCK_LOST}
    fromEnum MessageNewClock        = #{const GST_MESSAGE_NEW_CLOCK}
    fromEnum MessageStructureChange = #{const GST_MESSAGE_STRUCTURE_CHANGE}
    fromEnum MessageStreamStatus    = #{const GST_MESSAGE_STREAM_STATUS}
    fromEnum MessageApplication     = #{const GST_MESSAGE_APPLICATION}
    fromEnum MessageElement         = #{const GST_MESSAGE_ELEMENT}
    fromEnum MessageSegmentStart    = #{const GST_MESSAGE_SEGMENT_START}
    fromEnum MessageSegmentDone     = #{const GST_MESSAGE_SEGMENT_DONE}
    fromEnum MessageDuration        = #{const GST_MESSAGE_DURATION}
#if GST_CHECK_VERSION(0, 10, 12)
    fromEnum MessageLatency         = #{const GST_MESSAGE_LATENCY}
#endif
#if GST_CHECK_VERSION(0, 10, 13)
    fromEnum MessageAsyncStart      = #{const GST_MESSAGE_ASYNC_START}
    fromEnum MessageAsyncDone       = #{const GST_MESSAGE_ASYNC_DONE}
#endif
instance Flags MessageType

-- | The flags that a 'Caps' may have.
data CapsFlags = CapsAny
                 deriving (Eq, Bounded, Show)
instance Enum CapsFlags where
    toEnum n | n == #{const GST_CAPS_FLAGS_ANY} = CapsAny
    fromEnum CapsAny = #{const GST_CAPS_FLAGS_ANY}
instance Flags CapsFlags