Esempio n. 1
0
        private bool CheckRequiredSpaceForPath(ProjectType aProjectType, string fullPathname)
        {
            int availableSpace = MediaTypeSupport.GetMaxMediaSizeMbByProjectType(aProjectType, CurrentDrive);
            int neededSpace    = GetTotalMbForPath(fullPathname);

            log.Debug(
                "BurnManager: Project {0} of {1} needs a media with an estimated size of at least {2} MB - available: {3} MB",
                aProjectType.ToString(), fullPathname, Convert.ToString(neededSpace), Convert.ToString(availableSpace));
            return(availableSpace >= neededSpace);
        }
Esempio n. 2
0
        private bool CheckInsertedMediaCapacity(Burner aSelectedBurner, int aIsoSize)
        {
            int currentSpace      = (int)(aSelectedBurner.CurrentMediaInfo.Size / 1024);
            int currentSpaceGuess = MediaTypeSupport.GetMediaSizeMbByType(aSelectedBurner.CurrentMediaInfo.CurrentMediaType);

            // first try the "true" disk size
            if (currentSpace < aIsoSize)
            {
                return(currentSpaceGuess > aIsoSize);
            }

            return(true);
        }
Esempio n. 3
0
        /// <summary>
        ///   Query this to find out e.g. whether to display the option to burn for a specific item.
        /// </summary>
        /// <param name = "aProjectType">Does the item need a DVD or maybe an Audio-CD?</param>
        /// <param name = "aCheckMediaStatus">Check the current inserted media as well and fail if not suitable</param>
        /// <param name = "aBurnResult">For details on errors. Set to "Unknown" when calling</param>
        /// <returns></returns>
        public bool IsBurningPossible(ProjectType aProjectType, bool aCheckMediaStatus, out BurnResult aBurnResult)
        {
            // No burner found / set
            if (CurrentDrive == null)
            {
                aBurnResult = BurnResult.NoDriveAvailable;
                return(false);
            }
            // E.g. CD-Burner does not support Data-DVD
            if (!MediaTypeSupport.CheckBurnerRequirements(aProjectType, CurrentDrive))
            {
                aBurnResult = BurnResult.UnsupportedInput;
                return(false);
            }

            // Is the currently inserted Media ready for burning?
            if (aCheckMediaStatus)
            {
                // Check whether the correct type (CD,DVD) of media is inserted
                if (!MediaTypeSupport.CheckInsertedMediaType(aProjectType, CurrentDrive))
                {
                    aBurnResult = BurnResult.WrongMediaType;
                    return(false);
                }
                // E.g. Does our DVD-R writer support the DVD+RW in tray
                if (!CheckInsertedMediaSupported(CurrentDrive))
                {
                    aBurnResult = BurnResult.UnsupportedMedia;
                    return(false);
                }
                // Check if disk was already finalized, Auto-Blank Rewritable media
                if (!CheckInsertedMediaBlankStatus(CurrentDrive, true))
                {
                    aBurnResult = BurnResult.NotEnoughSpace;
                    return(false);
                }
            }

            aBurnResult = BurnResult.Ready;
            return(true);
        }
Esempio n. 4
0
        // ToDo: sort this out..
        private void ParseDescriptionForFeatures(List <string> FeatureDescription)
        {
            lock (this)
            {
                DriveFeatures currentFeatures = new DriveFeatures(false, false, false, false, false, false, false, false, false,
                                                                  false, false, false, string.Empty, string.Empty);
                MediaTypeSupport currentProfile = new MediaTypeSupport(false, false, false, false, false, false, false, false,
                                                                       false, false);

                for (int i = 0; i < FeatureDescription.Count; i++)
                {
                    string checkStr = FeatureDescription[i];

                    if (checkStr.Contains(@"Does read CD-R media"))
                    {
                        currentFeatures.ReadsCDR = true;
                    }
                    else if (checkStr.Contains(@"Does write CD-R media"))
                    {
                        currentFeatures.WriteCDR = true;
                    }
                    else if (checkStr.Contains(@"Does read CD-RW media"))
                    {
                        currentFeatures.ReadsCDRW = true;
                    }
                    else if (checkStr.Contains(@"Does write CD-RW"))
                    {
                        currentFeatures.WriteCDRW = true;
                    }
                    else if (checkStr.Contains(@"Does read DVD-ROM"))
                    {
                        currentFeatures.ReadsDVDRom = true;
                    }
                    else if (checkStr.Contains(@"Does read DVD-R"))
                    {
                        currentFeatures.ReadsDVDR = true;
                    }
                    else if (checkStr.Contains(@"Does write DVD-R"))
                    {
                        currentFeatures.WriteDVDR = true;
                    }
                    else if (checkStr.Contains(@"Does read DVD-RAM"))
                    {
                        currentFeatures.ReadsDVDRam = true;
                    }
                    else if (checkStr.Contains(@"Does write DVD-RAM"))
                    {
                        currentFeatures.WriteDVDRam = true;
                    }
                    else if (checkStr.Contains(@"Does support Buffer-Underrun-Free recording"))
                    {
                        currentFeatures.SupportsBurnFree = true;
                    }
                    else if (checkStr.Contains(@"Does support test writing"))
                    {
                        currentFeatures.AllowsDummyWrite = true;
                    }
                    else if (checkStr.Contains(@"Maximum read"))
                    {
                        currentFeatures.MaxReadSpeed = checkStr.Substring(23).Trim(trimchars);
                    }
                    else if (checkStr.Contains(@"Maximum write"))
                    {
                        currentFeatures.MaxWriteSpeed = checkStr.Substring(23).Trim(trimchars);
                    }
                    else if (checkStr.Contains(@"Vendor_info"))
                    {
                        fDeviceVendor = checkStr.Substring(16).Trim(trimchars);
                    }
                    else if (checkStr.Contains(@"Identifikation : "))
                    {
                        fDeviceName = checkStr.Substring(16).Trim(trimchars);
                    }
                    else if (checkStr.Contains(@" DVD+R/DL"))
                    {
                        currentProfile.WriteDlDVDplusR = true;
                    }
                    else if (checkStr.Contains(@" DVD+RW"))
                    {
                        currentProfile.WriteDVDplusRW = true;
                    }
                    else if (checkStr.Contains(@" DVD+R"))
                    {
                        currentProfile.WriteDVDplusR = true;
                    }
                    else if (checkStr.Contains(@" DVD-RW"))
                    {
                        currentProfile.WriteDVDminusRW = true;
                    }
                    else if (checkStr.Contains(@" DVD-R"))
                    {
                        currentProfile.WriteDVDminusR = true;
                    }
                    else if (checkStr.Contains(@" CD-RW"))
                    {
                        currentProfile.WriteCDRW = true;
                    }
                    else if (checkStr.Contains(@" CD-R"))
                    {
                        currentProfile.WriteCDR = true;
                    }
                    else if (checkStr.Contains(@"BD-ROM"))
                    {
                        currentFeatures.ReadsBRRom = true;
                    }
                }

                fDriveFeatures = currentFeatures;
                fMediaFeatures = currentProfile;
            }
        }
        // ToDo: sort this out..
        private void ParseDescriptionForFeatures(List<string> FeatureDescription)
        {
            lock (this)
              {
            DriveFeatures currentFeatures = new DriveFeatures(false, false, false, false, false, false, false, false, false,
                                                          false, false, false, string.Empty, string.Empty);
            MediaTypeSupport currentProfile = new MediaTypeSupport(false, false, false, false, false, false, false, false,
                                                               false, false);

            for (int i = 0; i < FeatureDescription.Count; i++)
            {
              string checkStr = FeatureDescription[i];

              if (checkStr.Contains(@"Does read CD-R media"))
            currentFeatures.ReadsCDR = true;
              else if (checkStr.Contains(@"Does write CD-R media"))
            currentFeatures.WriteCDR = true;
              else if (checkStr.Contains(@"Does read CD-RW media"))
            currentFeatures.ReadsCDRW = true;
              else if (checkStr.Contains(@"Does write CD-RW"))
            currentFeatures.WriteCDRW = true;
              else if (checkStr.Contains(@"Does read DVD-ROM"))
            currentFeatures.ReadsDVDRom = true;
              else if (checkStr.Contains(@"Does read DVD-R"))
            currentFeatures.ReadsDVDR = true;
              else if (checkStr.Contains(@"Does write DVD-R"))
            currentFeatures.WriteDVDR = true;
              else if (checkStr.Contains(@"Does read DVD-RAM"))
            currentFeatures.ReadsDVDRam = true;
              else if (checkStr.Contains(@"Does write DVD-RAM"))
            currentFeatures.WriteDVDRam = true;
              else if (checkStr.Contains(@"Does support Buffer-Underrun-Free recording"))
            currentFeatures.SupportsBurnFree = true;
              else if (checkStr.Contains(@"Does support test writing"))
            currentFeatures.AllowsDummyWrite = true;
              else if (checkStr.Contains(@"Maximum read"))
            currentFeatures.MaxReadSpeed = checkStr.Substring(23).Trim(trimchars);
              else if (checkStr.Contains(@"Maximum write"))
            currentFeatures.MaxWriteSpeed = checkStr.Substring(23).Trim(trimchars);
              else if (checkStr.Contains(@"Vendor_info"))
            fDeviceVendor = checkStr.Substring(16).Trim(trimchars);
              else if (checkStr.Contains(@"Identifikation : "))
            fDeviceName = checkStr.Substring(16).Trim(trimchars);
              else if (checkStr.Contains(@" DVD+R/DL"))
            currentProfile.WriteDlDVDplusR = true;
              else if (checkStr.Contains(@" DVD+RW"))
            currentProfile.WriteDVDplusRW = true;
              else if (checkStr.Contains(@" DVD+R"))
            currentProfile.WriteDVDplusR = true;
              else if (checkStr.Contains(@" DVD-RW"))
            currentProfile.WriteDVDminusRW = true;
              else if (checkStr.Contains(@" DVD-R"))
            currentProfile.WriteDVDminusR = true;
              else if (checkStr.Contains(@" CD-RW"))
            currentProfile.WriteCDRW = true;
              else if (checkStr.Contains(@" CD-R"))
            currentProfile.WriteCDR = true;
              else if (checkStr.Contains(@"BD-ROM"))
            currentFeatures.ReadsBRRom = true;
            }

            fDriveFeatures = currentFeatures;
            fMediaFeatures = currentProfile;
              }
        }