Inheritance: IDisposable
    //this is pretty straightforward - get the elapsed time
    public int GetMusicTimeInMS()
    {
        AkSegmentInfo segmentInfo = new AkSegmentInfo();

        AkSoundEngine.GetPlayingSegmentInfo(playingID, segmentInfo, true);

        return(segmentInfo.iCurrentPosition);
    }
    //We're going to call this when we spawn a gem, in order to determine when it's crossing time should be
    //based on the current playback position, our beat duration, and our beat offset
    public int SetCrossingTimeInMS(int beatOffset)
    {
        AkSegmentInfo segmentInfo = new AkSegmentInfo();

        AkSoundEngine.GetPlayingSegmentInfo(playingID, segmentInfo, true);

        int offsetTime = Mathf.RoundToInt(1000 * secondsPerBeat * beatOffset);

        //Debug.Log("setting time: " + segmentInfo.iCurrentPosition + offsetTime);

        return(segmentInfo.iCurrentPosition + offsetTime);
    }
    // Use this for initialization
    void Start()
    {
        if (!AkSoundEngine.IsInitialized())
        {
            m_logger.Error("Error_EngineNotInit");
            return;
        }

        uint bankID;         // Not used

        AkSoundEngine.LoadBank(m_BankName, AkSoundEngine.AK_DEFAULT_POOL_ID, out bankID);

        StartMusic();

        m_segmentInfo = new AkSegmentInfo();
    }
Example #4
0
 protected override void ResetParamsInternal()
 {
     seekTiming_     = null;
     currentMSec_    = 0;
     sequenceEndBar_ = 0;
     endOfEvent_     = false;
     playingId_      = AkSoundEngine.AK_INVALID_PLAYING_ID;
     TransitionState = ETransitionState.Invalid;
     segmentInfo_    = new AkSegmentInfo();
     if (string.IsNullOrEmpty(HorizontalStateGroup) == false && string.IsNullOrEmpty(InitialHorizontalState) == false)
     {
         AkSoundEngine.SetState(HorizontalStateGroup, InitialHorizontalState);
     }
     if (string.IsNullOrEmpty(VerticalStateGroup) == false && string.IsNullOrEmpty(InitialVerticalState) == false)
     {
         AkSoundEngine.SetState(VerticalStateGroup, InitialVerticalState);
     }
 }
Example #5
0
    public virtual void Dispose()
    {
        AkSegmentInfo info = this;

        lock (info)
        {
            if (this.swigCPtr != IntPtr.Zero)
            {
                if (this.swigCMemOwn)
                {
                    this.swigCMemOwn = false;
                    AkSoundEnginePINVOKE.CSharp_delete_AkSegmentInfo(this.swigCPtr);
                }
                this.swigCPtr = IntPtr.Zero;
            }
            GC.SuppressFinalize(this);
        }
    }
Example #6
0
 internal static IntPtr getCPtr(AkSegmentInfo obj)
 {
     return((obj == null) ? IntPtr.Zero : obj.swigCPtr);
 }
Example #7
0
 internal static IntPtr getCPtr(AkSegmentInfo obj)
 {
     return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
 }
  public static AKRESULT GetPlayingSegmentInfo(uint in_PlayingID, AkSegmentInfo out_segmentInfo) {
    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPlayingSegmentInfo__SWIG_1(in_PlayingID, AkSegmentInfo.getCPtr(out_segmentInfo));

    return ret;
  }
  public static AKRESULT GetPlayingSegmentInfo(uint in_PlayingID, AkSegmentInfo out_segmentInfo, bool in_bExtrapolate) {
    AKRESULT ret = (AKRESULT)AkSoundEnginePINVOKE.CSharp_GetPlayingSegmentInfo__SWIG_0(in_PlayingID, AkSegmentInfo.getCPtr(out_segmentInfo), in_bExtrapolate);

    return ret;
  }
Example #10
0
 internal static HandleRef getCPtr(AkSegmentInfo obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Example #11
0
 internal static HandleRef getCPtr(AkSegmentInfo obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
 internal static global::System.IntPtr getCPtr(AkSegmentInfo obj)
 {
     return((obj == null) ? global::System.IntPtr.Zero : obj.swigCPtr);
 }
Example #13
0
 internal static IntPtr getCPtr(AkSegmentInfo obj)
 {
     return((obj != null) ? obj.swigCPtr : IntPtr.Zero);
 }