Example #1
0
        public static void HandleDiskFromAutoplay(char driveLetter, CDAction action)
        {
            CDAlbumCommand cdAlbumCommand = null;

            foreach (CDAlbumCommand cd in Instance.CDs)
            {
                if (cd != null && cd.CDDevice.DrivePath == driveLetter)
                {
                    cdAlbumCommand = cd;
                    break;
                }
            }
            if (cdAlbumCommand == null)
            {
                Instance._pendingAutoPlay = new AutoplayInfo(driveLetter, action);
            }
            else
            {
                cdAlbumCommand.Invoke();
                if (action == CDAction.Rip && cdAlbumCommand.InsertedDuringSession && ZuneShell.DefaultInstance.Management.AutoCopyCD.Value || !cdAlbumCommand.CDDevice.IsDriveReady)
                {
                    return;
                }
                cdAlbumCommand.AutoPlayAction = action;
            }
        }
Example #2
0
        public void UpdateNodes(CDAccess cdAccess, char changedLetter, bool mediaArrived)
        {
            this.RecalculateAvailableNodes();
            CDAlbumCommand nodes1 = (CDAlbumCommand)this.NodesList[0];

            if (this.IsCurrent)
            {
                if (!(ZuneShell.DefaultInstance.CurrentPage is CDLand currentPage))
                {
                    return;
                }
                bool flag = false;
                if (currentPage.Album.CDDevice != null && currentPage.Album.CDDevice.DrivePath == changedLetter)
                {
                    flag = true;
                }
                if (!flag && (!mediaArrived || !this.NoCD.IsCurrent))
                {
                    return;
                }
                nodes1.Invoke();
            }
            else
            {
                if (!mediaArrived)
                {
                    return;
                }
                foreach (CDAlbumCommand nodes2 in NodesList)
                {
                    if (nodes2.CDDevice != null && nodes2.CDDevice.DrivePath == changedLetter)
                    {
                        this.Nodes.ChosenValue = nodes2;
                        break;
                    }
                }
            }
        }
Example #3
0
 internal CDAlbumTrack(CDAlbumCommand album, uint trackIndex)
 {
     this._album      = album;
     this._trackIndex = trackIndex;
 }