示例#1
0
        public BlurayInfoViewModel([CanBeNull] byte[] blurayDiscInformation, [CanBeNull] byte[] blurayBurstCuttingArea,
                                   [CanBeNull] byte[] blurayDds, [CanBeNull] byte[] blurayCartridgeStatus,
                                   [CanBeNull] byte[] bluraySpareAreaInformation, [CanBeNull] byte[] blurayPowResources,
                                   [CanBeNull] byte[] blurayTrackResources, [CanBeNull] byte[] blurayRawDfl,
                                   [CanBeNull] byte[] blurayPac, Window view)
        {
            _view             = view;
            _discInformation  = blurayDiscInformation;
            _burstCuttingArea = blurayBurstCuttingArea;
            _dds                              = blurayDds;
            _cartridgeStatus                  = blurayCartridgeStatus;
            _spareAreaInformation             = bluraySpareAreaInformation;
            _powResources                     = blurayPowResources;
            _trackResources                   = blurayTrackResources;
            _rawDfl                           = blurayRawDfl;
            _pac                              = blurayPac;
            SaveBlurayDiscInformationCommand  = ReactiveCommand.Create(ExecuteSaveBlurayDiscInformationCommand);
            SaveBlurayBurstCuttingAreaCommand = ReactiveCommand.Create(ExecuteSaveBlurayBurstCuttingAreaCommand);
            SaveBlurayDdsCommand              = ReactiveCommand.Create(ExecuteSaveBlurayDdsCommand);
            SaveBlurayCartridgeStatusCommand  = ReactiveCommand.Create(ExecuteSaveBlurayCartridgeStatusCommand);

            SaveBluraySpareAreaInformationCommand =
                ReactiveCommand.Create(ExecuteSaveBluraySpareAreaInformationCommand);

            SaveBlurayPowResourcesCommand   = ReactiveCommand.Create(ExecuteSaveBlurayPowResourcesCommand);
            SaveBlurayTrackResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayTrackResourcesCommand);
            SaveBlurayRawDflCommand         = ReactiveCommand.Create(ExecuteSaveBlurayRawDflCommand);
            SaveBlurayPacCommand            = ReactiveCommand.Create(ExecuteSaveBlurayPacCommand);

            if (blurayDiscInformation != null)
            {
                SaveBlurayDiscInformationVisible = true;
                BlurayDiscInformationText        = DI.Prettify(blurayDiscInformation);
            }

            if (blurayBurstCuttingArea != null)
            {
                SaveBlurayBurstCuttingAreaVisible = true;
                BlurayBurstCuttingAreaText        = BCA.Prettify(blurayBurstCuttingArea);
            }

            if (blurayDds != null)
            {
                SaveBlurayDdsVisible = true;
                BlurayDdsText        = DDS.Prettify(blurayDds);
            }

            if (blurayCartridgeStatus != null)
            {
                SaveBlurayCartridgeStatusVisible = true;
                BlurayCartridgeStatusText        = Cartridge.Prettify(blurayCartridgeStatus);
            }

            if (bluraySpareAreaInformation != null)
            {
                SaveBluraySpareAreaInformationVisible = true;
                BluraySpareAreaInformationText        = Spare.Prettify(bluraySpareAreaInformation);
            }

            if (blurayPowResources != null)
            {
                SaveBlurayPowResourcesVisible = true;
                BlurayPowResourcesText        = DiscInformation.Prettify(blurayPowResources);
            }

            if (blurayTrackResources != null)
            {
                SaveBlurayTrackResourcesVisible = true;
                BlurayTrackResourcesText        = DiscInformation.Prettify(blurayTrackResources);
            }

            SaveBlurayRawDflVisible = blurayRawDfl != null;
            SaveBlurayPacVisible    = blurayPac != null;
        }
        internal void LoadData(byte[] blurayDiscInformation, byte[] blurayBurstCuttingArea, byte[] blurayDds,
                               byte[] blurayCartridgeStatus, byte[] bluraySpareAreaInformation,
                               byte[] blurayPowResources, byte[] blurayTrackResources, byte[] blurayRawDfl,
                               byte[] blurayPac)
        {
            DiscInformation  = blurayDiscInformation;
            BurstCuttingArea = blurayBurstCuttingArea;
            Dds                  = blurayDds;
            CartridgeStatus      = blurayCartridgeStatus;
            SpareAreaInformation = bluraySpareAreaInformation;
            PowResources         = blurayPowResources;
            TrackResources       = blurayTrackResources;
            RawDfl               = blurayRawDfl;
            Pac                  = blurayPac;

            if (blurayDiscInformation != null)
            {
                grpBlurayDiscInformation.Visible     = true;
                btnSaveBlurayDiscInformation.Visible = true;
                txtBlurayDiscInformation.Text        = DI.Prettify(blurayDiscInformation);
            }

            if (blurayBurstCuttingArea != null)
            {
                grpBlurayBurstCuttingArea.Visible     = true;
                btnSaveBlurayBurstCuttingArea.Visible = true;
                txtBlurayBurstCuttingArea.Text        = BCA.Prettify(blurayBurstCuttingArea);
            }

            if (blurayDds != null)
            {
                grpBlurayDds.Visible     = true;
                btnSaveBlurayDds.Visible = true;
                txtBlurayDds.Text        = DDS.Prettify(blurayDds);
            }

            if (blurayCartridgeStatus != null)
            {
                grpBlurayCartridgeStatus.Visible     = true;
                btnSaveBlurayCartridgeStatus.Visible = true;
                txtBlurayCartridgeStatus.Text        = Cartridge.Prettify(blurayCartridgeStatus);
            }

            if (bluraySpareAreaInformation != null)
            {
                grpBluraySpareAreaInformation.Visible     = true;
                btnSaveBluraySpareAreaInformation.Visible = true;
                txtBluraySpareAreaInformation.Text        = Spare.Prettify(bluraySpareAreaInformation);
            }

            if (blurayPowResources != null)
            {
                grpBlurayPowResources.Visible     = true;
                btnSaveBlurayPowResources.Visible = true;
                txtBlurayPowResources.Text        = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayPowResources);
            }

            if (blurayTrackResources != null)
            {
                grpBlurayTrackResources.Visible     = true;
                btnSaveBlurayTrackResources.Visible = true;
                txtBlurayTrackResources.Text        = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayTrackResources);
            }

            btnSaveBlurayRawDfl.Visible = blurayRawDfl != null;
            btnSaveBlurayPac.Visible    = blurayPac != null;

            Visible = grpBlurayDiscInformation.Visible || grpBlurayBurstCuttingArea.Visible ||
                      grpBlurayDds.Visible ||
                      grpBlurayCartridgeStatus.Visible || grpBluraySpareAreaInformation.Visible ||
                      grpBlurayPowResources.Visible || grpBlurayTrackResources.Visible ||
                      btnSaveBlurayRawDfl.Visible ||
                      btnSaveBlurayPac.Visible;
        }
        internal void LoadData(MediaType mediaType, byte[] dds, byte[] cartridgeStatus,
                               byte[]    spareArea,
                               byte[]    lastBorderOutRmd, byte[] preRecordedInfo, byte[] mediaIdentifier,
                               byte[]    physicalInformation, byte[] mediumStatus, byte[] hdLastRmd,
                               byte[]    layerCapacity,
                               byte[]    middleZoneStart, byte[] jumpIntervalSize, byte[] manualLayerJumpStartLba,
                               byte[]    remapAnchorPoint, byte[] adip, byte[] dcb)
        {
            dvdRamDds                     = dds;
            dvdRamCartridgeStatus         = cartridgeStatus;
            dvdRamSpareArea               = spareArea;
            dvdLastBorderOutRmd           = lastBorderOutRmd;
            dvdPreRecordedInfo            = preRecordedInfo;
            dvdrMediaIdentifier           = mediaIdentifier;
            dvdrPhysicalInformation       = physicalInformation;
            hddvdrMediumStatus            = mediumStatus;
            hddvdrLastRmd                 = hdLastRmd;
            dvdrLayerCapacity             = layerCapacity;
            dvdrDlMiddleZoneStart         = middleZoneStart;
            dvdrDlJumpIntervalSize        = jumpIntervalSize;
            dvdrDlManualLayerJumpStartLba = manualLayerJumpStartLba;
            dvdrDlRemapAnchorPoint        = remapAnchorPoint;
            dvdPlusAdip                   = adip;
            dvdPlusDcb                    = dcb;
            switch (mediaType)
            {
            case MediaType.DVDR:
                Text = "DVD-R";
                break;

            case MediaType.DVDRW:
                Text = "DVD-RW";
                break;

            case MediaType.DVDPR:
                Text = "DVD+R";
                break;

            case MediaType.DVDPRW:
                Text = "DVD+RW";
                break;

            case MediaType.DVDPRWDL:
                Text = "DVD+RW DL";
                break;

            case MediaType.DVDRDL:
                Text = "DVD-R DL";
                break;

            case MediaType.DVDPRDL:
                Text = "DVD+R DL";
                break;

            case MediaType.DVDRAM:
                Text = "DVD-RAM";
                break;

            case MediaType.DVDRWDL:
                Text = "DVD-RW DL";
                break;

            case MediaType.HDDVDRAM:
                Text = "HD DVD-RAM";
                break;

            case MediaType.HDDVDR:
                Text = "HD DVD-R";
                break;

            case MediaType.HDDVDRW:
                Text = "HD DVD-RW";
                break;

            case MediaType.HDDVDRDL:
                Text = "HD DVD-R DL";
                break;

            case MediaType.HDDVDRWDL:
                Text = "HD DVD-RW DL";
                break;
            }

            if (dds != null)
            {
                grpDvdRamDds.Visible     = true;
                btnSaveDvdRamDds.Visible = true;
                txtDvdRamDds.Text        = DDS.Prettify(dds);
            }

            if (cartridgeStatus != null)
            {
                grpDvdRamCartridgeStatus.Visible     = true;
                btnSaveDvdRamCartridgeStatus.Visible = true;
                txtDvdRamCartridgeStatus.Text        = Cartridge.Prettify(cartridgeStatus);
            }

            if (spareArea != null)
            {
                grpDvdRamSpareAreaInformation.Visible     = true;
                btnSaveDvdRamSpareAreaInformation.Visible = true;
                txtDvdRamSpareAreaInformation.Text        = Spare.Prettify(spareArea);
            }

            btnSaveDvdRamDds.Visible                     = dds != null;
            btnSaveDvdRamCartridgeStatus.Visible         = cartridgeStatus != null;
            btnSaveDvdRamSpareAreaInformation.Visible    = spareArea != null;
            btnSaveLastBorderOutRmd.Visible              = lastBorderOutRmd != null;
            btnSaveDvdPreRecordedInfo.Visible            = preRecordedInfo != null;
            btnSaveDvdrMediaIdentifier.Visible           = mediaIdentifier != null;
            btnSaveDvdrPhysicalInformation.Visible       = physicalInformation != null;
            btnSaveHddvdrMediumStatus.Visible            = mediumStatus != null;
            btnSaveHddvdrLastRmd.Visible                 = hdLastRmd != null;
            btnSaveDvdrLayerCapacity.Visible             = layerCapacity != null;
            btnSaveDvdrDlMiddleZoneStart.Visible         = middleZoneStart != null;
            btnSaveDvdrDlJumpIntervalSize.Visible        = jumpIntervalSize != null;
            btnSaveDvdrDlManualLayerJumpStartLba.Visible = manualLayerJumpStartLba != null;
            btnSaveDvdrDlRemapAnchorPoint.Visible        = remapAnchorPoint != null;
            btnSaveDvdPlusAdip.Visible                   = adip != null;
            btnSaveDvdPlusDcb.Visible                    = dcb != null;

            Visible = grpDvdRamDds.Visible || grpDvdRamCartridgeStatus.Visible ||
                      grpDvdRamSpareAreaInformation.Visible || btnSaveDvdRamDds.Visible ||
                      btnSaveDvdRamCartridgeStatus.Visible || btnSaveDvdRamSpareAreaInformation.Visible ||
                      btnSaveLastBorderOutRmd.Visible || btnSaveDvdPreRecordedInfo.Visible ||
                      btnSaveDvdrMediaIdentifier.Visible || btnSaveDvdrPhysicalInformation.Visible ||
                      btnSaveHddvdrMediumStatus.Visible || btnSaveHddvdrLastRmd.Visible ||
                      btnSaveDvdrLayerCapacity.Visible || btnSaveDvdrDlMiddleZoneStart.Visible ||
                      btnSaveDvdrDlJumpIntervalSize.Visible || btnSaveDvdrDlManualLayerJumpStartLba.Visible ||
                      btnSaveDvdrDlRemapAnchorPoint.Visible || btnSaveDvdPlusAdip.Visible ||
                      btnSaveDvdPlusDcb.Visible;
        }
示例#4
0
        public DvdWritableInfoViewModel(MediaType mediaType, byte[] dds, byte[] cartridgeStatus, byte[] spareArea,
                                        byte[] lastBorderOutRmd, byte[] preRecordedInfo, byte[] mediaIdentifier,
                                        byte[] physicalInformation, byte[] mediumStatus, byte[] hdLastRmd,
                                        byte[] layerCapacity, byte[] middleZoneStart, byte[] jumpIntervalSize,
                                        byte[] manualLayerJumpStartLba, byte[] remapAnchorPoint, byte[] adip,
                                        byte[] dcb, Window view)
        {
            _view = view;
            SaveDvdRamDdsCommand             = ReactiveCommand.Create(ExecuteSaveDvdRamDdsCommand);
            SaveDvdRamCartridgeStatusCommand = ReactiveCommand.Create(ExecuteSaveDvdRamCartridgeStatusCommand);

            SaveDvdRamSpareAreaInformationCommand =
                ReactiveCommand.Create(ExecuteSaveDvdRamSpareAreaInformationCommand);

            SaveLastBorderOutRmdCommand        = ReactiveCommand.Create(ExecuteSaveLastBorderOutRmdCommand);
            SaveDvdPreRecordedInfoCommand      = ReactiveCommand.Create(ExecuteSaveDvdPreRecordedInfoCommand);
            SaveDvdrMediaIdentifierCommand     = ReactiveCommand.Create(ExecuteSaveDvdrMediaIdentifierCommand);
            SaveDvdrPhysicalInformationCommand = ReactiveCommand.Create(ExecuteSaveDvdrPhysicalInformationCommand);
            SaveHddvdrMediumStatusCommand      = ReactiveCommand.Create(ExecuteSaveHddvdrMediumStatusCommand);
            SaveHddvdrLastRmdCommand           = ReactiveCommand.Create(ExecuteSaveHddvdrLastRmdCommand);
            SaveDvdrLayerCapacityCommand       = ReactiveCommand.Create(ExecuteSaveDvdrLayerCapacityCommand);
            SaveDvdrDlMiddleZoneStartCommand   = ReactiveCommand.Create(ExecuteSaveDvdrDlMiddleZoneStartCommand);
            SaveDvdrDlJumpIntervalSizeCommand  = ReactiveCommand.Create(ExecuteSaveDvdrDlJumpIntervalSizeCommand);

            SaveDvdrDlManualLayerJumpStartLbaCommand =
                ReactiveCommand.Create(ExecuteSaveDvdrDlManualLayerJumpStartLbaCommand);

            SaveDvdrDlRemapAnchorPointCommand = ReactiveCommand.Create(ExecuteSaveDvdrDlRemapAnchorPointCommand);
            SaveDvdPlusAdipCommand            = ReactiveCommand.Create(ExecuteSaveDvdPlusAdipCommand);
            SaveDvdPlusDcbCommand             = ReactiveCommand.Create(ExecuteSaveDvdPlusDcbCommand);

            _dvdRamDds                     = dds;
            _dvdRamCartridgeStatus         = cartridgeStatus;
            _dvdRamSpareArea               = spareArea;
            _dvdLastBorderOutRmd           = lastBorderOutRmd;
            _dvdPreRecordedInfo            = preRecordedInfo;
            _dvdrMediaIdentifier           = mediaIdentifier;
            _dvdrPhysicalInformation       = physicalInformation;
            _hddvdrMediumStatus            = mediumStatus;
            _hddvdrLastRmd                 = hdLastRmd;
            _dvdrLayerCapacity             = layerCapacity;
            _dvdrDlMiddleZoneStart         = middleZoneStart;
            _dvdrDlJumpIntervalSize        = jumpIntervalSize;
            _dvdrDlManualLayerJumpStartLba = manualLayerJumpStartLba;
            _dvdrDlRemapAnchorPoint        = remapAnchorPoint;
            _dvdPlusAdip                   = adip;
            _dvdPlusDcb                    = dcb;

            /* TODO: Pass back
             * switch(mediaType)
             * {
             *  case MediaType.DVDR:
             *      Text = "DVD-R";
             *
             *      break;
             *  case MediaType.DVDRW:
             *      Text = "DVD-RW";
             *
             *      break;
             *  case MediaType.DVDPR:
             *      Text = "DVD+R";
             *
             *      break;
             *  case MediaType.DVDPRW:
             *      Text = "DVD+RW";
             *
             *      break;
             *  case MediaType.DVDPRWDL:
             *      Text = "DVD+RW DL";
             *
             *      break;
             *  case MediaType.DVDRDL:
             *      Text = "DVD-R DL";
             *
             *      break;
             *  case MediaType.DVDPRDL:
             *      Text = "DVD+R DL";
             *
             *      break;
             *  case MediaType.DVDRAM:
             *      Text = "DVD-RAM";
             *
             *      break;
             *  case MediaType.DVDRWDL:
             *      Text = "DVD-RW DL";
             *
             *      break;
             *  case MediaType.HDDVDRAM:
             *      Text = "HD DVD-RAM";
             *
             *      break;
             *  case MediaType.HDDVDR:
             *      Text = "HD DVD-R";
             *
             *      break;
             *  case MediaType.HDDVDRW:
             *      Text = "HD DVD-RW";
             *
             *      break;
             *  case MediaType.HDDVDRDL:
             *      Text = "HD DVD-R DL";
             *
             *      break;
             *  case MediaType.HDDVDRWDL:
             *      Text = "HD DVD-RW DL";
             *
             *      break;
             * }
             */

            if (dds != null)
            {
                DvdRamDdsText = DDS.Prettify(dds);
            }

            if (cartridgeStatus != null)
            {
                DvdRamCartridgeStatusText = Cartridge.Prettify(cartridgeStatus);
            }

            if (spareArea != null)
            {
                DvdRamSpareAreaInformationText = Spare.Prettify(spareArea);
            }

            SaveDvdRamDdsVisible                     = dds != null;
            SaveDvdRamCartridgeStatusVisible         = cartridgeStatus != null;
            SaveDvdRamSpareAreaInformationVisible    = spareArea != null;
            SaveLastBorderOutRmdVisible              = lastBorderOutRmd != null;
            SaveDvdPreRecordedInfoVisible            = preRecordedInfo != null;
            SaveDvdrMediaIdentifierVisible           = mediaIdentifier != null;
            SaveDvdrPhysicalInformationVisible       = physicalInformation != null;
            SaveHddvdrMediumStatusVisible            = mediumStatus != null;
            SaveHddvdrLastRmdVisible                 = hdLastRmd != null;
            SaveDvdrLayerCapacityVisible             = layerCapacity != null;
            SaveDvdrDlMiddleZoneStartVisible         = middleZoneStart != null;
            SaveDvdrDlJumpIntervalSizeVisible        = jumpIntervalSize != null;
            SaveDvdrDlManualLayerJumpStartLbaVisible = manualLayerJumpStartLba != null;
            SaveDvdrDlRemapAnchorPointVisible        = remapAnchorPoint != null;
            SaveDvdPlusAdipVisible                   = adip != null;
            SaveDvdPlusDcbVisible                    = dcb != null;
        }