{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The t'GI.GstPbutils.Objects.Discoverer.Discoverer' is a utility object which allows to get as much
-- information as possible from one or many URIs.
-- 
-- It provides two APIs, allowing usage in blocking or non-blocking mode.
-- 
-- The blocking mode just requires calling 'GI.GstPbutils.Objects.Discoverer.discovererDiscoverUri'
-- with the URI one wishes to discover.
-- 
-- The non-blocking mode requires a running t'GI.GLib.Structs.MainLoop.MainLoop' iterating a
-- t'GI.GLib.Structs.MainContext.MainContext', where one connects to the various signals, appends the
-- URIs to be processed (through 'GI.GstPbutils.Objects.Discoverer.discovererDiscoverUriAsync') and then
-- asks for the discovery to begin (through 'GI.GstPbutils.Objects.Discoverer.discovererStart').
-- By default this will use the GLib default main context unless you have
-- set a custom context using 'GI.GLib.Structs.MainContext.mainContextPushThreadDefault'.
-- 
-- All the information is returned in a t'GI.GstPbutils.Objects.DiscovererInfo.DiscovererInfo' structure.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GstPbutils.Objects.Discoverer
    ( 

-- * Exported types
    Discoverer(..)                          ,
    IsDiscoverer                            ,
    toDiscoverer                            ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [discoverUri]("GI.GstPbutils.Objects.Discoverer#g:method:discoverUri"), [discoverUriAsync]("GI.GstPbutils.Objects.Discoverer#g:method:discoverUriAsync"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [start]("GI.GstPbutils.Objects.Discoverer#g:method:start"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [stop]("GI.GstPbutils.Objects.Discoverer#g:method:stop"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveDiscovererMethod                 ,
#endif

-- ** discoverUri #method:discoverUri#

#if defined(ENABLE_OVERLOADING)
    DiscovererDiscoverUriMethodInfo         ,
#endif
    discovererDiscoverUri                   ,


-- ** discoverUriAsync #method:discoverUriAsync#

#if defined(ENABLE_OVERLOADING)
    DiscovererDiscoverUriAsyncMethodInfo    ,
#endif
    discovererDiscoverUriAsync              ,


-- ** new #method:new#

    discovererNew                           ,


-- ** start #method:start#

#if defined(ENABLE_OVERLOADING)
    DiscovererStartMethodInfo               ,
#endif
    discovererStart                         ,


-- ** stop #method:stop#

#if defined(ENABLE_OVERLOADING)
    DiscovererStopMethodInfo                ,
#endif
    discovererStop                          ,




 -- * Properties


-- ** timeout #attr:timeout#
-- | The duration (in nanoseconds) after which the discovery of an individual
-- URI will timeout.
-- 
-- If the discovery of a URI times out, the 'GI.GstPbutils.Enums.DiscovererResultTimeout' will be
-- set on the result flags.

#if defined(ENABLE_OVERLOADING)
    DiscovererTimeoutPropertyInfo           ,
#endif
    constructDiscovererTimeout              ,
#if defined(ENABLE_OVERLOADING)
    discovererTimeout                       ,
#endif
    getDiscovererTimeout                    ,
    setDiscovererTimeout                    ,


-- ** useCache #attr:useCache#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    DiscovererUseCachePropertyInfo          ,
#endif
    constructDiscovererUseCache             ,
#if defined(ENABLE_OVERLOADING)
    discovererUseCache                      ,
#endif
    getDiscovererUseCache                   ,
    setDiscovererUseCache                   ,




 -- * Signals


-- ** discovered #signal:discovered#

    DiscovererDiscoveredCallback            ,
#if defined(ENABLE_OVERLOADING)
    DiscovererDiscoveredSignalInfo          ,
#endif
    afterDiscovererDiscovered               ,
    onDiscovererDiscovered                  ,


-- ** finished #signal:finished#

    DiscovererFinishedCallback              ,
#if defined(ENABLE_OVERLOADING)
    DiscovererFinishedSignalInfo            ,
#endif
    afterDiscovererFinished                 ,
    onDiscovererFinished                    ,


-- ** sourceSetup #signal:sourceSetup#

    DiscovererSourceSetupCallback           ,
#if defined(ENABLE_OVERLOADING)
    DiscovererSourceSetupSignalInfo         ,
#endif
    afterDiscovererSourceSetup              ,
    onDiscovererSourceSetup                 ,


-- ** starting #signal:starting#

    DiscovererStartingCallback              ,
#if defined(ENABLE_OVERLOADING)
    DiscovererStartingSignalInfo            ,
#endif
    afterDiscovererStarting                 ,
    onDiscovererStarting                    ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Objects.Element as Gst.Element
import {-# SOURCE #-} qualified GI.GstPbutils.Objects.DiscovererInfo as GstPbutils.DiscovererInfo

-- | Memory-managed wrapper type.
newtype Discoverer = Discoverer (SP.ManagedPtr Discoverer)
    deriving (Discoverer -> Discoverer -> Bool
(Discoverer -> Discoverer -> Bool)
-> (Discoverer -> Discoverer -> Bool) -> Eq Discoverer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Discoverer -> Discoverer -> Bool
== :: Discoverer -> Discoverer -> Bool
$c/= :: Discoverer -> Discoverer -> Bool
/= :: Discoverer -> Discoverer -> Bool
Eq)

instance SP.ManagedPtrNewtype Discoverer where
    toManagedPtr :: Discoverer -> ManagedPtr Discoverer
toManagedPtr (Discoverer ManagedPtr Discoverer
p) = ManagedPtr Discoverer
p

foreign import ccall "gst_discoverer_get_type"
    c_gst_discoverer_get_type :: IO B.Types.GType

instance B.Types.TypedObject Discoverer where
    glibType :: IO GType
glibType = IO GType
c_gst_discoverer_get_type

instance B.Types.GObject Discoverer

-- | Type class for types which can be safely cast to `Discoverer`, for instance with `toDiscoverer`.
class (SP.GObject o, O.IsDescendantOf Discoverer o) => IsDiscoverer o
instance (SP.GObject o, O.IsDescendantOf Discoverer o) => IsDiscoverer o

instance O.HasParentTypes Discoverer
type instance O.ParentTypes Discoverer = '[GObject.Object.Object]

-- | Cast to `Discoverer`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDiscoverer :: (MIO.MonadIO m, IsDiscoverer o) => o -> m Discoverer
toDiscoverer :: forall (m :: * -> *) o.
(MonadIO m, IsDiscoverer o) =>
o -> m Discoverer
toDiscoverer = IO Discoverer -> m Discoverer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Discoverer -> m Discoverer)
-> (o -> IO Discoverer) -> o -> m Discoverer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Discoverer -> Discoverer) -> o -> IO Discoverer
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Discoverer -> Discoverer
Discoverer

-- | Convert 'Discoverer' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Discoverer) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_discoverer_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Discoverer -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Discoverer
P.Nothing = Ptr GValue -> Ptr Discoverer -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Discoverer
forall a. Ptr a
FP.nullPtr :: FP.Ptr Discoverer)
    gvalueSet_ Ptr GValue
gv (P.Just Discoverer
obj) = Discoverer -> (Ptr Discoverer -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Discoverer
obj (Ptr GValue -> Ptr Discoverer -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Discoverer)
gvalueGet_ Ptr GValue
gv = do
        Ptr Discoverer
ptr <- Ptr GValue -> IO (Ptr Discoverer)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Discoverer)
        if Ptr Discoverer
ptr Ptr Discoverer -> Ptr Discoverer -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Discoverer
forall a. Ptr a
FP.nullPtr
        then Discoverer -> Maybe Discoverer
forall a. a -> Maybe a
P.Just (Discoverer -> Maybe Discoverer)
-> IO Discoverer -> IO (Maybe Discoverer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Discoverer -> Discoverer)
-> Ptr Discoverer -> IO Discoverer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Discoverer -> Discoverer
Discoverer Ptr Discoverer
ptr
        else Maybe Discoverer -> IO (Maybe Discoverer)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Discoverer
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveDiscovererMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveDiscovererMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDiscovererMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDiscovererMethod "discoverUri" o = DiscovererDiscoverUriMethodInfo
    ResolveDiscovererMethod "discoverUriAsync" o = DiscovererDiscoverUriAsyncMethodInfo
    ResolveDiscovererMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDiscovererMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDiscovererMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDiscovererMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDiscovererMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDiscovererMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDiscovererMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDiscovererMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDiscovererMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDiscovererMethod "start" o = DiscovererStartMethodInfo
    ResolveDiscovererMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDiscovererMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDiscovererMethod "stop" o = DiscovererStopMethodInfo
    ResolveDiscovererMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDiscovererMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDiscovererMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDiscovererMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDiscovererMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDiscovererMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDiscovererMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDiscovererMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDiscovererMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDiscovererMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDiscovererMethod t Discoverer, O.OverloadedMethod info Discoverer p) => OL.IsLabel t (Discoverer -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDiscovererMethod t Discoverer, O.OverloadedMethod info Discoverer p, R.HasField t Discoverer p) => R.HasField t Discoverer p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveDiscovererMethod t Discoverer, O.OverloadedMethodInfo info Discoverer) => OL.IsLabel t (O.MethodProxy info Discoverer) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- signal Discoverer::discovered
-- | Will be emitted in async mode when all information on a URI could be
-- discovered, or an error occurred.
-- 
-- When an error occurs, /@info@/ might still contain some partial information,
-- depending on the circumstances of the error.
type DiscovererDiscoveredCallback =
    GstPbutils.DiscovererInfo.DiscovererInfo
    -- ^ /@info@/: the results t'GI.GstPbutils.Objects.DiscovererInfo.DiscovererInfo'
    -> Maybe GError
    -- ^ /@error@/: t'GError', which will be non-NULL
    --                                         if an error occurred during
    --                                         discovery. You must not free
    --                                         this t'GError', it will be freed by
    --                                         the discoverer.
    -> IO ()

type C_DiscovererDiscoveredCallback =
    Ptr Discoverer ->                       -- object
    Ptr GstPbutils.DiscovererInfo.DiscovererInfo ->
    Ptr GError ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DiscovererDiscoveredCallback`.
foreign import ccall "wrapper"
    mk_DiscovererDiscoveredCallback :: C_DiscovererDiscoveredCallback -> IO (FunPtr C_DiscovererDiscoveredCallback)

wrap_DiscovererDiscoveredCallback :: 
    GObject a => (a -> DiscovererDiscoveredCallback) ->
    C_DiscovererDiscoveredCallback
wrap_DiscovererDiscoveredCallback :: forall a.
GObject a =>
(a -> DiscovererDiscoveredCallback)
-> C_DiscovererDiscoveredCallback
wrap_DiscovererDiscoveredCallback a -> DiscovererDiscoveredCallback
gi'cb Ptr Discoverer
gi'selfPtr Ptr DiscovererInfo
info Ptr GError
error_ Ptr ()
_ = do
    DiscovererInfo
info' <- ((ManagedPtr DiscovererInfo -> DiscovererInfo)
-> Ptr DiscovererInfo -> IO DiscovererInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DiscovererInfo -> DiscovererInfo
GstPbutils.DiscovererInfo.DiscovererInfo) Ptr DiscovererInfo
info
    Maybe GError
maybeError_ <-
        if Ptr GError
error_ Ptr GError -> Ptr GError -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr GError
forall a. Ptr a
nullPtr
        then Maybe GError -> IO (Maybe GError)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GError
forall a. Maybe a
Nothing
        else do
            GError
error_' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_
            Maybe GError -> IO (Maybe GError)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe GError -> IO (Maybe GError))
-> Maybe GError -> IO (Maybe GError)
forall a b. (a -> b) -> a -> b
$ GError -> Maybe GError
forall a. a -> Maybe a
Just GError
error_'
    Ptr Discoverer -> (Discoverer -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Discoverer
gi'selfPtr ((Discoverer -> IO ()) -> IO ()) -> (Discoverer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Discoverer
gi'self -> a -> DiscovererDiscoveredCallback
gi'cb (Discoverer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Discoverer
gi'self)  DiscovererInfo
info' Maybe GError
maybeError_


-- | Connect a signal handler for the [discovered](#signal:discovered) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' discoverer #discovered callback
-- @
-- 
-- 
onDiscovererDiscovered :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererDiscoveredCallback) -> m SignalHandlerId
onDiscovererDiscovered :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a
-> ((?self::a) => DiscovererDiscoveredCallback)
-> m SignalHandlerId
onDiscovererDiscovered a
obj (?self::a) => DiscovererDiscoveredCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DiscovererDiscoveredCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DiscovererDiscoveredCallback
DiscovererDiscoveredCallback
cb
    let wrapped' :: C_DiscovererDiscoveredCallback
wrapped' = (a -> DiscovererDiscoveredCallback)
-> C_DiscovererDiscoveredCallback
forall a.
GObject a =>
(a -> DiscovererDiscoveredCallback)
-> C_DiscovererDiscoveredCallback
wrap_DiscovererDiscoveredCallback a -> DiscovererDiscoveredCallback
wrapped
    FunPtr C_DiscovererDiscoveredCallback
wrapped'' <- C_DiscovererDiscoveredCallback
-> IO (FunPtr C_DiscovererDiscoveredCallback)
mk_DiscovererDiscoveredCallback C_DiscovererDiscoveredCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererDiscoveredCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"discovered" FunPtr C_DiscovererDiscoveredCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [discovered](#signal:discovered) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' discoverer #discovered callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterDiscovererDiscovered :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererDiscoveredCallback) -> m SignalHandlerId
afterDiscovererDiscovered :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a
-> ((?self::a) => DiscovererDiscoveredCallback)
-> m SignalHandlerId
afterDiscovererDiscovered a
obj (?self::a) => DiscovererDiscoveredCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DiscovererDiscoveredCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DiscovererDiscoveredCallback
DiscovererDiscoveredCallback
cb
    let wrapped' :: C_DiscovererDiscoveredCallback
wrapped' = (a -> DiscovererDiscoveredCallback)
-> C_DiscovererDiscoveredCallback
forall a.
GObject a =>
(a -> DiscovererDiscoveredCallback)
-> C_DiscovererDiscoveredCallback
wrap_DiscovererDiscoveredCallback a -> DiscovererDiscoveredCallback
wrapped
    FunPtr C_DiscovererDiscoveredCallback
wrapped'' <- C_DiscovererDiscoveredCallback
-> IO (FunPtr C_DiscovererDiscoveredCallback)
mk_DiscovererDiscoveredCallback C_DiscovererDiscoveredCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererDiscoveredCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"discovered" FunPtr C_DiscovererDiscoveredCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DiscovererDiscoveredSignalInfo
instance SignalInfo DiscovererDiscoveredSignalInfo where
    type HaskellCallbackType DiscovererDiscoveredSignalInfo = DiscovererDiscoveredCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DiscovererDiscoveredCallback cb
        cb'' <- mk_DiscovererDiscoveredCallback cb'
        connectSignalFunPtr obj "discovered" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer::discovered"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:signal:discovered"})

#endif

-- signal Discoverer::finished
-- | Will be emitted in async mode when all pending URIs have been processed.
type DiscovererFinishedCallback =
    IO ()

type C_DiscovererFinishedCallback =
    Ptr Discoverer ->                       -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DiscovererFinishedCallback`.
foreign import ccall "wrapper"
    mk_DiscovererFinishedCallback :: C_DiscovererFinishedCallback -> IO (FunPtr C_DiscovererFinishedCallback)

wrap_DiscovererFinishedCallback :: 
    GObject a => (a -> DiscovererFinishedCallback) ->
    C_DiscovererFinishedCallback
wrap_DiscovererFinishedCallback :: forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererFinishedCallback a -> IO ()
gi'cb Ptr Discoverer
gi'selfPtr Ptr ()
_ = do
    Ptr Discoverer -> (Discoverer -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Discoverer
gi'selfPtr ((Discoverer -> IO ()) -> IO ()) -> (Discoverer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Discoverer
gi'self -> a -> IO ()
gi'cb (Discoverer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Discoverer
gi'self) 


-- | Connect a signal handler for the [finished](#signal:finished) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' discoverer #finished callback
-- @
-- 
-- 
onDiscovererFinished :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererFinishedCallback) -> m SignalHandlerId
onDiscovererFinished :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onDiscovererFinished a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_DiscovererFinishedCallback
wrapped' = (a -> IO ()) -> C_DiscovererFinishedCallback
forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererFinishedCallback a -> IO ()
wrapped
    FunPtr C_DiscovererFinishedCallback
wrapped'' <- C_DiscovererFinishedCallback
-> IO (FunPtr C_DiscovererFinishedCallback)
mk_DiscovererFinishedCallback C_DiscovererFinishedCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"finished" FunPtr C_DiscovererFinishedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [finished](#signal:finished) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' discoverer #finished callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterDiscovererFinished :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererFinishedCallback) -> m SignalHandlerId
afterDiscovererFinished :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterDiscovererFinished a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_DiscovererFinishedCallback
wrapped' = (a -> IO ()) -> C_DiscovererFinishedCallback
forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererFinishedCallback a -> IO ()
wrapped
    FunPtr C_DiscovererFinishedCallback
wrapped'' <- C_DiscovererFinishedCallback
-> IO (FunPtr C_DiscovererFinishedCallback)
mk_DiscovererFinishedCallback C_DiscovererFinishedCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"finished" FunPtr C_DiscovererFinishedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DiscovererFinishedSignalInfo
instance SignalInfo DiscovererFinishedSignalInfo where
    type HaskellCallbackType DiscovererFinishedSignalInfo = DiscovererFinishedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DiscovererFinishedCallback cb
        cb'' <- mk_DiscovererFinishedCallback cb'
        connectSignalFunPtr obj "finished" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer::finished"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:signal:finished"})

#endif

-- signal Discoverer::source-setup
-- | This signal is emitted after the source element has been created for, so
-- the URI being discovered, so it can be configured by setting additional
-- properties (e.g. set a proxy server for an http source, or set the device
-- and read speed for an audio cd source).
-- 
-- This signal is usually emitted from the context of a GStreamer streaming
-- thread.
type DiscovererSourceSetupCallback =
    Gst.Element.Element
    -- ^ /@source@/: source element
    -> IO ()

type C_DiscovererSourceSetupCallback =
    Ptr Discoverer ->                       -- object
    Ptr Gst.Element.Element ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DiscovererSourceSetupCallback`.
foreign import ccall "wrapper"
    mk_DiscovererSourceSetupCallback :: C_DiscovererSourceSetupCallback -> IO (FunPtr C_DiscovererSourceSetupCallback)

wrap_DiscovererSourceSetupCallback :: 
    GObject a => (a -> DiscovererSourceSetupCallback) ->
    C_DiscovererSourceSetupCallback
wrap_DiscovererSourceSetupCallback :: forall a.
GObject a =>
(a -> DiscovererSourceSetupCallback)
-> C_DiscovererSourceSetupCallback
wrap_DiscovererSourceSetupCallback a -> DiscovererSourceSetupCallback
gi'cb Ptr Discoverer
gi'selfPtr Ptr Element
source Ptr ()
_ = do
    Element
source' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
source
    Ptr Discoverer -> (Discoverer -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Discoverer
gi'selfPtr ((Discoverer -> IO ()) -> IO ()) -> (Discoverer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Discoverer
gi'self -> a -> DiscovererSourceSetupCallback
gi'cb (Discoverer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Discoverer
gi'self)  Element
source'


-- | Connect a signal handler for the [sourceSetup](#signal:sourceSetup) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' discoverer #sourceSetup callback
-- @
-- 
-- 
onDiscovererSourceSetup :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererSourceSetupCallback) -> m SignalHandlerId
onDiscovererSourceSetup :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a
-> ((?self::a) => DiscovererSourceSetupCallback)
-> m SignalHandlerId
onDiscovererSourceSetup a
obj (?self::a) => DiscovererSourceSetupCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DiscovererSourceSetupCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DiscovererSourceSetupCallback
DiscovererSourceSetupCallback
cb
    let wrapped' :: C_DiscovererSourceSetupCallback
wrapped' = (a -> DiscovererSourceSetupCallback)
-> C_DiscovererSourceSetupCallback
forall a.
GObject a =>
(a -> DiscovererSourceSetupCallback)
-> C_DiscovererSourceSetupCallback
wrap_DiscovererSourceSetupCallback a -> DiscovererSourceSetupCallback
wrapped
    FunPtr C_DiscovererSourceSetupCallback
wrapped'' <- C_DiscovererSourceSetupCallback
-> IO (FunPtr C_DiscovererSourceSetupCallback)
mk_DiscovererSourceSetupCallback C_DiscovererSourceSetupCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererSourceSetupCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"source-setup" FunPtr C_DiscovererSourceSetupCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [sourceSetup](#signal:sourceSetup) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' discoverer #sourceSetup callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterDiscovererSourceSetup :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererSourceSetupCallback) -> m SignalHandlerId
afterDiscovererSourceSetup :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a
-> ((?self::a) => DiscovererSourceSetupCallback)
-> m SignalHandlerId
afterDiscovererSourceSetup a
obj (?self::a) => DiscovererSourceSetupCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DiscovererSourceSetupCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DiscovererSourceSetupCallback
DiscovererSourceSetupCallback
cb
    let wrapped' :: C_DiscovererSourceSetupCallback
wrapped' = (a -> DiscovererSourceSetupCallback)
-> C_DiscovererSourceSetupCallback
forall a.
GObject a =>
(a -> DiscovererSourceSetupCallback)
-> C_DiscovererSourceSetupCallback
wrap_DiscovererSourceSetupCallback a -> DiscovererSourceSetupCallback
wrapped
    FunPtr C_DiscovererSourceSetupCallback
wrapped'' <- C_DiscovererSourceSetupCallback
-> IO (FunPtr C_DiscovererSourceSetupCallback)
mk_DiscovererSourceSetupCallback C_DiscovererSourceSetupCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererSourceSetupCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"source-setup" FunPtr C_DiscovererSourceSetupCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DiscovererSourceSetupSignalInfo
instance SignalInfo DiscovererSourceSetupSignalInfo where
    type HaskellCallbackType DiscovererSourceSetupSignalInfo = DiscovererSourceSetupCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DiscovererSourceSetupCallback cb
        cb'' <- mk_DiscovererSourceSetupCallback cb'
        connectSignalFunPtr obj "source-setup" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer::source-setup"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:signal:sourceSetup"})

#endif

-- signal Discoverer::starting
-- | Will be emitted when the discover starts analyzing the pending URIs
type DiscovererStartingCallback =
    IO ()

type C_DiscovererStartingCallback =
    Ptr Discoverer ->                       -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_DiscovererStartingCallback`.
foreign import ccall "wrapper"
    mk_DiscovererStartingCallback :: C_DiscovererStartingCallback -> IO (FunPtr C_DiscovererStartingCallback)

wrap_DiscovererStartingCallback :: 
    GObject a => (a -> DiscovererStartingCallback) ->
    C_DiscovererStartingCallback
wrap_DiscovererStartingCallback :: forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererStartingCallback a -> IO ()
gi'cb Ptr Discoverer
gi'selfPtr Ptr ()
_ = do
    Ptr Discoverer -> (Discoverer -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Discoverer
gi'selfPtr ((Discoverer -> IO ()) -> IO ()) -> (Discoverer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Discoverer
gi'self -> a -> IO ()
gi'cb (Discoverer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Discoverer
gi'self) 


-- | Connect a signal handler for the [starting](#signal:starting) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' discoverer #starting callback
-- @
-- 
-- 
onDiscovererStarting :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererStartingCallback) -> m SignalHandlerId
onDiscovererStarting :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onDiscovererStarting a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_DiscovererFinishedCallback
wrapped' = (a -> IO ()) -> C_DiscovererFinishedCallback
forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererStartingCallback a -> IO ()
wrapped
    FunPtr C_DiscovererFinishedCallback
wrapped'' <- C_DiscovererFinishedCallback
-> IO (FunPtr C_DiscovererFinishedCallback)
mk_DiscovererStartingCallback C_DiscovererFinishedCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"starting" FunPtr C_DiscovererFinishedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [starting](#signal:starting) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' discoverer #starting callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterDiscovererStarting :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererStartingCallback) -> m SignalHandlerId
afterDiscovererStarting :: forall a (m :: * -> *).
(IsDiscoverer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterDiscovererStarting a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_DiscovererFinishedCallback
wrapped' = (a -> IO ()) -> C_DiscovererFinishedCallback
forall a. GObject a => (a -> IO ()) -> C_DiscovererFinishedCallback
wrap_DiscovererStartingCallback a -> IO ()
wrapped
    FunPtr C_DiscovererFinishedCallback
wrapped'' <- C_DiscovererFinishedCallback
-> IO (FunPtr C_DiscovererFinishedCallback)
mk_DiscovererStartingCallback C_DiscovererFinishedCallback
wrapped'
    a
-> Text
-> FunPtr C_DiscovererFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"starting" FunPtr C_DiscovererFinishedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DiscovererStartingSignalInfo
instance SignalInfo DiscovererStartingSignalInfo where
    type HaskellCallbackType DiscovererStartingSignalInfo = DiscovererStartingCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DiscovererStartingCallback cb
        cb'' <- mk_DiscovererStartingCallback cb'
        connectSignalFunPtr obj "starting" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer::starting"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:signal:starting"})

#endif

-- VVV Prop "timeout"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' discoverer #timeout
-- @
getDiscovererTimeout :: (MonadIO m, IsDiscoverer o) => o -> m Word64
getDiscovererTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsDiscoverer o) =>
o -> m Word64
getDiscovererTimeout o
obj = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word64
forall a. GObject a => a -> String -> IO Word64
B.Properties.getObjectPropertyUInt64 o
obj String
"timeout"

-- | Set the value of the “@timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' discoverer [ #timeout 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiscovererTimeout :: (MonadIO m, IsDiscoverer o) => o -> Word64 -> m ()
setDiscovererTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsDiscoverer o) =>
o -> Word64 -> m ()
setDiscovererTimeout o
obj Word64
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Word64 -> IO ()
forall a. GObject a => a -> String -> Word64 -> IO ()
B.Properties.setObjectPropertyUInt64 o
obj String
"timeout" Word64
val

-- | Construct a `GValueConstruct` with valid value for the “@timeout@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructDiscovererTimeout :: (IsDiscoverer o, MIO.MonadIO m) => Word64 -> m (GValueConstruct o)
constructDiscovererTimeout :: forall o (m :: * -> *).
(IsDiscoverer o, MonadIO m) =>
Word64 -> m (GValueConstruct o)
constructDiscovererTimeout Word64
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word64 -> IO (GValueConstruct o)
forall o. String -> Word64 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt64 String
"timeout" Word64
val

#if defined(ENABLE_OVERLOADING)
data DiscovererTimeoutPropertyInfo
instance AttrInfo DiscovererTimeoutPropertyInfo where
    type AttrAllowedOps DiscovererTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint DiscovererTimeoutPropertyInfo = IsDiscoverer
    type AttrSetTypeConstraint DiscovererTimeoutPropertyInfo = (~) Word64
    type AttrTransferTypeConstraint DiscovererTimeoutPropertyInfo = (~) Word64
    type AttrTransferType DiscovererTimeoutPropertyInfo = Word64
    type AttrGetType DiscovererTimeoutPropertyInfo = Word64
    type AttrLabel DiscovererTimeoutPropertyInfo = "timeout"
    type AttrOrigin DiscovererTimeoutPropertyInfo = Discoverer
    attrGet = getDiscovererTimeout
    attrSet = setDiscovererTimeout
    attrTransfer _ v = do
        return v
    attrConstruct = constructDiscovererTimeout
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.timeout"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:attr:timeout"
        })
#endif

-- VVV Prop "use-cache"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@use-cache@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' discoverer #useCache
-- @
getDiscovererUseCache :: (MonadIO m, IsDiscoverer o) => o -> m Bool
getDiscovererUseCache :: forall (m :: * -> *) o. (MonadIO m, IsDiscoverer o) => o -> m Bool
getDiscovererUseCache o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"use-cache"

-- | Set the value of the “@use-cache@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' discoverer [ #useCache 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiscovererUseCache :: (MonadIO m, IsDiscoverer o) => o -> Bool -> m ()
setDiscovererUseCache :: forall (m :: * -> *) o.
(MonadIO m, IsDiscoverer o) =>
o -> Bool -> m ()
setDiscovererUseCache o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"use-cache" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@use-cache@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructDiscovererUseCache :: (IsDiscoverer o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructDiscovererUseCache :: forall o (m :: * -> *).
(IsDiscoverer o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructDiscovererUseCache Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"use-cache" Bool
val

#if defined(ENABLE_OVERLOADING)
data DiscovererUseCachePropertyInfo
instance AttrInfo DiscovererUseCachePropertyInfo where
    type AttrAllowedOps DiscovererUseCachePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint DiscovererUseCachePropertyInfo = IsDiscoverer
    type AttrSetTypeConstraint DiscovererUseCachePropertyInfo = (~) Bool
    type AttrTransferTypeConstraint DiscovererUseCachePropertyInfo = (~) Bool
    type AttrTransferType DiscovererUseCachePropertyInfo = Bool
    type AttrGetType DiscovererUseCachePropertyInfo = Bool
    type AttrLabel DiscovererUseCachePropertyInfo = "use-cache"
    type AttrOrigin DiscovererUseCachePropertyInfo = Discoverer
    attrGet = getDiscovererUseCache
    attrSet = setDiscovererUseCache
    attrTransfer _ v = do
        return v
    attrConstruct = constructDiscovererUseCache
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.useCache"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#g:attr:useCache"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Discoverer
type instance O.AttributeList Discoverer = DiscovererAttributeList
type DiscovererAttributeList = ('[ '("timeout", DiscovererTimeoutPropertyInfo), '("useCache", DiscovererUseCachePropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
discovererTimeout :: AttrLabelProxy "timeout"
discovererTimeout = AttrLabelProxy

discovererUseCache :: AttrLabelProxy "useCache"
discovererUseCache = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Discoverer = DiscovererSignalList
type DiscovererSignalList = ('[ '("discovered", DiscovererDiscoveredSignalInfo), '("finished", DiscovererFinishedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("sourceSetup", DiscovererSourceSetupSignalInfo), '("starting", DiscovererStartingSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method Discoverer::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "timeout"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "timeout per file, in nanoseconds. Allowed are values between\n    one second (#GST_SECOND) and one hour (3600 * #GST_SECOND)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GstPbutils" , name = "Discoverer" })
-- throws : True
-- Skip return : False

foreign import ccall "gst_discoverer_new" gst_discoverer_new :: 
    Word64 ->                               -- timeout : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Discoverer)

-- | Creates a new t'GI.GstPbutils.Objects.Discoverer.Discoverer' with the provided timeout.
discovererNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word64
    -- ^ /@timeout@/: timeout per file, in nanoseconds. Allowed are values between
    --     one second ('GI.Gst.Constants.SECOND') and one hour (3600 * 'GI.Gst.Constants.SECOND')
    -> m Discoverer
    -- ^ __Returns:__ The new t'GI.GstPbutils.Objects.Discoverer.Discoverer'.
    -- If an error occurred when creating the discoverer, /@err@/ will be set
    -- accordingly and 'P.Nothing' will be returned. If /@err@/ is set, the caller must
    -- free it when no longer needed using 'GI.GLib.Structs.Error.errorFree'. /(Can throw 'Data.GI.Base.GError.GError')/
discovererNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word64 -> m Discoverer
discovererNew Word64
timeout = IO Discoverer -> m Discoverer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Discoverer -> m Discoverer) -> IO Discoverer -> m Discoverer
forall a b. (a -> b) -> a -> b
$ do
    IO Discoverer -> IO () -> IO Discoverer
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Discoverer
result <- (Ptr (Ptr GError) -> IO (Ptr Discoverer)) -> IO (Ptr Discoverer)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Discoverer)) -> IO (Ptr Discoverer))
-> (Ptr (Ptr GError) -> IO (Ptr Discoverer)) -> IO (Ptr Discoverer)
forall a b. (a -> b) -> a -> b
$ Word64 -> Ptr (Ptr GError) -> IO (Ptr Discoverer)
gst_discoverer_new Word64
timeout
        Text -> Ptr Discoverer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"discovererNew" Ptr Discoverer
result
        Discoverer
result' <- ((ManagedPtr Discoverer -> Discoverer)
-> Ptr Discoverer -> IO Discoverer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Discoverer -> Discoverer
Discoverer) Ptr Discoverer
result
        Discoverer -> IO Discoverer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Discoverer
result'
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Discoverer::discover_uri
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "discoverer"
--           , argType =
--               TInterface Name { namespace = "GstPbutils" , name = "Discoverer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GstDiscoverer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The URI to run on." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GstPbutils" , name = "DiscovererInfo" })
-- throws : True
-- Skip return : False

foreign import ccall "gst_discoverer_discover_uri" gst_discoverer_discover_uri :: 
    Ptr Discoverer ->                       -- discoverer : TInterface (Name {namespace = "GstPbutils", name = "Discoverer"})
    CString ->                              -- uri : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr GstPbutils.DiscovererInfo.DiscovererInfo)

-- | Synchronously discovers the given /@uri@/.
-- 
-- A copy of /@uri@/ will be made internally, so the caller can safely 'GI.GLib.Functions.free'
-- afterwards.
discovererDiscoverUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscoverer a) =>
    a
    -- ^ /@discoverer@/: A t'GI.GstPbutils.Objects.Discoverer.Discoverer'
    -> T.Text
    -- ^ /@uri@/: The URI to run on.
    -> m GstPbutils.DiscovererInfo.DiscovererInfo
    -- ^ __Returns:__ the result of the scanning. Can be 'P.Nothing' if an
    -- error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
discovererDiscoverUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDiscoverer a) =>
a -> Text -> m DiscovererInfo
discovererDiscoverUri a
discoverer Text
uri = IO DiscovererInfo -> m DiscovererInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DiscovererInfo -> m DiscovererInfo)
-> IO DiscovererInfo -> m DiscovererInfo
forall a b. (a -> b) -> a -> b
$ do
    Ptr Discoverer
discoverer' <- a -> IO (Ptr Discoverer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
discoverer
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    IO DiscovererInfo -> IO () -> IO DiscovererInfo
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr DiscovererInfo
result <- (Ptr (Ptr GError) -> IO (Ptr DiscovererInfo))
-> IO (Ptr DiscovererInfo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr DiscovererInfo))
 -> IO (Ptr DiscovererInfo))
-> (Ptr (Ptr GError) -> IO (Ptr DiscovererInfo))
-> IO (Ptr DiscovererInfo)
forall a b. (a -> b) -> a -> b
$ Ptr Discoverer
-> CString -> Ptr (Ptr GError) -> IO (Ptr DiscovererInfo)
gst_discoverer_discover_uri Ptr Discoverer
discoverer' CString
uri'
        Text -> Ptr DiscovererInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"discovererDiscoverUri" Ptr DiscovererInfo
result
        DiscovererInfo
result' <- ((ManagedPtr DiscovererInfo -> DiscovererInfo)
-> Ptr DiscovererInfo -> IO DiscovererInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DiscovererInfo -> DiscovererInfo
GstPbutils.DiscovererInfo.DiscovererInfo) Ptr DiscovererInfo
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
discoverer
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
        DiscovererInfo -> IO DiscovererInfo
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return DiscovererInfo
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
     )

#if defined(ENABLE_OVERLOADING)
data DiscovererDiscoverUriMethodInfo
instance (signature ~ (T.Text -> m GstPbutils.DiscovererInfo.DiscovererInfo), MonadIO m, IsDiscoverer a) => O.OverloadedMethod DiscovererDiscoverUriMethodInfo a signature where
    overloadedMethod = discovererDiscoverUri

instance O.OverloadedMethodInfo DiscovererDiscoverUriMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.discovererDiscoverUri",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#v:discovererDiscoverUri"
        })


#endif

-- method Discoverer::discover_uri_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "discoverer"
--           , argType =
--               TInterface Name { namespace = "GstPbutils" , name = "Discoverer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GstDiscoverer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the URI to add." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_discover_uri_async" gst_discoverer_discover_uri_async :: 
    Ptr Discoverer ->                       -- discoverer : TInterface (Name {namespace = "GstPbutils", name = "Discoverer"})
    CString ->                              -- uri : TBasicType TUTF8
    IO CInt

-- | Appends the given /@uri@/ to the list of URIs to discoverer. The actual
-- discovery of the /@uri@/ will only take place if 'GI.GstPbutils.Objects.Discoverer.discovererStart' has
-- been called.
-- 
-- A copy of /@uri@/ will be made internally, so the caller can safely 'GI.GLib.Functions.free'
-- afterwards.
discovererDiscoverUriAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscoverer a) =>
    a
    -- ^ /@discoverer@/: A t'GI.GstPbutils.Objects.Discoverer.Discoverer'
    -> T.Text
    -- ^ /@uri@/: the URI to add.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the /@uri@/ was successfully appended to the list of pending
    -- uris, else 'P.False'
discovererDiscoverUriAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDiscoverer a) =>
a -> Text -> m Bool
discovererDiscoverUriAsync a
discoverer Text
uri = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Discoverer
discoverer' <- a -> IO (Ptr Discoverer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
discoverer
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    CInt
result <- Ptr Discoverer -> CString -> IO CInt
gst_discoverer_discover_uri_async Ptr Discoverer
discoverer' CString
uri'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
discoverer
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DiscovererDiscoverUriAsyncMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDiscoverer a) => O.OverloadedMethod DiscovererDiscoverUriAsyncMethodInfo a signature where
    overloadedMethod = discovererDiscoverUriAsync

instance O.OverloadedMethodInfo DiscovererDiscoverUriAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.discovererDiscoverUriAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#v:discovererDiscoverUriAsync"
        })


#endif

-- method Discoverer::start
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "discoverer"
--           , argType =
--               TInterface Name { namespace = "GstPbutils" , name = "Discoverer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GstDiscoverer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_start" gst_discoverer_start :: 
    Ptr Discoverer ->                       -- discoverer : TInterface (Name {namespace = "GstPbutils", name = "Discoverer"})
    IO ()

-- | Allow asynchronous discovering of URIs to take place.
-- A t'GI.GLib.Structs.MainLoop.MainLoop' must be available for t'GI.GstPbutils.Objects.Discoverer.Discoverer' to properly work in
-- asynchronous mode.
discovererStart ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscoverer a) =>
    a
    -- ^ /@discoverer@/: A t'GI.GstPbutils.Objects.Discoverer.Discoverer'
    -> m ()
discovererStart :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDiscoverer a) =>
a -> m ()
discovererStart a
discoverer = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Discoverer
discoverer' <- a -> IO (Ptr Discoverer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
discoverer
    Ptr Discoverer -> IO ()
gst_discoverer_start Ptr Discoverer
discoverer'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
discoverer
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DiscovererStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDiscoverer a) => O.OverloadedMethod DiscovererStartMethodInfo a signature where
    overloadedMethod = discovererStart

instance O.OverloadedMethodInfo DiscovererStartMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.discovererStart",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#v:discovererStart"
        })


#endif

-- method Discoverer::stop
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "discoverer"
--           , argType =
--               TInterface Name { namespace = "GstPbutils" , name = "Discoverer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GstDiscoverer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_stop" gst_discoverer_stop :: 
    Ptr Discoverer ->                       -- discoverer : TInterface (Name {namespace = "GstPbutils", name = "Discoverer"})
    IO ()

-- | Stop the discovery of any pending URIs and clears the list of
-- pending URIS (if any).
discovererStop ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscoverer a) =>
    a
    -- ^ /@discoverer@/: A t'GI.GstPbutils.Objects.Discoverer.Discoverer'
    -> m ()
discovererStop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDiscoverer a) =>
a -> m ()
discovererStop a
discoverer = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Discoverer
discoverer' <- a -> IO (Ptr Discoverer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
discoverer
    Ptr Discoverer -> IO ()
gst_discoverer_stop Ptr Discoverer
discoverer'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
discoverer
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DiscovererStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDiscoverer a) => O.OverloadedMethod DiscovererStopMethodInfo a signature where
    overloadedMethod = discovererStop

instance O.OverloadedMethodInfo DiscovererStopMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GstPbutils.Objects.Discoverer.discovererStop",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstpbutils-1.0.27/docs/GI-GstPbutils-Objects-Discoverer.html#v:discovererStop"
        })


#endif