Read the settings from the registry
| 72 | |
| 73 | // Read the settings from the registry |
| 74 | void Wireless360Controller::readSettings(void) |
| 75 | { |
| 76 | OSBoolean *value; |
| 77 | OSNumber *number; |
| 78 | OSDictionary *dataDictionary = OSDynamicCast(OSDictionary, getProperty(kDriverSettingKey)); |
| 79 | |
| 80 | if(dataDictionary==NULL) return; |
| 81 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertLeftX")); |
| 82 | if (value != NULL) invertLeftX = value->getValue(); |
| 83 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertLeftY")); |
| 84 | if (value != NULL) invertLeftY = value->getValue(); |
| 85 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertRightX")); |
| 86 | if (value != NULL) invertRightX = value->getValue(); |
| 87 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("InvertRightY")); |
| 88 | if (value != NULL) invertRightY = value->getValue(); |
| 89 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("DeadzoneLeft")); |
| 90 | if (number != NULL) deadzoneLeft = number->unsigned32BitValue(); |
| 91 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("DeadzoneRight")); |
| 92 | if (number != NULL) deadzoneRight = number->unsigned32BitValue(); |
| 93 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("RelativeLeft")); |
| 94 | if (value != NULL) relativeLeft = value->getValue(); |
| 95 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("RelativeRight")); |
| 96 | if (value != NULL) relativeRight=value->getValue(); |
| 97 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("DeadOffLeft")); |
| 98 | if (value != NULL) deadOffLeft = value->getValue(); |
| 99 | value = OSDynamicCast(OSBoolean, dataDictionary->getObject("DeadOffRight")); |
| 100 | if (value != NULL) deadOffRight = value->getValue(); |
| 101 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("RumbleType")); |
| 102 | if (number != NULL) rumbleType = number->unsigned8BitValue(); |
| 103 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingUp")); |
| 104 | if (number != NULL) mapping[0] = number->unsigned32BitValue(); |
| 105 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingDown")); |
| 106 | if (number != NULL) mapping[1] = number->unsigned32BitValue(); |
| 107 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLeft")); |
| 108 | if (number != NULL) mapping[2] = number->unsigned32BitValue(); |
| 109 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRight")); |
| 110 | if (number != NULL) mapping[3] = number->unsigned32BitValue(); |
| 111 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingStart")); |
| 112 | if (number != NULL) mapping[4] = number->unsigned32BitValue(); |
| 113 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingBack")); |
| 114 | if (number != NULL) mapping[5] = number->unsigned32BitValue(); |
| 115 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLSC")); |
| 116 | if (number != NULL) mapping[6] = number->unsigned32BitValue(); |
| 117 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRSC")); |
| 118 | if (number != NULL) mapping[7] = number->unsigned32BitValue(); |
| 119 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingLB")); |
| 120 | if (number != NULL) mapping[8] = number->unsigned32BitValue(); |
| 121 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingRB")); |
| 122 | if (number != NULL) mapping[9] = number->unsigned32BitValue(); |
| 123 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingGuide")); |
| 124 | if (number != NULL) mapping[10] = number->unsigned32BitValue(); |
| 125 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingA")); |
| 126 | if (number != NULL) mapping[11] = number->unsigned32BitValue(); |
| 127 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingB")); |
| 128 | if (number != NULL) mapping[12] = number->unsigned32BitValue(); |
| 129 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingX")); |
| 130 | if (number != NULL) mapping[13] = number->unsigned32BitValue(); |
| 131 | number = OSDynamicCast(OSNumber, dataDictionary->getObject("BindingY")); |
nothing calls this directly
no outgoing calls
no test coverage detected