示例#1
0
        public static CameraParser TryParseMenuSet(RawMenuSet resultMenuSet, string lang, out MenuSet menuset, CameraParser[] parsers = null)
        {
            var innerParsers = parsers ?? new CameraParser[]
            {
                new GH4Parser(),
                new GH3Parser()
            };

            var exceptions = new List <Exception>();

            foreach (var p in innerParsers)
            {
                try
                {
                    var ms = p.ParseMenuSet(resultMenuSet, lang);
                    if (ms == null)
                    {
                        continue;
                    }

                    menuset = ms;
                    return(p);
                }
                catch (Exception ex)
                {
                    exceptions.Add(ex);
                }
            }

            throw new AggregateException("Could not parse MenuSet", exceptions);
        }
示例#2
0
        protected override bool InnerParseMenuSet(MenuSet result, RawMenuSet menuset, string lang)
        {
            var photosettings = menuset?.Photosettings?.Items;

            if (photosettings == null)
            {
                return(false);
            }

            var qmenu = menuset.Qmenu2.Items;

            DefaultLanguage = menuset.TitleList.Languages.Single(l => l.Default == YesNo.Yes).Titles;
            CurrentLanguage = menuset.TitleList.Languages.TryGetValue(lang, out var cur) ? cur.Titles : null;

            result.LiveviewQuality = ToMenuItems(menuset.MainMenu
                                                 .Items["menu_item_id_liveview_settings"]
                                                 .Items["menu_item_id_liveview_quality"]);

            result.CreativeControls = ToMenuItems(photosettings["menu_item_id_crtv_ctrl"]);
            result.PhotoStyles      = ToMenuItems(photosettings["menu_item_id_ph_sty"]);
            result.PhotoSizes       = ToMenuItems(photosettings["menu_item_id_pctsiz"]);
            result.PhotoQuality     = ToMenuItems(photosettings["menu_item_id_quality"]);
            result.MeteringMode     = ToMenuItems(photosettings["menu_item_id_lightmet"]);
            result.VideoFormat      = ToMenuItems(photosettings["menu_item_id_videoformat"]);
            result.VideoQuality     = ToMenuItems(photosettings["menu_item_id_v_quality"]);
            result.FlashModes       = ToMenuItems(photosettings["menu_item_id_flash"]);

            result.Angles           = ToMenuItems(qmenu["menu_item_id_f_and_ss_angle"]);
            result.ExposureShifts   = ToMenuItems(qmenu["menu_item_id_exposure3"] ?? qmenu["menu_item_id_exposure2"]);
            result.AutofocusModes   = ToMenuItems(qmenu["menu_item_id_afmode"]);
            result.CustomMultiModes = ToMenuItems(qmenu["menu_item_id_afmode"].Items["menu_item_id_afmode_custom_multi"]);
            result.IsoValues        = ToMenuItems(qmenu["menu_item_id_sensitivity"]);
            result.DbValues         = ToMenuItems(qmenu["menu_item_id_sensitivity_db"]);
            result.WhiteBalances    = ToMenuItems(qmenu["menu_item_id_whitebalance"]);
            result.BurstModes       = ToMenuItems(qmenu["menu_item_id_burst"]);
            result.PeakingModes     = ToMenuItems(qmenu["menu_item_id_peaking"]);

            return(true);
        }
示例#3
0
        protected override bool InnerParseMenuSet(MenuSet result, RawMenuSet menuset, string lang)
        {
            DefaultLanguage = menuset.TitleList.Languages.Single(l => l.Default == YesNo.Yes).Titles;
            CurrentLanguage = menuset.TitleList.Languages.TryGetValue(lang, out var cur) ? cur.Titles : null;
            var photosettings = menuset.MainMenu.Items["menu_item_id_photo_settings"].Items;
            var qmenu         = menuset.Qmenu.Items;
            var driveMode     = menuset.DriveMode.Items;

            result.LiveviewQuality = ToMenuItems(menuset.MainMenu
                                                 .Items["menu_item_id_liveview_settings"]
                                                 .Items["menu_item_id_liveview_quality"]);

            result.CreativeControls = ToMenuItems(photosettings["menu_item_id_crtv_ctrl"]);
            result.AutofocusModes   = ToMenuItems(photosettings["menu_item_id_afmode"]);
            result.PhotoStyles      = ToMenuItems(photosettings["menu_item_id_ph_sty"]);
            result.FlashModes       = ToMenuItems(photosettings["menu_item_id_flash"]);
            result.PhotoAspects     = ToMenuItems(photosettings["menu_item_id_asprat"]);
            result.PhotoSizes       = ToMenuItems(photosettings["menu_item_id_pctsiz"]);
            result.VideoQuality     = ToMenuItems(photosettings["menu_item_id_v_quality"]);
            result.MeteringMode     = ToMenuItems(photosettings["menu_item_id_lightmet"]);

            result.ExposureShifts = ToMenuItems(qmenu["menu_item_id_exposure2"]);
            result.IsoValues      = ToMenuItems(qmenu["menu_item_id_sensitivity"]) ?? DefaultIsoValues;
            result.WhiteBalances  = ToMenuItems(qmenu["menu_item_id_whitebalance"]);

            result.SingleShootMode = ToMenuItem(driveMode["menu_item_id_1shoot"]);
            result.BurstModes      = ToMenuItems(driveMode["menu_item_id_burst"]) ?? ToMenuItems(photosettings["menu_item_id_burst"]);

            result.VideoFormat = null;

            result.Angles           = null;
            result.CustomMultiModes = null;
            result.DbValues         = null;
            result.PeakingModes     = null;
            return(true);
        }