C# Class xZune.Bass.Channel

Inheritance: HandleObject, IChannel, IChannelInternal
Show file Open project: higankanshi/xZune.Bass Class Usage Examples

Public Methods

Method Description
Get3DAttribute ( Channel3DMode &mode, float &min, float &max, uint &iAngle, uint &oAngle, float &outVloume ) : void

Get the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

Get3DPosition ( Vector3 &pos, Vector3 &orientation, Vector3 &vel ) : void

Get the 3D position of a sample, stream, or MOD music channel with 3D functionality.

GetDate ( IntPtr buffer, SampleDataType dataType ) : uint
GetLevelEx ( LevelConfig config, float length ) : float[]

Retrieves the level of a sample, stream, MOD music, or recording channel.

Lock ( ) : void

Locks a stream, MOD music or recording channel to the current thread.

Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.

Pause ( ) : void

Pauses a sample, stream, MOD music, or recording.

PauseTest ( ) : System.Threading.Tasks.Task
Play ( ) : void

Starts (or resumes) playback of a sample, stream, MOD music, or recording.

PlayTest ( ) : System.Threading.Tasks.Task
RemoveEffect ( Effect effect ) : void

Removes an effect on a stream, MOD music, or recording channel.

Replay ( ) : void

Restart playback of a sample, stream, MOD music, or recording.

ResetEffects ( ) : void

Resets the state of all effects on a channel.

This function flushes the internal buffers of the effects. Effects are automatically reset by Position, except when called from a "mixtime" SYNCPROC.

Set3DAttribute ( Channel3DMode mode, float min, float max, uint iAngle, uint oAngle, float outVloume ) : void

Sets the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

Set3DPosition ( Vector3 pos, Vector3 orientation, Vector3 vel ) : void

Sets the 3D position of a sample, stream, or MOD music channel with 3D functionality.

SetFreqAnimate ( float value, uint time ) : void

Slides a channel's Freq from its current value to a new value.

SetPanningPositionAnimate ( float value, uint time ) : void

Slides a channel's PanningPosition from its current value to a new value.

SetVolumeAnimate ( float value, uint time ) : void

Slides a channel's Volume from its current value to a new value.

Stop ( ) : void

Stops a sample, stream, MOD music, or recording, Stop can be used to stop a paused channel.

Unlock ( ) : void

Unlocks a stream, MOD music or recording channel to the current thread.

Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.

Protected Methods

Method Description
AttachEvent ( ) : void
Channel ( ) : System
Free ( ) : void

Private Methods

Method Description
IChannelInternal ( DisplayHandler handler, IntPtr user, int priority ) : IntPtr
IChannelInternal ( SyncHandlerType type, System.UInt64 param, SyncHandler handler, IntPtr user ) : IntPtr
IChannelInternal ( PositionConfig config ) : System.UInt64
IChannelInternal ( ChannelAttribute attribute ) : bool
IChannelInternal ( ChannelAttributeEx attribute ) : byte[]
IChannelInternal ( ulong position ) : double
IChannelInternal ( ChannelAttribute attribute ) : float
IChannelInternal ( TagType type ) : object
IChannelInternal ( PositionConfig config ) : ulong
IChannelInternal ( double time ) : ulong
IChannelInternal ( Channel channel ) : void
IChannelInternal ( ChannelAttribute attribute, float value ) : void
IChannelInternal ( ChannelAttribute attribute, float value, uint time ) : void
IChannelInternal ( ChannelAttributeEx attribute, byte value ) : void
IChannelInternal ( xZune.Bass.Interop.Flags.ChannelFlags config, xZune.Bass.Interop.Flags.ChannelFlags mask ) : void
IChannelInternal ( IntPtr displayHandle ) : void
IChannelInternal ( PositionConfig config, ulong value ) : void
IChannelInternal ( int length ) : void
OnAnimationCompleted ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnEnded ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnFreed ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnMetaTagAvailabled ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnOggChanged ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnPlaybacking ( IntPtr displayHandle, IntPtr channel, IntPtr buffer, uint length, IntPtr user ) : void
OnPositionSet ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void
OnStallOrResumed ( IntPtr displayHandle, IntPtr channel, uint data, IntPtr user ) : void

Method Details

AttachEvent() protected method

protected AttachEvent ( ) : void
return void

Channel() protected method

protected Channel ( ) : System
return System

Free() protected abstract method

protected abstract Free ( ) : void
return void

Get3DAttribute() public method

Get the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Get3DAttribute ( Channel3DMode &mode, float &min, float &max, uint &iAngle, uint &oAngle, float &outVloume ) : void
mode Channel3DMode The 3D processing mode.
min float The minimum distance.
max float The maximum distance.
iAngle uint The angle of the inside projection cone.
oAngle uint The angle of the outside projection cone.
outVloume float The delta-volume outside the outer projection cone.
return void

Get3DPosition() public method

Get the 3D position of a sample, stream, or MOD music channel with 3D functionality.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Get3DPosition ( Vector3 &pos, Vector3 &orientation, Vector3 &vel ) : void
pos Vector3 Position of the sound.
orientation Vector3 Orientation of the sound.
vel Vector3 Velocity of the sound.
return void

GetDate() public method

Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public GetDate ( IntPtr buffer, SampleDataType dataType ) : uint
buffer System.IntPtr
dataType SampleDataType
return uint

GetLevelEx() public method

Retrieves the level of a sample, stream, MOD music, or recording channel.
public GetLevelEx ( LevelConfig config, float length ) : float[]
config LevelConfig Level configure.
length float /// The amount of data to inspect to calculate the level, in seconds. The maximum is 1 second. Less /// data than requested may be used if the full amount is not available, eg. if the channel's playback buffer is /// shorter. ///
return float[]

Lock() public method

Locks a stream, MOD music or recording channel to the current thread.
Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Lock ( ) : void
return void

Pause() public method

Pauses a sample, stream, MOD music, or recording.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Pause ( ) : void
return void

PauseTest() public method

public PauseTest ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Play() public method

Starts (or resumes) playback of a sample, stream, MOD music, or recording.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Play ( ) : void
return void

PlayTest() public method

public PlayTest ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

RemoveEffect() public method

Removes an effect on a stream, MOD music, or recording channel.
Effect is not on channel.
public RemoveEffect ( Effect effect ) : void
effect Effect The effect to remove from the channel.
return void

Replay() public method

Restart playback of a sample, stream, MOD music, or recording.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Replay ( ) : void
return void

ResetEffects() public method

Resets the state of all effects on a channel.
This function flushes the internal buffers of the effects. Effects are automatically reset by Position, except when called from a "mixtime" SYNCPROC.
public ResetEffects ( ) : void
return void

Set3DAttribute() public method

Sets the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Set3DAttribute ( Channel3DMode mode, float min, float max, uint iAngle, uint oAngle, float outVloume ) : void
mode Channel3DMode The 3D processing mode.
min float The minimum distance.
max float The maximum distance.
iAngle uint The angle of the inside projection cone.
oAngle uint The angle of the outside projection cone.
outVloume float The delta-volume outside the outer projection cone.
return void

Set3DPosition() public method

Sets the 3D position of a sample, stream, or MOD music channel with 3D functionality.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Set3DPosition ( Vector3 pos, Vector3 orientation, Vector3 vel ) : void
pos Vector3 Position of the sound.
orientation Vector3 Orientation of the sound.
vel Vector3 Velocity of the sound.
return void

SetFreqAnimate() public method

Slides a channel's Freq from its current value to a new value.
public SetFreqAnimate ( float value, uint time ) : void
value float New sample rate value.
time uint /// The length of time (in milliseconds) that it should take for the to reach the /// value. ///
return void

SetPanningPositionAnimate() public method

Slides a channel's PanningPosition from its current value to a new value.
public SetPanningPositionAnimate ( float value, uint time ) : void
value float New volume value. -1 (full left) to +1 (full right), 0 = center.
time uint /// The length of time (in milliseconds) that it should take for the to /// reach the value. ///
return void

SetVolumeAnimate() public method

Slides a channel's Volume from its current value to a new value.
public SetVolumeAnimate ( float value, uint time ) : void
value float New volume value. 0 (silent) to 1.0 (full). This can go above 1.0 on decoding channels.
time uint /// The length of time (in milliseconds) that it should take for the to reach the /// value. ///
return void

Stop() public method

Stops a sample, stream, MOD music, or recording, Stop can be used to stop a paused channel.
public Stop ( ) : void
return void

Unlock() public method

Unlocks a stream, MOD music or recording channel to the current thread.
Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to /// load Bass DLL first. ///
public Unlock ( ) : void
return void