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(); } }
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(); }
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); }
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(); } }
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(); } }
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(); }
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)); } }