本文整理汇总了C#中NAudio.Wave.StoppedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# StoppedEventArgs类的具体用法?C# StoppedEventArgs怎么用?C# StoppedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StoppedEventArgs类属于NAudio.Wave命名空间,在下文中一共展示了StoppedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: waveIn_RecordingStopped
private void waveIn_RecordingStopped(object sender, StoppedEventArgs e)
{
waveIn.Dispose();
waveIn = null;
writer.Close();
writer = null;
}
示例2: OnDataStopped
public void OnDataStopped(object sender, StoppedEventArgs e)
{
if (waveIn != null)
waveIn.Dispose();
if (WFile != null)
WFile.Close();
}
示例3: OnPlaybackStopped
private void OnPlaybackStopped(object sender, StoppedEventArgs e)
{
if (!CheckAccess())
{
Dispatcher.Invoke(() => OnPlaybackStopped(sender, e));
return;
}
try
{
_playbackButton.ImageSource = Icons.PlayIcon;
_timeTextBlock.Text = "00:00 / 00:00";
if (_waveProvider != null)
_waveProvider.CurrentTime = TimeSpan.Zero;
if (e.Exception != null)
UiHelper.ShowError(this, e.Exception);
}
catch (Exception ex)
{
UiHelper.ShowError(this, ex);
}
finally
{
_timer.Stop();
}
}
示例4: WaveOut_PlaybackStopped
private void WaveOut_PlaybackStopped(object sender, StoppedEventArgs e)
{
if (sender != null) (sender as WaveOutEvent).Dispose();
if (reader != null)
{
reader.Dispose();
reader = null;
}
}
示例5: OnRecordingStopped
static void OnRecordingStopped(object sender, StoppedEventArgs e)
{
Cleanup();
if (e.Exception != null)
{
Console.WriteLine(String.Format("A problem was encountered during recording {0}",
e.Exception.Message));
}
}
示例6: loadNextSong
protected override void loadNextSong(object sender, StoppedEventArgs e)
{
getNextSample();
if (songsUntilNextSample > 1)
setGUIText(songsUntilNextSample + " songs until sample");
else
setGUIText("Sample playing next");
mainPlayer.sampleDone();
}
示例7: RecordingStopped
private void RecordingStopped(object sender, StoppedEventArgs e)
{
isStopping = false;
IsRecording = false;
if (resumeRecording)
{
WaveIn.StartRecording();
resumeRecording = false;
IsRecording = true;
}
}
示例8: waveSource_RecordingStopped
//------------------------------------------------------------------------------------------------------------------------
void waveSource_RecordingStopped(object sender, StoppedEventArgs e)
{
lock (this)
{
if (waveSource != null)
{
waveSource.Dispose();
waveSource = null;
IsActive = false;
}
}
}
示例9: waveSource_RecordingStopped
void waveSource_RecordingStopped(object sender, StoppedEventArgs e)
{
if (Source != null)
{
Source.Dispose();
Source = null;
}
if (File != null)
{
File.Dispose();
File = null;
}
}
示例10: loadNextSong
protected override void loadNextSong(object sender, StoppedEventArgs e)
{
Debug.WriteLine("Load next song");
if (manuallyStopped) { // this prevents next song from loading when stop button is pressed
Debug.WriteLine("Manual stop");
manuallyStopped = false;
return;
}
nextSong = getNextSong();
if (samplePlayer.ready())
samplePlayer.playSample();
else
playSong();
}
示例11: OnRecordingStopped
void OnRecordingStopped(object sender, StoppedEventArgs e)
{
if (_writer != null)
{
_writer.Close();
_writer = null;
}
if (_waveIn != null)
{
_waveIn.Dispose();
_waveIn = null;
}
_isRecording = false;
if (e.Exception != null)
throw e.Exception;
}
示例12: RecordingStoppedHandler
void RecordingStoppedHandler(object sender, StoppedEventArgs e)
{
if (saveToFile)
{
fileWriter.Flush();
fileWriter.Close();
fileWriter = null;
}
//if (streamWriter != null)
//{
// streamWriter.Dispose();
// streamWriter = null;
//}
//if (fileStream != null)
//{
// fileStream.Dispose();
// fileStream = null;
//}
waveIn.DataAvailable -= DataAvailableHandler;
waveIn.RecordingStopped -= RecordingStoppedHandler;
}
示例13: OnPlaybackStopped
void OnPlaybackStopped(object sender, StoppedEventArgs e)
{
groupBoxDriverModel.Enabled = true;
if (e.Exception != null)
{
MessageBox.Show(e.Exception.Message, "Playback Device Error");
}
if (_waveProvider != null)
{
_waveProvider.Position = 0;
}
}
示例14: MyWaveOutOnPlaybackStopped
private void MyWaveOutOnPlaybackStopped(object sender, StoppedEventArgs stoppedEventArgs)
{
if (_userStopped) return;
if (stoppedEventArgs.Exception == null && PlaybackFinished != null) PlaybackFinished(this, new EventArgs());
else if (PlaybackError != null) PlaybackError(this, new EventArgs());
}
示例15: PlayerOnPlaybackStopped
private void PlayerOnPlaybackStopped(object sender, StoppedEventArgs stoppedEventArgs)
{
LoadCommand.IsEnabled = true;
StopCommand.IsEnabled = false;
PauseCommand.IsEnabled = false;
}