Exemplo n.º 1
0
 private void _play(int index) {
     index = index < 0 && lv_playlist.Items.Count > 0 ? 0 : index;
     if (index > -1 && index < lv_playlist.Items.Count) {
         _playlist_update(index);
         _file_playing = lv_playlist.SelectedItem as MyMediaFile;
         _play();
     }
 }
Exemplo n.º 2
0
 private void _prev() {
     if (ml_main.Position.TotalSeconds > 2) {
         ml_main.Position = new TimeSpan(0, 0, 0);
     } else {
         if (lv_playlist.Items.Count < 2) {
             if (_file_playing != null) {
                 String filename = FileHandling.get_file_relative_to(_file_playing.FilePath.LocalPath, -1);
                 if (filename != null) {
                     _open_files(true, _current_media_type, filename);
                 }
             }
         } else {
             if (btn_shuffle.IsChecked == true && _playlist_history.Count > 0) {
                 _file_playing = _playlist_history.Pop();
                 for (int i = 0; i < lv_playlist.Items.Count; i++) {
                     if ((lv_playlist.Items[i] as MyMediaFile).Equals(_file_playing)) {
                         _playlist_update(i);
                     }
                 }
                 _play();
             } else if (_item_playing_index > -1) {
                 _play(--_item_playing_index);
             }
         }
     }
 }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            MyMediaFile other = obj as MyMediaFile;

            return(other == null ? false : other.Title.Equals(this.Title) && other.FilePath.Equals(this.FilePath));
        }