Controlling MythTV with an n900 accelerometer from Ben Martin on Vimeo.
The normal functions from the older qedje remote are also available on the main page shown in the video below. I have now put the cursor keys into a submenu which is opened by both the joystick and menu buttons, the latter first getting mythtv to open the menu and then changing the remote configuration to show the cursor key submenu. This explains the vacant positions in the grid in the new design -- submenu shuffle has given me a few extra spots to play with. Also the settings can be set in the program itself now instead of the old edit the launcher file and set environment variables. I would like to make the volume adjustment use a popup slider and also route the hardware vol +/- keys to mythtv, but I'm still working out how to do the later.
Clawmotia QML: The Qt MythTV remote control from Ben Martin on Vimeo.
Interestingly, the big "oh no" moments came when I tried to do trivial things from QML such as reading a file (the accelerometer in /sys). I would have thought that QFile was available but it seems not. Perhaps it is from dedicated javascript files or I'm just doing it wrong^TM. I also notice that the simulator doesn't update that /sys file so you have to test that on the device :/
I also bumped into other things like hooking up signals bidirectionally which would need pass by reference or similar to make it useful in custom QML elements. I might also make some data bound classes to use with QSettings, it seems like an idea for a QString like class to update the QSettings automatically when you assign new data to it.
I also tinkered in Nokias SDK environment for this but reverted to emacs and js-mode because there are just too many things my hands are used to happening that don't in the SDK editor. Though for QML stuff I suspect I need to update my elisp to have better "add property" support so the get/set/signal/member declarations are all added from a "QString foo" input. I have part of that done but need to revisit it.
2 comments:
The simulator only simulates accelerometer data that is read by QtMobility, and using QtMobility also has the advantage of making your app more portable, as you do not have to special-case the path of the accelerometer.
The accelerometer support is in QtMobility's sensor module.
I'll have to look more at QtMobility. Thanks for the heads up. If anyone has a link to some QML code using it that would be great, otherwise I'll poke around in due course.
Post a Comment