{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gst.Objects.Bus
(
Bus(..) ,
IsBus ,
toBus ,
#if defined(ENABLE_OVERLOADING)
ResolveBusMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BusAddSignalWatchMethodInfo ,
#endif
busAddSignalWatch ,
#if defined(ENABLE_OVERLOADING)
BusAddSignalWatchFullMethodInfo ,
#endif
busAddSignalWatchFull ,
#if defined(ENABLE_OVERLOADING)
BusAddWatchMethodInfo ,
#endif
busAddWatch ,
#if defined(ENABLE_OVERLOADING)
BusAsyncSignalFuncMethodInfo ,
#endif
busAsyncSignalFunc ,
#if defined(ENABLE_OVERLOADING)
BusCreateWatchMethodInfo ,
#endif
busCreateWatch ,
#if defined(ENABLE_OVERLOADING)
BusDisableSyncMessageEmissionMethodInfo ,
#endif
busDisableSyncMessageEmission ,
#if defined(ENABLE_OVERLOADING)
BusEnableSyncMessageEmissionMethodInfo ,
#endif
busEnableSyncMessageEmission ,
#if defined(ENABLE_OVERLOADING)
BusGetPollfdMethodInfo ,
#endif
busGetPollfd ,
#if defined(ENABLE_OVERLOADING)
BusHavePendingMethodInfo ,
#endif
busHavePending ,
busNew ,
#if defined(ENABLE_OVERLOADING)
BusPeekMethodInfo ,
#endif
busPeek ,
#if defined(ENABLE_OVERLOADING)
BusPollMethodInfo ,
#endif
busPoll ,
#if defined(ENABLE_OVERLOADING)
BusPopMethodInfo ,
#endif
busPop ,
#if defined(ENABLE_OVERLOADING)
BusPopFilteredMethodInfo ,
#endif
busPopFiltered ,
#if defined(ENABLE_OVERLOADING)
BusPostMethodInfo ,
#endif
busPost ,
#if defined(ENABLE_OVERLOADING)
BusRemoveSignalWatchMethodInfo ,
#endif
busRemoveSignalWatch ,
#if defined(ENABLE_OVERLOADING)
BusRemoveWatchMethodInfo ,
#endif
busRemoveWatch ,
#if defined(ENABLE_OVERLOADING)
BusSetFlushingMethodInfo ,
#endif
busSetFlushing ,
#if defined(ENABLE_OVERLOADING)
BusSetSyncHandlerMethodInfo ,
#endif
busSetSyncHandler ,
#if defined(ENABLE_OVERLOADING)
BusSyncSignalHandlerMethodInfo ,
#endif
busSyncSignalHandler ,
#if defined(ENABLE_OVERLOADING)
BusTimedPopMethodInfo ,
#endif
busTimedPop ,
#if defined(ENABLE_OVERLOADING)
BusTimedPopFilteredMethodInfo ,
#endif
busTimedPopFiltered ,
#if defined(ENABLE_OVERLOADING)
BusEnableAsyncPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
busEnableAsync ,
#endif
constructBusEnableAsync ,
BusMessageCallback ,
#if defined(ENABLE_OVERLOADING)
BusMessageSignalInfo ,
#endif
afterBusMessage ,
onBusMessage ,
BusSyncMessageCallback ,
#if defined(ENABLE_OVERLOADING)
BusSyncMessageSignalInfo ,
#endif
afterBusSyncMessage ,
onBusSyncMessage ,
) 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.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.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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Callbacks as Gst.Callbacks
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Flags as Gst.Flags
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Structs.Message as Gst.Message
newtype Bus = Bus (SP.ManagedPtr Bus)
deriving (Bus -> Bus -> Bool
(Bus -> Bus -> Bool) -> (Bus -> Bus -> Bool) -> Eq Bus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Bus -> Bus -> Bool
$c/= :: Bus -> Bus -> Bool
== :: Bus -> Bus -> Bool
$c== :: Bus -> Bus -> Bool
Eq)
instance SP.ManagedPtrNewtype Bus where
toManagedPtr :: Bus -> ManagedPtr Bus
toManagedPtr (Bus ManagedPtr Bus
p) = ManagedPtr Bus
p
foreign import ccall "gst_bus_get_type"
c_gst_bus_get_type :: IO B.Types.GType
instance B.Types.TypedObject Bus where
glibType :: IO GType
glibType = IO GType
c_gst_bus_get_type
instance B.Types.GObject Bus
class (SP.GObject o, O.IsDescendantOf Bus o) => IsBus o
instance (SP.GObject o, O.IsDescendantOf Bus o) => IsBus o
instance O.HasParentTypes Bus
type instance O.ParentTypes Bus = '[Gst.Object.Object, GObject.Object.Object]
toBus :: (MIO.MonadIO m, IsBus o) => o -> m Bus
toBus :: forall (m :: * -> *) o. (MonadIO m, IsBus o) => o -> m Bus
toBus = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bus -> m Bus) -> (o -> IO Bus) -> o -> m Bus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Bus -> Bus) -> o -> IO Bus
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Bus -> Bus
Bus
instance B.GValue.IsGValue (Maybe Bus) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_bus_get_type
gvalueSet_ :: Ptr GValue -> Maybe Bus -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Bus
P.Nothing = Ptr GValue -> Ptr Bus -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Bus
forall a. Ptr a
FP.nullPtr :: FP.Ptr Bus)
gvalueSet_ Ptr GValue
gv (P.Just Bus
obj) = Bus -> (Ptr Bus -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Bus
obj (Ptr GValue -> Ptr Bus -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Bus)
gvalueGet_ Ptr GValue
gv = do
Ptr Bus
ptr <- Ptr GValue -> IO (Ptr Bus)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Bus)
if Ptr Bus
ptr Ptr Bus -> Ptr Bus -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Bus
forall a. Ptr a
FP.nullPtr
then Bus -> Maybe Bus
forall a. a -> Maybe a
P.Just (Bus -> Maybe Bus) -> IO Bus -> IO (Maybe Bus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Bus -> Bus
Bus Ptr Bus
ptr
else Maybe Bus -> IO (Maybe Bus)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Bus
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveBusMethod (t :: Symbol) (o :: *) :: * where
ResolveBusMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
ResolveBusMethod "addSignalWatch" o = BusAddSignalWatchMethodInfo
ResolveBusMethod "addSignalWatchFull" o = BusAddSignalWatchFullMethodInfo
ResolveBusMethod "addWatch" o = BusAddWatchMethodInfo
ResolveBusMethod "asyncSignalFunc" o = BusAsyncSignalFuncMethodInfo
ResolveBusMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBusMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBusMethod "createWatch" o = BusCreateWatchMethodInfo
ResolveBusMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
ResolveBusMethod "disableSyncMessageEmission" o = BusDisableSyncMessageEmissionMethodInfo
ResolveBusMethod "enableSyncMessageEmission" o = BusEnableSyncMessageEmissionMethodInfo
ResolveBusMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBusMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBusMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBusMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
ResolveBusMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
ResolveBusMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
ResolveBusMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
ResolveBusMethod "havePending" o = BusHavePendingMethodInfo
ResolveBusMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBusMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBusMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBusMethod "peek" o = BusPeekMethodInfo
ResolveBusMethod "poll" o = BusPollMethodInfo
ResolveBusMethod "pop" o = BusPopMethodInfo
ResolveBusMethod "popFiltered" o = BusPopFilteredMethodInfo
ResolveBusMethod "post" o = BusPostMethodInfo
ResolveBusMethod "ref" o = Gst.Object.ObjectRefMethodInfo
ResolveBusMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBusMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
ResolveBusMethod "removeSignalWatch" o = BusRemoveSignalWatchMethodInfo
ResolveBusMethod "removeWatch" o = BusRemoveWatchMethodInfo
ResolveBusMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBusMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBusMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBusMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
ResolveBusMethod "syncSignalHandler" o = BusSyncSignalHandlerMethodInfo
ResolveBusMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
ResolveBusMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBusMethod "timedPop" o = BusTimedPopMethodInfo
ResolveBusMethod "timedPopFiltered" o = BusTimedPopFilteredMethodInfo
ResolveBusMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
ResolveBusMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
ResolveBusMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBusMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
ResolveBusMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
ResolveBusMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBusMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
ResolveBusMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
ResolveBusMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
ResolveBusMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
ResolveBusMethod "getPollfd" o = BusGetPollfdMethodInfo
ResolveBusMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBusMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBusMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
ResolveBusMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
ResolveBusMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
ResolveBusMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
ResolveBusMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBusMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBusMethod "setFlushing" o = BusSetFlushingMethodInfo
ResolveBusMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
ResolveBusMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
ResolveBusMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBusMethod "setSyncHandler" o = BusSetSyncHandlerMethodInfo
ResolveBusMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBusMethod t Bus, O.OverloadedMethod info Bus p) => OL.IsLabel t (Bus -> 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 ~ ResolveBusMethod t Bus, O.OverloadedMethod info Bus p, R.HasField t Bus p) => R.HasField t Bus p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveBusMethod t Bus, O.OverloadedMethodInfo info Bus) => OL.IsLabel t (O.MethodProxy info Bus) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type BusMessageCallback =
Gst.Message.Message
-> IO ()
type C_BusMessageCallback =
Ptr Bus ->
Ptr Gst.Message.Message ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusMessageCallback :: C_BusMessageCallback -> IO (FunPtr C_BusMessageCallback)
wrap_BusMessageCallback ::
GObject a => (a -> BusMessageCallback) ->
C_BusMessageCallback
wrap_BusMessageCallback :: forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusMessageCallback a -> BusMessageCallback
gi'cb Ptr Bus
gi'selfPtr Ptr Message
message Ptr ()
_ = do
Ptr Message -> BusMessageCallback -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Message
message (BusMessageCallback -> IO ()) -> BusMessageCallback -> IO ()
forall a b. (a -> b) -> a -> b
$ \Message
message' -> do
Ptr Bus -> (Bus -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Bus
gi'selfPtr ((Bus -> IO ()) -> IO ()) -> (Bus -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Bus
gi'self -> a -> BusMessageCallback
gi'cb (Bus -> a
Coerce.coerce Bus
gi'self) Message
message'
onBusMessage :: (IsBus a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => BusMessageCallback) -> m SignalHandlerId
onBusMessage :: forall a (m :: * -> *).
(IsBus a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => BusMessageCallback)
-> m SignalHandlerId
onBusMessage a
obj Maybe Text
detail (?self::a) => BusMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 -> BusMessageCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BusMessageCallback
BusMessageCallback
cb
let wrapped' :: C_BusMessageCallback
wrapped' = (a -> BusMessageCallback) -> C_BusMessageCallback
forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusMessageCallback a -> BusMessageCallback
wrapped
FunPtr C_BusMessageCallback
wrapped'' <- C_BusMessageCallback -> IO (FunPtr C_BusMessageCallback)
mk_BusMessageCallback C_BusMessageCallback
wrapped'
a
-> Text
-> FunPtr C_BusMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"message" FunPtr C_BusMessageCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterBusMessage :: (IsBus a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => BusMessageCallback) -> m SignalHandlerId
afterBusMessage :: forall a (m :: * -> *).
(IsBus a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => BusMessageCallback)
-> m SignalHandlerId
afterBusMessage a
obj Maybe Text
detail (?self::a) => BusMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 -> BusMessageCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BusMessageCallback
BusMessageCallback
cb
let wrapped' :: C_BusMessageCallback
wrapped' = (a -> BusMessageCallback) -> C_BusMessageCallback
forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusMessageCallback a -> BusMessageCallback
wrapped
FunPtr C_BusMessageCallback
wrapped'' <- C_BusMessageCallback -> IO (FunPtr C_BusMessageCallback)
mk_BusMessageCallback C_BusMessageCallback
wrapped'
a
-> Text
-> FunPtr C_BusMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"message" FunPtr C_BusMessageCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data BusMessageSignalInfo
instance SignalInfo BusMessageSignalInfo where
type HaskellCallbackType BusMessageSignalInfo = BusMessageCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusMessageCallback cb
cb'' <- mk_BusMessageCallback cb'
connectSignalFunPtr obj "message" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus::message"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#g:signal:message"})
#endif
type BusSyncMessageCallback =
Gst.Message.Message
-> IO ()
type C_BusSyncMessageCallback =
Ptr Bus ->
Ptr Gst.Message.Message ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusSyncMessageCallback :: C_BusSyncMessageCallback -> IO (FunPtr C_BusSyncMessageCallback)
wrap_BusSyncMessageCallback ::
GObject a => (a -> BusSyncMessageCallback) ->
C_BusSyncMessageCallback
wrap_BusSyncMessageCallback :: forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusSyncMessageCallback a -> BusMessageCallback
gi'cb Ptr Bus
gi'selfPtr Ptr Message
message Ptr ()
_ = do
Ptr Message -> BusMessageCallback -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Message
message (BusMessageCallback -> IO ()) -> BusMessageCallback -> IO ()
forall a b. (a -> b) -> a -> b
$ \Message
message' -> do
Ptr Bus -> (Bus -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Bus
gi'selfPtr ((Bus -> IO ()) -> IO ()) -> (Bus -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Bus
gi'self -> a -> BusMessageCallback
gi'cb (Bus -> a
Coerce.coerce Bus
gi'self) Message
message'
onBusSyncMessage :: (IsBus a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => BusSyncMessageCallback) -> m SignalHandlerId
onBusSyncMessage :: forall a (m :: * -> *).
(IsBus a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => BusMessageCallback)
-> m SignalHandlerId
onBusSyncMessage a
obj Maybe Text
detail (?self::a) => BusMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 -> BusMessageCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BusMessageCallback
BusMessageCallback
cb
let wrapped' :: C_BusMessageCallback
wrapped' = (a -> BusMessageCallback) -> C_BusMessageCallback
forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusSyncMessageCallback a -> BusMessageCallback
wrapped
FunPtr C_BusMessageCallback
wrapped'' <- C_BusMessageCallback -> IO (FunPtr C_BusMessageCallback)
mk_BusSyncMessageCallback C_BusMessageCallback
wrapped'
a
-> Text
-> FunPtr C_BusMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"sync-message" FunPtr C_BusMessageCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterBusSyncMessage :: (IsBus a, MonadIO m) => a -> P.Maybe T.Text -> ((?self :: a) => BusSyncMessageCallback) -> m SignalHandlerId
afterBusSyncMessage :: forall a (m :: * -> *).
(IsBus a, MonadIO m) =>
a
-> Maybe Text
-> ((?self::a) => BusMessageCallback)
-> m SignalHandlerId
afterBusSyncMessage a
obj Maybe Text
detail (?self::a) => BusMessageCallback
cb = IO SignalHandlerId -> m SignalHandlerId
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 -> BusMessageCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BusMessageCallback
BusMessageCallback
cb
let wrapped' :: C_BusMessageCallback
wrapped' = (a -> BusMessageCallback) -> C_BusMessageCallback
forall a.
GObject a =>
(a -> BusMessageCallback) -> C_BusMessageCallback
wrap_BusSyncMessageCallback a -> BusMessageCallback
wrapped
FunPtr C_BusMessageCallback
wrapped'' <- C_BusMessageCallback -> IO (FunPtr C_BusMessageCallback)
mk_BusSyncMessageCallback C_BusMessageCallback
wrapped'
a
-> Text
-> FunPtr C_BusMessageCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"sync-message" FunPtr C_BusMessageCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data BusSyncMessageSignalInfo
instance SignalInfo BusSyncMessageSignalInfo where
type HaskellCallbackType BusSyncMessageSignalInfo = BusSyncMessageCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusSyncMessageCallback cb
cb'' <- mk_BusSyncMessageCallback cb'
connectSignalFunPtr obj "sync-message" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus::sync-message"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#g:signal:syncMessage"})
#endif
constructBusEnableAsync :: (IsBus o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBusEnableAsync :: forall o (m :: * -> *).
(IsBus o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructBusEnableAsync Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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 (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
"enable-async" Bool
val
#if defined(ENABLE_OVERLOADING)
data BusEnableAsyncPropertyInfo
instance AttrInfo BusEnableAsyncPropertyInfo where
type AttrAllowedOps BusEnableAsyncPropertyInfo = '[ 'AttrConstruct]
type AttrBaseTypeConstraint BusEnableAsyncPropertyInfo = IsBus
type AttrSetTypeConstraint BusEnableAsyncPropertyInfo = (~) Bool
type AttrTransferTypeConstraint BusEnableAsyncPropertyInfo = (~) Bool
type AttrTransferType BusEnableAsyncPropertyInfo = Bool
type AttrGetType BusEnableAsyncPropertyInfo = ()
type AttrLabel BusEnableAsyncPropertyInfo = "enable-async"
type AttrOrigin BusEnableAsyncPropertyInfo = Bus
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBusEnableAsync
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.enableAsync"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#g:attr:enableAsync"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Bus
type instance O.AttributeList Bus = BusAttributeList
type BusAttributeList = ('[ '("enableAsync", BusEnableAsyncPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
busEnableAsync :: AttrLabelProxy "enableAsync"
busEnableAsync = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Bus = BusSignalList
type BusSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("message", BusMessageSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("syncMessage", BusSyncMessageSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_bus_new" gst_bus_new ::
IO (Ptr Bus)
busNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bus
busNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Bus
busNew = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bus -> m Bus) -> IO Bus -> m Bus
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
result <- IO (Ptr Bus)
gst_bus_new
Text -> Ptr Bus -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busNew" Ptr Bus
result
Bus
result' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Bus -> Bus
Bus) Ptr Bus
result
Bus -> IO Bus
forall (m :: * -> *) a. Monad m => a -> m a
return Bus
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_bus_add_signal_watch" gst_bus_add_signal_watch ::
Ptr Bus ->
IO ()
busAddSignalWatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m ()
busAddSignalWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m ()
busAddSignalWatch a
bus = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Bus -> IO ()
gst_bus_add_signal_watch Ptr Bus
bus'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusAddSignalWatchMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusAddSignalWatchMethodInfo a signature where
overloadedMethod = busAddSignalWatch
instance O.OverloadedMethodInfo BusAddSignalWatchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busAddSignalWatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busAddSignalWatch"
})
#endif
foreign import ccall "gst_bus_add_signal_watch_full" gst_bus_add_signal_watch_full ::
Ptr Bus ->
Int32 ->
IO ()
busAddSignalWatchFull ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Int32
-> m ()
busAddSignalWatchFull :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Int32 -> m ()
busAddSignalWatchFull a
bus Int32
priority = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Bus -> Int32 -> IO ()
gst_bus_add_signal_watch_full Ptr Bus
bus' Int32
priority
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusAddSignalWatchFullMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusAddSignalWatchFullMethodInfo a signature where
overloadedMethod = busAddSignalWatchFull
instance O.OverloadedMethodInfo BusAddSignalWatchFullMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busAddSignalWatchFull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busAddSignalWatchFull"
})
#endif
foreign import ccall "gst_bus_add_watch_full" gst_bus_add_watch_full ::
Ptr Bus ->
Int32 ->
FunPtr Gst.Callbacks.C_BusFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO Word32
busAddWatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Int32
-> Gst.Callbacks.BusFunc
-> m Word32
busAddWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Int32 -> BusFunc -> m Word32
busAddWatch a
bus Int32
priority BusFunc
func = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
FunPtr C_BusFunc
func' <- C_BusFunc -> IO (FunPtr C_BusFunc)
Gst.Callbacks.mk_BusFunc (Maybe (Ptr (FunPtr C_BusFunc)) -> BusFunc_WithClosures -> C_BusFunc
Gst.Callbacks.wrap_BusFunc Maybe (Ptr (FunPtr C_BusFunc))
forall a. Maybe a
Nothing (BusFunc -> BusFunc_WithClosures
Gst.Callbacks.drop_closures_BusFunc BusFunc
func))
let userData :: Ptr ()
userData = FunPtr C_BusFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_BusFunc
func'
let notify :: FunPtr (Ptr a -> IO ())
notify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Word32
result <- Ptr Bus
-> Int32
-> FunPtr C_BusFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO Word32
gst_bus_add_watch_full Ptr Bus
bus' Int32
priority FunPtr C_BusFunc
func' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
notify
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BusAddWatchMethodInfo
instance (signature ~ (Int32 -> Gst.Callbacks.BusFunc -> m Word32), MonadIO m, IsBus a) => O.OverloadedMethod BusAddWatchMethodInfo a signature where
overloadedMethod = busAddWatch
instance O.OverloadedMethodInfo BusAddWatchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busAddWatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busAddWatch"
})
#endif
foreign import ccall "gst_bus_async_signal_func" gst_bus_async_signal_func ::
Ptr Bus ->
Ptr Gst.Message.Message ->
Ptr () ->
IO CInt
busAsyncSignalFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Gst.Message.Message
-> Ptr ()
-> m Bool
busAsyncSignalFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Message -> Ptr () -> m Bool
busAsyncSignalFunc a
bus Message
message Ptr ()
data_ = IO Bool -> m Bool
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
message' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Message
message
CInt
result <- C_BusFunc
gst_bus_async_signal_func Ptr Bus
bus' Ptr Message
message' Ptr ()
data_
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
bus
BusMessageCallback
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
message
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusAsyncSignalFuncMethodInfo
instance (signature ~ (Gst.Message.Message -> Ptr () -> m Bool), MonadIO m, IsBus a) => O.OverloadedMethod BusAsyncSignalFuncMethodInfo a signature where
overloadedMethod = busAsyncSignalFunc
instance O.OverloadedMethodInfo BusAsyncSignalFuncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busAsyncSignalFunc",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busAsyncSignalFunc"
})
#endif
foreign import ccall "gst_bus_create_watch" gst_bus_create_watch ::
Ptr Bus ->
IO (Ptr GLib.Source.Source)
busCreateWatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m (Maybe GLib.Source.Source)
busCreateWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m (Maybe Source)
busCreateWatch a
bus = IO (Maybe Source) -> m (Maybe Source)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Source) -> m (Maybe Source))
-> IO (Maybe Source) -> m (Maybe Source)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Source
result <- Ptr Bus -> IO (Ptr Source)
gst_bus_create_watch Ptr Bus
bus'
Maybe Source
maybeResult <- Ptr Source -> (Ptr Source -> IO Source) -> IO (Maybe Source)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Source
result ((Ptr Source -> IO Source) -> IO (Maybe Source))
-> (Ptr Source -> IO Source) -> IO (Maybe Source)
forall a b. (a -> b) -> a -> b
$ \Ptr Source
result' -> do
Source
result'' <- ((ManagedPtr Source -> Source) -> Ptr Source -> IO Source
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Source -> Source
GLib.Source.Source) Ptr Source
result'
Source -> IO Source
forall (m :: * -> *) a. Monad m => a -> m a
return Source
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Source -> IO (Maybe Source)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Source
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusCreateWatchMethodInfo
instance (signature ~ (m (Maybe GLib.Source.Source)), MonadIO m, IsBus a) => O.OverloadedMethod BusCreateWatchMethodInfo a signature where
overloadedMethod = busCreateWatch
instance O.OverloadedMethodInfo BusCreateWatchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busCreateWatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busCreateWatch"
})
#endif
foreign import ccall "gst_bus_disable_sync_message_emission" gst_bus_disable_sync_message_emission ::
Ptr Bus ->
IO ()
busDisableSyncMessageEmission ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m ()
busDisableSyncMessageEmission :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m ()
busDisableSyncMessageEmission a
bus = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Bus -> IO ()
gst_bus_disable_sync_message_emission Ptr Bus
bus'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusDisableSyncMessageEmissionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusDisableSyncMessageEmissionMethodInfo a signature where
overloadedMethod = busDisableSyncMessageEmission
instance O.OverloadedMethodInfo BusDisableSyncMessageEmissionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busDisableSyncMessageEmission",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busDisableSyncMessageEmission"
})
#endif
foreign import ccall "gst_bus_enable_sync_message_emission" gst_bus_enable_sync_message_emission ::
Ptr Bus ->
IO ()
busEnableSyncMessageEmission ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m ()
busEnableSyncMessageEmission :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m ()
busEnableSyncMessageEmission a
bus = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Bus -> IO ()
gst_bus_enable_sync_message_emission Ptr Bus
bus'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusEnableSyncMessageEmissionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusEnableSyncMessageEmissionMethodInfo a signature where
overloadedMethod = busEnableSyncMessageEmission
instance O.OverloadedMethodInfo BusEnableSyncMessageEmissionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busEnableSyncMessageEmission",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busEnableSyncMessageEmission"
})
#endif
foreign import ccall "gst_bus_get_pollfd" gst_bus_get_pollfd ::
Ptr Bus ->
Ptr GLib.PollFD.PollFD ->
IO ()
busGetPollfd ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m (GLib.PollFD.PollFD)
busGetPollfd :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m PollFD
busGetPollfd a
bus = IO PollFD -> m PollFD
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PollFD -> m PollFD) -> IO PollFD -> m PollFD
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr PollFD
fd <- Int -> IO (Ptr PollFD)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
8 :: IO (Ptr GLib.PollFD.PollFD)
Ptr Bus -> Ptr PollFD -> IO ()
gst_bus_get_pollfd Ptr Bus
bus' Ptr PollFD
fd
PollFD
fd' <- ((ManagedPtr PollFD -> PollFD) -> Ptr PollFD -> IO PollFD
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PollFD -> PollFD
GLib.PollFD.PollFD) Ptr PollFD
fd
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
PollFD -> IO PollFD
forall (m :: * -> *) a. Monad m => a -> m a
return PollFD
fd'
#if defined(ENABLE_OVERLOADING)
data BusGetPollfdMethodInfo
instance (signature ~ (m (GLib.PollFD.PollFD)), MonadIO m, IsBus a) => O.OverloadedMethod BusGetPollfdMethodInfo a signature where
overloadedMethod = busGetPollfd
instance O.OverloadedMethodInfo BusGetPollfdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busGetPollfd",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busGetPollfd"
})
#endif
foreign import ccall "gst_bus_have_pending" gst_bus_have_pending ::
Ptr Bus ->
IO CInt
busHavePending ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busHavePending :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m Bool
busHavePending a
bus = IO Bool -> m Bool
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
gst_bus_have_pending Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusHavePendingMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.OverloadedMethod BusHavePendingMethodInfo a signature where
overloadedMethod = busHavePending
instance O.OverloadedMethodInfo BusHavePendingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busHavePending",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busHavePending"
})
#endif
foreign import ccall "gst_bus_peek" gst_bus_peek ::
Ptr Bus ->
IO (Ptr Gst.Message.Message)
busPeek ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m (Maybe Gst.Message.Message)
busPeek :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m (Maybe Message)
busPeek a
bus = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
result <- Ptr Bus -> IO (Ptr Message)
gst_bus_peek Ptr Bus
bus'
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusPeekMethodInfo
instance (signature ~ (m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusPeekMethodInfo a signature where
overloadedMethod = busPeek
instance O.OverloadedMethodInfo BusPeekMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busPeek",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busPeek"
})
#endif
foreign import ccall "gst_bus_poll" gst_bus_poll ::
Ptr Bus ->
CUInt ->
Word64 ->
IO (Ptr Gst.Message.Message)
busPoll ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> [Gst.Flags.MessageType]
-> Word64
-> m (Maybe Gst.Message.Message)
busPoll :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> [MessageType] -> Word64 -> m (Maybe Message)
busPoll a
bus [MessageType]
events Word64
timeout = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let events' :: CUInt
events' = [MessageType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MessageType]
events
Ptr Message
result <- Ptr Bus -> CUInt -> Word64 -> IO (Ptr Message)
gst_bus_poll Ptr Bus
bus' CUInt
events' Word64
timeout
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusPollMethodInfo
instance (signature ~ ([Gst.Flags.MessageType] -> Word64 -> m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusPollMethodInfo a signature where
overloadedMethod = busPoll
instance O.OverloadedMethodInfo BusPollMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busPoll",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busPoll"
})
#endif
foreign import ccall "gst_bus_pop" gst_bus_pop ::
Ptr Bus ->
IO (Ptr Gst.Message.Message)
busPop ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m (Maybe Gst.Message.Message)
busPop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m (Maybe Message)
busPop a
bus = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
result <- Ptr Bus -> IO (Ptr Message)
gst_bus_pop Ptr Bus
bus'
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusPopMethodInfo
instance (signature ~ (m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusPopMethodInfo a signature where
overloadedMethod = busPop
instance O.OverloadedMethodInfo BusPopMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busPop",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busPop"
})
#endif
foreign import ccall "gst_bus_pop_filtered" gst_bus_pop_filtered ::
Ptr Bus ->
CUInt ->
IO (Ptr Gst.Message.Message)
busPopFiltered ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> [Gst.Flags.MessageType]
-> m (Maybe Gst.Message.Message)
busPopFiltered :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> [MessageType] -> m (Maybe Message)
busPopFiltered a
bus [MessageType]
types = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let types' :: CUInt
types' = [MessageType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MessageType]
types
Ptr Message
result <- Ptr Bus -> CUInt -> IO (Ptr Message)
gst_bus_pop_filtered Ptr Bus
bus' CUInt
types'
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusPopFilteredMethodInfo
instance (signature ~ ([Gst.Flags.MessageType] -> m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusPopFilteredMethodInfo a signature where
overloadedMethod = busPopFiltered
instance O.OverloadedMethodInfo BusPopFilteredMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busPopFiltered",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busPopFiltered"
})
#endif
foreign import ccall "gst_bus_post" gst_bus_post ::
Ptr Bus ->
Ptr Gst.Message.Message ->
IO CInt
busPost ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Gst.Message.Message
-> m Bool
busPost :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Message -> m Bool
busPost a
bus Message
message = IO Bool -> m Bool
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
message' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Message
message
CInt
result <- Ptr Bus -> Ptr Message -> IO CInt
gst_bus_post Ptr Bus
bus' Ptr Message
message'
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
bus
BusMessageCallback
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
message
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusPostMethodInfo
instance (signature ~ (Gst.Message.Message -> m Bool), MonadIO m, IsBus a) => O.OverloadedMethod BusPostMethodInfo a signature where
overloadedMethod = busPost
instance O.OverloadedMethodInfo BusPostMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busPost",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busPost"
})
#endif
foreign import ccall "gst_bus_remove_signal_watch" gst_bus_remove_signal_watch ::
Ptr Bus ->
IO ()
busRemoveSignalWatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m ()
busRemoveSignalWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m ()
busRemoveSignalWatch a
bus = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Bus -> IO ()
gst_bus_remove_signal_watch Ptr Bus
bus'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusRemoveSignalWatchMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusRemoveSignalWatchMethodInfo a signature where
overloadedMethod = busRemoveSignalWatch
instance O.OverloadedMethodInfo BusRemoveSignalWatchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busRemoveSignalWatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busRemoveSignalWatch"
})
#endif
foreign import ccall "gst_bus_remove_watch" gst_bus_remove_watch ::
Ptr Bus ->
IO CInt
busRemoveWatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busRemoveWatch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> m Bool
busRemoveWatch a
bus = IO Bool -> m Bool
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
gst_bus_remove_watch Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusRemoveWatchMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.OverloadedMethod BusRemoveWatchMethodInfo a signature where
overloadedMethod = busRemoveWatch
instance O.OverloadedMethodInfo BusRemoveWatchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busRemoveWatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busRemoveWatch"
})
#endif
foreign import ccall "gst_bus_set_flushing" gst_bus_set_flushing ::
Ptr Bus ->
CInt ->
IO ()
busSetFlushing ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Bool
-> m ()
busSetFlushing :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Bool -> m ()
busSetFlushing a
bus Bool
flushing = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let flushing' :: CInt
flushing' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
flushing
Ptr Bus -> CInt -> IO ()
gst_bus_set_flushing Ptr Bus
bus' CInt
flushing'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetFlushingMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusSetFlushingMethodInfo a signature where
overloadedMethod = busSetFlushing
instance O.OverloadedMethodInfo BusSetFlushingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busSetFlushing",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busSetFlushing"
})
#endif
foreign import ccall "gst_bus_set_sync_handler" gst_bus_set_sync_handler ::
Ptr Bus ->
FunPtr Gst.Callbacks.C_BusSyncHandler ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
busSetSyncHandler ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Maybe (Gst.Callbacks.BusSyncHandler)
-> m ()
busSetSyncHandler :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Maybe BusSyncHandler -> m ()
busSetSyncHandler a
bus Maybe BusSyncHandler
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
FunPtr C_BusSyncHandler
maybeFunc <- case Maybe BusSyncHandler
func of
Maybe BusSyncHandler
Nothing -> FunPtr C_BusSyncHandler -> IO (FunPtr C_BusSyncHandler)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_BusSyncHandler
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just BusSyncHandler
jFunc -> do
FunPtr C_BusSyncHandler
jFunc' <- C_BusSyncHandler -> IO (FunPtr C_BusSyncHandler)
Gst.Callbacks.mk_BusSyncHandler (Maybe (Ptr (FunPtr C_BusSyncHandler))
-> BusSyncHandler_WithClosures -> C_BusSyncHandler
Gst.Callbacks.wrap_BusSyncHandler Maybe (Ptr (FunPtr C_BusSyncHandler))
forall a. Maybe a
Nothing (BusSyncHandler -> BusSyncHandler_WithClosures
Gst.Callbacks.drop_closures_BusSyncHandler BusSyncHandler
jFunc))
FunPtr C_BusSyncHandler -> IO (FunPtr C_BusSyncHandler)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_BusSyncHandler
jFunc'
let userData :: Ptr ()
userData = FunPtr C_BusSyncHandler -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_BusSyncHandler
maybeFunc
let notify :: FunPtr (Ptr a -> IO ())
notify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Ptr Bus
-> FunPtr C_BusSyncHandler
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gst_bus_set_sync_handler Ptr Bus
bus' FunPtr C_BusSyncHandler
maybeFunc Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
notify
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetSyncHandlerMethodInfo
instance (signature ~ (Maybe (Gst.Callbacks.BusSyncHandler) -> m ()), MonadIO m, IsBus a) => O.OverloadedMethod BusSetSyncHandlerMethodInfo a signature where
overloadedMethod = busSetSyncHandler
instance O.OverloadedMethodInfo BusSetSyncHandlerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busSetSyncHandler",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busSetSyncHandler"
})
#endif
foreign import ccall "gst_bus_sync_signal_handler" gst_bus_sync_signal_handler ::
Ptr Bus ->
Ptr Gst.Message.Message ->
Ptr () ->
IO CUInt
busSyncSignalHandler ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Gst.Message.Message
-> Ptr ()
-> m Gst.Enums.BusSyncReply
busSyncSignalHandler :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Message -> Ptr () -> m BusSyncReply
busSyncSignalHandler a
bus Message
message Ptr ()
data_ = IO BusSyncReply -> m BusSyncReply
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BusSyncReply -> m BusSyncReply)
-> IO BusSyncReply -> m BusSyncReply
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
message' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Message
message
CUInt
result <- C_BusSyncHandler
gst_bus_sync_signal_handler Ptr Bus
bus' Ptr Message
message' Ptr ()
data_
let result' :: BusSyncReply
result' = (Int -> BusSyncReply
forall a. Enum a => Int -> a
toEnum (Int -> BusSyncReply) -> (CUInt -> Int) -> CUInt -> BusSyncReply
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
BusMessageCallback
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
message
BusSyncReply -> IO BusSyncReply
forall (m :: * -> *) a. Monad m => a -> m a
return BusSyncReply
result'
#if defined(ENABLE_OVERLOADING)
data BusSyncSignalHandlerMethodInfo
instance (signature ~ (Gst.Message.Message -> Ptr () -> m Gst.Enums.BusSyncReply), MonadIO m, IsBus a) => O.OverloadedMethod BusSyncSignalHandlerMethodInfo a signature where
overloadedMethod = busSyncSignalHandler
instance O.OverloadedMethodInfo BusSyncSignalHandlerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busSyncSignalHandler",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busSyncSignalHandler"
})
#endif
foreign import ccall "gst_bus_timed_pop" gst_bus_timed_pop ::
Ptr Bus ->
Word64 ->
IO (Ptr Gst.Message.Message)
busTimedPop ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Word64
-> m (Maybe Gst.Message.Message)
busTimedPop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Word64 -> m (Maybe Message)
busTimedPop a
bus Word64
timeout = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Message
result <- Ptr Bus -> Word64 -> IO (Ptr Message)
gst_bus_timed_pop Ptr Bus
bus' Word64
timeout
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusTimedPopMethodInfo
instance (signature ~ (Word64 -> m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusTimedPopMethodInfo a signature where
overloadedMethod = busTimedPop
instance O.OverloadedMethodInfo BusTimedPopMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busTimedPop",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busTimedPop"
})
#endif
foreign import ccall "gst_bus_timed_pop_filtered" gst_bus_timed_pop_filtered ::
Ptr Bus ->
Word64 ->
CUInt ->
IO (Ptr Gst.Message.Message)
busTimedPopFiltered ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Word64
-> [Gst.Flags.MessageType]
-> m (Maybe Gst.Message.Message)
busTimedPopFiltered :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBus a) =>
a -> Word64 -> [MessageType] -> m (Maybe Message)
busTimedPopFiltered a
bus Word64
timeout [MessageType]
types = IO (Maybe Message) -> m (Maybe Message)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let types' :: CUInt
types' = [MessageType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MessageType]
types
Ptr Message
result <- Ptr Bus -> Word64 -> CUInt -> IO (Ptr Message)
gst_bus_timed_pop_filtered Ptr Bus
bus' Word64
timeout CUInt
types'
Maybe Message
maybeResult <- Ptr Message -> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Message
result ((Ptr Message -> IO Message) -> IO (Maybe Message))
-> (Ptr Message -> IO Message) -> IO (Maybe Message)
forall a b. (a -> b) -> a -> b
$ \Ptr Message
result' -> do
Message
result'' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Message -> Message
Gst.Message.Message) Ptr Message
result'
Message -> IO Message
forall (m :: * -> *) a. Monad m => a -> m a
return Message
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe Message -> IO (Maybe Message)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Message
maybeResult
#if defined(ENABLE_OVERLOADING)
data BusTimedPopFilteredMethodInfo
instance (signature ~ (Word64 -> [Gst.Flags.MessageType] -> m (Maybe Gst.Message.Message)), MonadIO m, IsBus a) => O.OverloadedMethod BusTimedPopFilteredMethodInfo a signature where
overloadedMethod = busTimedPopFiltered
instance O.OverloadedMethodInfo BusTimedPopFilteredMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gst.Objects.Bus.busTimedPopFiltered",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gst-1.0.25/docs/GI-Gst-Objects-Bus.html#v:busTimedPopFiltered"
})
#endif