📄 cdevent.bas
字号:
Attribute VB_Name = "Module4"
Option Explicit
'/****************************************************************************
' ****************************************************************************
' * Canon Digital Camera SDK : Event IDs *
' ****************************************************************************
' ****************************************************************************/
'/*---------------------------------------------------------------------------
' Camera Event Identifiers : cdEventID
'----------------------------------------------------------------------------*/
'/*////////// Event Code Masks ////////////////////////////////////////////*/
Public Const cdEVENT_ISSPECIFIC_MASK = 134217728 '= &H8000000
Public Const cdEVENT_RESERVED_MASK = 133169152 '= &H7F00000
Public Const cdEVENT_SEVERITY_MASK = 983040 '=&HF0000
Public Const cdEVENT_EVENTID_MASK = 65535 '= &HFFFF
'/*////////// Event Severity levels ////////////////////////////////////////*/
Public Const cdEVENT_SEVERITY_NONE = &H0
' /* nothing bad happened: this notification is just informational
' */
Public Const cdEVENT_SEVERITY_WARNING = &H20000
' /* The camera is going to shut down, or some warning event happened.
' More detail information is given in the event code.
' If client does not know the event code, it should close device
' immediatly.
' */
Public Const cdEVENT_SEVERITY_SHUTDOWN = &H40000
' /* the camera has shut down. The Event ID tells the reason of the shut
' down.
' */
'/*////////// Event Identifiers ///////////////////////////////////////////*/
Public Const cdEVENT_BATTERY_LEVEL_CHANGED = &H1
' /* event data tells current battery level
' */
Public Const BATTERY_LEVEL_MASK = &HF
Public Const BATTERY_LEVEL_NORMAL = &H6
Public Const BATTERY_LEVEL_WEAK = &H4
Public Const BATTERY_LEVEL_SAFETY_LOW = &H3
Public Const BATTERY_LEVEL_LB = &H2
Public Const BATTERY_STATUS_NORMAL = &H6
Public Const BATTERY_STATUS_WEAK = &H4
Public Const BATTERY_STATUS_SAFETY_LOW = &H3
Public Const BATTERY_KIND_MASK = &HF0000000
Public Const BATTERY_KIND_UNKNOWN = &H0
Public Const BATTERY_KIND_AC = &H10000000
Public Const BATTERY_KIND_LI = &H20000000
Public Const BATTERY_KIND_NIH = &H30000000
Public Const BATTERY_KIND_NICD = &H40000000
Public Const BATTERY_KIND_ALMN = &H50000000
' /* Combining this with cdEVENT_SEVERITY_NONE indicates the notification is
' just for information, no action is required.
' Combining this with cdEVENT_SEVERITY_WARNING indicates that user should
' close device immediately.
' Combining this with cdEVENT_SEVERITY_SHUTDOWN indicates that device has
' shut down because of Low Battery
' */
Public Const cdEVENT_DIAL_CHANGE = &H2
Public Const cdEVENT_CF_GATE_CHANGED = &H3
' /* event data tells whether gate opened */
Public Const cdEVENT_PARAM_CF_GATE_OPEN = &H0
' /*Public Const cdEVENT_PARAM_CF_GATE_CLOSE = &H00000001*/
Public Const cdEVENT_BATT_COVER_CHANGED = &H4
' /* event data tells whether cover opened */
Public Const cdEVENT_PARAM_BATT_COVER_OPEN = &H0
' /*Public Const cdEVENT_PARAM_BATT_COVER_CLOSE = &H00000001*/
Public Const cdEVENT_CONNECTION_TIME_OUT = &H5
' /* Combining this with cdEVENT_SEVERITY_SHUTDOWN tells that the camera has
' already shut down because of the time out.
' Combining this with cdEVENT_SEVERITY_WARNING tells that the camera is
' going to shut down.
' The event data tells how long (in minutes) camera would remain waking up.
' */
Public Const cdEVENT_CONNECTION_DISAPPEARED = &HD
' /* USB/IEEE1394 connection is disappeared
' */
Public Const cdEVENT_UPDATE_CAMERA_CONDITIONS = &HE
' /* Update Camera conditions event
' */
Public Const cdEVENT_PARAM_FILE_CREATED = &H1
Public Const cdEVENT_PARAM_FILE_REMOVED = &H2
Public Const cdEVENT_PARAM_FILE_ATTRIBUTE_CHANGED = &H4
Public Const cdEVENT_PARAM_FORMATED = &H100
'/* PTP Camera event's flag*/
Public Const cdEVENT_PARAM_PTP = &H10000
Public Const cdEVENT_CHANGE_LOCK_STATUS = &HF
' /* Used as parameter
' */
Public Const cdEVENT_PARAM_DISPLAY_PLAY_OR_NENU = &H1000000
Public Const cdEVENT_PARAM_PROCESSING_REC_OR_PREPARE_REC = &H2000000
' /* used as lower 3Byte for parameter
' */
Public Const cdEVENT_PARAM_LOCK_TYPE1 = &H1
Public Const cdEVENT_PARAM_LOCK_TYPE2 = &H2
Public Const cdEVENT_PARAM_LOCK_TYPE3 = &H4
Public Const cdEVENT_PARAM_LOCK_TYPE4 = &H8
Public Const cdEVENT_PARAM_LOCK_TYPE5 = &H10
Public Const cdEVENT_PARAM_LOCK_TYPE6 = &H20
Public Const cdEVENT_UNRECOVERABLE_ERROR = &H6
Public Const cdEVENT_UNKNOWN_COMMAND_RECEIVED = &H7
Public Const cdEVENT_RELEASE_PARAM_CHANGED = &HB
'/*---------------------------------------------------------------------------
' Release control Event Identifiers : cdReleaseEventID
'----------------------------------------------------------------------------*/
Public Const cdRELEASE_EVENT_RESET_HW_ERROR = 10
' /* Notify hardware error.
' The second parameter of this event specifies the kind of error as
' follows.
' */
Public Const HW_ERROR_PARAM_CAPTURE_FAULT = &H1 '/* Capture faild */
Public Const HW_ERROR_PARAM_LENSE_CLOSE = &H2 '/* Lens closed */
Public Const HW_ERROR_PARAM_CAPTURE_MODE_DEPTH = &H3 '/* DEPTH mode */
Public Const HW_ERROR_PARAM_SENSOR_CLEANING = &H4 '/* Cleaning */
Public Const HW_ERROR_PARAM_SILENT_OPERATION = &H5 '/* PF21 */
Public Const cdRELEASE_EVENT_CHANGED_BY_UI = 27
' /* Notify the capture parameter in the camera is changed by user
' operation to camera UI.
' The Host PC must get new capture parameter from the camera by
' using RELEASE_CONTROL_GET_RELEASE_PARAMS command when this
' notification received.
' */
Public Const cdRELEASE_EVENT_RELEASE_START = 28
' /* Notify the camera starts the capture operation with asynchronous mode.
' */
Public Const cdRESEASE_EVENT_RELEASE_COMPLETE = 29
' /* Notify the camera stop the capture operation with asynchronous mode.
' The second parameter of this event specifies the number of released image data.
' Data type is cdUInt32.
' SDK client have to execute CDGetReleasedData() this number of the times.
' */
Public Const cdRELEASE_EVENT_CAM_RELEASE_ON = 30
' /* Notify the release SW is pushed on the camera by User.
' Currently this notification is supported by new Powershot only.
' When this notification is happened, the camera does not start
' the captre.
' To capture the image, the host PC must execute the sequence to
' capture the image same as PC release operation nomaly.
' (Do CDRelease() command.)
' */
Public Const cdRELEASE_EVENT_ROTATION_ANGLE_CHANGED = 31
' /* Notify the rotation angle detected by auto rotation sensor has changed.
' The second parameter of this event shows the angle.
' 0: 0 or 180 degree
' 1: 90 degrees
' 3: 270 degrees
' */
Public Const cdRELEASE_EVENT_ABORT_PC_EVF = 32
' /* Notify the viewfinder function became the use cancel.
' */
Public Const cdRELEASE_EVENT_ENABLE_PC_EVF = 33
' /* Notify the view finder function became applicable.
' */
'/*////////// Macros //////////////////////////////////////////////////////*/
Public Function cdEVENT_ISSPECIFIC(eventID As Long) As Long
cdEVENT_ISSPECIFIC = eventID And cdEVENT_ISSPECIFIC_MASK
End Function
Public Function cdEVENT_SEVERITY(eventID As Long) As Long
cdEVENT_SEVERITY = eventID And cdEVENT_SEVERITY_MASK
End Function
Public Function cdEVENT_RESERVEDID(eventID As Long) As Long
cdEVENT_RESERVEDID = eventID And cdEVENT_RESERVED_MASK
End Function
Public Function cdEVENT_EVENTID(eventID As Long) As Long
cdEVENT_EVENTID = eventID And cdEVENT_EVENTID_MASK
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -