![]() |
Re: N810 in car, pause music/canola2 when not charging?
This should be fairly simple (a few lines of python) so that when it received a dbus charging off it would emit a media pause event, and charging would push play, however it would start when you plugged it in even if you never pressed play.
|
Re: N810 in car, pause music/canola2 when not charging?
Horridly cobbled hack (os.system dbus send is a one-line but I should use Python to emit the signal).
With the media player, it does exactly what was described. When the charger is on (providing voltage) it does a "play", when the voltage is lost or the charger is disconnected, it does a "pause". Code:
#!/usr/bin/env python2.5 |
Re: N810 in car, pause music/canola2 when not charging?
The above is a variant of the bluetooth or normal headset button control scripts others have done, but with an event listener for the charger events instead of the button press.
Feel free to improve it (and explain how to install Python though it should already be there with Canola if I remember right). |
Re: N810 in car, pause music/canola2 when not charging?
Uhh...ohh... I'm stunned.
So it should work with that..? |
Re: N810 in car, pause music/canola2 when not charging?
Copy the text in the box (which is a python program) and paste it into a file on the tablet.
Then in an xterm do "python <filename>" or use something like osso cpu statusbar to launch it. I don't have time at the moment to package it (or create a universal play/pause app that would use the bluetooth switch, headset switch, and the charger or something). If someone else is interested, please run with it. (I've wanted something like this since my car/motorcycle audio also shuts down when I turn off the ignition so having a pause/resume is nice so it probably isn't dead, I'm just extremely busy) |
Re: N810 in car, pause music/canola2 when not charging?
Rather than starting another thread, I hope it's appropriate to offer a shell script to address the same situation, but NOT with Canola. This script does the same pause/unpause operation, but using XMMS and its command-line controller, xmmsctrl. It also addresses the issue that volume is automatically reduced when you plug into the audio output (headphone) jack, usually helpful behavior if phones are being plugged in, but not when using the tablet as an audio source for another device. (The cure was posted by Benson, here: http://www.internettablettalk.com/fo...4&postcount=10 )
Code:
#!/bin/sh Corrections are welcome. I'm sure there are better ways to acomplish this. |
All times are GMT. The time now is 00:04. |
vBulletin® Version 3.8.8