GAudio.GATTrack.SubscribeContributor C# (CSharp) Method

SubscribeContributor() public method

A track may have one IGATTrackContributor which will get the opportunity to mix directly to the track buffer before filters are applied. This method returns false if another contributor is already set.
public SubscribeContributor ( IGATTrackContributor contributor ) : bool
contributor IGATTrackContributor
return bool
        public bool SubscribeContributor( IGATTrackContributor contributor )
        {
            if( _contributor == contributor )
                return true;

            if( _contributor != null )
                return false;

            _contributor = contributor;

            return true;
        }

Usage Example

 /// <summary>
 /// Starts mixing the stream to the specified track.
 /// An exception is thrown if the track already has a contributor.
 /// </summary>
 public void Start()
 {
     if (_track.SubscribeContributor(this) == false)
     {
         throw new GATException("Track " + _track.TrackNb + " already has a contributor.");
     }
     _stream.AddAudioThreadStreamClient(this);
 }