示例#1
0
 public GATRealTimeSample(IGATDataOwner dataOwner, bool canPitchShift, AGATPanInfo ipaninfo = null) : base(dataOwner, ipaninfo)
 {
     // Note: for some reason, Unity's not picking up the Obsolete attribute...
     Debug.LogWarning("Obsolete ctor: canPitchShift parameter is now obsolete. Please use GATLoopedSample if you need to monitor and smoothly stop playback without pitch shift.");
     _dataSource = new GATDataSource(dataOwner.AudioData);
     _fader      = new Fader();
 }
示例#2
0
        /// <summary>
        /// Wraps audio data in a looping container. Set NumberOfLoops to -1 for infinite looping.
        /// 0 for no loop. Pass a GATFixedPanInfo or GATDynamicPanInfo object if you intend to route
        /// playback directly to the player ( as opposed to through a track ).
        /// </summary>
        public GATLoopedSample(IGATDataOwner dataOwner, int numberOfLoops = -1, AGATPanInfo panInfo = null) : base(dataOwner, panInfo)
        {
            if (numberOfLoops != 0)
            {
                Loop = true;
            }

            NumberOfLoops = numberOfLoops;
        }
示例#3
0
        /// <summary>
        /// Wraps audio data in a looping container. Set NumberOfLoops to -1 for infinite looping.
        /// 0 for no loop. Pass a GATFixedPanInfo or GATDynamicPanInfo object if you intend to route
        /// playback directly to the player ( as opposed to through a track ).
        /// </summary>
        public GATLoopedSample( IGATDataOwner dataOwner, int numberOfLoops = -1, AGATPanInfo panInfo = null )
            : base(dataOwner, panInfo)
        {
            if( numberOfLoops != 0 )
            {
                Loop = true;
            }

            NumberOfLoops = numberOfLoops;
        }
示例#4
0
        /// <summary>
        /// Sets the data to play. Use for recycling
        /// GATRealTimeSample objects. If the sample is currently playing or scheduled,
        /// this method has no effect.
        /// </summary>
        public void SetData(IGATDataOwner dataOwner)
        {
            if (_dataOwner == dataOwner)
            {
                return;
            }

            if (PlayingStatus != Status.ReadyToPlay)
            {
                                #if UNITY_EDITOR
                Debug.LogWarning("GATRealTimeSample.SetData ignored: sample is already playing or scheduled.");
                                #endif
                return;
            }

            _dataOwner = dataOwner;
            _dataSource.SetData(_dataOwner.AudioData);
        }
示例#5
0
 /// <summary>
 /// Wrap a GATData or IGATProcessedSample for
 /// real time control over playback.
 /// </summary>
 /// <param name='dataOwner'>
 /// GATData or IGATProcessedSample.
 /// </param>
 /// <param name='ipaninfo'>
 /// Specify a GATFixedPanInfo or GATDynamicPanInfo
 /// reference if you intend to play directly( not through a track ).
 /// </param>
 public GATRealTimeSample(IGATDataOwner dataOwner, AGATPanInfo ipaninfo = null) : base(dataOwner, ipaninfo)
 {
     _dataSource = new GATDataSource(dataOwner == null ? null : dataOwner.AudioData);
     _fader      = new Fader();
 }
示例#6
0
 /// <summary>
 /// Data owners include IGATProcessedSample and GATData obects.
 /// Specify a GATDynamicPanInfo or GATFixedPanInfo object to
 /// enable routing playback directly to the player ( not through tracks ).
 /// </summary>
 public AGATWrappedSample(IGATDataOwner dataOwner, AGATPanInfo ipaninfo = null)
 {
     panInfo    = ipaninfo;
     _dataOwner = dataOwner;
 }
示例#7
0
 /// <summary>
 /// Wrap a GATData or a IGATProcessedSample
 /// object for ADSR playback.
 /// </summary>
 public GATRealTimeADSR(IGATDataOwner dataOwner)
 {
     _dataOwner    = dataOwner;
     _currentState = State.Attack;
 }
示例#8
0
 /// <summary>
 /// Wrap a GATData or a IGATProcessedSample
 /// object for ADSR playback.
 /// </summary>
 public GATRealTimeADSR( IGATDataOwner dataOwner )
 {
     _dataOwner = dataOwner;
     _currentState = State.Attack;
 }
示例#9
0
 /// <summary>
 /// Data owners include IGATProcessedSample and GATData obects.
 /// Specify a GATDynamicPanInfo or GATFixedPanInfo object to
 /// enable routing playback directly to the player ( not through tracks ).
 /// </summary>
 public AGATWrappedSample( IGATDataOwner dataOwner, AGATPanInfo ipaninfo = null )
 {
     panInfo 	= ipaninfo;
     _dataOwner 	= dataOwner;
 }