本文整理汇总了C#中IWaveSource.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# IWaveSource.SetPosition方法的具体用法?C# IWaveSource.SetPosition怎么用?C# IWaveSource.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWaveSource
的用法示例。
在下文中一共展示了IWaveSource.SetPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ttbbPrev_Click
private void ttbbPrev_Click(object sender, ThumbnailButtonClickedEventArgs e)
{
Changing = true;
player.Stop();
t.Stop();
if (ActualFileIndex == 0)
ActualFileIndex = Playlist.Count - 1;
else
ActualFileIndex--;
GetAndFillWithSongInfo();
source = CodecFactory.Instance.GetCodec(Playlist[ActualFileIndex]);
if (playerInit)
{
ttbbPlayPause.Icon = Icon.FromHandle(ToolbarIcons.ic_play_arrow_white_18dp.GetHicon());
ttbbPlayPause.Tooltip = "Wznów odtwarzanie";
mbtnPlayPause.Image = PlayerControlIcons.ic_pause_grey600_48dp;
player.Initialize(source);
source.SetPosition(new TimeSpan(0, 0, 0));
t.Start();
player.Play();
mtbTime.Maximum = Convert.ToInt32(source.GetLength().TotalSeconds);
mtbTime.Value = 0;
}
}
示例2: player_Stopped
private void player_Stopped(object sender, PlaybackStoppedEventArgs e)
{
if (!Changing)
{
//MessageBox.Show(e.Exception.ToString());
t.Stop();
if (ActualFileIndex == Playlist.Count - 1)
ActualFileIndex = 0;
else
ActualFileIndex++;
GetAndFillWithSongInfo();
source = CodecFactory.Instance.GetCodec(Playlist[ActualFileIndex]);
if (playerInit)
{
ttbbPlayPause.Icon = Icon.FromHandle(ToolbarIcons.ic_play_arrow_white_18dp.GetHicon());
ttbbPlayPause.Tooltip = "Wznów odtwarzanie";
player.Initialize(source);
source.SetPosition(new TimeSpan(0, 0, 0));
t.Start();
player.Play();
mtbTime.Maximum = Convert.ToInt32(source.GetLength().TotalSeconds);
mtbTime.Value = 0;
}
}
}