Example #1
0
        public static MMC MapMmc(mmcType oldMmc)
        {
            if (oldMmc == null)
            {
                return(null);
            }

            MMC newMmc = new MMC
            {
                Features    = Features.MapFeatures(oldMmc.Features),
                ModeSense2A = Mode2A.MapMode2A(oldMmc.ModeSense2A)
            };

            if (oldMmc.TestedMedia == null)
            {
                return(newMmc);
            }

            newMmc.TestedMedia = new List <TestedMedia>(oldMmc.TestedMedia.Select(Models.TestedMedia.MapTestedMedia));

            return(newMmc);
        }
Example #2
0
        public static Mode2A MapMode2A(mmcModeType oldMode)
        {
            if (oldMode == null)
            {
                return(null);
            }

            Mode2A newMode = new Mode2A
            {
                AccurateCDDA                = oldMode.AccurateCDDA,
                BCK                         = oldMode.BCK,
                BufferUnderRunProtection    = oldMode.BufferUnderRunProtection,
                CanEject                    = oldMode.CanEject,
                CanLockMedia                = oldMode.CanLockMedia,
                CDDACommand                 = oldMode.CDDACommand,
                CompositeAudioVideo         = oldMode.CompositeAudioVideo,
                CSSandCPPMSupported         = oldMode.CSSandCPPMSupported,
                DeterministicSlotChanger    = oldMode.DeterministicSlotChanger,
                DigitalPort1                = oldMode.DigitalPort1,
                DigitalPort2                = oldMode.DigitalPort2,
                LeadInPW                    = oldMode.LeadInPW,
                LoadingMechanismType        = oldMode.LoadingMechanismType,
                LockStatus                  = oldMode.LockStatus,
                LSBF                        = oldMode.LSBF,
                PlaysAudio                  = oldMode.PlaysAudio,
                PreventJumperStatus         = oldMode.PreventJumperStatus,
                RCK                         = oldMode.RCK,
                ReadsBarcode                = oldMode.ReadsBarcode,
                ReadsBothSides              = oldMode.ReadsBothSides,
                ReadsCDR                    = oldMode.ReadsCDR,
                ReadsCDRW                   = oldMode.ReadsCDRW,
                ReadsDeinterlavedSubchannel = oldMode.ReadsDeinterlavedSubchannel,
                ReadsDVDR                   = oldMode.ReadsDVDR,
                ReadsDVDRAM                 = oldMode.ReadsDVDRAM,
                ReadsDVDROM                 = oldMode.ReadsDVDROM,
                ReadsISRC                   = oldMode.ReadsISRC,
                ReadsMode2Form2             = oldMode.ReadsMode2Form2,
                ReadsMode2Form1             = oldMode.ReadsMode2Form1,
                ReadsPacketCDR              = oldMode.ReadsPacketCDR,
                ReadsSubchannel             = oldMode.ReadsSubchannel,
                ReadsUPC                    = oldMode.ReadsUPC,
                ReturnsC2Pointers           = oldMode.ReturnsC2Pointers,
                SeparateChannelMute         = oldMode.SeparateChannelMute,
                SeparateChannelVolume       = oldMode.SeparateChannelVolume,
                SSS                         = oldMode.SSS,
                SupportsMultiSession        = oldMode.SupportsMultiSession,
                TestWrite                   = oldMode.TestWrite,
                WritesCDR                   = oldMode.WritesCDR,
                WritesCDRW                  = oldMode.WritesCDRW,
                WritesDVDR                  = oldMode.WritesDVDR,
                WritesDVDRAM                = oldMode.WritesDVDRAM
            };

            if (oldMode.BufferSizeSpecified)
            {
                newMode.BufferSize = oldMode.BufferSize;
            }
            if (oldMode.CurrentSpeedSpecified)
            {
                newMode.CurrentSpeed = oldMode.CurrentSpeed;
            }
            if (oldMode.CurrentWriteSpeedSpecified)
            {
                newMode.CurrentWriteSpeed = oldMode.CurrentWriteSpeed;
            }
            if (oldMode.CurrentWriteSpeedSelectedSpecified)
            {
                newMode.CurrentWriteSpeedSelected = oldMode.CurrentWriteSpeedSelected;
            }
            if (oldMode.MaximumSpeedSpecified)
            {
                newMode.MaximumSpeed = oldMode.MaximumSpeed;
            }
            if (oldMode.MaximumWriteSpeedSpecified)
            {
                newMode.MaximumWriteSpeed = oldMode.MaximumWriteSpeed;
            }
            if (oldMode.RotationControlSelectedSpecified)
            {
                newMode.RotationControlSelected = oldMode.RotationControlSelected;
            }
            if (oldMode.SupportedVolumeLevelsSpecified)
            {
                newMode.SupportedVolumeLevels = oldMode.SupportedVolumeLevels;
            }

            if (oldMode.WriteSpeedPerformanceDescriptors == null)
            {
                return(newMode);
            }

            newMode.WriteSpeedPerformanceDescriptors =
                new List <WriteDescriptor>(oldMode.WriteSpeedPerformanceDescriptors.Select(t => new WriteDescriptor
            {
                RotationControl = t.RotationControl,
                WriteSpeed      = t.WriteSpeed
            }));

            return(newMode);
        }