| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // SoundStream.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>
- /// Base class for sound streams.
- /// </summary>
- public unsafe partial class SoundStream : RefCounted
- {
- unsafe partial void OnSoundStreamCreated ();
- [Preserve]
- public SoundStream (IntPtr handle) : base (handle)
- {
- OnSoundStreamCreated ();
- }
- [Preserve]
- protected SoundStream (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnSoundStreamCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool SoundStream_Seek (IntPtr handle, uint sample_number);
- /// <summary>
- /// Seek to sample number. Return true on success. Need not be implemented by all streams.
- /// </summary>
- public virtual bool Seek (uint sample_number)
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_Seek (handle, sample_number);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SoundStream_GetData (IntPtr handle, sbyte* dest, uint numBytes);
- /// <summary>
- /// Produce sound data into destination. Return number of bytes produced. Called by SoundSource from the mixing thread.
- /// </summary>
- public virtual uint GetData (sbyte* dest, uint numBytes)
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_GetData (handle, dest, numBytes);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundStream_SetFormat (IntPtr handle, uint frequency, bool sixteenBit, bool stereo);
- /// <summary>
- /// Set sound data format.
- /// </summary>
- public void SetFormat (uint frequency, bool sixteenBit, bool stereo)
- {
- Runtime.ValidateRefCounted (this);
- SoundStream_SetFormat (handle, frequency, sixteenBit, stereo);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SoundStream_SetStopAtEnd (IntPtr handle, bool enable);
- /// <summary>
- /// Set whether playback should stop when no more data. Default false.
- /// </summary>
- private void SetStopAtEnd (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- SoundStream_SetStopAtEnd (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SoundStream_GetSampleSize (IntPtr handle);
- /// <summary>
- /// Return sample size.
- /// </summary>
- private uint GetSampleSize ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_GetSampleSize (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float SoundStream_GetFrequency (IntPtr handle);
- /// <summary>
- /// Return default frequency as a float.
- /// </summary>
- private float GetFrequency ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_GetFrequency (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SoundStream_GetIntFrequency (IntPtr handle);
- /// <summary>
- /// Return default frequency as an integer.
- /// </summary>
- private uint GetIntFrequency ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_GetIntFrequency (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool SoundStream_GetStopAtEnd (IntPtr handle);
- /// <summary>
- /// Return whether playback should stop when no more data.
- /// </summary>
- private bool GetStopAtEnd ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_GetStopAtEnd (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool SoundStream_IsSixteenBit (IntPtr handle);
- /// <summary>
- /// Return whether data is sixteen bit.
- /// </summary>
- private bool IsSixteenBit ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_IsSixteenBit (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool SoundStream_IsStereo (IntPtr handle);
- /// <summary>
- /// Return whether data is stereo.
- /// </summary>
- private bool IsStereo ()
- {
- Runtime.ValidateRefCounted (this);
- return SoundStream_IsStereo (handle);
- }
- /// <summary>
- /// Return whether playback should stop when no more data.
- /// Or
- /// Set whether playback should stop when no more data. Default false.
- /// </summary>
- public bool StopAtEnd {
- get {
- return GetStopAtEnd ();
- }
- set {
- SetStopAtEnd (value);
- }
- }
- /// <summary>
- /// Return sample size.
- /// </summary>
- public uint SampleSize {
- get {
- return GetSampleSize ();
- }
- }
- /// <summary>
- /// Return default frequency as a float.
- /// </summary>
- public float Frequency {
- get {
- return GetFrequency ();
- }
- }
- /// <summary>
- /// Return default frequency as an integer.
- /// </summary>
- public uint IntFrequency {
- get {
- return GetIntFrequency ();
- }
- }
- /// <summary>
- /// Return whether data is sixteen bit.
- /// </summary>
- public bool SixteenBit {
- get {
- return IsSixteenBit ();
- }
- }
- /// <summary>
- /// Return whether data is stereo.
- /// </summary>
- public bool Stereo {
- get {
- return IsStereo ();
- }
- }
- }
- }
|