Skip to content

SoundChannelBase

AutumnSky1010 edited this page Jun 29, 2024 · 8 revisions

Abstract class SoundChannelBase

Definition

Namespace: SoundMaker.Sounds.SoundChannels
Assembly: SoundMaker.dll

Provides a base class for a sound channel to inherit from.

public abstract class SoundChannelBase : ISoundChannel

Inheritance

Object -> SoundChannelBase

Implements

Constructors

SoundChannelBase(int, SoundFormat, PanType, int)

Declaration

public SoundChannelBase(int tempo, SoundFormat format, PanType panType, int capacity)

Parameters

Type Desctiption
int Quarter note/rest per minute.
SoundFormat Format of the sound.
PanType Direction of hearing.
int The total number of sound components the internal data structure can hold without resizing.

Exceptions

Exception Desctiption
ArgumentOutOfRangeException Tempo must be non-negative and greater than 0.
ArgumentOutOfRangeException Index must be non-negative and greater than 0.

SoundChannelBase(int, SoundFormat, PanType)

Declaration

public SoundChannelBase(int tempo, SoundFormat format, PanType panType)

Parameters

Type Desctiption
int Quarter note/rest per minute.
SoundFormat Format of the sound.
PanType Direction of hearing.

Exceptions

Exception Desctiption
ArgumentOutOfRangeException Tempo must be non-negative and greater than 0.

Properties

Item

Declaration

ISoundComponent this[int index] { get; }

Parameters

Type Desctiption
int Index of sound components.

Property Value

Type Desctiption
ISoundComponent The sound component at index.

Exceptions

Exception Desctiption
IndexOutOfRangeException index is less than 0 or index is equal to or greater than Count.

Capacity

Declaration

public int Capacity { get; }

Property Value

Type Desctiption
int The total number of sound components the internal data structure can hold without resizing.

ComponentCount

Declaration

public int ComponentCount { get; }

Property Value

Type Desctiption
int Count of sound components.

WaveArrayLength

Declaration

public int WaveArrayLength { get; }

Property Value

Type Desctiption
int Length of wave data.

Tempo

Declaration

public int Tempo { get; }

Property Value

Type Desctiption
int Quarter note/rest per minute.

Format

Declaration

SoundFormat Format { get; }

Property Value

Type Desctiption
SoundFormat Format of the sound.

PanType

Declaration

PanType PanType { get; }

Property Value

Type Desctiption
PanType Direction of hearing.

Methods

GenerateWave()

Declaration

public abstract ushort[] GenerateWave();

Returns

Type Desctiption
ushort[] The array of wave data.

Add(ISoundComponent)

Declaration

public void Add(ISoundComponent components);

Parameters

Type Desctiption
ISoundComponent The sound component to be added to this.

RemoveAt(int)

Declaration

public void RemoveAt(int index);

Parameters

Type Desctiption
int The index of the sound component to remove.

Exceptions

Exception Desctiption
ArgumentOutOfRangeException index is less than 0 or index is equal to or greater than Count.

Clear()

Removes all sound component from this.
Declaration

public void Clear();

Import(IEnumerable)

Declaration

public void Import(IEnumerable<ISoundComponent> components)

Version 2.3.0 ~

Parameters

Type Desctiption
IEnumerable<ISoundComponent> Sound components.
Clone this wiki locally