                                 (fromIntegral $ fromEnum stopType)
                                 (fromIntegral stop)
 
-onElementNoMorePads, afterElementNoMorePads :: (ElementClass element)
-                                            => element
-                                            -> IO ()
-                                            -> IO (ConnectId element)
-onElementNoMorePads =
-    connect_NONE__NONE "no-more-pads" False
-afterElementNoMorePads =
-    connect_NONE__NONE "no-more-pads" True
-
-onElementPadAdded, afterElementPadAdded :: (ElementClass element)
-                                        => element
-                                        -> (Pad -> IO ())
-                                        -> IO (ConnectId element)
-onElementPadAdded =
-    connect_OBJECT__NONE "pad-added" False
-afterElementPadAdded =
-    connect_OBJECT__NONE "pad-added" True
-
-onElementPadRemoved, afterElementPadRemoved :: (ElementClass element)
-                                            => element
-                                            -> (Pad -> IO ())
-                                            -> IO (ConnectId element)
-onElementPadRemoved =
-    connect_OBJECT__NONE "pad-removed" False
-afterElementPadRemoved =
-    connect_OBJECT__NONE "pad-removed" True
+-- | The signal emitted when an element will not generate more dynamic
+--   pads.
+elementNoMorePads :: (ElementClass element)
+                  => Signal element (IO ())
+elementNoMorePads =
+    Signal $ connect_NONE__NONE "no-more-pads"
+
+-- | The signal emitted when a new 'Pad' has been added to the
+--   element.
+elementPadAdded :: (ElementClass element)
+                => Signal element (Pad -> IO ())
+elementPadAdded =
+    Signal $ connect_OBJECT__NONE "pad-added"
+
+-- | The signal emitted when a 'Pad' has been removed from the
+--   element.
+elementPadRemoved :: (ElementClass element)
+                  => Signal element (Pad -> IO ())
+elementPadRemoved =
+    Signal $ connect_OBJECT__NONE "pad-removed"

                                          fromIntegral duration)
                   else return Nothing

elementSendEvent :: (ElementClass element, EventClass event)
                 => element
                 -> event
                 -> IO Bool
elementSendEvent element event =
    liftM toBool $
        giveMiniObject (toEvent event) $ {# call element_send_event #} (toElement element)

elementSeekSimple :: ElementClass element
                  => element
                  -> Format
                  -> [SeekFlags]
                  -> Int64
                  -> IO Bool
elementSeekSimple element format seekFlags seekPos =
    liftM toBool $
        {# call element_seek_simple #} (toElement element)

        {# call element_get_query_types #} (toElement element) >>=
            peekArray0 0

-- | Perform a query on the given element.
--   
--   For elements that don't implement a query handler, this function
--   forwards the query to a random srcpad or to the peer of a random
--   linked sinkpad of this element.
elementQuery :: (ElementClass element, QueryClass query)
             => element -- ^ @element@ - 
             -> query   -- ^ @query@ - 
             -> IO Bool -- ^ 'True' if the query could be performed
elementQuery element query =
    do query' <- {# call mini_object_copy #} (toMiniObject query) >>=
                    newForeignPtr_ . castPtr
       fmap toBool $ {# call element_query #} (toElement element) $ Query query'

-- | Query an element for the convertion of a value from one format to
--   another.
elementQueryConvert :: ElementClass element
                    => element -- ^ @element@ - the element to query
                    -> Format  -- ^ @srcFormat@ - the format to convert from
                    -> Int64   -- ^ @srcVal@ - the value to convert
                    -> Format  -- ^ @destFormat@ - the format to convert to
                    -> IO (Maybe (Format, Word64)) -- ^ the resulting format and value
elementQueryConvert element srcFormat srcVal destFormat =
    alloca $ \destFormatPtr ->
        alloca $ \destValPtr ->
            do poke destFormatPtr $ fromIntegral $ fromEnum destFormat
               success <- {# call element_query_convert #} (toElement element)
                                                       (fromIntegral $ fromEnum srcFormat)
                                                       (fromIntegral srcVal)
                                                       destFormatPtr
