aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorLars Op den Kamp <lars@opdenkamp.eu>2011-08-29 15:04:49 +0200
committerLars Op den Kamp <lars@opdenkamp.eu>2011-09-30 00:37:53 +0200
commit034236bf690119b2a82be1133ff328bccbdc4411 (patch)
tree73591daaadc6539cee5c71bab0325485096e79ec /system
parent714ad40da8b2ead338aa8e57ef6a5b6802d8a2df (diff)
Squashed original peripherals PR #383
This is a PR for a new "peripherals manager", /xbmc/peripherals, that detects devices and automatically configures them for use with XBMC. The device mappings and configurations can be defined in system/peripherals.xml. Users can modify settings via system->system->input->peripherals. It works as follows: - CPeripherals contains one or more CPeripheralBus instances. - CPeripheralBus contains the device scanning implementations for the different platforms we support. - The implementations for the devices can be found in peripheral/devices and all devices inherit from CPeripheral. - The devices that are detected are looked up in peripherals.xml, starting at the top of the file and going down. If no mapping was found for the device, an instance of one of the default classes will be created: CPeripheralHID, CPeripheralDisk or CPeripheralNIC. - in peripherals.xml, devices can be matched by vendor id (vendor="xxxx"), product id (product="xxxx"), bus type (bus="xxxx"), device class (class="xxxx") or a combination of these values. The class that will be instantiated for that device is defined in mapTo="xxxx" - the configuration for the device can be defined in peripherals.xml as well. Have a look at system/peripherals.xml, where you can find the possible settings in the demo entry at the bottom. When a device is inserted and there are any settings with configurable="true" present for that device, these settings will be added to the settings dialog, under system->system->input->peripherals. - an example of how these settings can be used can be found in CPeripheralHID, which checks for a "keymap" setting and will automatically switch the keymap XBMC uses to the one that is defined in the setting. TODO: - keep separate configs when the same device is found more than once - general review of this code.
Diffstat (limited to 'system')
-rw-r--r--system/deviceidmappings.xml3
-rw-r--r--system/peripherals.xml30
2 files changed, 30 insertions, 3 deletions
diff --git a/system/deviceidmappings.xml b/system/deviceidmappings.xml
deleted file mode 100644
index 7114170a6d..0000000000
--- a/system/deviceidmappings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<devicemappings>
- <device id="HID#VID_1915&PID_003B&MI_00#7&314e95d&0&0000#" keymap="Motorola Nyxboard Hybrid" />
-</devicemappings> \ No newline at end of file
diff --git a/system/peripherals.xml b/system/peripherals.xml
new file mode 100644
index 0000000000..d410f433c7
--- /dev/null
+++ b/system/peripherals.xml
@@ -0,0 +1,30 @@
+<peripherals>
+ <peripheral vendor="1915" product="003B" bus="usb" name="Motorola Nyxboard Hybrid" mapTo="nyxboard">
+ <setting key="keymap_enabled" type="bool" value="1" label="35008" configurable="0" />
+ <setting key="keymap" value="Motorola Nyxboard Hybrid" label="35007" configurable="0" />
+ <setting key="enable_flip_commands" type="bool" value="1" label="36005" />
+ <setting key="flip_keyboard" value="XBMC.VideoLibrary.Search" label="36002" />
+ <setting key="flip_remote" value="Dialog.Close(virtualkeyboard)" label="36003" />
+ <setting key="key_user" value="" label="36004" />
+ </peripheral>
+ <peripheral vendor="22B8" product="003B" bus="usb" name="Motorola Nyxboard Hybrid" mapTo="nyxboard">
+ <setting key="keymap_enabled" type="bool" value="1" label="35008" configurable="0" />
+ <setting key="keymap" value="Motorola Nyxboard Hybrid" label="35007" configurable="0" />
+ <setting key="enable_flip_commands" type="bool" value="1" label="36005" />
+ <setting key="flip_keyboard" value="XBMC.VideoLibrary.Search" label="36002" />
+ <setting key="flip_remote" value="Dialog.Close(virtualkeyboard)" label="36003" />
+ <setting key="key_user" value="" label="36004" />
+ </peripheral>
+
+ <peripheral class="hid" name="Generic HID device" mapTo="hid">
+ <setting key="keymap_enabled" type="bool" value="0" label="35008" />
+ <setting key="keymap" value="" label="35007" />
+ </peripheral>
+
+ <peripheral vendor="1234" product="5678" bus="usb" name="Demo Device" mapTo="hid">
+ <setting key="demo1" type="int" label="1" value="50" min="0" max="100" step="5" />
+ <setting key="demo2" type="float" label="2" value="13.37" min="0" max="100" step="0.50" />
+ <setting key="demo3" type="string" label="3" value="demoOrigValue" />
+ <setting key="demo4" type="bool" label="4" value="1" />
+ </peripheral>
+</peripherals>