private void cmdPlayStop_Click(object sender, EventArgs e) { String useext = txtFileType.Text; //If currently playing; stop. Otherwise, play the sound data in LoadedSoundData. if (playingsound == null && LoadedSoundData !=null) { usedriver = BCBlockGameState.Soundman.Driver; mTempFilename = BCBlockGameState.GetTempFile(useext); //write the sounddata to that file. FileStream writesound = new FileStream(mTempFilename, FileMode.Create); writesound.Write(LoadedSoundData, 0, LoadedSoundData.Length); writesound.Close(); //load a sound object from the current Driver... usedriver.OnSoundStop += new OnSoundStopDelegate(usedriver_OnSoundStop); playingsound = usedriver.LoadSound(mTempFilename); playedsound = playingsound.Play(false); cmdPlayStop.Text = "&Stop"; //start the PositionUpdate Timer. PositionUpdateTimer = new Timer((w) => BeginInvoke((MethodInvoker)(() => { UpdateSoundPos(); })),null,0,250); } else { PositionUpdateTimer.Dispose(); PositionUpdateTimer = null; playedsound.Stop(); // usedriver_OnSoundStop(playedsound); cmdPlayStop.Text = "&Play"; SetStopState(); } }
public cNewSoundManager(iSoundEngineDriver sounddriver, String SoundFilePath) : this(sounddriver) { LoadSounds(SoundFilePath); }
protected cNewSoundManager(iSoundEngineDriver sounddriver) { mDriver = sounddriver; mDriver.OnSoundStop +=new OnSoundStopDelegate(mDriver_OnSoundStop); mDriver.OnSoundPlay += new OnSoundPlayDelegate(mDriver_OnSoundPlay); }
public cNewSoundManager(iSoundEngineDriver sounddriver, DirectoryInfo[] DirsUse) : this(sounddriver) { LoadSounds(DirsUse); }