{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

'GI.GstPbutils.Objects.DiscovererStreamInfo.DiscovererStreamInfo' specific to audio streams.
-}

module GI.GstPbutils.Objects.DiscovererAudioInfo
    ( 

-- * Exported types
    DiscovererAudioInfo(..)                 ,
    IsDiscovererAudioInfo                   ,
    toDiscovererAudioInfo                   ,
    noDiscovererAudioInfo                   ,


 -- * Methods
-- ** getBitrate #method:getBitrate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetBitrateMethodInfo ,
#endif
    discovererAudioInfoGetBitrate           ,


-- ** getChannels #method:getChannels#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetChannelsMethodInfo,
#endif
    discovererAudioInfoGetChannels          ,


-- ** getDepth #method:getDepth#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetDepthMethodInfo   ,
#endif
    discovererAudioInfoGetDepth             ,


-- ** getLanguage #method:getLanguage#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetLanguageMethodInfo,
#endif
    discovererAudioInfoGetLanguage          ,


-- ** getMaxBitrate #method:getMaxBitrate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetMaxBitrateMethodInfo,
#endif
    discovererAudioInfoGetMaxBitrate        ,


-- ** getSampleRate #method:getSampleRate#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DiscovererAudioInfoGetSampleRateMethodInfo,
#endif
    discovererAudioInfoGetSampleRate        ,




    ) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.GstPbutils.Objects.DiscovererStreamInfo as GstPbutils.DiscovererStreamInfo

newtype DiscovererAudioInfo = DiscovererAudioInfo (ManagedPtr DiscovererAudioInfo)
foreign import ccall "gst_discoverer_audio_info_get_type"
    c_gst_discoverer_audio_info_get_type :: IO GType

instance GObject DiscovererAudioInfo where
    gobjectType _ = c_gst_discoverer_audio_info_get_type
    

class GObject o => IsDiscovererAudioInfo o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DiscovererAudioInfo a) =>
    IsDiscovererAudioInfo a
#endif
instance IsDiscovererAudioInfo DiscovererAudioInfo
instance GstPbutils.DiscovererStreamInfo.IsDiscovererStreamInfo DiscovererAudioInfo
instance GObject.Object.IsObject DiscovererAudioInfo

toDiscovererAudioInfo :: (MonadIO m, IsDiscovererAudioInfo o) => o -> m DiscovererAudioInfo
toDiscovererAudioInfo = liftIO . unsafeCastTo DiscovererAudioInfo

noDiscovererAudioInfo :: Maybe DiscovererAudioInfo
noDiscovererAudioInfo = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveDiscovererAudioInfoMethod (t :: Symbol) (o :: *) :: * where
    ResolveDiscovererAudioInfoMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDiscovererAudioInfoMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDiscovererAudioInfoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDiscovererAudioInfoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDiscovererAudioInfoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDiscovererAudioInfoMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDiscovererAudioInfoMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDiscovererAudioInfoMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDiscovererAudioInfoMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDiscovererAudioInfoMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDiscovererAudioInfoMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDiscovererAudioInfoMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDiscovererAudioInfoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDiscovererAudioInfoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDiscovererAudioInfoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDiscovererAudioInfoMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDiscovererAudioInfoMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDiscovererAudioInfoMethod "getBitrate" o = DiscovererAudioInfoGetBitrateMethodInfo
    ResolveDiscovererAudioInfoMethod "getCaps" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetCapsMethodInfo
    ResolveDiscovererAudioInfoMethod "getChannels" o = DiscovererAudioInfoGetChannelsMethodInfo
    ResolveDiscovererAudioInfoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDiscovererAudioInfoMethod "getDepth" o = DiscovererAudioInfoGetDepthMethodInfo
    ResolveDiscovererAudioInfoMethod "getLanguage" o = DiscovererAudioInfoGetLanguageMethodInfo
    ResolveDiscovererAudioInfoMethod "getMaxBitrate" o = DiscovererAudioInfoGetMaxBitrateMethodInfo
    ResolveDiscovererAudioInfoMethod "getMisc" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetMiscMethodInfo
    ResolveDiscovererAudioInfoMethod "getNext" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetNextMethodInfo
    ResolveDiscovererAudioInfoMethod "getPrevious" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetPreviousMethodInfo
    ResolveDiscovererAudioInfoMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDiscovererAudioInfoMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDiscovererAudioInfoMethod "getSampleRate" o = DiscovererAudioInfoGetSampleRateMethodInfo
    ResolveDiscovererAudioInfoMethod "getStreamId" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetStreamIdMethodInfo
    ResolveDiscovererAudioInfoMethod "getStreamTypeNick" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetStreamTypeNickMethodInfo
    ResolveDiscovererAudioInfoMethod "getTags" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetTagsMethodInfo
    ResolveDiscovererAudioInfoMethod "getToc" o = GstPbutils.DiscovererStreamInfo.DiscovererStreamInfoGetTocMethodInfo
    ResolveDiscovererAudioInfoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDiscovererAudioInfoMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDiscovererAudioInfoMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDiscovererAudioInfoMethod t DiscovererAudioInfo, O.MethodInfo info DiscovererAudioInfo p) => O.IsLabelProxy t (DiscovererAudioInfo -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDiscovererAudioInfoMethod t DiscovererAudioInfo, O.MethodInfo info DiscovererAudioInfo p) => O.IsLabel t (DiscovererAudioInfo -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList DiscovererAudioInfo
type instance O.AttributeList DiscovererAudioInfo = DiscovererAudioInfoAttributeList
type DiscovererAudioInfoAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList DiscovererAudioInfo = DiscovererAudioInfoSignalList
type DiscovererAudioInfoSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method DiscovererAudioInfo::get_bitrate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_bitrate" gst_discoverer_audio_info_get_bitrate :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO Word32

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetBitrate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m Word32
    {- ^ __Returns:__ the average or nominal bitrate of the stream in bits\/second. -}
discovererAudioInfoGetBitrate info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_bitrate info'
    touchManagedPtr info
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetBitrateMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetBitrateMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetBitrate

#endif

-- method DiscovererAudioInfo::get_channels
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_channels" gst_discoverer_audio_info_get_channels :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO Word32

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetChannels ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m Word32
    {- ^ __Returns:__ the number of channels in the stream. -}
discovererAudioInfoGetChannels info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_channels info'
    touchManagedPtr info
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetChannelsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetChannelsMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetChannels

#endif

-- method DiscovererAudioInfo::get_depth
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_depth" gst_discoverer_audio_info_get_depth :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO Word32

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetDepth ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m Word32
    {- ^ __Returns:__ the number of bits used per sample in each channel. -}
discovererAudioInfoGetDepth info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_depth info'
    touchManagedPtr info
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetDepthMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetDepthMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetDepth

#endif

-- method DiscovererAudioInfo::get_language
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_language" gst_discoverer_audio_info_get_language :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO CString

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m T.Text
    {- ^ __Returns:__ the language of the stream, or NULL if unknown. -}
discovererAudioInfoGetLanguage info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_language info'
    checkUnexpectedReturnNULL "discovererAudioInfoGetLanguage" result
    result' <- cstringToText result
    touchManagedPtr info
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetLanguageMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetLanguageMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetLanguage

#endif

-- method DiscovererAudioInfo::get_max_bitrate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_max_bitrate" gst_discoverer_audio_info_get_max_bitrate :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO Word32

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetMaxBitrate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m Word32
    {- ^ __Returns:__ the maximum bitrate of the stream in bits\/second. -}
discovererAudioInfoGetMaxBitrate info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_max_bitrate info'
    touchManagedPtr info
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetMaxBitrateMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetMaxBitrateMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetMaxBitrate

#endif

-- method DiscovererAudioInfo::get_sample_rate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstDiscovererAudioInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_discoverer_audio_info_get_sample_rate" gst_discoverer_audio_info_get_sample_rate :: 
    Ptr DiscovererAudioInfo ->              -- info : TInterface (Name {namespace = "GstPbutils", name = "DiscovererAudioInfo"})
    IO Word32

{- |
/No description available in the introspection data./
-}
discovererAudioInfoGetSampleRate ::
    (B.CallStack.HasCallStack, MonadIO m, IsDiscovererAudioInfo a) =>
    a
    {- ^ /@info@/: a 'GI.GstPbutils.Objects.DiscovererAudioInfo.DiscovererAudioInfo' -}
    -> m Word32
    {- ^ __Returns:__ the sample rate of the stream in Hertz. -}
discovererAudioInfoGetSampleRate info = liftIO $ do
    info' <- unsafeManagedPtrCastPtr info
    result <- gst_discoverer_audio_info_get_sample_rate info'
    touchManagedPtr info
    return result

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DiscovererAudioInfoGetSampleRateMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDiscovererAudioInfo a) => O.MethodInfo DiscovererAudioInfoGetSampleRateMethodInfo a signature where
    overloadedMethod _ = discovererAudioInfoGetSampleRate

#endif