Methods (6) Properties (2)
Namespace: CSCore.Streams.Effects

Syntax

public abstract class DmoEffectBase<TDXEffect, TDXEffectStruct> : DmoAggregator where TDXEffect : DirectSoundFxBase<TDXEffectStruct> where TDXEffectStruct : struct, ValueType 

Base Type

Summary

Base class for all DMO effects.

Type Parameters

TDXEffect

DMO effect itself.

TDXEffectStruct

Parameter struct of the DMO effect.

Uses

Methods

DmoEffectBase(IWaveSource source)

Creates a new instance of DmoEffectBase class.

protected void DmoEffectBase(IWaveSource source)

Parameters

source

IWaveSource

The base source, which feeds the effect with data.

CreateComObject()

Creates and returns a new instance of the native COM object.

protected abstract object CreateComObject()

Returns

A new instance of the native COM object.

CreateMediaObject(WaveFormat inputFormat, WaveFormat outputFormat)

Creates an MediaObject from the effect DMO.

protected MediaObject CreateMediaObject(WaveFormat inputFormat, WaveFormat outputFormat)

Parameters

inputFormat

WaveFormat

The input format of the MediaObject to create.

outputFormat

WaveFormat

The output format of the MediaObject to create.

Returns

The created MediaObject to use for processing audio data.

GetOutputFormat()

Gets the output format of the effect.

protected WaveFormat GetOutputFormat()

Returns

The output format of the effect.

Read(Byte[] buffer, Int32 offset, Int32 count)

Reads a sequence of bytes from the stream and applies the Dmo effect to them (only if the IsEnabled property is set to true).

public Int32 Read(Byte[] buffer, Int32 offset, Int32 count)

Parameters

buffer

Byte[]

An array of bytes. When this method returns, the buffer contains the read bytes.

offset

Int32

The zero-based byte offset in buffer at which to begin storing the data read from the stream.

count

Int32

The maximum number of bytes to be read from the stream

Returns

The actual number of read bytes.

SetValue(String fieldname, T value)

Sets the value for one of the effects parameter and updates the effect.

protected void SetValue<T>(String fieldname, T value)

Parameters

fieldname

String

Name of the field to set the value for.

value

T

Value to set.

Type Parameters

T

Type of the value.

Properties

Effect

Gets the underlying effect.

protected TDXEffect Effect { get; }

IsEnabled

Gets or sets whether the effect is enabled.

public Boolean IsEnabled { get; set; }