C# Class Symphonary.MidiPlayer

Afficher le fichier Open project: tfreedman/Symphonary Class Usage Examples

Méthodes publiques

Свойство Type Description
al_CurrentPlayingChannelNotes System.Collections.ArrayList

Méthodes publiques

Méthode Description
EnterPreviewMode ( EventHandler extHandlePreviewPlayingCompleted ) : void

Configure player for preview mode, stashes settings for which channels are played, detaches event handlers related to gameplay, attaches preview completion event handler

ExitPreviewMode ( EventHandler extHandlePreviewPlayingCompleted ) : void

Resets player configuration from preview mode, restores settings for which channels are played, re-attaches event handlers related to gameplay, detaches preview completion event handler

MidiPlayer ( string s_Filename, ProgressChangedEventHandler extHandleLoadProgressChanged, EventHandler extHandleLoadCompleted, EventHandler extHandleChannelMessagePlayed, EventHandler extHandlePlayingCompleted ) : System

Constructor for the class. Several additional event handlers are hooked up, these are for driving changes in the UI

OnClosedOperations ( ) : void

Disposes some resources when program has closed

OnClosingOperations ( ) : void

Sets the program closing flag value to true. This stops teh player from performing some opertions that may cause an exception when the program is closing

ResumePlaying ( ) : void

Pause playing the MIDI file

StartPlaying ( ) : void

Play the MIDI file

StopPlaying ( ) : void

Stop playing the MIDI file

UnmuteOtherChannels ( ) : void

Unmute all channels other than the persistent channel. The persistent channel is not muted in the first place so this effectively unmutes all channels

Private Methods

Méthode Description
HandleChannelMessagePlayed ( object sender, Sanford.Multimedia.Midi.ChannelMessageEventArgs e ) : void

Internal event handler for channel message played

HandleChased ( object sender, Sanford.Multimedia.Midi.ChasedEventArgs e ) : void

Internal event handler for channel message chased. Not sure what this does

HandleLoadCompleted ( object sender, AsyncCompletedEventArgs e ) : void

Internal event handler for load completed

HandlePlayingCompleted ( object sender, EventArgs e ) : void

Internal event handler for playing completed. Don't have anything that needed to be done by this yet

HandleStopped ( object sender, Sanford.Multimedia.Midi.StoppedEventArgs e ) : void

Internal event handler for playing stopped

MuteAllChannels ( ) : void

Mutes all channels in the MIDI file. This is used to get rid of "hanging" notes when the MIDI file stops playing

MuteOtherChannels ( ) : void

Mutes all channels except the persistent channel

ReattachExternalPlaybackEventHandles ( ) : void

Used by preview mode

RecoverChannelPlaySettings ( ) : void

Used by preview mode

StashChannelPlaySettings ( ) : void

Used by preview mode

UnHookExternalPlaybackEventHandles ( ) : void

Used by preview mode

Method Details

EnterPreviewMode() public méthode

Configure player for preview mode, stashes settings for which channels are played, detaches event handlers related to gameplay, attaches preview completion event handler
public EnterPreviewMode ( EventHandler extHandlePreviewPlayingCompleted ) : void
extHandlePreviewPlayingCompleted EventHandler
Résultat void

ExitPreviewMode() public méthode

Resets player configuration from preview mode, restores settings for which channels are played, re-attaches event handlers related to gameplay, detaches preview completion event handler
public ExitPreviewMode ( EventHandler extHandlePreviewPlayingCompleted ) : void
extHandlePreviewPlayingCompleted EventHandler
Résultat void

MidiPlayer() public méthode

Constructor for the class. Several additional event handlers are hooked up, these are for driving changes in the UI
public MidiPlayer ( string s_Filename, ProgressChangedEventHandler extHandleLoadProgressChanged, EventHandler extHandleLoadCompleted, EventHandler extHandleChannelMessagePlayed, EventHandler extHandlePlayingCompleted ) : System
s_Filename string directory of the MIDI file to play
extHandleLoadProgressChanged ProgressChangedEventHandler external event handler for load progress changed
extHandleLoadCompleted EventHandler external event handler for load completed
extHandleChannelMessagePlayed EventHandler external event handler for channel message played
extHandlePlayingCompleted EventHandler external event handler for loading completed
Résultat System

OnClosedOperations() public méthode

Disposes some resources when program has closed
public OnClosedOperations ( ) : void
Résultat void

OnClosingOperations() public méthode

Sets the program closing flag value to true. This stops teh player from performing some opertions that may cause an exception when the program is closing
public OnClosingOperations ( ) : void
Résultat void

ResumePlaying() public méthode

Pause playing the MIDI file
public ResumePlaying ( ) : void
Résultat void

StartPlaying() public méthode

Play the MIDI file
public StartPlaying ( ) : void
Résultat void

StopPlaying() public méthode

Stop playing the MIDI file
public StopPlaying ( ) : void
Résultat void

UnmuteOtherChannels() public méthode

Unmute all channels other than the persistent channel. The persistent channel is not muted in the first place so this effectively unmutes all channels
public UnmuteOtherChannels ( ) : void
Résultat void

Property Details

al_CurrentPlayingChannelNotes public_oe property

public ArrayList,System.Collections al_CurrentPlayingChannelNotes
Résultat System.Collections.ArrayList