C# 클래스 Symphonary.MidiPlayer

파일 보기 프로젝트 열기: tfreedman/Symphonary 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
al_CurrentPlayingChannelNotes System.Collections.ArrayList

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

EnterPreviewMode() 공개 메소드

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
리턴 void

ExitPreviewMode() 공개 메소드

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
리턴 void

MidiPlayer() 공개 메소드

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
리턴 System

OnClosedOperations() 공개 메소드

Disposes some resources when program has closed
public OnClosedOperations ( ) : void
리턴 void

OnClosingOperations() 공개 메소드

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
리턴 void

ResumePlaying() 공개 메소드

Pause playing the MIDI file
public ResumePlaying ( ) : void
리턴 void

StartPlaying() 공개 메소드

Play the MIDI file
public StartPlaying ( ) : void
리턴 void

StopPlaying() 공개 메소드

Stop playing the MIDI file
public StopPlaying ( ) : void
리턴 void

UnmuteOtherChannels() 공개 메소드

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
리턴 void

프로퍼티 상세

al_CurrentPlayingChannelNotes 공개적으로 프로퍼티

public ArrayList,System.Collections al_CurrentPlayingChannelNotes
리턴 System.Collections.ArrayList