Use the new enum syntax in devices as well

This commit is contained in:
Michal Moskal 2016-04-01 14:18:11 -07:00
parent 7c564ebaab
commit d54baaca51

View File

@ -1,118 +1,118 @@
enum MesCameraEvent {
//% enumval=MES_CAMERA_EVT_TAKE_PHOTO block="take photo"
TakePhoto,
//% enumval=MES_CAMERA_EVT_START_VIDEO_CAPTURE block="start video capture"
StartVideoCapture,
//% enumval=MES_CAMERA_EVT_STOP_VIDEO_CAPTURE block="stop video capture"
StopVideoCapture,
//% enumval=MES_CAMERA_EVT_TOGGLE_FRONT_REAR block="toggle front-rear"
ToggleFrontRear,
//% enumval=MES_CAMERA_EVT_LAUNCH_PHOTO_MODE block="launch photo mode"
LaunchPhotoMode,
//% enumval=MES_CAMERA_EVT_LAUNCH_VIDEO_MODE block="launch video mode"
LaunchVideoMode,
//% enumval=MES_CAMERA_EVT_STOP_PHOTO_MODE block="stop photo mode"
StopPhotoMode,
//% enumval=MES_CAMERA_EVT_STOP_VIDEO_MODE block="stop video mode"
StopVideoMode,
//% block="take photo"
TakePhoto = DAL.MES_CAMERA_EVT_TAKE_PHOTO as number,
//% block="start video capture"
StartVideoCapture = DAL.MES_CAMERA_EVT_START_VIDEO_CAPTURE as number,
//% block="stop video capture"
StopVideoCapture = DAL.MES_CAMERA_EVT_STOP_VIDEO_CAPTURE as number,
//% block="toggle front-rear"
ToggleFrontRear = DAL.MES_CAMERA_EVT_TOGGLE_FRONT_REAR as number,
//% block="launch photo mode"
LaunchPhotoMode = DAL.MES_CAMERA_EVT_LAUNCH_PHOTO_MODE as number,
//% block="launch video mode"
LaunchVideoMode = DAL.MES_CAMERA_EVT_LAUNCH_VIDEO_MODE as number,
//% block="stop photo mode"
StopPhotoMode = DAL.MES_CAMERA_EVT_STOP_PHOTO_MODE as number,
//% block="stop video mode"
StopVideoMode = DAL.MES_CAMERA_EVT_STOP_VIDEO_MODE as number,
}
enum MesAlertEvent {
//% enumval=MES_ALERT_EVT_DISPLAY_TOAST block="display toast"
DisplayToast,
//% enumval=MES_ALERT_EVT_VIBRATE block="vibrate"
Vibrate,
//% enumval=MES_ALERT_EVT_PLAY_SOUND block="play sound"
PlaySound,
//% enumval=MES_ALERT_EVT_PLAY_RINGTONE block="play ring tone"
PlayRingtone,
//% enumval=MES_ALERT_EVT_FIND_MY_PHONE block="find my phone"
FindMyPhone,
//% enumval=MES_ALERT_EVT_ALARM1 block="ring alarm"
RingAlarm,
//% enumval=MES_ALERT_EVT_ALARM2 block="ring alarm 2"
RingAlarm2,
//% enumval=MES_ALERT_EVT_ALARM3 block="ring alarm 3"
RingAlarm3,
//% enumval=MES_ALERT_EVT_ALARM4 block="ring alarm 4"
RingAlarm4,
//% enumval=MES_ALERT_EVT_ALARM5 block="ring alarm 5"
RingAlarm5,
//% enumval=MES_ALERT_EVT_ALARM6 block="ring alarm 6"
RingAlarm6,
//% block="display toast"
DisplayToast = DAL.MES_ALERT_EVT_DISPLAY_TOAST as number,
//% block="vibrate"
Vibrate = DAL.MES_ALERT_EVT_VIBRATE as number,
//% block="play sound"
PlaySound = DAL.MES_ALERT_EVT_PLAY_SOUND as number,
//% block="play ring tone"
PlayRingtone = DAL.MES_ALERT_EVT_PLAY_RINGTONE as number,
//% block="find my phone"
FindMyPhone = DAL.MES_ALERT_EVT_FIND_MY_PHONE as number,
//% block="ring alarm"
RingAlarm = DAL.MES_ALERT_EVT_ALARM1 as number,
//% block="ring alarm 2"
RingAlarm2 = DAL.MES_ALERT_EVT_ALARM2 as number,
//% block="ring alarm 3"
RingAlarm3 = DAL.MES_ALERT_EVT_ALARM3 as number,
//% block="ring alarm 4"
RingAlarm4 = DAL.MES_ALERT_EVT_ALARM4 as number,
//% block="ring alarm 5"
RingAlarm5 = DAL.MES_ALERT_EVT_ALARM5 as number,
//% block="ring alarm 6"
RingAlarm6 = DAL.MES_ALERT_EVT_ALARM6 as number,
}
enum MesDeviceInfo {
//% enumval=MES_DEVICE_INCOMING_CALL block="incoming call"
IncomingCall,
//% enumval=MES_DEVICE_INCOMING_MESSAGE block="incoming message"
IncomingMessage,
//% enumval=MES_DEVICE_ORIENTATION_LANDSCAPE block="orientation landscape"
OrientationLandscape,
//% enumval=MES_DEVICE_ORIENTATION_PORTRAIT block="orientation portrait"
OrientationPortrait,
//% enumval=MES_DEVICE_GESTURE_DEVICE_SHAKEN block="shaken"
Shaken,
//% enumval=MES_DEVICE_DISPLAY_OFF block="display off"
DisplayOff,
//% enumval=MES_DEVICE_DISPLAY_ON block="display on"
DisplayOn,
//% block="incoming call"
IncomingCall = DAL.MES_DEVICE_INCOMING_CALL as number,
//% block="incoming message"
IncomingMessage = DAL.MES_DEVICE_INCOMING_MESSAGE as number,
//% block="orientation landscape"
OrientationLandscape = DAL.MES_DEVICE_ORIENTATION_LANDSCAPE as number,
//% block="orientation portrait"
OrientationPortrait = DAL.MES_DEVICE_ORIENTATION_PORTRAIT as number,
//% block="shaken"
Shaken = DAL.MES_DEVICE_GESTURE_DEVICE_SHAKEN as number,
//% block="display off"
DisplayOff = DAL.MES_DEVICE_DISPLAY_OFF as number,
//% block="display on"
DisplayOn = DAL.MES_DEVICE_DISPLAY_ON as number,
}
enum MesRemoteControlEvent {
//% enumval=MES_REMOTE_CONTROL_EVT_PLAY block="play"
play,
//% enumval=MES_REMOTE_CONTROL_EVT_PAUSE block="pause"
pause,
//% enumval=MES_REMOTE_CONTROL_EVT_STOP block="stop"
stop,
//% enumval=MES_REMOTE_CONTROL_EVT_NEXTTRACK block="next track"
nextTrack,
//% enumval=MES_REMOTE_CONTROL_EVT_PREVTRACK block="previous track"
previousTrack,
//% enumval=MES_REMOTE_CONTROL_EVT_FORWARD block="forward"
forward,
//% enumval=MES_REMOTE_CONTROL_EVT_REWIND block="rewind"
rewind,
//% enumval=MES_REMOTE_CONTROL_EVT_VOLUMEUP block="volume up"
volumeUp,
//% enumval=MES_REMOTE_CONTROL_EVT_VOLUMEDOWN block="volume down"
volumeDown,
//% block="play"
play = DAL.MES_REMOTE_CONTROL_EVT_PLAY as number,
//% block="pause"
pause = DAL.MES_REMOTE_CONTROL_EVT_PAUSE as number,
//% block="stop"
stop = DAL.MES_REMOTE_CONTROL_EVT_STOP as number,
//% block="next track"
nextTrack = DAL.MES_REMOTE_CONTROL_EVT_NEXTTRACK as number,
//% block="previous track"
previousTrack = DAL.MES_REMOTE_CONTROL_EVT_PREVTRACK as number,
//% block="forward"
forward = DAL.MES_REMOTE_CONTROL_EVT_FORWARD as number,
//% block="rewind"
rewind = DAL.MES_REMOTE_CONTROL_EVT_REWIND as number,
//% block="volume up"
volumeUp = DAL.MES_REMOTE_CONTROL_EVT_VOLUMEUP as number,
//% block="volume down"
volumeDown = DAL.MES_REMOTE_CONTROL_EVT_VOLUMEDOWN as number,
}
enum MesDpadButtonInfo {
//% enumval=MES_DPAD_BUTTON_A_DOWN block="A down"
ADown,
//% enumval=MES_DPAD_BUTTON_A_UP block="A up"
AUp,
//% enumval=MES_DPAD_BUTTON_B_DOWN block="B down"
BDown,
//% enumval=MES_DPAD_BUTTON_B_UP block="B up"
BUp,
//% enumval=MES_DPAD_BUTTON_C_DOWN block="C down"
CDown,
//% enumval=MES_DPAD_BUTTON_C_UP block="C up"
CUp,
//% enumval=MES_DPAD_BUTTON_D_DOWN block="D down"
DDown,
//% enumval=MES_DPAD_BUTTON_D_UP block="D up"
DUp,
//% enumval=MES_DPAD_BUTTON_1_UP block="1 down"
_1Down,
//% enumval=MES_DPAD_BUTTON_1_DOWN block="1 up"
_1Up,
//% enumval=MES_DPAD_BUTTON_2_DOWN block="2 down"
_2Down,
//% enumval=MES_DPAD_BUTTON_2_UP block="2 up"
_2Up,
//% enumval=MES_DPAD_BUTTON_3_DOWN block="3 down"
_3Down,
//% enumval=MES_DPAD_BUTTON_3_UP block="3 up"
_3Up,
//% enumval=MES_DPAD_BUTTON_4_DOWN block="4 down"
_4Down,
//% enumval=MES_DPAD_BUTTON_4_UP block="4 up"
_4Up,
//% block="A down"
ADown = DAL.MES_DPAD_BUTTON_A_DOWN as number,
//% block="A up"
AUp = DAL.MES_DPAD_BUTTON_A_UP as number,
//% block="B down"
BDown = DAL.MES_DPAD_BUTTON_B_DOWN as number,
//% block="B up"
BUp = DAL.MES_DPAD_BUTTON_B_UP as number,
//% block="C down"
CDown = DAL.MES_DPAD_BUTTON_C_DOWN as number,
//% block="C up"
CUp = DAL.MES_DPAD_BUTTON_C_UP as number,
//% block="D down"
DDown = DAL.MES_DPAD_BUTTON_D_DOWN as number,
//% block="D up"
DUp = DAL.MES_DPAD_BUTTON_D_UP as number,
//% block="1 down"
_1Down = DAL.MES_DPAD_BUTTON_1_UP as number,
//% block="1 up"
_1Up = DAL.MES_DPAD_BUTTON_1_DOWN as number,
//% block="2 down"
_2Down = DAL.MES_DPAD_BUTTON_2_DOWN as number,
//% block="2 up"
_2Up = DAL.MES_DPAD_BUTTON_2_UP as number,
//% block="3 down"
_3Down = DAL.MES_DPAD_BUTTON_3_DOWN as number,
//% block="3 up"
_3Up = DAL.MES_DPAD_BUTTON_3_UP as number,
//% block="4 down"
_4Down = DAL.MES_DPAD_BUTTON_4_DOWN as number,
//% block="4 up"
_4Up = DAL.MES_DPAD_BUTTON_4_UP as number,
}
//% color=156 weight=80