MPfm: Music Player for Musicians - Developer Documentation - 0.6.0.0
Player Class
NamespacesMPfm.PlayerPlayer
The Player class manages audio playback through playlists and supports multiple driver types and devices.
Declaration Syntax
C#Visual Basic
public class Player
Public Class Player
Members
All MembersConstructorsMethodsPropertiesEvents



IconMemberDescription
Player()()()()
Default constructor for the Player class. Initializes the player using the default values (see property comments).

Player(Device, Int32, Int32, Int32, Boolean)
Constructor for the Player class which requires the mixer sample rate value to be passed in parameter.

AddEQ(EQPreset)
Adds the 18-band equalizer.

ApplyEQPreset(EQPreset)
Applies a preset on the 18-band equalizer. The equalizer needs to be created using the AddEQ method.

BufferSize
Defines the buffer size (in milliseconds). Increase this value if older computers have trouble filling up the buffer in time. Default value: 1000ms. The default BASS value is 500ms.

BypassEQ()()()()
Bypasses the 18-band equalizer.

CurrentEQPreset
Defines the current EQ preset.

CurrentLoop
Defines the currently playing loop.

Device
Defines the currently used device for playback.

Dispose()()()()
Disposes the current device and the audio plugins.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
FreeDevice()()()()
Frees the device currently used for playback.

FreePlugins()()()()
Frees the BASS plugins used by the player.

FXChannel
Effects stream/channel.

GetEQParams(Int32)
Gets the parameters of an EQ band.

GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetPosition()()()()
Gets the position of the currently playing channel, in bytes.

GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
GoTo(Int32)
Stops the playback and starts playback at a specific playlist song.

GoToMarker(Marker)
Go to a marker position.

InitializeDevice()()()()
Initializes the default audio device for playback.

InitializeDevice(Device, Int32)
Initializes a specific audio device for playback.

IsDeviceInitialized
Indicates if the device (as in the Device property) is initialized.

IsEQBypassed
Indicates if the EQ is bypassed.

IsEQEnabled
Indicates if the EQ is enabled.

IsPaused
Indicates if the player is currently paused.

IsPlaying
Indicates if the player is currently playing an audio file.

LoadPlugins()()()()
Loads the BASS plugins depending on the current platform.

Loops
Defines a collection of loops.

Markers
Defines a collection of markers.

MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
MixerChannel
Pointer to the mixer channel.

MixerSampleRate
Defines the sample rate of the mixer.

Next()()()()
Skips to the next channel in the list.

OnPlaylistIndexChanged
The OnPlaylistIndexChanged event is triggered when the playlist index changes (i.e. when an audio file starts to play).

Pause()()()()
Pauses the audio playback. Resumes the audio playback if it was paused.

Play()()()()
Plays the playlist from the current item index.

PlayFiles(List<(Of <<'(String>)>>))
Plays the list of audio files specified in the filePaths parameter.

PlayFiles(List<(Of <<'(AudioFile>)>>))
Plays the list of audio files specified in the audioFiles parameter. The AudioFile instances can come from MPfm.Library (reading from database) or by creating instances of the AudioFile class manually, which will read metadata from audio files to fill the properties.

Playlist
Playlist used for playback. Contains the audio file metadata and decode channels for playback.

Previous()()()()
Goes back to the previous channel in the list.

RemoveEQ()()()()
Removes the 18-band equalizer.

RemoveSyncCallback(Int32)
Removes a synchronization callback from the sync callback list.

RemoveSyncCallbacks()()()()
Removes all synchronization callbacks from the sync callback list.

RepeatType
Repeat type (Off, Playlist, Song)

ResetEQ()()()()
Resets the gain of every EQ band.

SetPosition(Double)
Sets the position of the currently playing channel.

SetPosition(Int64)
Sets the position of the currently playing channel. If the value is in floating point, divide the value by 2 before using it with the "bytes" parameter.

SetSyncCallback(Int64)
Sets a sync callback for triggering events when the playlist index increments.

StartLoop(Loop)
Starts a loop. The playback must be activated.

Stop()()()()
Stops the audio playback and frees the resources used by the playback engine.

StopLoop()()()()
Stops any loop currently playing.

timerPlayer_Elapsed(Object, ElapsedEventArgs)
Occurs when the timer for loading the next song in advance expires.

TimeShifting
Defines the time shifting applied to the currently playing stream. Value range from -100.0f (-100%) to 100.0f (+100%). To reset, set to 0.0f.

ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)
UpdateEQBand(Int32, Single, Boolean)
Updates the gain of an EQ band.

UpdatePeriod
Defines how often BASS fills the buffer to make sure it is always full (in milliseconds). This affects the accuracy of the ChannelGetPosition value. Default value: 10ms. The default BASS value is 100ms.

UpdateThreads
Defines how many threads BASS can use to update playback buffers in parrallel. Note: The playback engine plays perfectly with just one update thread. Default value: 1 thread. The default BASS value is 1 thread.

Volume
Defines the master volume (from 0 to 1).

Inheritance Hierarchy
Object
Player

Assembly: MPfm.Player (Module: MPfm.Player) Version: 0.5.3.0 (0.5.3.0)