Wikia

CHDK Wiki

Srsa 4c/UI properties

Talk0
575pages on
this wiki

< User:Srsa 4c


UI properties are special variables used by the firmware. They keep the state of the camera's various user interface elements. Not all UI elements have properties (examples of these: zoom, focus, Av, Tv values).

Some UI elements with property:

  • the camera sound "mute" master switch in the Canon menu
  • operation mode of the flash (no flash, auto, ...)
  • drive mode (single, continuous, ...)
  • image size (L, M, S, ...)
  • JPEG compression quality (normal, fine, superfine)
  • ISO (auto, ..., 100, 200, ...)
  • exposure compensation
  • flash exposure compensation
  • selected "my colors" effect

UI properties, which are enabled in the currently selected shooting mode (or even playback mode), can be set directly to their allowed values. This method can be useful in scripts which currently use simulated keypresses to browse the camera menus. However, not all camera settings are accessible this way (as noted above).

The number of these properties varies (~60...140...), newer models usually have more of them. Cameras from the same generation don't necessarily have the same UI property count (this may depend on the number of features supported by the camera / firmware).
All UI properties are 16 bit integers. The identifier (ID) of the UI properties is an integer starting with 0x8000 (exception: ixus30_sd200 and ixus40_sd300 where the IDs start at 0). The identifiers are camera model or camera generation dependent (further research is needed).

The Canon firmware has a number of event procedures that deal with these properties. They are (the list is not complete):

  • PTM_GetCurrentItem (ID)

Returns the current value of the selected property.

  • PTM_SetCurrentItem (ID, value)

Sets the property to the given value. The property has to be available in the currently active shooting mode, otherwise the eventproc returns with 'failure' (0xd return value). In a few cases, properties which are not accessible from the camera UI, are allowed to be set (for example, flash exposure compensation on some models which don't support the feature). Setting properties to unsupported values may result in an assert.
Setting a property to a supported value has immediate effect, screen icons also indicate the change (except when the shooting menu is open).

  • PTM_IsEnableItem (ID)

(TODO)

  • PTM_NextItem (ID)

Sets the property to the next possible value, wraps around.

  • PTM_PrevItem (ID)

Sets the property to the previous possible value, wraps around.

  • PTM_SetProprietyEnable (ID, state)

Enables (state=1) or disables (state=0) the selected property. Properties which are normally disabled won't necessarily become usable when enabled. Early cameras don't have this eventproc. (TODO)

All above listed event procedures cause an assert when unavailable IDs are used. They are registered with

  • UI_RegistDebugEventProc on old VxWorks cameras
  • UI.CreatePublic on newer models


Discussion thread in the forum

Around Wikia's network

Random Wiki