mode 0 menu "Startup Options" name "Set Startup Defaults" label "Set Startup Defaults" ########################################################################## ## ## ## STARTDEF.CSM Set Default Values which aren't normally stored ## ## Public Domain by Ralf Brown ## ## 815 Copeland Way PMB 26 ## ## Pittsburgh, PA 15232 ## ## USA ## ## Version 3.4 ## ## Last Edit 28jan00 ## ## ## ## Target Devices: Kodak DC220/DC260/DC265/DC290, ## ## Minolta Dimage EX1500 (developed and tested on a DC260 thru ## ## version 3.2, DC290 thereafter) ## ## ## ## Documentation ## ## ============= ## ## ## ## Install by copying to the \SYSTEM folder on your flash card ## ## (either using a card reader or the Mounter). When using a ## ## card reader or PCMCIA slot, be sure to use an ALL-CAPS filename, ## ## as the Kodak models have been known to lock up when there are ## ## MSWindows long file names on the card. The script places ## ## itself in the Startup Options menu in Capture mode, which is ## ## also where the startup script it creates is placed. You can ## ## also choose to create four sets of alternative settings in ## ## addition to the startup defaults; one set ("Quick Alternate" ## ## will appear on the "Picture Type" menu, and the others on the ## ## "Startup Options" menu. ## ## ## ## To use, start the script, then select the category of settings ## ## you want to permanently change, make the changes, and select ## ## the "Save Settings" menu item to save the current settings -- as ## ## modified by your selections within the script -- as the new ## ## startup default values. To save the settings that were active ## ## when you started the script, simply select "Save" immediately. ## ## ## ## Whenever there is a menu of choices for a particular setting, ## ## the first item on the menu not only shows which setting you ## ## are changing, but allows you to choose the current value without ## ## scrolling down to the checked item. ## ## ## ## Due to the limitations of DigitaScript (100 demerits to the ## ## developers!), entry of numeric settings on cameras other than ## ## the DC290 is more complicated than it should be, and can't ## ## perform any error checking. ## ## To enter a number, you must input the value as though it were ## ## a string value (you can input the empty string by immediately ## ## selecting Continue if you want to use the default value). To ## ## get to the digits for input, press the left softkey twice. ## ## NOTE: if you enter a string which is not a number, you will get ## ## a script error when the startup script tries to run; if you ## ## enter a number which is out of range, the setting will most ## ## likely be ignored. ## ## ## ## Of the numeric settings, both zoom and exposure compensation ## ## are specified in hundredths, i.e. set zoom to 150 for 1.5x ## ## and exposure compensation to -33 for -0.33 (-1/3). And yes, ## ## it is possible to set exposure compensations which are not a ## ## multiple of 1/2 (1/3 on the EX1500) -- and on the DC260, the top ## ## LCD will even show such values correctly (to one decimal place)! ## ## ## ## In addition to making various settings "sticky", you can also ## ## force the flash off at startup. Normally, if you turn off the ## ## flash, that setting is stored as Auto on power-down; STARTDEF ## ## lets you select whether you want to convert the Auto setting back ## ## to Off, or even force the flash off regardless of what setting ## ## was saved at power-down. Note that if you select External Flash, ## ## the flash will always be set to XSync (Firmware 1.0.6+) or Fill ## ## (earlier firmware versions) in order to allow the external flash ## ## to fire. ## ## ## ## Finally, this script gives you access to a few settings that are ## ## not available from the menus. You can select from among the ## ## three different available date formats for imprinting as ## ## watermarks on your pictures: the default numeric format, an ## ## abbreviated "Jan 6, 1999" format, or the long "Wed, Jan 6, 1999" ## ## format. You can also choose to include seconds in the imprinted ## ## time, but the DC-260 (firmware 1.0.6) does not display seconds ## ## even when told to do so.... ## ## ## ## If you would like to have your own startup commands, do not ## ## put them in \SYSTEM\STARTUP.CSM (which this script overwrites), ## ## but instead use \SYSTEM\USERSTRT.CSM, which is executed at each ## ## startup by the automatically-generated startup script. ## ## ## ## If you choose to save one of the alternate setups, a variety of ## ## settings in addition to those presented on this script's menus ## ## are stored, allowing you to quickly switch to a different use of ## ## the camera. If you are saving the startup defaults, you will be ## ## asked whether to store the additional settings; if you do, then ## ## any changes you make via menus will be overridden at startup (to ## ## cancel this behavior, simply re-save the startup defaults, ## ## choosing NOT to store the extra settings). Additional settings ## ## which are stored include the burst capture rate, focus distance ## ## for manual focusing, QuickView duration, whether image ## ## auto-rotation is enabled, the shutter speed for long-exposure ## ## mode, red-eye reduction, the timelapse interval and image count, ## ## which watermarks (if any) are enabled, the watermark text string ## ## and logo file, watermark colors, R-G-B white balance, and the ## ## capture sizes and compression for all three capture modes (still, ## ## burst, timelapse). ## ## ## ## Tip: for maximum speed and to save a bit of memory on your flash ## ## card, you can remove all of the comments (lines starting with '#' ## ## from a copy of this file prior to installing it in the camera. ## ## ## ## Known Limitations ## ## ================= ## ## This script can't set Overlay in Review Mode, and can't set the ## ## default Album in Capture Mode; neither setting appears to be ## ## accessible from DigitaScript on the Kodak cameras. ## ## ## ## Setting the flash mode from the startup script does not work ## ## properly on the DC290; always choose "Use Saved Flash Mode" for ## ## the startup script (setting flash mode works properly for the ## ## alternate setups). ## ## ## ## In addition, there's a display bug on the DC290 with firmware ## ## v1.0.0 if you elect to use the 24H/MM/SS time display format, ## ## so you should avoid setting that format; use one of the other ## ## three. ## ## ## ## Availability ## ## ============ ## ## The newest version of this script is always available at ## ## www.digitacamera.com. ## ## ## ## Thanks ## ## ====== ## ## to Fred, Jim, and Patrick for testing & feedback. ## ## ## ########################################################################## declare u:u_ret, u_value, uVarType declare u:uEnumCount, uEnumDefault, uEnumValue declare u:uFileID, count declare u:fmod, fmtd, mcap, mcro, smod, wmod, xmod, oerv declare u:hint, rpos, dfmt, tfmt declare u:u_zpos, u_mtdy, u_xcmp, u_scmp, u_aagc, u_zmod, u_zspd declare u:choice, u_current, full_restore declare i:status, iMin, iMax, iDefault, iCurrent, getDefaults declare s:sPrompt, sName, sVarName, sEnumDesc, s_value declare s:zpos, mtdy, xcmp, scmp, aagc, zspd declare s:s_script, s_filename, s_menu, s_title, s_current, s_type, s_desc declare s:s_sep declare b:have_xsync, have_DC290, have_Digita1point5, selected # some manifest constants declare u:UNINITIALIZED declare u:EXTERNAL_FLASH, FLASH_OFF, FLASH_AUTO, FLASH_FILL, FLASH_XSYNC declare u:OFF_IF_AUTO # # let user know that we're doing something before the first menu comes up # DisplayClear() DisplayLine("Getting Current Settings") # # initialize the variables storing manifest constants # UNINITIALIZED = 999999999 EXTERNAL_FLASH = 3 FLASH_OFF = 1 FLASH_AUTO = 2 FLASH_FILL = 3 FLASH_XSYNC = 5 OFF_IF_AUTO = 99 # # initialize various settings prior to reading them # u_zpos = UNINITIALIZED u_mtdy = UNINITIALIZED u_xcmp = UNINITIALIZED u_aagc = UNINITIALIZED u_zmod = UNINITIALIZED smod = 0 getDefaults = 1 # # since XSync only exists on firmware 1.0.6 and up, check whether it's # available on this camera # u_ret = 100 sVarName = "smod" u_value = FLASH_XSYNC goto ValidEnumValue ret_100: have_xsync = u_value status = 0 status = GetCameraState("oerv",oerv) if status == 0 have_Digita1point5 = 1 end GetProductInfo("ptid", sName) if sName == "KODAK DC290 Zoom Digital Camera" have_DC290 = 1 end MainLoop: # # because we're invoking the same code to get the current settings that # we later invoke to get the user's new settings, and that code jumps # back to MainLoop, we need to make a few dummy passes of the loop at # the outset, controlled by "getDefaults" # if getDefaults == 1 getDefaults = 2 goto focus_settings end if getDefaults == 2 getDefaults = 3 # misc_settings comes before exposure_settings, because we may need # to reset 'smod' based on the value of 'xmod' goto misc_settings end if getDefaults == 3 getDefaults = 4 goto datetime_settings end if getDefaults == 4 getDefaults = 5 goto exposure_settings end if getDefaults >= 5 getDefaults = 0 end # # once we finally get down here, we've collected all the current settings, # so go ask for user's new selections # DisplayClear() SetOption(1,"Save Current Settings") SetOption(2,"Focus Settings") SetOption(3,"Exposure Settings") SetOption(4,"Date/Time Formats") SetOption(5,"Miscellaneous Settings") GetOption(choice) if choice == 1 goto save_settings end if choice == 2 goto focus_settings end if choice == 3 goto exposure_settings end if choice == 4 goto datetime_settings end if choice == 5 goto misc_settings end goto MainLoop ######################################################################### # # # MenuItem: Focus-related Settings # # # ######################################################################### focus_settings: sPrompt = "Use Current Focus Mode" sVarName = "fmod" u_value = fmod u_ret = 201 goto AskEnum ret_201: fmod = u_value sPrompt = "Use Current Focus Method" sVarName = "fmtd" u_value = fmtd u_ret = 202 goto AskEnum ret_202: fmtd = u_value sPrompt = "Use Current Macro Mode" sVarName = "mcro" u_value = mcro u_ret = 203 goto AskEnum ret_203: mcro = u_value sPrompt = "Set Zoom Position" sVarName = "zpos" u_value = u_zpos u_ret = 204 goto AskRange ret_204: zpos = s_value u_zpos = u_value # DC290 sPrompt = "Use Current Zoom Mode" sVarName = "zmod" u_value = u_zmod u_ret = 205 goto AskEnum ret_205: u_zmod = u_value # DC290 sPrompt = "Select Zoom Speed" sVarName = "zspd" u_value = u_zspd u_ret = 206 goto AskRange ret_206: zspd = s_value u_zspd = u_value # # [insert any additional settings which may require saving right here] # goto MainLoop ######################################################################### # # # MenuItem: Exposure-related Settings # # # ######################################################################### exposure_settings: # SDK claims this is stored in EEPROM, but it isn't.... sPrompt = "Use Current Exposure Mode" sVarName = "xmod" u_value = xmod u_ret = 211 goto AskEnum ret_211: xmod = u_value if xmod == EXTERNAL_FLASH smod = FLASH_FILL if have_xsync smod = FLASH_XSYNC end end sPrompt = "Set Exposure Compensation" sVarName = "xcmp" u_value = u_xcmp u_ret = 212 goto AskRange ret_212: xcmp = s_value u_xcmp = u_value sPrompt = "Set Strobe Compensation" sVarName = "scmp" u_value = u_scmp u_ret = 213 goto AskRange ret_213: scmp = s_value u_scmp = u_value # SDK claims this is stored in EEPROM, but it isn't.... sPrompt = "Use Current White Balance" sVarName = "wmod" u_value = wmod u_ret = 214 goto AskEnum ret_214: wmod = u_value # # [insert any additional settings which may require saving right here] # goto MainLoop ######################################################################### # # # MenuItem: Date/Time Formats # # # ######################################################################### datetime_settings: sPrompt = "Use Current Date Format" sVarName = "dfmt" u_value = dfmt u_ret = 221 goto AskEnum ret_221: dfmt = u_value sPrompt = "Use Current Time Format" sVarName = "tfmt" u_value = tfmt u_ret = 222 goto AskEnum ret_222: tfmt = u_value # # [insert any additional settings which may require saving right here] # goto MainLoop ######################################################################### # # # MenuItem: Miscellaneous Settings # # # ######################################################################### misc_settings: sPrompt = "Use Current Capture Mode" sVarName = "mcap" u_value = mcap u_ret = 231 goto AskEnum ret_231: mcap = u_value sPrompt = "Set Self-Timer Delay" sVarName = "mtdy" u_value = u_mtdy u_ret = 232 goto AskRange ret_232: mtdy = s_value u_mtdy = u_value # Minolta Dimage EX and Kodak DC290 only sPrompt = "Use Current Hint Mode" sVarName = "hint" u_value = hint u_ret = 233 goto AskEnum ret_233: hint = u_value # appears to be present but disabled on DC260; description string is # "Review/Play Overlay Specification" sPrompt = "Use Current Overlay Mode" sVarName = "rpos" u_value = rpos u_ret = 234 goto AskEnum ret_234: rpos = u_value # Kodak DC290 only sPrompt = "Select ISO Sensitivity" sVarName = "aagc" u_value = u_aagc u_ret = 235 goto AskRange ret_235: aagc = s_value u_aagc = u_value # # [insert any additional settings which may require saving right here] # if getDefaults != 0 status = 0 status = GetCameraState("smod",smod) if status == 0 # if current state is OFF, store in script as "Off if Auto" on # anything older than the DC290 (because the 290 is the first to # properly save "Flash Off") if smod == FLASH_OFF if have_DC290 == 0 smod = OFF_IF_AUTO end end end # # should there have been an error, leave out the flash setting from # the startup script # if status != 0 smod = 0 end end if getDefaults == 0 # # Get desired Flash Mode "smod" 1=off,2=auto,3=fill,5=XSync # This needs to be special-cased since we allow some values that aren't # actually valid enumeration values # DisplayClear() SetOption(0, "Use Saved Flash Mode",0) SetOption(OFF_IF_AUTO,"Off if Auto", smod == OFF_IF_AUTO) SetOption(FLASH_OFF, "Always Force Off",smod == FLASH_OFF) if have_xsync SetOption(FLASH_XSYNC,"External Sync",smod == FLASH_XSYNC) end SetOption(FLASH_FILL, "Fill Flash", smod == FLASH_FILL) SetOption(FLASH_AUTO, "Auto",0) GetOption(smod) end goto MainLoop ######################################################################### # # # MenuItem: Save Current Settings to STARTUP.CSM # # # ######################################################################### save_settings: # # ask which setup script to write # DisplayClear() SetOption(1,"Write new Startup Script",0) SetOption(2,"Write Quick Alternate Setup",0) SetOption(3,"Write Setup #2",0) SetOption(4,"Write Setup #3",0) SetOption(5,"Write Setup #4",0) # [for more setup files, add additional options here and supply an # appropriate filename/menu/title in the "if"s below] GetOption(choice) s_type = "setup" full_restore = 1 if choice == 1 s_script = "STARTUP.CSM" s_filename = "/SYSTEM/STARTUP.CSM" s_menu = "Startup Options" s_title = "Startup Script" s_type = "startup" SetOption(0,"Restore only unsaved items") SetOption(1,"Restore ALL camera settings") GetOption(full_restore) end if choice == 2 s_script = "SETTING1.CSM" s_filename = "/SYSTEM/SETTING1.CSM" s_menu = "Picture Type" s_title = "Alternate Setup" end if choice == 3 s_script = "SETTING2.CSM" s_filename = "/SYSTEM/SETTING2.CSM" s_menu = "Startup Options" s_title = "Use Setup #2" end if choice == 4 s_script = "SETTING3.CSM" s_filename = "/SYSTEM/SETTING3.CSM" s_menu = "Startup Options" s_title = "Use Setup #3" end if choice == 5 s_script = "SETTING4.CSM" s_filename = "/SYSTEM/SETTING4.CSM" s_menu = "Startup Options" s_title = "Use Setup #4" end s_desc = "" s_sep = " " if s_type == "setup" # get a brief description of the setup GetString("Name of Setup (8 characters)",8,s_desc) if s_desc != "" s_sep = ": " end end # # first, check whether the script already exists; if so, ask user whether # to replace it # status = 0 status = GetScriptName(s_script,sName) if status == 0 Alert("Select 'Continue' to replace your current ",s_type," script") EraseFile("/SYSTEM/", s_script) end # # next, create a new startup/setup script file # DisplayClear() DisplayLine("Writing new ",s_type," script") status = 0 status = FileOpen(2, s_filename, 1, uFileID) if status != 0 Alert("Unable to create ",s_type," script") end if status == 0 # # if the file create/open was successful, write the fixed header # WriteLine(uFileID,"mode 0") WriteLine(uFileID,"menu \"", s_menu, "\"") WriteLine(uFileID,"name \"", s_title, "\"") WriteLine(uFileID,"label \"", s_title, s_sep, s_desc, "\"") WriteLine(uFileID,"") WriteLine(uFileID,"#################################################################") WriteLine(uFileID,"# ",s_script," - ",s_type," script generated by STARTDEF.CSM v3.3 #") WriteLine(uFileID,"# (STARTDEF.CSM written by Ralf Brown) #") WriteLine(uFileID,"#################################################################") WriteLine(uFileID,"") WriteLine(uFileID,"declare i:status") WriteLine(uFileID,"declare u:smod") WriteLine(uFileID,"declare s:sName") WriteLine(uFileID,"") # # now write each of the values that we need to restore on each restart # sPrompt = "focus mode" sVarName = "fmod" u_value = fmod u_ret = 300 goto WriteSettingU ret_300: sPrompt = "focus method" sVarName = "fmtd" u_value = fmtd u_ret = 301 goto WriteSettingU ret_301: sPrompt = "capture mode" sVarName = "mcap" u_value = mcap u_ret = 302 goto WriteSettingU ret_302: sPrompt = "macro mode" sVarName = "mcro" u_value = mcro u_ret = 303 goto WriteSettingU ret_303: sPrompt = "zoom position" sVarName = "zpos" s_value = zpos u_value = u_zpos u_ret = 304 goto WriteSettingI ret_304: sPrompt = "self-timer delay" sVarName = "mtdy" s_value = mtdy u_value = u_mtdy u_ret = 305 goto WriteSettingI ret_305: sPrompt = "exposure mode" sVarName = "xmod" u_value = xmod u_ret = 306 goto WriteSettingU ret_306: sPrompt = "exposure compensation" sVarName = "xcmp" s_value = xcmp u_value = u_xcmp u_ret = 307 goto WriteSettingI ret_307: sPrompt = "white balance" sVarName = "wmod" u_value = wmod u_ret = 308 goto WriteSettingU ret_308: sPrompt = "hint mode" sVarName = "hint" u_value = hint u_ret = 309 goto WriteSettingU ret_309: sPrompt = "date format" sVarName = "dfmt" u_value = dfmt u_ret = 310 goto WriteSettingU ret_310: sPrompt = "time format" sVarName = "tfmt" u_value = tfmt u_ret = 311 goto WriteSettingU ret_311: sPrompt = "Aperture (F-stop) for ext.flash" sVarName = "aper" u_ret = 312 goto SaveUVariable ret_312: sPrompt = "Red-Eye Reduction" sVarName = "spre" u_ret = 313 goto SaveUVariable ret_313: sPrompt = "ISO Sensitivity" sVarName = "aagc" u_ret = 314 s_value = aagc u_value = u_aagc goto WriteSettingU ret_314: sPrompt = "strobe compensation" sVarName = "scmp" s_value = scmp u_value = u_scmp u_ret = 315 goto WriteSettingI ret_315: sPrompt = "Zoom Mode" sVarName = "zmod" u_value = u_zmod u_ret = 316 goto WriteSettingU ret_316: sPrompt = "Zoom Speed" sVarName = "zmod" s_value = zspd u_value = u_zspd u_ret = 317 goto WriteSettingI ret_317: # # special case for flash mode, since we may need to conditionally set it # if xmod == EXTERNAL_FLASH # handle case of exposure set to External Flash -- we can't set the # flash to Off (and preferably not to Auto) in that case smod = FLASH_FILL if have_xsync smod = FLASH_XSYNC end end if smod != 0 WriteLine(uFileID,"# set flash mode") if smod == OFF_IF_AUTO # turn off only if Auto at startup (since a state of Off is stored # as Auto) WriteLine(uFileID,"GetCameraState(\"smod\", smod)") WriteLine(uFileID,"if smod == ",FLASH_AUTO) # the following Wait() is a workaround for the problem that the # DC290 won't properly set the flash mode WriteLine(uFileID," Wait(50)") WriteLine(uFileID," SetCameraState(\"smod\", ",FLASH_OFF,")") WriteLine(uFileID,"end") goto smod_set end if smod == FLASH_XSYNC # we need to force the exposure mode to external flash to keep # the DC290 from getting confused about its state on the top # display (won't show f-number) and menus (shows Programmed AE # even tho External Flash mode is active) WriteLine(uFileID,"SetCameraState(\"xmod\", ",EXTERNAL_FLASH,")") # the following Wait() is a workaround for the problem that # setting "smod" to XSync does not actually enable external flash # on the DC260 fw 1.0.6 WriteLine(uFileID,"Wait(50)") WriteLine(uFileID,"SetCameraState(\"smod\", ",smod,")") WriteLine(uFileID,"Wait(50)") WriteLine(uFileID,"SetCameraState(\"xmod\", ",EXTERNAL_FLASH,")") goto smod_set end #--default case for flash mode # the following Wait() is a workaround for the problem that # setting "smod" doesn't properly set the flash mode WriteLine(uFileID,"Wait(50)") WriteLine(uFileID,"SetCameraState(\"smod\", ",smod,")") smod_set: end # # if we are NOT writing the startup script, or the user has elected # to restore all settings, also write a variety of other settings which # are normally preserved anyway, in order to allow a quick change of ALL # important settings # if full_restore != 0 # intermediate progress indicator Display(".") sPrompt = "Burst Rate (full-size images)" sVarName = "fbti" u_ret = 321 goto SaveUVariable ret_321: sPrompt = "Burst Rate (quarter-size)" sVarName = "qbti" u_ret = 322 goto SaveUVariable ret_322: sPrompt = "Focus Distance" sVarName = "fdst" u_ret = 323 goto SaveUVariable ret_323: sPrompt = "Quick-View duration" sVarName = "irev" u_ret = 324 goto SaveUVariable ret_324: sPrompt = "Auto-Rotation" sVarName = "rmod" u_ret = 325 goto SaveUVariable ret_325: sPrompt = "Shutter Speed (long exposure)" sVarName = "shut" u_ret = 326 goto SaveUVariable ret_326: sPrompt = "Timelapse Image Count" sVarName = "tcnt" u_ret = 328 goto SaveUVariable ret_328: sPrompt = "Timelapse Capture Interval" sVarName = "tldy" u_ret = 329 goto SaveUVariable ret_329: sPrompt = "Watermark Enable flags" sVarName = "wena" u_ret = 330 goto SaveIVariable ret_330: sPrompt = "Watermark Text String" sVarName = "wstr" u_ret = 331 goto SaveSVariable ret_331: # intermediate progress indicator DisplayLine(".") sPrompt = "Still Capture Size" sVarName = "ssiz" u_ret = 332 goto SaveUVariable ret_332: sPrompt = "Burst Capture Size" sVarName = "bsiz" u_ret = 333 goto SaveUVariable ret_333: sPrompt = "Timelapse Capture Size" sVarName = "tsiz" u_ret = 334 goto SaveUVariable ret_334: sPrompt = "Still Capture Compression" sVarName = "scpn" u_ret = 335 goto SaveUVariable ret_335: sPrompt = "Burst Capture Compression" sVarName = "bcpn" u_ret = 336 goto SaveUVariable ret_336: sPrompt = "Timelapse Capture Compression" sVarName = "tcpn" u_ret = 337 goto SaveUVariable ret_337: sPrompt = "Self-Timer Enable" sVarName = "stim" u_ret = 338 goto SaveUVariable ret_338: # intermediate progress indicator Display(".") sPrompt = "Watermark Logo File" sVarName = "wpic" u_ret = 339 goto SaveSVariable ret_339: sPrompt = "Watermark Logo X Position" sVarName = "wsxp" u_ret = 340 goto SaveUVariable ret_340: sPrompt = "Watermark Logo Y Position" sVarName = "wsyp" u_ret = 341 goto SaveUVariable ret_341: sPrompt = "Watermark Text X Position" sVarName = "wsxp" u_ret = 342 goto SaveUVariable ret_342: sPrompt = "Watermark Text Y Position" sVarName = "wsyp" u_ret = 343 goto SaveUVariable ret_343: sPrompt = "Watermark Text Operation Mode" sVarName = "wsop" u_ret = 344 goto SaveUVariable ret_344: # intermediate progress indicator DisplayLine(".") sPrompt = "Watermark Time X Position" sVarName = "wtxp" u_ret = 345 goto SaveUVariable ret_345: sPrompt = "Watermark Time Y Position" sVarName = "wtyp" u_ret = 346 goto SaveUVariable ret_346: sPrompt = "Watermark Time Operation Mode" sVarName = "wtop" u_ret = 347 goto SaveUVariable ret_347: sPrompt = "Watermark Logo File Operation" sVarName = "wpop" u_ret = 348 goto SaveUVariable ret_348: sPrompt = "Watermark Text Background Color" sVarName = "wsbc" u_ret = 349 goto SaveUVariable ret_349: sPrompt = "Watermark Text Foreground Color" sVarName = "wsfc" u_ret = 350 goto SaveUVariable ret_350: sPrompt = "Watermark Time Background Color" sVarName = "wtbc" u_ret = 351 goto SaveUVariable ret_351: sPrompt = "Watermark Time Foreground Color" sVarName = "wtfc" u_ret = 352 goto SaveUVariable ret_352: sPrompt = "White Balance Reg" sVarName = "wbcr" u_ret = 353 goto SaveUVariable ret_353: sPrompt = "White Balance Green" sVarName = "wbcg" u_ret = 354 goto SaveUVariable ret_354: sPrompt = "White Balance Blue" sVarName = "wbcb" u_ret = 355 goto SaveUVariable ret_355: sPrompt = "AutoExposure Lock Mode" sVarName = "aelk" u_ret = 356 goto SaveUVariable ret_356: sPrompt = "Video Output Mode" sVarName = "vmod" u_ret = 357 goto SaveUVariable ret_357: sPrompt = "Exposure Method" sVarName = "xmtd" u_ret = 358 goto SaveUVariable ret_358: # DC290 sPrompt = "Image Sharpness Amount" sVarName = "isam" u_ret = 359 goto SaveIVariable ret_359: # DC290 sPrompt = "Image Sharpness Radius" sVarName = "isra" u_ret = 360 goto SaveUVariable ret_360: # DC290 sPrompt = "Image Sharpness Threshold" sVarName = "isth" u_ret = 361 goto SaveUVariable ret_361: sPrompt = "File Type" sVarName = "flty" u_ret = 362 goto SaveUVariable ret_362: # DC290 sPrompt = "Watermark Text Font Size" sVarName = "wsts" u_ret = 363 goto SaveUVariable ret_363: # DC290 sPrompt = "Watermark Time Font Size" sVarName = "wtts" u_ret = 364 goto SaveUVariable ret_364: # DC290 sPropmt = "Remote Shutter" sVarName = "RSHT" u_ret = 365 goto SaveSVariable ret_365: # # Other variables which may be worth saving for the alternate setups: # ssvl - shutter sound volume # (none of the following are usefully supported on DC2x0 or EX1500) # aflk - autofocus lock # bccl - burst capture color mode # sccl - still capture color mode # tccl - timelapse capture color mode # ssnd - shutter sound # end # # finally, in the startup script, allow the user to provide a startup # script which is not altered or destroyed by using this Startup # Defaults script # if s_script == "STARTUP.CSM" DisplayLine("") WriteLine(uFileID,"") WriteLine(uFileID,"status = 0") WriteLine(uFileID,"status = GetScriptName(\"USERSTRT.CSM\",sName)") WriteLine(uFileID,"if status == 0") WriteLine(uFileID," RunScript(\"USERSTRT.CSM\")") WriteLine(uFileID,"end") # the following Wait() is a workaround for a Digita problem which # leaves the LCD display in a weird state if a startup script is run WriteLine(uFileID,"Wait(100)") end WriteLine(uFileID,"exitscript") end FileClose(uFileID) # # We're Done! Tell the user and exit # DisplayLine("A new ",s_type," script has been created.") Wait (2000) exitscript ######################################################################### # # # Check whether a given value is valid for the enumerated variable # # named by sVarName; the value is passed in u_value, which is updated # # on return (1 if supported, 0 if not) # # # ######################################################################### ValidEnumValue: # # verify that the requested variable actually exists and is of the correct # type # status = 0 status = GetCapabilityType(sVarName,uVarType) if status == 0 if uVarType == 1 # # We have a valid enum-list variable, so iterate through its values # until we find the requested value or run out of values # GetCapabilitiesCount(sVarName, uEnumCount, uEnumDefault) if uEnumCount > 0 count = 0 find_enum_loop: GetCapabilitiesListItem(sVarName,count,sEnumDesc,uEnumValue) if uEnumValue == u_value u_value = 1 goto ret_ValidEnumValue end count = count + 1 if count < uEnumCount goto find_enum_loop end #end of loop 'find_enum_loop' end end end # if we get to this point, the variable isn't supported, is not an enum, # or doesn't support the requested value, so indicate that the value is # not valid u_value = 0 ret_ValidEnumValue: # # figure out who called us and return to the appropriate point. # This mess wouldn't be needed if DigitaScript had actual subroutines.... # if u_ret == 100 goto ret_100 end # uh oh, someone added a new call without updating the return code Alert("Program Error: missing return case in AskEnum") Wait(10) exitscript ######################################################################### # # # Ask the user for a new preferred setting for an enumerated value # # This subroutine displays a menu showing the possible values for the # # variable, with a check mark next to the current value for the var # # # ######################################################################### AskEnum: u_current = u_value # # set a default value which will later be used to suppress the writing # of the variable to the startup script # u_value = UNINITIALIZED # # verify that the requested variable actually exists and is of the correct # type # status = 0 status = GetCapabilityType(sVarName,uVarType) if status != 0 # setting not supported on this camera.... goto ret_AskEnum end if uVarType != 1 Alert("Program Error: setting is not an enum") exitscript end # # now that we know that the variable is present and an enumeration, get # the number of values, the default value, and the current value # GetCapabilitiesCount(sVarName, uEnumCount, uEnumDefault) if uEnumCount != 0 if getDefaults != 0 GetCameraState(sVarName,u_value) end if getDefaults == 0 # # We have a valid enum-list variable, so get the user's choice for # default. Start by displaying a menu containing the valid values # DisplayClear() SetOption(u_current,sPrompt,0) count = 0 enum_loop: GetCapabilitiesListItem(sVarName,count,sEnumDesc,uEnumValue) SetOption(uEnumValue,sEnumDesc, uEnumValue == u_current) count = count + 1 if count < uEnumCount goto enum_loop end #end of loop 'enum_loop' # # We've built the menu of choices for the user, so find out what the # user wants # GetOption(u_value) end end ret_AskEnum: # # figure out who called us and return to the appropriate point. # This mess wouldn't be needed if DigitaScript had actual subroutines.... # if u_ret == 201 goto ret_201 end if u_ret == 202 goto ret_202 end if u_ret == 203 goto ret_203 end if u_ret == 205 goto ret_205 end if u_ret == 211 goto ret_211 end if u_ret == 214 goto ret_214 end if u_ret == 221 goto ret_221 end if u_ret == 222 goto ret_222 end if u_ret == 231 goto ret_231 end if u_ret == 233 goto ret_233 end if u_ret == 234 goto ret_234 end # uh oh, someone added a new call without updating the return code Alert("Program Error: missing return case in AskEnum") Wait(10) exitscript ######################################################################### # # # Ask the user for a new value for a integral range variable # # Since there is no GetNumber() function available, we need to tell # # the user what the limits of the range are, then prompt for a string # # input (which we'll eventually write to the new startup script). # # # ######################################################################### AskRange: iCurrent = u_value # # set a default value which will later be used to suppress the writing # of the variable to the startup script # s_value = "" u_value = UNINITIALIZED # # verify that the requested variable actually exists and is of the correct # type # status = 0 status = GetCapabilityType(sVarName,uVarType) if status != 0 # setting not supported on this camera.... goto ret_AskRange end if uVarType != 2 Alert("Program Error: setting is not a range") exitscript end status = 0 status = GetCapabilitiesRange(sVarName,iMin,iMax,iDefault) if status == 0 if getDefaults != 0 GetCameraState(sVarName,iCurrent) u_value = iCurrent goto ret_AskRange end if iMin == iMax u_value = iCurrent goto ret_AskRange end if iCurrent == UNINITIALIZED GetCameraState(sVarName,iCurrent) end # # We have a valid range variable, so get the user's choice for default # loop_AskRange: DisplayClear() DisplayLine(sPrompt) DisplayLine("Valid values are ",iMin," to ",iMax) Wait(1500) DisplayLine("Default is ",iDefault,", currently ",iCurrent) Wait(2500) GetString(sPrompt,6,s_value) if have_Digita1point5 != 0 if s_value == "" u_value = iCurrent Alert("Keeping current value: ",iCurrent) goto ret_AskRange end StringToNumber(s_value,u_value) if u_value < iMin Alert(iMin," is the lowest allowed value. Please re-enter.") goto loop_AskRange end if u_value > iMax Alert(iMax," is the highest allowed value. Please re-enter.") goto loop_AskRange end # we've successfully converted the string into a number, so discard # the string s_value = "" end end ret_AskRange: # figure out who called us and return to the appropriate point if u_ret == 204 goto ret_204 end if u_ret == 206 goto ret_206 end if u_ret == 212 goto ret_212 end if u_ret == 213 goto ret_213 end if u_ret == 232 goto ret_232 end if u_ret == 235 goto ret_235 end # uh oh, someone added a new call without updating the return code Alert("Program Error: missing return case in AskRange") Wait(10) exitscript ######################################################################### # # # Write a numeric setting (which has been input and stored as a string # # due to the limitations of DigitaScript) to the new setup script. # # # ######################################################################### WriteSettingI: if s_value != "" WriteLine(uFileID,"# set the ",sPrompt) WriteLine(uFileID,"SetCameraState(\"",sVarName,"\", ",s_value,")") goto ret_WriteSetting end # if no string available, fall through to WriteSettingU and try to write # the integer version of the variable ######################################################################### # # # Write an enumerated or numeric setting (stored as a number) to the # # new setup script. # # # ######################################################################### WriteSettingU: if u_value != UNINITIALIZED WriteLine(uFileID,"# set the ",sPrompt) WriteLine(uFileID,"SetCameraState(\"",sVarName,"\", ", u_value,")") end ret_WriteSetting: # figure out who called us and return to the appropriate point if u_ret == 300 goto ret_300 end if u_ret == 301 goto ret_301 end if u_ret == 302 goto ret_302 end if u_ret == 303 goto ret_303 end if u_ret == 304 goto ret_304 end if u_ret == 305 goto ret_305 end if u_ret == 306 goto ret_306 end if u_ret == 307 goto ret_307 end if u_ret == 308 goto ret_308 end if u_ret == 309 goto ret_309 end if u_ret == 310 goto ret_310 end if u_ret == 311 goto ret_311 end if u_ret == 314 goto ret_314 end if u_ret == 315 goto ret_315 end if u_ret == 316 goto ret_316 end if u_ret == 317 goto ret_317 end # uh oh, someone added a new call without updating the return code Alert("Program Error: missing return case in WriteSetting") Wait(10) exitscript ######################################################################### ######################################################################### SaveSVariable: # # start by checking whether the variable is supported on this camera # status = 0 status = GetCapabilityType(sVarName,uVarType) if status == 0 status = 0 status = GetCameraState(sVarName,s_current) if status == 0 WriteLine(uFileID,"# set the ",sPrompt) WriteLine(uFileID,"SetCameraState(\"",sVarName,"\", \"",s_current,"\")") end end goto ret_SaveVariable ######################################################################### ######################################################################### SaveIVariable: # # start by checking whether the variable is supported on this camera # status = 0 status = GetCapabilityType(sVarName,uVarType) if status == 0 status = 0 status = GetCameraState(sVarName,iCurrent) if status == 0 WriteLine(uFileID,"# set the ",sPrompt) WriteLine(uFileID,"SetCameraState(\"",sVarName,"\", ",iCurrent,")") end end goto ret_SaveVariable ######################################################################### ######################################################################### SaveUVariable: # # start by checking whether the variable is supported on this camera # status = 0 status = GetCapabilityType(sVarName,uVarType) if status == 0 status = 0 status = GetCameraState(sVarName,u_current) if status == 0 WriteLine(uFileID,"# set the ",sPrompt) WriteLine(uFileID,"SetCameraState(\"",sVarName,"\", ",u_current,")") end end ret_SaveVariable: # figure out who called us and return to the appropriate point if u_ret == 312 goto ret_312 end if u_ret == 313 goto ret_313 end if u_ret == 321 goto ret_321 end if u_ret == 322 goto ret_322 end if u_ret == 323 goto ret_323 end if u_ret == 324 goto ret_324 end if u_ret == 325 goto ret_325 end if u_ret == 326 goto ret_326 end if u_ret == 327 goto ret_327 end if u_ret == 328 goto ret_328 end if u_ret == 329 goto ret_329 end if u_ret == 330 goto ret_330 end if u_ret == 331 goto ret_331 end if u_ret == 332 goto ret_332 end if u_ret == 333 goto ret_333 end if u_ret == 334 goto ret_334 end if u_ret == 335 goto ret_335 end if u_ret == 336 goto ret_336 end if u_ret == 337 goto ret_337 end if u_ret == 338 goto ret_338 end if u_ret == 339 goto ret_339 end if u_ret == 340 goto ret_340 end if u_ret == 341 goto ret_341 end if u_ret == 342 goto ret_342 end if u_ret == 343 goto ret_343 end if u_ret == 344 goto ret_344 end if u_ret == 345 goto ret_345 end if u_ret == 346 goto ret_346 end if u_ret == 346 goto ret_346 end if u_ret == 347 goto ret_347 end if u_ret == 348 goto ret_348 end if u_ret == 349 goto ret_349 end if u_ret == 350 goto ret_350 end if u_ret == 351 goto ret_351 end if u_ret == 352 goto ret_352 end if u_ret == 353 goto ret_353 end if u_ret == 354 goto ret_354 end if u_ret == 355 goto ret_355 end if u_ret == 356 goto ret_356 end if u_ret == 357 goto ret_357 end if u_ret == 358 goto ret_358 end if u_ret == 359 goto ret_359 end if u_ret == 360 goto ret_360 end if u_ret == 361 goto ret_361 end if u_ret == 362 goto ret_362 end if u_ret == 363 goto ret_363 end if u_ret == 364 goto ret_364 end if u_ret == 365 goto ret_365 end # uh oh, someone added a new call without updating the return code Alert("Program Error: missing return case in SaveVariable") Wait(10) exitscript ######################################################################### # End of File # #########################################################################