Ejemplo n.º 1
0
 public XPBurnProgressEvents(XPBurnMessageQueue owner)
 {
     fOwner = owner;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// The constructor for the burn component.  This call does a lot of work under the covers,
        /// including communicating with imapi to find out whether there is an XP compatible cd drive attached.
        /// </summary>
        unsafe public XPBurnCD()
        {
            IEnumDiscMasterFormats pEnumDiscFormats;
            uint pcFetched;
            Guid guidFormatID;

            fCancel    = false;
            fIsBurning = false;
            uint  cookieValue = (uint)10;
            uint *tempCookie  = &cookieValue;

            fProgressCookie = &tempCookie;

            Debug.WriteLine(@"8/30/2003 6:59p.m. version 1");

            fMessageQueue = new XPBurnMessageQueue(this);

            fMusicDiscWriter     = null;
            fMusicRecorderDrives = new ArrayList();
            fMusicRecorders      = new ArrayList();
            fDataDiscWriter      = null;
            fDataRecorderDrives  = new ArrayList();
            fDataRecorders       = new ArrayList();

            fFiles = new Hashtable();

            try
            {
                fDiscMaster = (IDiscMaster) new MSDiscMasterObj();
            }
            catch (COMException)
            {
                throw new XPBurnException(Resource.NoMAPI);
            }

            fDiscMaster.Open();

            fDiscMaster.ProgressAdvise(new XPBurnProgressEvents(fMessageQueue), fProgressCookie);

            fDiscMaster.EnumDiscMasterFormats(out pEnumDiscFormats);

            pcFetched = 1;
            while (pcFetched == 1)
            {
                pEnumDiscFormats.Next(1, out guidFormatID, out pcFetched);
                if (guidFormatID == GUIDS.IID_IJolietDiscMaster)
                {
                    fSupportedFormats = ((SupportedRecordTypes)((int)fSupportedFormats | 1));
                }
                else
                {
                    if (guidFormatID == GUIDS.IID_IRedbookDiscMaster)
                    {
                        fSupportedFormats = ((SupportedRecordTypes)((int)fSupportedFormats | 2));
                    }
                }
            }

            if (fSupportedFormats == SupportedRecordTypes.sfNone)
            {
                fDiscMaster.Close();
                throw new XPBurnException(Resource.NoSupport);
            }


            EnumerateDiscRecorders();

            fBurnerDrive  = 0;
            fActiveFormat = RecordType.afData;

            SetDrive(fBurnerDrive);
        }