C# Класс MediaPortal.MusicPlayer.BASS.BassAudioEngine

Handles playback of Audio files and Internet streams via the BASS Audio Engine.
Наследование: MediaPortal.Player.IPlayer
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
_initialized bool

Открытые методы

Метод Описание
BASS_WASAPI_IsStarted ( ) : bool
BassAudioEngine ( ) : System
CanSeek ( ) : bool

Is Seeking enabled

Dispose ( ) : void

Release the Video Window

DisposeAndCleanUp ( ) : void

Dispose the BASS Audio engine. Free all BASS and Visualisation related resources

FreeBass ( ) : void

Free BASS, when not playing Audio content, as it might cause S/PDIF output stop working

GetChannelData ( int handle, float buffer, int lenght ) : int
GetDataFFT ( float buffer, int lenght ) : int
GetStreamTags ( ) : MediaPortal.TagReader.MusicTag

Returns the Tags of an AV Stream

InitBass ( ) : void

Init BASS, when a Audio file is to be played

NewMixerNeeded ( MediaPortal.MusicPlayer.BASS.MusicStream stream ) : bool

Checks, if a new Mixer would be needed, because of changes in Sample Rate or number of channels

Pause ( ) : void

Pause Playback

Play ( string filePath ) : bool

Starts Playback of the given file

Process ( ) : void

Process Method

RMS ( double &dbLevelL, double &dbLevelR ) : void

Return the dbLevel to be used by a VUMeter

SeekAbsolute ( double dTime ) : void

Seek Absoluet in the Stream

SeekAsolutePercentage ( int iPercentage ) : void

Seek Absolute Percentage

SeekForward ( int ms ) : bool

Seek Forward in the Stream

SeekRelative ( double dTime ) : void

Seek Relative in the Stream

SeekRelativePercentage ( int iPercentage ) : void

Seek Relative Percentage

SeekReverse ( int ms ) : bool

Seek Backwards within the stream

SeekToTimePosition ( int position ) : bool

Seek to a specific position in the stream

Stop ( ) : void

Stopping Playback

SwitchToDefaultPlaybackMode ( ) : void

Switch back to the default Playback Mode, whoch was saved before starting playback of a complete album

SwitchToGaplessPlaybackMode ( ) : void

Switches the Playback to Gapless Used, if playback of a complete Album is started

Приватные методы

Метод Описание
ChannelIsActive ( int handle ) : BASSActive
ChannelPlay ( int handle, bool restart ) : bool
ChannelRemoveLink ( int handle, int chan ) : bool
ChannelSetLink ( int handle, int chan ) : bool
CommandThread ( ) : void
CreateCommandThread ( ) : void
GetCurrentStream ( ) : MediaPortal.MusicPlayer.BASS.MusicStream

Returns the Current Stream

GetSoundDevice ( ) : int

Get the Sound devive as set in the Configuartion

GetWasApiFormats ( ) : void

Detect the supported output formats for WASAPI

GetWasApiSpeakers ( ) : int

WASAPI doesnj't provide a way to ask the driver on the maximum of supported speakers. So we try to enumerate the channels and detect the attached speakers.

HandleBassError ( string methodName ) : void

Displays Information about a BASS Exception

HandleCueFile ( string &filePath, bool endOnly ) : bool

Parse the Cue file. Return a Fake Cue track and adjest the playback position within the file.

HandleSongEnded ( ) : void

Handle Stop of a song

InitAsio ( ) : bool

Initialises the Asio Device

InitDirectSoundDevice ( ) : bool

Initialise the DirectSound Device

InitWasapi ( ) : bool

Initialises the Wasapi Device

Initialize ( ) : void

Initialise the Visualisation Window and Load Decoder/DSP Plugins The BASS engine itself is not initialised at this stage, since it may cause S/PDIF for Movies not working on some systems.

OnAppFormDisposed ( object sender, EventArgs e ) : void

The Main Form is disposed, so dispose the player

OnMusicStreamMessage ( object sender, MediaPortal.MusicPlayer.BASS.MusicStream action ) : void

This Message is sent from a MusicStream

OnNewAction ( MediaPortal.GUI.Library.Action action ) : void
PlayInternal ( string filePath ) : bool

Called to start playback of next files internally, without makinbg use of g_player. This gives us the capability to achieve gapless playback.

SetCueTrackEndPosition ( MediaPortal.MusicPlayer.BASS.MusicStream stream, bool endOnly ) : void

Sets the End Position for the CUE Track

StopCommand ( ) : void
StreamCreate ( int freq, int chans, BASSFlag Flags, STREAMPROC proc, IntPtr user ) : int
StreamFree ( int handle ) : bool

Описание методов

BASS_WASAPI_IsStarted() публичный Метод

public BASS_WASAPI_IsStarted ( ) : bool
Результат bool

BassAudioEngine() публичный Метод

public BassAudioEngine ( ) : System
Результат System

CanSeek() публичный Метод

Is Seeking enabled
public CanSeek ( ) : bool
Результат bool

Dispose() публичный Метод

Release the Video Window
public Dispose ( ) : void
Результат void

DisposeAndCleanUp() публичный Метод

Dispose the BASS Audio engine. Free all BASS and Visualisation related resources
public DisposeAndCleanUp ( ) : void
Результат void

FreeBass() публичный Метод

Free BASS, when not playing Audio content, as it might cause S/PDIF output stop working
public FreeBass ( ) : void
Результат void

GetChannelData() публичный Метод

public GetChannelData ( int handle, float buffer, int lenght ) : int
handle int
buffer float
lenght int
Результат int

GetDataFFT() публичный Метод

public GetDataFFT ( float buffer, int lenght ) : int
buffer float
lenght int
Результат int

GetStreamTags() публичный Метод

Returns the Tags of an AV Stream
public GetStreamTags ( ) : MediaPortal.TagReader.MusicTag
Результат MediaPortal.TagReader.MusicTag

InitBass() публичный Метод

Init BASS, when a Audio file is to be played
public InitBass ( ) : void
Результат void

NewMixerNeeded() публичный Метод

Checks, if a new Mixer would be needed, because of changes in Sample Rate or number of channels
public NewMixerNeeded ( MediaPortal.MusicPlayer.BASS.MusicStream stream ) : bool
stream MediaPortal.MusicPlayer.BASS.MusicStream
Результат bool

Pause() публичный Метод

Pause Playback
public Pause ( ) : void
Результат void

Play() публичный Метод

Starts Playback of the given file
public Play ( string filePath ) : bool
filePath string
Результат bool

Process() публичный Метод

Process Method
public Process ( ) : void
Результат void

RMS() публичный Метод

Return the dbLevel to be used by a VUMeter
public RMS ( double &dbLevelL, double &dbLevelR ) : void
dbLevelL double
dbLevelR double
Результат void

SeekAbsolute() публичный Метод

Seek Absoluet in the Stream
public SeekAbsolute ( double dTime ) : void
dTime double
Результат void

SeekAsolutePercentage() публичный Метод

Seek Absolute Percentage
public SeekAsolutePercentage ( int iPercentage ) : void
iPercentage int
Результат void

SeekForward() публичный Метод

Seek Forward in the Stream
public SeekForward ( int ms ) : bool
ms int
Результат bool

SeekRelative() публичный Метод

Seek Relative in the Stream
public SeekRelative ( double dTime ) : void
dTime double
Результат void

SeekRelativePercentage() публичный Метод

Seek Relative Percentage
public SeekRelativePercentage ( int iPercentage ) : void
iPercentage int
Результат void

SeekReverse() публичный Метод

Seek Backwards within the stream
public SeekReverse ( int ms ) : bool
ms int
Результат bool

SeekToTimePosition() публичный Метод

Seek to a specific position in the stream
public SeekToTimePosition ( int position ) : bool
position int
Результат bool

Stop() публичный Метод

Stopping Playback
public Stop ( ) : void
Результат void

SwitchToDefaultPlaybackMode() публичный Метод

Switch back to the default Playback Mode, whoch was saved before starting playback of a complete album
public SwitchToDefaultPlaybackMode ( ) : void
Результат void

SwitchToGaplessPlaybackMode() публичный Метод

Switches the Playback to Gapless Used, if playback of a complete Album is started
public SwitchToGaplessPlaybackMode ( ) : void
Результат void

Описание свойств

_initialized публичное статическое свойство

public static bool _initialized
Результат bool