{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstAudio.Structs.AudioResampler
(
AudioResampler(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveAudioResamplerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AudioResamplerFreeMethodInfo ,
#endif
audioResamplerFree ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerGetInFramesMethodInfo ,
#endif
audioResamplerGetInFrames ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerGetMaxLatencyMethodInfo ,
#endif
audioResamplerGetMaxLatency ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerGetOutFramesMethodInfo ,
#endif
audioResamplerGetOutFrames ,
audioResamplerNew ,
audioResamplerOptionsSetQuality ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerResampleMethodInfo ,
#endif
audioResamplerResample ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerResetMethodInfo ,
#endif
audioResamplerReset ,
#if defined(ENABLE_OVERLOADING)
AudioResamplerUpdateMethodInfo ,
#endif
audioResamplerUpdate ,
) 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.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.Gst.Structs.Structure as Gst.Structure
import {-# SOURCE #-} qualified GI.GstAudio.Enums as GstAudio.Enums
import {-# SOURCE #-} qualified GI.GstAudio.Flags as GstAudio.Flags
newtype AudioResampler = AudioResampler (SP.ManagedPtr AudioResampler)
deriving (AudioResampler -> AudioResampler -> Bool
(AudioResampler -> AudioResampler -> Bool)
-> (AudioResampler -> AudioResampler -> Bool) -> Eq AudioResampler
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AudioResampler -> AudioResampler -> Bool
== :: AudioResampler -> AudioResampler -> Bool
$c/= :: AudioResampler -> AudioResampler -> Bool
/= :: AudioResampler -> AudioResampler -> Bool
Eq)
instance SP.ManagedPtrNewtype AudioResampler where
toManagedPtr :: AudioResampler -> ManagedPtr AudioResampler
toManagedPtr (AudioResampler ManagedPtr AudioResampler
p) = ManagedPtr AudioResampler
p
instance BoxedPtr AudioResampler where
boxedPtrCopy :: AudioResampler -> IO AudioResampler
boxedPtrCopy = AudioResampler -> IO AudioResampler
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: AudioResampler -> IO ()
boxedPtrFree = \AudioResampler
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AudioResampler
type instance O.AttributeList AudioResampler = AudioResamplerAttributeList
type AudioResamplerAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gst_audio_resampler_free" gst_audio_resampler_free ::
Ptr AudioResampler ->
IO ()
audioResamplerFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> m ()
audioResamplerFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> m ()
audioResamplerFree AudioResampler
resampler = 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 AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Ptr AudioResampler -> IO ()
gst_audio_resampler_free Ptr AudioResampler
resampler'
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AudioResamplerFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod AudioResamplerFreeMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerFree
instance O.OverloadedMethodInfo AudioResamplerFreeMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerFree"
})
#endif
foreign import ccall "gst_audio_resampler_get_in_frames" gst_audio_resampler_get_in_frames ::
Ptr AudioResampler ->
Word64 ->
IO Word64
audioResamplerGetInFrames ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> Word64
-> m Word64
audioResamplerGetInFrames :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> Word64 -> m Word64
audioResamplerGetInFrames AudioResampler
resampler Word64
outFrames = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Word64
result <- Ptr AudioResampler -> Word64 -> IO Word64
gst_audio_resampler_get_in_frames Ptr AudioResampler
resampler' Word64
outFrames
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AudioResamplerGetInFramesMethodInfo
instance (signature ~ (Word64 -> m Word64), MonadIO m) => O.OverloadedMethod AudioResamplerGetInFramesMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerGetInFrames
instance O.OverloadedMethodInfo AudioResamplerGetInFramesMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerGetInFrames",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerGetInFrames"
})
#endif
foreign import ccall "gst_audio_resampler_get_max_latency" gst_audio_resampler_get_max_latency ::
Ptr AudioResampler ->
IO Word64
audioResamplerGetMaxLatency ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> m Word64
audioResamplerGetMaxLatency :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> m Word64
audioResamplerGetMaxLatency AudioResampler
resampler = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Word64
result <- Ptr AudioResampler -> IO Word64
gst_audio_resampler_get_max_latency Ptr AudioResampler
resampler'
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AudioResamplerGetMaxLatencyMethodInfo
instance (signature ~ (m Word64), MonadIO m) => O.OverloadedMethod AudioResamplerGetMaxLatencyMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerGetMaxLatency
instance O.OverloadedMethodInfo AudioResamplerGetMaxLatencyMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerGetMaxLatency",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerGetMaxLatency"
})
#endif
foreign import ccall "gst_audio_resampler_get_out_frames" gst_audio_resampler_get_out_frames ::
Ptr AudioResampler ->
Word64 ->
IO Word64
audioResamplerGetOutFrames ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> Word64
-> m Word64
audioResamplerGetOutFrames :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> Word64 -> m Word64
audioResamplerGetOutFrames AudioResampler
resampler Word64
inFrames = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Word64
result <- Ptr AudioResampler -> Word64 -> IO Word64
gst_audio_resampler_get_out_frames Ptr AudioResampler
resampler' Word64
inFrames
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data AudioResamplerGetOutFramesMethodInfo
instance (signature ~ (Word64 -> m Word64), MonadIO m) => O.OverloadedMethod AudioResamplerGetOutFramesMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerGetOutFrames
instance O.OverloadedMethodInfo AudioResamplerGetOutFramesMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerGetOutFrames",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerGetOutFrames"
})
#endif
foreign import ccall "gst_audio_resampler_resample" gst_audio_resampler_resample ::
Ptr AudioResampler ->
Ptr () ->
Word64 ->
Ptr () ->
Word64 ->
IO ()
audioResamplerResample ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> Ptr ()
-> Word64
-> Ptr ()
-> Word64
-> m ()
audioResamplerResample :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> Ptr () -> Word64 -> Ptr () -> Word64 -> m ()
audioResamplerResample AudioResampler
resampler Ptr ()
in_ Word64
inFrames Ptr ()
out Word64
outFrames = 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 AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Ptr AudioResampler -> Ptr () -> Word64 -> Ptr () -> Word64 -> IO ()
gst_audio_resampler_resample Ptr AudioResampler
resampler' Ptr ()
in_ Word64
inFrames Ptr ()
out Word64
outFrames
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AudioResamplerResampleMethodInfo
instance (signature ~ (Ptr () -> Word64 -> Ptr () -> Word64 -> m ()), MonadIO m) => O.OverloadedMethod AudioResamplerResampleMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerResample
instance O.OverloadedMethodInfo AudioResamplerResampleMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerResample",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerResample"
})
#endif
foreign import ccall "gst_audio_resampler_reset" gst_audio_resampler_reset ::
Ptr AudioResampler ->
IO ()
audioResamplerReset ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> m ()
audioResamplerReset :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> m ()
audioResamplerReset AudioResampler
resampler = 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 AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Ptr AudioResampler -> IO ()
gst_audio_resampler_reset Ptr AudioResampler
resampler'
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AudioResamplerResetMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod AudioResamplerResetMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerReset
instance O.OverloadedMethodInfo AudioResamplerResetMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerReset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerReset"
})
#endif
foreign import ccall "gst_audio_resampler_update" gst_audio_resampler_update ::
Ptr AudioResampler ->
Int32 ->
Int32 ->
Ptr Gst.Structure.Structure ->
IO CInt
audioResamplerUpdate ::
(B.CallStack.HasCallStack, MonadIO m) =>
AudioResampler
-> Int32
-> Int32
-> Gst.Structure.Structure
-> m Bool
audioResamplerUpdate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResampler -> Int32 -> Int32 -> Structure -> m Bool
audioResamplerUpdate AudioResampler
resampler Int32
inRate Int32
outRate Structure
options = 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 AudioResampler
resampler' <- AudioResampler -> IO (Ptr AudioResampler)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AudioResampler
resampler
Ptr Structure
options' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
options
CInt
result <- Ptr AudioResampler -> Int32 -> Int32 -> Ptr Structure -> IO CInt
gst_audio_resampler_update Ptr AudioResampler
resampler' Int32
inRate Int32
outRate Ptr Structure
options'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
AudioResampler -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AudioResampler
resampler
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
options
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AudioResamplerUpdateMethodInfo
instance (signature ~ (Int32 -> Int32 -> Gst.Structure.Structure -> m Bool), MonadIO m) => O.OverloadedMethod AudioResamplerUpdateMethodInfo AudioResampler signature where
overloadedMethod = audioResamplerUpdate
instance O.OverloadedMethodInfo AudioResamplerUpdateMethodInfo AudioResampler where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GstAudio.Structs.AudioResampler.audioResamplerUpdate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gstaudio-1.0.25/docs/GI-GstAudio-Structs-AudioResampler.html#v:audioResamplerUpdate"
})
#endif
foreign import ccall "gst_audio_resampler_new" gst_audio_resampler_new ::
CUInt ->
CUInt ->
CUInt ->
Int32 ->
Int32 ->
Int32 ->
Ptr Gst.Structure.Structure ->
IO (Ptr AudioResampler)
audioResamplerNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
GstAudio.Enums.AudioResamplerMethod
-> [GstAudio.Flags.AudioResamplerFlags]
-> GstAudio.Enums.AudioFormat
-> Int32
-> Int32
-> Int32
-> Gst.Structure.Structure
-> m ()
audioResamplerNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResamplerMethod
-> [AudioResamplerFlags]
-> AudioFormat
-> Int32
-> Int32
-> Int32
-> Structure
-> m ()
audioResamplerNew AudioResamplerMethod
method [AudioResamplerFlags]
flags AudioFormat
format Int32
channels Int32
inRate Int32
outRate Structure
options = 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
let method' :: CUInt
method' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (AudioResamplerMethod -> Int) -> AudioResamplerMethod -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AudioResamplerMethod -> Int
forall a. Enum a => a -> Int
fromEnum) AudioResamplerMethod
method
let flags' :: CUInt
flags' = [AudioResamplerFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [AudioResamplerFlags]
flags
let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (AudioFormat -> Int) -> AudioFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AudioFormat -> Int
forall a. Enum a => a -> Int
fromEnum) AudioFormat
format
Ptr Structure
options' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
options
Ptr AudioResampler
_ <- CUInt
-> CUInt
-> CUInt
-> Int32
-> Int32
-> Int32
-> Ptr Structure
-> IO (Ptr AudioResampler)
gst_audio_resampler_new CUInt
method' CUInt
flags' CUInt
format' Int32
channels Int32
inRate Int32
outRate Ptr Structure
options'
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
options
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gst_audio_resampler_options_set_quality" gst_audio_resampler_options_set_quality ::
CUInt ->
Word32 ->
Int32 ->
Int32 ->
Ptr Gst.Structure.Structure ->
IO ()
audioResamplerOptionsSetQuality ::
(B.CallStack.HasCallStack, MonadIO m) =>
GstAudio.Enums.AudioResamplerMethod
-> Word32
-> Int32
-> Int32
-> Gst.Structure.Structure
-> m ()
audioResamplerOptionsSetQuality :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AudioResamplerMethod
-> Word32 -> Int32 -> Int32 -> Structure -> m ()
audioResamplerOptionsSetQuality AudioResamplerMethod
method Word32
quality Int32
inRate Int32
outRate Structure
options = 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
let method' :: CUInt
method' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (AudioResamplerMethod -> Int) -> AudioResamplerMethod -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AudioResamplerMethod -> Int
forall a. Enum a => a -> Int
fromEnum) AudioResamplerMethod
method
Ptr Structure
options' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
options
CUInt -> Word32 -> Int32 -> Int32 -> Ptr Structure -> IO ()
gst_audio_resampler_options_set_quality CUInt
method' Word32
quality Int32
inRate Int32
outRate Ptr Structure
options'
Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
options
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveAudioResamplerMethod (t :: Symbol) (o :: *) :: * where
ResolveAudioResamplerMethod "free" o = AudioResamplerFreeMethodInfo
ResolveAudioResamplerMethod "resample" o = AudioResamplerResampleMethodInfo
ResolveAudioResamplerMethod "reset" o = AudioResamplerResetMethodInfo
ResolveAudioResamplerMethod "update" o = AudioResamplerUpdateMethodInfo
ResolveAudioResamplerMethod "getInFrames" o = AudioResamplerGetInFramesMethodInfo
ResolveAudioResamplerMethod "getMaxLatency" o = AudioResamplerGetMaxLatencyMethodInfo
ResolveAudioResamplerMethod "getOutFrames" o = AudioResamplerGetOutFramesMethodInfo
ResolveAudioResamplerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAudioResamplerMethod t AudioResampler, O.OverloadedMethod info AudioResampler p) => OL.IsLabel t (AudioResampler -> 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 ~ ResolveAudioResamplerMethod t AudioResampler, O.OverloadedMethod info AudioResampler p, R.HasField t AudioResampler p) => R.HasField t AudioResampler p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAudioResamplerMethod t AudioResampler, O.OverloadedMethodInfo info AudioResampler) => OL.IsLabel t (O.MethodProxy info AudioResampler) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif