| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // SoundSource.cs
- //
- // Copyright 2015 Xamarin Inc. All rights reserved.
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using Urho.Urho2D;
- using Urho.Gui;
- using Urho.Resources;
- using Urho.IO;
- using Urho.Navigation;
- using Urho.Network;
- namespace Urho.Audio
- {
- /// <summary>
- /// %Sound source component with stereo position. A sound source needs to be created to a node to be considered "enabled" and be able to play, however that node does not need to belong to a scene.
- /// </summary>
- public unsafe partial class SoundSource : Component
- {
- unsafe partial void OnSoundSourceCreated ();
- [Preserve]
- public SoundSource (IntPtr handle) : base (handle)
- {
- OnSoundSourceCreated ();
- }
- [Preserve]
- protected SoundSource (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnSoundSourceCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int SoundSource_GetType (IntPtr handle);
- private StringHash UrhoGetType ()
- {
- Runtime.ValidateRefCounted (this);
- return new StringHash (SoundSource_GetType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr SoundSource_GetTypeName (IntPtr handle);
- private string GetTypeName ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (SoundSource_GetTypeName (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int SoundSource_GetTypeStatic ();
- private static StringHash GetTypeStatic ()
- {
- Runtime.Validate (typeof(SoundSource));
- return new StringHash (SoundSource_GetTypeStatic ());
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr SoundSource_GetTypeNameStatic ();
- private static string GetTypeNameStatic ()
- {
- Runtime.Validate (typeof(SoundSource));
- return Marshal.PtrToStringAnsi (SoundSource_GetTypeNameStatic ());
- }
- [Preserve]
- public SoundSource () : this (Application.CurrentContext)
- {
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr SoundSource_SoundSource (IntPtr context);
- [Preserve]
- public SoundSource (Context context) : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(SoundSource));
- handle = SoundSource_SoundSource ((object)context == null ? IntPtr.Zero : context.Handle);
- Runtime.RegisterObject (this);
- OnSoundSourceCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_RegisterObject (IntPtr context);
- /// <summary>
- /// Register object factory.
- /// </summary>
- public new static void RegisterObject (Context context)
- {
- Runtime.Validate (typeof(SoundSource));
- SoundSource_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Seek (IntPtr handle, float seekTime);
- /// <summary>
- /// Seek to time.
- /// </summary>
- public void Seek (float seekTime)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Seek (handle, seekTime);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Play (IntPtr handle, IntPtr sound);
- /// <summary>
- /// Play a sound.
- /// </summary>
- public void Play (Sound sound)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Play (handle, (object)sound == null ? IntPtr.Zero : sound.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Play0 (IntPtr handle, IntPtr sound, float frequency);
- /// <summary>
- /// Play a sound with specified frequency.
- /// </summary>
- public void Play (Sound sound, float frequency)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Play0 (handle, (object)sound == null ? IntPtr.Zero : sound.Handle, frequency);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Play1 (IntPtr handle, IntPtr sound, float frequency, float gain);
- /// <summary>
- /// Play a sound with specified frequency and gain.
- /// </summary>
- public void Play (Sound sound, float frequency, float gain)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Play1 (handle, (object)sound == null ? IntPtr.Zero : sound.Handle, frequency, gain);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Play2 (IntPtr handle, IntPtr sound, float frequency, float gain, float panning);
- /// <summary>
- /// Play a sound with specified frequency, gain and panning.
- /// </summary>
- public void Play (Sound sound, float frequency, float gain, float panning)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Play2 (handle, (object)sound == null ? IntPtr.Zero : sound.Handle, frequency, gain, panning);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Play3 (IntPtr handle, IntPtr stream);
- /// <summary>
- /// Start playing a sound stream.
- /// </summary>
- public void Play (SoundStream stream)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Play3 (handle, (object)stream == null ? IntPtr.Zero : stream.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Stop (IntPtr handle);
- /// <summary>
- /// Stop playback.
- /// </summary>
- public void Stop ()
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Stop (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetSoundType (IntPtr handle, string type);
- /// <summary>
- /// Set sound type, determines the master gain group.
- /// </summary>
- public void SetSoundType (string type)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetSoundType (handle, type);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetFrequency (IntPtr handle, float frequency);
- /// <summary>
- /// Set frequency.
- /// </summary>
- private void SetFrequency (float frequency)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetFrequency (handle, frequency);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetGain (IntPtr handle, float gain);
- /// <summary>
- /// Set gain. 0.0 is silence, 1.0 is full volume.
- /// </summary>
- private void SetGain (float gain)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetGain (handle, gain);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetAttenuation (IntPtr handle, float attenuation);
- /// <summary>
- /// Set attenuation. 1.0 is unaltered. Used for distance attenuated playback.
- /// </summary>
- private void SetAttenuation (float attenuation)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetAttenuation (handle, attenuation);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetPanning (IntPtr handle, float panning);
- /// <summary>
- /// Set stereo panning. -1.0 is full left and 1.0 is full right.
- /// </summary>
- private void SetPanning (float panning)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetPanning (handle, panning);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetAutoRemoveMode (IntPtr handle, AutoRemoveMode mode);
- /// <summary>
- /// Set to remove either the sound source component or its owner node from the scene automatically on sound playback completion. Disabled by default.
- /// </summary>
- private void SetAutoRemoveMode (AutoRemoveMode mode)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetAutoRemoveMode (handle, mode);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetPlayPosition (IntPtr handle, sbyte* pos);
- /// <summary>
- /// Set new playback position.
- /// </summary>
- public void SetPlayPosition (sbyte* pos)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetPlayPosition (handle, pos);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr SoundSource_GetSound (IntPtr handle);
- /// <summary>
- /// Return sound.
- /// </summary>
- private Sound GetSound ()
- {
- Runtime.ValidateRefCounted (this);
- return Runtime.LookupObject<Sound> (SoundSource_GetSound (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern sbyte* SoundSource_GetPlayPosition (IntPtr handle);
- /// <summary>
- /// Return playback position.
- /// </summary>
- private sbyte* GetPlayPosition ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetPlayPosition (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr SoundSource_GetSoundType (IntPtr handle);
- /// <summary>
- /// Return sound type, determines the master gain group.
- /// </summary>
- private string GetSoundType ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (SoundSource_GetSoundType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundSource_GetTimePosition (IntPtr handle);
- /// <summary>
- /// Return playback time position.
- /// </summary>
- private float GetTimePosition ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetTimePosition (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundSource_GetFrequency (IntPtr handle);
- /// <summary>
- /// Return frequency.
- /// </summary>
- private float GetFrequency ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetFrequency (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundSource_GetGain (IntPtr handle);
- /// <summary>
- /// Return gain.
- /// </summary>
- private float GetGain ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetGain (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundSource_GetAttenuation (IntPtr handle);
- /// <summary>
- /// Return attenuation.
- /// </summary>
- private float GetAttenuation ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetAttenuation (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundSource_GetPanning (IntPtr handle);
- /// <summary>
- /// Return stereo panning.
- /// </summary>
- private float GetPanning ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetPanning (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern AutoRemoveMode SoundSource_GetAutoRemoveMode (IntPtr handle);
- /// <summary>
- /// Return automatic removal mode on sound playback completion.
- /// </summary>
- private AutoRemoveMode GetAutoRemoveMode ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetAutoRemoveMode (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool SoundSource_IsPlaying (IntPtr handle);
- /// <summary>
- /// Return whether is playing.
- /// </summary>
- private bool IsPlaying ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_IsPlaying (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Update (IntPtr handle, float timeStep);
- /// <summary>
- /// Update the sound source. Perform subclass specific operations. Called by Audio.
- /// </summary>
- public virtual void Update (float timeStep)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Update (handle, timeStep);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_Mix (IntPtr handle, int* dest, uint samples, int mixRate, bool stereo, bool interpolation);
- /// <summary>
- /// Mix sound source output to a 32-bit clipping buffer. Called by Audio.
- /// </summary>
- public void Mix (int* dest, uint samples, int mixRate, bool stereo, bool interpolation)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_Mix (handle, dest, samples, mixRate, stereo, interpolation);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_UpdateMasterGain (IntPtr handle);
- /// <summary>
- /// Update the effective master gain. Called internally and by Audio when the master gain changes.
- /// </summary>
- public void UpdateMasterGain ()
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_UpdateMasterGain (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetPositionAttr (IntPtr handle, int value);
- /// <summary>
- /// Set sound position attribute.
- /// </summary>
- private void SetPositionAttr (int value)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetPositionAttr (handle, value);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern ResourceRef SoundSource_GetSoundAttr (IntPtr handle);
- /// <summary>
- /// Return sound attribute.
- /// </summary>
- private ResourceRef GetSoundAttr ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetSoundAttr (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundSource_SetPlayingAttr (IntPtr handle, bool value);
- /// <summary>
- /// Set sound playing attribute
- /// </summary>
- public void SetPlayingAttr (bool value)
- {
- Runtime.ValidateRefCounted (this);
- SoundSource_SetPlayingAttr (handle, value);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int SoundSource_GetPositionAttr (IntPtr handle);
- /// <summary>
- /// Return sound position attribute.
- /// </summary>
- private int GetPositionAttr ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundSource_GetPositionAttr (handle);
- }
- public override StringHash Type {
- get {
- return UrhoGetType ();
- }
- }
- public override string TypeName {
- get {
- return GetTypeName ();
- }
- }
- [Preserve]
- public new static StringHash TypeStatic {
- get {
- return GetTypeStatic ();
- }
- }
- public new static string TypeNameStatic {
- get {
- return GetTypeNameStatic ();
- }
- }
- /// <summary>
- /// Return sound type, determines the master gain group.
- /// </summary>
- public string SoundType {
- get {
- return GetSoundType ();
- }
- }
- /// <summary>
- /// Return frequency.
- /// Or
- /// Set frequency.
- /// </summary>
- public float Frequency {
- get {
- return GetFrequency ();
- }
- set {
- SetFrequency (value);
- }
- }
- /// <summary>
- /// Return gain.
- /// Or
- /// Set gain. 0.0 is silence, 1.0 is full volume.
- /// </summary>
- public float Gain {
- get {
- return GetGain ();
- }
- set {
- SetGain (value);
- }
- }
- /// <summary>
- /// Return attenuation.
- /// Or
- /// Set attenuation. 1.0 is unaltered. Used for distance attenuated playback.
- /// </summary>
- public float Attenuation {
- get {
- return GetAttenuation ();
- }
- set {
- SetAttenuation (value);
- }
- }
- /// <summary>
- /// Return stereo panning.
- /// Or
- /// Set stereo panning. -1.0 is full left and 1.0 is full right.
- /// </summary>
- public float Panning {
- get {
- return GetPanning ();
- }
- set {
- SetPanning (value);
- }
- }
- /// <summary>
- /// Return automatic removal mode on sound playback completion.
- /// Or
- /// Set to remove either the sound source component or its owner node from the scene automatically on sound playback completion. Disabled by default.
- /// </summary>
- public AutoRemoveMode AutoRemoveMode {
- get {
- return GetAutoRemoveMode ();
- }
- set {
- SetAutoRemoveMode (value);
- }
- }
- /// <summary>
- /// Return playback position.
- /// </summary>
- public sbyte* PlayPosition {
- get {
- return GetPlayPosition ();
- }
- }
- /// <summary>
- /// Return sound.
- /// </summary>
- public Sound Sound {
- get {
- return GetSound ();
- }
- }
- /// <summary>
- /// Return playback time position.
- /// </summary>
- public float TimePosition {
- get {
- return GetTimePosition ();
- }
- }
- /// <summary>
- /// Return whether is playing.
- /// </summary>
- public bool Playing {
- get {
- return IsPlaying ();
- }
- }
- /// <summary>
- /// Return sound attribute.
- /// </summary>
- public ResourceRef SoundAttr {
- get {
- return GetSoundAttr ();
- }
- }
- /// <summary>
- /// Return sound position attribute.
- /// Or
- /// Set sound position attribute.
- /// </summary>
- public int PositionAttr {
- get {
- return GetPositionAttr ();
- }
- set {
- SetPositionAttr (value);
- }
- }
- }
- }
|