public void AddSongToPlayList(SongDetails song)
 {
     if (!this.HaveCoreClass())
     {
         return;
     }
     ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.appendItem(this.mediaPlayerCore.newMedia(song.SongPath));
 }
 public void RemoveSongFromPlayList(SongDetails song)
 {
     if (!this.HaveCoreClass())
     {
         return;
     }
     ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.removeItem(((IWMPCore3)this.mediaPlayerCore).currentPlaylist.get_Item(song.SongNumber));
 }
        public SongDetails GetCurrentSongDetails()
        {
            SongDetails songDetails = new SongDetails();

            if (this.HaveCoreClass() && ((IWMPCore3)this.mediaPlayerCore).currentMedia != null)
            {
                string str1     = string.Empty;
                string itemInfo = ((IWMPCore3)this.mediaPlayerCore).currentMedia.getItemInfo("Artist");
                if (!string.IsNullOrEmpty(itemInfo))
                {
                    str1 = itemInfo + " - ";
                }
                string str2 = str1 + ((IWMPCore3)this.mediaPlayerCore).currentMedia.name;
                songDetails.SongName = str2;
                songDetails.Duration = ((IWMPCore3)this.mediaPlayerCore).currentMedia.duration;
            }
            return(songDetails);
        }
 public SongDetails[] GetPlayList()
 {
     SongDetails[] songDetailsArray = new SongDetails[((IWMPCore3)this.mediaPlayerCore).currentPlaylist.count];
     if (!this.HaveCoreClass())
     {
         return(songDetailsArray);
     }
     for (int lIndex = 0; lIndex < ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.count; ++lIndex)
     {
         songDetailsArray[lIndex] = new SongDetails()
         {
             SongName   = ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.get_Item(lIndex).name,
             Duration   = ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.get_Item(lIndex).duration,
             SongPath   = ((IWMPCore3)this.mediaPlayerCore).currentPlaylist.get_Item(lIndex).sourceURL,
             SongNumber = lIndex
         }
     }
     ;
     return(songDetailsArray);
 }