public override void Connect(IBassStreamComponent previous)
 {
     //BassUtils.OK(BassGapless.SetConfig(BassGaplessAttriubute.KeepAlive, true));
     Logger.Write(this, LogLevel.Debug, "Creating BASS CROSSFADE stream with rate {0} and {1} channels.", this.Rate, this.Channels);
     this.ChannelHandle = BassCrossfade.StreamCreate(this.Rate, this.Channels, this.Flags);
     if (this.ChannelHandle == 0)
     {
         BassUtils.Throw();
     }
 }
예제 #2
0
 public override void Connect(IBassStreamComponent previous)
 {
     Logger.Write(this, LogLevel.Debug, "Creating BASS SOX stream with rate {0} => {1} and {2} channels.", previous.Rate, this.Rate, this.Channels);
     this.InputRate     = previous.Rate;
     this.ChannelHandle = BassSox.StreamCreate(this.Rate, this.Flags, previous.ChannelHandle);
     if (this.ChannelHandle == 0)
     {
         BassUtils.Throw();
     }
     this.Configure();
 }
예제 #3
0
 public override void Connect(IBassStreamComponent previous)
 {
     Logger.Write(this, LogLevel.Debug, "Creating BASS MIX stream with rate {0} and {1} channels.", this.Rate, this.Channels);
     this.ChannelHandle = BassMix.CreateMixerStream(this.Rate, this.Channels, this.Flags);
     if (this.ChannelHandle == 0)
     {
         BassUtils.Throw();
     }
     Logger.Write(this, LogLevel.Debug, "Adding stream to the mixer: {0}", previous.ChannelHandle);
     BassUtils.OK(BassMix.MixerAddChannel(this.ChannelHandle, previous.ChannelHandle, BassFlags.Default | BassFlags.MixerBuffer));
     this.MixerChannelHandles.Add(previous.ChannelHandle);
 }
예제 #4
0
 public override void Connect(IBassStreamComponent previous)
 {
     this.Rate          = previous.Rate;
     this.Channels      = previous.Channels;
     this.ChannelHandle = BassFx.TempoCreate(previous.ChannelHandle, previous.Flags);
     if (this.ChannelHandle == 0)
     {
         BassUtils.Throw();
     }
     if (this.IsActive)
     {
         this.Update();
     }
 }
예제 #5
0
 public void Activate()
 {
     if (!this.IsActive)
     {
         this.EffectHandle = Bass.ChannelSetFX(this.ChannelHandle, this.Parameters.FXType, 0);
         if (this.EffectHandle == 0)
         {
             BassUtils.Throw();
         }
         this.IsActive = true;
     }
     if (!Bass.FXSetParameters(this.EffectHandle, this.Parameters))
     {
         BassUtils.Throw();
     }
 }
예제 #6
0
 public override void Connect(IBassStreamComponent previous)
 {
     this.InputRate = previous.Rate;
     if (this.Behaviour.Output.EnforceRate)
     {
         //Rate is enforced.
         this.Rate = this.Behaviour.Output.Rate;
     }
     else
     {
         //We already established that the output does not support the stream rate so use the closest one.
         this.Rate = this.Query.GetNearestRate(previous.Rate);
     }
     Logger.Write(this, LogLevel.Debug, "Creating BASS SOX stream with rate {0} => {1} and {2} channels.", previous.Rate, this.Rate, this.Channels);
     this.ChannelHandle = BassSox.StreamCreate(this.Rate, this.Flags, previous.ChannelHandle);
     if (this.ChannelHandle == 0)
     {
         BassUtils.Throw();
     }
     this.Configure();
 }
예제 #7
0
 public override void Connect(IBassStreamComponent previous)
 {
     this.ConfigureWASAPI(previous);
     if (this.ShouldCreateMixer(previous))
     {
         Logger.Write(this, LogLevel.Debug, "Creating BASS MIX stream with rate {0} and {1} channels.", this.Rate, this.Channels);
         this.ChannelHandle = BassMix.CreateMixerStream(this.Rate, this.Channels, this.Flags);
         if (this.ChannelHandle == 0)
         {
             BassUtils.Throw();
         }
         Logger.Write(this, LogLevel.Debug, "Adding stream to the mixer: {0}", previous.ChannelHandle);
         BassUtils.OK(BassMix.MixerAddChannel(this.ChannelHandle, previous.ChannelHandle, BassFlags.Default | BassFlags.MixerBuffer));
         BassUtils.OK(BassWasapiHandler.StreamSet(this.ChannelHandle));
         this.MixerChannelHandles.Add(previous.ChannelHandle);
     }
     else
     {
         Logger.Write(this, LogLevel.Debug, "The stream properties match the device, playing directly.");
         BassUtils.OK(BassWasapiHandler.StreamSet(previous.ChannelHandle));
     }
 }