| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // BufferedSoundStream.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 stream that supports manual buffering of data from the main thread.
- /// </summary>
- public unsafe partial class BufferedSoundStream : SoundStream
- {
- unsafe partial void OnBufferedSoundStreamCreated ();
- [Preserve]
- public BufferedSoundStream (IntPtr handle) : base (handle)
- {
- OnBufferedSoundStreamCreated ();
- }
- [Preserve]
- protected BufferedSoundStream (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnBufferedSoundStreamCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr BufferedSoundStream_BufferedSoundStream ();
- [Preserve]
- public BufferedSoundStream () : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(BufferedSoundStream));
- handle = BufferedSoundStream_BufferedSoundStream ();
- Runtime.RegisterObject (this);
- OnBufferedSoundStreamCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint BufferedSoundStream_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 override uint GetData (sbyte* dest, uint numBytes)
- {
- Runtime.ValidateRefCounted (this);
- return BufferedSoundStream_GetData (handle, dest, numBytes);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void BufferedSoundStream_AddData (IntPtr handle, IntPtr data, uint numBytes);
- /// <summary>
- /// Buffer sound data. Makes a copy of it.
- /// </summary>
- public void AddData (IntPtr data, uint numBytes)
- {
- Runtime.ValidateRefCounted (this);
- BufferedSoundStream_AddData (handle, data, numBytes);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void BufferedSoundStream_Clear (IntPtr handle);
- /// <summary>
- /// Remove all buffered audio data.
- /// </summary>
- public void Clear ()
- {
- Runtime.ValidateRefCounted (this);
- BufferedSoundStream_Clear (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint BufferedSoundStream_GetBufferNumBytes (IntPtr handle);
- /// <summary>
- /// Return amount of buffered (unplayed) sound data in bytes.
- /// </summary>
- private uint GetBufferNumBytes ()
- {
- Runtime.ValidateRefCounted (this);
- return BufferedSoundStream_GetBufferNumBytes (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float BufferedSoundStream_GetBufferLength (IntPtr handle);
- /// <summary>
- /// Return length of buffered (unplayed) sound data in seconds.
- /// </summary>
- private float GetBufferLength ()
- {
- Runtime.ValidateRefCounted (this);
- return BufferedSoundStream_GetBufferLength (handle);
- }
- /// <summary>
- /// Return amount of buffered (unplayed) sound data in bytes.
- /// </summary>
- public uint BufferNumBytes {
- get {
- return GetBufferNumBytes ();
- }
- }
- /// <summary>
- /// Return length of buffered (unplayed) sound data in seconds.
- /// </summary>
- public float BufferLength {
- get {
- return GetBufferLength ();
- }
- }
- }
- }
|