Rockbox

Tasklist

FS#7979 - Shutdown with hold button

Attached to Project: Rockbox
Opened by Stephane Doyon (sdoyon) - Wednesday, 17 October 2007, 04:18 GMT
Last edited by Alex Parker (BigBambi) - Sunday, 06 June 2010, 08:37 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

This patch causes the player to shutdown when the hold switch is
engaged. Implemented for e200 and x5.

Includes a setting to activate this behavior.

I personally don't use the hold button when using the player, and I
usually set it to hold whenever I turn my player off.

Being blind, I like that the button clicks and I'm sure what position
it's in. I know that it has clicked off and then I can forget about my
player and expect it to shutdown.

The long press on POWER involves some guesswork if you don't have your
earphones on (say you've been interrupted and had to remove them in a
hurry), or if you're feeding the audio through some other system that got
shut off. If you have it setup to resume playback on startup, it's even
more guess work.

As a bonus, engaging the hold button is instantaneous, rather than
waiting for the extra long POWER press to register, the bookmark to be
saved and finally getting the voice shutdown message. Really useful when
you didn't notice that the bus was arriving at the station and you have
to move in a hurry. Or your in a waiting room and they just called your
name...

Anyway I figured, if they have a backlight mode for the hold switch,
maybe I can do something useful with it for myself.

I'd like comments on the idea: is this just a gadget, or does someone
else think this might be useful to them?
This task depends upon

Closed by  Alex Parker (BigBambi)
Sunday, 06 June 2010, 08:37 GMT
Reason for closing:  Rejected
Comment by Frank Grisafi (JobVanDam) - Wednesday, 17 October 2007, 06:05 GMT
Holy shit what an idea. I'm not blind I'm just lazy so I dig this idea. I NEVER use the hold switch so using it for on/off is awesome.

Can you set it so flipping it back turns the player on? That functionality would get my vote... F it I'm voting for it anyway but still turning it on via the hold switch would be super, great nifty.

Ah jeez, does this thing work for the Gigabeat F? It says All Players but you said you implemented it for only two players.
Comment by Daniel Dalton (ddalton) - Wednesday, 17 October 2007, 10:11 GMT
Stephane another great idea!
Could you please make this work on the h300? I can't understand how to get it working on it.
I don't understand about the #defines and what they equal.
You seemed to have assigned them with a random number and letters.
Not sure what this means though.
If you could make it support the h300 I would appreciate it.
Thanks.
Comment by Stephane Doyon (sdoyon) - Thursday, 18 October 2007, 04:13 GMT
Thanks for the enthusiasm! Didn't think it would be so appreciated.

>Holy shit what an idea. I'm not blind I'm just lazy so I dig this idea. I
>NEVER use the hold switch so using it for on/off is awesome.
>Can you set it so flipping it back turns the player on? That functionality

I wish. I don't believe the hardware will be designed for this to
be programmable.

Oh well let's ask... ... No, jhMikeS says the hardware won't do it.

>Ah jeez, does this thing work for the Gigabeat F? It says All Players but
>you said you implemented it for only two players.

Yeah I had two so I couldn't just select one in the menu :-).

OK here's an additional patch, to be applied in addition to the
earlier one, with untested support for Gigabeat F and H300. Please do
let me know if it works! And whether you actually find this convenient,
or whether it's just a toy idea.

ddalton:
>You seemed to have assigned them with a random number and letters.

Random letters?
Those are hexadecimal constants. One bit per button, so they can be
combined. Just had to find a free bit.
Comment by Daniel Dalton (ddalton) - Thursday, 18 October 2007, 07:53 GMT
Thanks for the update. Works great on h300.
Comment by Frank Grisafi (JobVanDam) - Friday, 19 October 2007, 12:55 GMT
HI YYYYYOOOOOOO! She works on GigabeatF!
Notes:
- By default the option is turned off. This threw me at first cause I thought it didn't work.
- The option is spelled really incorrectly, "Poweroff on ohld". You're blind so I'll let it slide this time but next time I won't be so lenient.
- Is it possible to turn the Gigabeat ON with the hold switch? It would be cool cause that would make the hold switch the complete on/off button.

Somewhat unreleated when trying to patch my build I came upon this annoying problem. Everytime it had to patch a different file I had to specify what file to patch because it couldn't find the proper file because it would put the "trunk" folder in the begining of every path. I'm using Cygwin.
Is my patch statement wrong? I can patch fine with another file but these two cause these problems. Below is a sample of what was printed. Thank you.

$ patch --binary < hold-poweroff.diff (--my input--)
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: trunk/firmware/target/arm/sandisk/sansa-e200/button-e200.c
|===================================================================
|--- trunk.orig/firmware/target/arm/sandisk/sansa-e200/button-e200.c
|+++ trunk/firmware/target/arm/sandisk/sansa-e200/button-e200.c
--------------------------
File to patch: firmware\target\arm\sandisk\sansa-e200\button-e200.c (--my input--)
patching file 'firmware\target\arm\sandisk\sansa-e200\button-e200.c'
Comment by Daniel Dalton (ddalton) - Saturday, 20 October 2007, 01:38 GMT
>Notes:
>- By default the option is turned off. This threw me at first cause I thought it didn't work.

Yes. But if people don't want it it will behave as normal. So I think it should be off by default.
I use this feature, but I am sure there are people that don't.

Most options are off by default. Like voice dir names.

>- The option is spelled really incorrectly, "Poweroff on ohld". You're blind so I'll let it >slide this time but next time I won't be so lenient.

Ah yes your right... A typing error in english.lang. The voice string is fine though. I won't update it because I think Stephane would prefer if I left it for him. :-)

>- Is it possible to turn the Gigabeat ON with the hold switch? It would be cool cause that >would make the hold switch the complete on/off button.

Why do you ask the same question twice? You should read the comments. Because Stephane told you it isn't possible with the hardware. Yes I would like that but it isn't possible.

>Somewhat unreleated when trying to patch my build I came upon this annoying problem. >Everytime it had to patch a different file I had to specify what file
>to patch because it couldn't find the proper file because it would put the "trunk" folder in >the begining of every path. I'm using Cygwin.
>Is my patch statement wrong? I can patch fine with another file but these two cause these >problems. Below is a sample of what was printed. Thank you.

>$ patch --binary < hold-poweroff.diff (--my input--)

Read the wiki. You need to strip one directory level from the left. (p1 not p0)
It depends what patch you are applying though. If it was made from the trunk or somewhere else...
Comment by Daniel Dalton (ddalton) - Saturday, 20 October 2007, 04:35 GMT
Fixed a typing error in english.lang.
Comment by Frank Grisafi (JobVanDam) - Friday, 26 October 2007, 18:40 GMT
Just wondering does this new "shutdown-hold.patch" replace the "hold-poweroff.diff" or both files or do I have to patch all three individually? Thanks.
Comment by harry tu (bookshare) - Saturday, 27 October 2007, 01:03 GMT
If someone will add ipod support, I will test it.
Comment by alex wallis (alexwallis646) - Monday, 31 December 2007, 15:13 GMT
Hi any chance this patch could be made to work with the h140 please?
Comment by Stephane Doyon (sdoyon) - Sunday, 27 April 2008, 04:05 GMT
I got another request for this so here's a new patch.

I was frustrated with the complexity and difficulty of adding support for
new models. So this is a simplified patch for ease of maintenance: no
fancy feature define and button definitions in a bunch of target-specific
files... I just hooked into the backlight function. The upside is it
should now support any player that's able to use the hold switch to
control the backlight.

If this is ever considered for inclusion, then the hold button event
should be made to go through a function with a more generic name than
backlight_hold_changed(). But I won't push to commit this unless another
dev shares my enthusiasm for this feature, or unless some happy users
speak up. I stil use it every day and love it.
Comment by Claudio Capriati (claudiocpr) - Monday, 28 April 2008, 21:48 GMT
Hi Stephane,

i'm a blind user and i tested this patch. It is a good idea so i decided to have it on my e200. It is very usefull when i travel by train/ bus or wait for doctor because in this situations i must shutdown quickly the player .
However i think that this patch can be accepted if study mode function is accepted, it is in fs#6188. in fact if it is not accepted you can not lock the keyboard while playing to avoid an accidental transition to the next track or the beginning of current one: you need to disable "power off on hold" function for this result.

greetings.

Loading...