/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.4
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace cAudio {

using System;
using System.Runtime.InteropServices;

public class IAudioDecoder : IRefCounted {
  private HandleRef swigCPtr;

  internal IAudioDecoder(IntPtr cPtr, bool cMemoryOwn) : base(cAudioCSharpWrapperPINVOKE.IAudioDecoder_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(IAudioDecoder obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~IAudioDecoder() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          cAudioCSharpWrapperPINVOKE.delete_IAudioDecoder(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public IAudioDecoder(IDataSource stream) : this(cAudioCSharpWrapperPINVOKE.new_IAudioDecoder(IDataSource.getCPtr(stream)), true) {
    SwigDirectorConnect();
  }

  public virtual AudioFormats getFormat() {
    AudioFormats ret = (AudioFormats)cAudioCSharpWrapperPINVOKE.IAudioDecoder_getFormat(swigCPtr);
    return ret;
  }

  public virtual int getFrequency() {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getFrequency(swigCPtr);
    return ret;
  }

  public virtual bool isSeekingSupported() {
    bool ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_isSeekingSupported(swigCPtr);
    return ret;
  }

  public virtual bool isValid() {
    bool ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_isValid(swigCPtr);
    return ret;
  }

  public virtual int readAudioData(SWIGTYPE_p_void output, int amount) {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_readAudioData(swigCPtr, SWIGTYPE_p_void.getCPtr(output), amount);
    return ret;
  }

  public virtual bool setPosition(int position, bool relative) {
    bool ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_setPosition(swigCPtr, position, relative);
    return ret;
  }

  public virtual bool seek(float seconds, bool relative) {
    bool ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_seek(swigCPtr, seconds, relative);
    return ret;
  }

  public virtual float getTotalTime() {
    float ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getTotalTime(swigCPtr);
    return ret;
  }

  public virtual int getTotalSize() {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getTotalSize(swigCPtr);
    return ret;
  }

  public virtual int getCompressedSize() {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getCompressedSize(swigCPtr);
    return ret;
  }

  public virtual float getCurrentTime() {
    float ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getCurrentTime(swigCPtr);
    return ret;
  }

  public virtual int getCurrentPosition() {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getCurrentPosition(swigCPtr);
    return ret;
  }

  public virtual int getCurrentCompressedPosition() {
    int ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getCurrentCompressedPosition(swigCPtr);
    return ret;
  }

  public virtual string getType() {
    string ret = cAudioCSharpWrapperPINVOKE.IAudioDecoder_getType(swigCPtr);
    return ret;
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("grab", swigMethodTypes0))
      swigDelegate0 = new SwigDelegateIAudioDecoder_0(SwigDirectorgrab);
    if (SwigDerivedClassHasMethod("drop", swigMethodTypes1))
      swigDelegate1 = new SwigDelegateIAudioDecoder_1(SwigDirectordrop);
    if (SwigDerivedClassHasMethod("getFormat", swigMethodTypes2))
      swigDelegate2 = new SwigDelegateIAudioDecoder_2(SwigDirectorgetFormat);
    if (SwigDerivedClassHasMethod("getFrequency", swigMethodTypes3))
      swigDelegate3 = new SwigDelegateIAudioDecoder_3(SwigDirectorgetFrequency);
    if (SwigDerivedClassHasMethod("isSeekingSupported", swigMethodTypes4))
      swigDelegate4 = new SwigDelegateIAudioDecoder_4(SwigDirectorisSeekingSupported);
    if (SwigDerivedClassHasMethod("isValid", swigMethodTypes5))
      swigDelegate5 = new SwigDelegateIAudioDecoder_5(SwigDirectorisValid);
    if (SwigDerivedClassHasMethod("readAudioData", swigMethodTypes6))
      swigDelegate6 = new SwigDelegateIAudioDecoder_6(SwigDirectorreadAudioData);
    if (SwigDerivedClassHasMethod("setPosition", swigMethodTypes7))
      swigDelegate7 = new SwigDelegateIAudioDecoder_7(SwigDirectorsetPosition);
    if (SwigDerivedClassHasMethod("seek", swigMethodTypes8))
      swigDelegate8 = new SwigDelegateIAudioDecoder_8(SwigDirectorseek);
    if (SwigDerivedClassHasMethod("getTotalTime", swigMethodTypes9))
      swigDelegate9 = new SwigDelegateIAudioDecoder_9(SwigDirectorgetTotalTime);
    if (SwigDerivedClassHasMethod("getTotalSize", swigMethodTypes10))
      swigDelegate10 = new SwigDelegateIAudioDecoder_10(SwigDirectorgetTotalSize);
    if (SwigDerivedClassHasMethod("getCompressedSize", swigMethodTypes11))
      swigDelegate11 = new SwigDelegateIAudioDecoder_11(SwigDirectorgetCompressedSize);
    if (SwigDerivedClassHasMethod("getCurrentTime", swigMethodTypes12))
      swigDelegate12 = new SwigDelegateIAudioDecoder_12(SwigDirectorgetCurrentTime);
    if (SwigDerivedClassHasMethod("getCurrentPosition", swigMethodTypes13))
      swigDelegate13 = new SwigDelegateIAudioDecoder_13(SwigDirectorgetCurrentPosition);
    if (SwigDerivedClassHasMethod("getCurrentCompressedPosition", swigMethodTypes14))
      swigDelegate14 = new SwigDelegateIAudioDecoder_14(SwigDirectorgetCurrentCompressedPosition);
    if (SwigDerivedClassHasMethod("getType", swigMethodTypes15))
      swigDelegate15 = new SwigDelegateIAudioDecoder_15(SwigDirectorgetType);
    cAudioCSharpWrapperPINVOKE.IAudioDecoder_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15);
  }

  private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
    System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
    bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(IAudioDecoder));
    return hasDerivedMethod;
  }

  private void SwigDirectorgrab() {
    grab();
  }

  private bool SwigDirectordrop() {
    return drop();
  }

  private int SwigDirectorgetFormat() {
    return (int)getFormat();
  }

  private int SwigDirectorgetFrequency() {
    return getFrequency();
  }

  private bool SwigDirectorisSeekingSupported() {
    return isSeekingSupported();
  }

  private bool SwigDirectorisValid() {
    return isValid();
  }

  private int SwigDirectorreadAudioData(IntPtr output, int amount) {
    return readAudioData((output == IntPtr.Zero) ? null : new SWIGTYPE_p_void(output, false), amount);
  }

  private bool SwigDirectorsetPosition(int position, bool relative) {
    return setPosition(position, relative);
  }

  private bool SwigDirectorseek(float seconds, bool relative) {
    return seek(seconds, relative);
  }

  private float SwigDirectorgetTotalTime() {
    return getTotalTime();
  }

  private int SwigDirectorgetTotalSize() {
    return getTotalSize();
  }

  private int SwigDirectorgetCompressedSize() {
    return getCompressedSize();
  }

  private float SwigDirectorgetCurrentTime() {
    return getCurrentTime();
  }

  private int SwigDirectorgetCurrentPosition() {
    return getCurrentPosition();
  }

  private int SwigDirectorgetCurrentCompressedPosition() {
    return getCurrentCompressedPosition();
  }

  private string SwigDirectorgetType() {
    return getType();
  }

  public delegate void SwigDelegateIAudioDecoder_0();
  public delegate bool SwigDelegateIAudioDecoder_1();
  public delegate int SwigDelegateIAudioDecoder_2();
  public delegate int SwigDelegateIAudioDecoder_3();
  public delegate bool SwigDelegateIAudioDecoder_4();
  public delegate bool SwigDelegateIAudioDecoder_5();
  public delegate int SwigDelegateIAudioDecoder_6(IntPtr output, int amount);
  public delegate bool SwigDelegateIAudioDecoder_7(int position, bool relative);
  public delegate bool SwigDelegateIAudioDecoder_8(float seconds, bool relative);
  public delegate float SwigDelegateIAudioDecoder_9();
  public delegate int SwigDelegateIAudioDecoder_10();
  public delegate int SwigDelegateIAudioDecoder_11();
  public delegate float SwigDelegateIAudioDecoder_12();
  public delegate int SwigDelegateIAudioDecoder_13();
  public delegate int SwigDelegateIAudioDecoder_14();
  public delegate string SwigDelegateIAudioDecoder_15();

  private SwigDelegateIAudioDecoder_0 swigDelegate0;
  private SwigDelegateIAudioDecoder_1 swigDelegate1;
  private SwigDelegateIAudioDecoder_2 swigDelegate2;
  private SwigDelegateIAudioDecoder_3 swigDelegate3;
  private SwigDelegateIAudioDecoder_4 swigDelegate4;
  private SwigDelegateIAudioDecoder_5 swigDelegate5;
  private SwigDelegateIAudioDecoder_6 swigDelegate6;
  private SwigDelegateIAudioDecoder_7 swigDelegate7;
  private SwigDelegateIAudioDecoder_8 swigDelegate8;
  private SwigDelegateIAudioDecoder_9 swigDelegate9;
  private SwigDelegateIAudioDecoder_10 swigDelegate10;
  private SwigDelegateIAudioDecoder_11 swigDelegate11;
  private SwigDelegateIAudioDecoder_12 swigDelegate12;
  private SwigDelegateIAudioDecoder_13 swigDelegate13;
  private SwigDelegateIAudioDecoder_14 swigDelegate14;
  private SwigDelegateIAudioDecoder_15 swigDelegate15;

  private static Type[] swigMethodTypes0 = new Type[] {  };
  private static Type[] swigMethodTypes1 = new Type[] {  };
  private static Type[] swigMethodTypes2 = new Type[] {  };
  private static Type[] swigMethodTypes3 = new Type[] {  };
  private static Type[] swigMethodTypes4 = new Type[] {  };
  private static Type[] swigMethodTypes5 = new Type[] {  };
  private static Type[] swigMethodTypes6 = new Type[] { typeof(SWIGTYPE_p_void), typeof(int) };
  private static Type[] swigMethodTypes7 = new Type[] { typeof(int), typeof(bool) };
  private static Type[] swigMethodTypes8 = new Type[] { typeof(float), typeof(bool) };
  private static Type[] swigMethodTypes9 = new Type[] {  };
  private static Type[] swigMethodTypes10 = new Type[] {  };
  private static Type[] swigMethodTypes11 = new Type[] {  };
  private static Type[] swigMethodTypes12 = new Type[] {  };
  private static Type[] swigMethodTypes13 = new Type[] {  };
  private static Type[] swigMethodTypes14 = new Type[] {  };
  private static Type[] swigMethodTypes15 = new Type[] {  };
}

}
