private void dispatcherTimer_Tick(object sender, EventArgs e) { if (m_curPlaying != null) { sitemStatus.Content = m_curPlaying.Status; // Text Right to left reihenfolge erst 9,8,7...0 sitemTime.Content = string.Format("{1} - {0}", MSToFormatedString(m_curPlaying.TimePosition), MSToFormatedString(m_curPlaying.TimeLenght)); sliderUpdate.Value = m_curPlaying.TimePosition; try { if ((sliderUpdate.Value == m_curPlaying.TimeLenght || sliderUpdate.Value == 0) && m_curPlaying.TimeLenght > 0) { if (m_ticks == 2) { if (m_repeatTitle) { m_curPlaying.StopItem(); m_curPlaying.PlayItem(); } else if (lstPlaylist.Items.IndexOf(m_curPlaying) + 1 == lstPlaylist.Items.Count) { if (m_repeatAll) { lstPlaylist.SelectedItem = lstPlaylist.Items.GetItemAt(0); cmdPlay_Click(sender, null); } else { cmdStop_Click(sender, null); } } else { cmdNext_Click(sender, null); } } else { m_ticks++; } } } catch (Exception ex) { frmMessageBox.ShowDialog(ex.ToString(), "Ramona Audio Player"); } } else { sitemStatus.Content = "Stopped"; } }
private void cmdNext_Click(object sender, RoutedEventArgs e) { int indexCur = lstPlaylist.Items.IndexOf(m_curPlaying); if (indexCur + 1 < lstPlaylist.Items.Count && m_curPlaying.StopItem()) { m_updateTimer.Stop(); m_curPlaying = lstPlaylist.Items.GetItemAt(indexCur + 1) as Plalistitem; m_curPlaying.PlayItem(); sliderUpdate.Maximum = m_curPlaying.TimeLenght; sliderUpdate.Value = 1; m_ticks = 0; m_updateTimer.Start(); } }
private void cmdBack_Click(object sender, RoutedEventArgs e) { int indexCur = lstPlaylist.Items.IndexOf(m_curPlaying); if (indexCur - 1 != -1 && m_curPlaying.StopItem()) { m_updateTimer.Stop(); m_curPlaying = lstPlaylist.Items.GetItemAt(indexCur - 1) as Plalistitem; m_curPlaying.PlayItem(); m_current.Plugin.ListenerPosition = new Vector3(0); m_current.Plugin.Update(1); sliderUpdate.Maximum = m_curPlaying.TimeLenght; sliderUpdate.Value = 1; m_ticks = 0; m_updateTimer.Start(); } }