getPosition() 공개 메소드

public getPosition ( uint &position, TIMEUNIT postype ) : RESULT
position uint
postype TIMEUNIT
리턴 RESULT
예제 #1
0
        public uint GetPosition()
        {
            uint pos = 0;

            if (channel != null)
            {
                result = channel.getPosition(out pos, FMOD.TIMEUNIT.MS);
            }
            return(pos);//return pos / 1000.f;
        }
예제 #2
0
        public int GetTotalMilliseconds(TIMEUNIT un = TIMEUNIT.MS)
        {
            uint pos = 0;

            songChannel1.getPosition(ref pos, un);
            return((int)pos);
        }
예제 #3
0
 public uint GetPosition()
 {
     if (channel != null)
     {
         uint lenms = 0;
         channel.getPosition(ref lenms, FMOD.TIMEUNIT.MS);
         return(lenms);
     }
     return(0);
 }
예제 #4
0
파일: Walkman.cs 프로젝트: starryangt/aoede
 public TimeSpan GetTime()
 {
     if (status == STATUS.PLAY)
     {
         uint position;
         channel.getPosition(out position, TIMEUNIT.MS);
         return(TimeSpan.FromMilliseconds(position));
     }
     else
     {
         return(TimeSpan.FromMilliseconds(0));
     }
 }
예제 #5
0
    void LateUpdate()
    {
        FMOD.Channel channel  = _mutedSourceJustForUserSpeed.Channel;
        TimeSpan     timespan = TimeSpan.FromMilliseconds(0);

        if (channel != null)
        {
            uint position;
            channel.getPosition(out position, FMOD.TIMEUNIT.MS);

            timespan = TimeSpan.FromMilliseconds(position);
        }

        _userProgression.text = String.Format("{0:D2}:{1:D2} / {2:D2}:{3:D2}",
                                              timespan.Minutes, timespan.Seconds,
                                              _totalTimeTimeSpan.Minutes, _totalTimeTimeSpan.Seconds);
    }
예제 #6
0
        public float GetProgress()
        {
            if (_sound != null && _channel != null)
            {
                uint len = 0;
                uint pos = 0;

                _sound.getLength(out len, TIMEUNIT.MS);
                _channel.getPosition(out pos, TIMEUNIT.MS);

                if (pos == 0)
                {
                    return(0f);
                }

                return((float)pos / len);
            }

            return(0f);
        }
예제 #7
0
    public void JoinReference(CustomAudioSource reference)
    {
        uint currentPosition, currentReferencePosition;

        if (Channel == null)
        {
            return;
        }
        Channel.getPosition(out currentPosition, TIMEUNIT.PCM);
        reference.Channel.getPosition(out currentReferencePosition, TIMEUNIT.PCM);
        var gapRatio = Mathf.Round((currentPosition / (float)currentReferencePosition) * 1000) / 1000;

        Speed  = reference.Speed - (gapRatio - 1) * 10;
        Volume = reference.Volume - Mathf.Abs(gapRatio - 1) * 100;
        if (currentPosition - currentReferencePosition >= 100 || currentPosition - currentReferencePosition == 0)
        {
            return;
        }
        Channel.setPosition(currentReferencePosition, TIMEUNIT.PCM);
        Speed = reference.Speed;
    }