• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Plugins
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
  • Private
Attached to Project: Rockbox
Opened by p.opus - 2007-12-09
Last edited by petur - 2008-04-23

FS#8285 - "Flashlight" plugin

I used to use the brightness of my Sansa E200 display in original firmware as sort of a “flashlight” to illuminate my way around the house or any other need where I needed a little light. The display on the Sansa is by default rather bright, and can illuminate an entire room with the brightest settings.

With Rockbox, my favorite themes have a darker background and as such, the display is not usable as a “flashlight” anymore. I like the dark background/light letters for readability, but don’t wish to change a theme, just to get more output from the screen light.

Perhaps a quick little plugin called flashlight could be added to plugins,
The “flashlight” would turn on whenever the application is selected. Rockbox would set maximum brightness on the LCD and provide a blank screen with a background color of FFFFFF regardless of the currently selected theme.

When the select or menu button is pushed, the plugin would simply go back to the Plugin selection screen with the original brightness and Theme.

If you wanted more features, such as a timer for the light, then you could simply add a configure screen that would allow you to perhaps set the max time of activation and customize the “color” of the light by using the color configurator much like the current background color configurator is written

It seems like it would be a pretty simple plugin, and I would use it quite a bit.

I just don’t know how to code.

Any chance for a simple “flashlight” plugin? Any interest from others?

Closed by  petur
2008-04-23 21:16
Reason for closing:  Accepted
jeton commented on 2007-12-09 22:24

I like the idea.
i white blank screen at maximum brightness would be useful as a plugin.

vmh commented on 2007-12-10 16:30

Try this. I don’t know if it really works, I haven’t tried. I don’t use it myself. It only tooks ~2-3 minutes to implement it. It turns on the blacklight, set the background to white. Press any button to quit. That’s all.

I can try it, but I’ll need to learn how to apply patches to Rockbox.

As an alternative, if you run the RockPaint application, it opens with a white screen by default, so maybe the need for this isn’t as great as originally thought.

However, I do still like the flashlight application idea.

I love the idea, I’m going to try using this patch if I can figure out how to implement it. Sorry, Vuong, but you’re talking to a bunch of people who don’t really know what we’re doing, haha.

I’ll update with information if I get it to work. If it does, I’d love to try changing it around to different colors. I play around with photography and would kill for something like this if it works out.

jeton commented on 2008-01-05 18:16

Another benefit of this would be the option to turn the scrollwheel on, as a lot of users turn it off. Therefore a white background (with maximum brightness) and a blue scrollwheel come in handy when there’s no electricity (like in my country, 3 days without power).

Uploaded a new version, which changes (if possible) the brightness to the highest value to increase the flashlight’ablity even more :)

This looks like a pretty useful plugin, especially if there’s a blackout and you don’t have a real flashlight handy. :)

Will try to compile it with one of my DAPs.

Ok, this one should actually work when one has a backdrop set. Also, I cleaned the code up a little and changed the header properly.

Tested on e200.

After some fun discussions in IRC and some boredom I’ve extended this plugin. Now it contains something to adjust the colour. There was kind of a request to be able to select a red light (night vision) so you can continue seeing things in the dark after using it (e.g. for viewing starmaps and such at night).

To change the colour on targets with a colour display use the left and right buttons (and the touch wheels, pads, scroll wheels where available). Any other button quits the plugin.

On targets without a colour display simply press/touch any button to quit the plugin.

Tested on iPod Video.

Note: The algorithm used to convert a hsv color to a rgb one probably can be optimized, because i didn’t really used the value and saturation values. But i wasn’t that bored ;-P

Oops… I broke the non colour targets.

The latest version yields the following for me:

$ patch –dry-run -p0 <flashlight_v5.patch
patching file apps/plugins/CATEGORIES
Hunk #1 succeeded at 96 (offset 1 line).
patching file apps/plugins/SOURCES
patching file apps/plugins/flashlight.c
patch: malformed patch at line 227:

Is that an “ignorable” error?

No, malformed patches means that the diff contains wrong info. I.e. @@ +1,7 -1,7 @@ means that it deletes 7 lines of the original and writes 7 into it (6 of those don’t differ). That’s the header of each hunk. But, if the body wants to delete 8 lines and write 9 lines, the header and the body dismatch, resulting in a malformed patch.

I suggest you to read some tutorials about diff.

Oh, yea, and malformed patch results in not applying cleanly (all hunks including and after the faulty line are not applied at all). So, it’s definitely not ignorable.

Resync (r17055)

I forgot to svn add. Sorry :-P

Whoever considers to commit it: I haven’t bumped the plugin api since it changes often and i don’t want to sync this patch everytime something changes. So you’d have to do it before committing :-)


Available keyboard shortcuts


Task Details

Task Editing