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