Release Pandora flashlight


_wb_

Microbe
Staff member
Joined
Apr 5, 2012
Messages
5,390
Age
42
Location
Brussels, Belgium
... my first self-made (no port) Pandora application!


screenshot.png



OK, that help screen probably looks a bit too intimidating, sorry about that :)


(EDIT: the above no longer is the help screen, because I changed the screenshot in the PND to reduce the PND size)


Here's the readme:


Pandora flashlight


==================


Features:


---------


- Flashlight, in any (24-bit) color


- Automatically sets backlight LED brightness to get higher range


- Choose color by changing R,G,B and/or H,S,V (hue, saturation, value)


- Shortcuts for common colors like white, red, green, etc.


- Store up to 10 favorite colors


- Color cycling mode (smooth transition between stored colors), variable speed


- Stroboscope mode, variable speed


How to use:


-----------


When started for the very first time, the help screen will be shown.


Use the SELECT button to show or hide the help screen.


Left shoulder button: toggle light as long as the button is pressed


Right shoulder button: switch light


START (or SPACE): show current color values in HSV and RGB


SELECT: show help


SHIFT: toggle color cycling (use "," and "." to adjust speed)


S: toggle stroboscope (use "A" and "D" to adjust speed)


R: set color to red (use "E" and "T" to adjust amount of red)


G: set color to green (use "F" and "H" to adjust amount of green)


B: set color to blue (use "V" and "N" to adjust amount of blue)


dpad LEFT/RIGHT: adjust saturation


dpad UP/DOWN: adjust value (brightness)


action button A/B: adjust hue


1,2,..,0: select stored color


F1,F2,...,F10: store current color in corresponding slot


Q (or ESC): quit


Predefined colors:


W white


R red


Y yellow


I ivory


O orange


P pink


G green


K khaki


L lime


C cyan


B blue


M magenta


Your password will be asked once to allow changing the backlight brightness.


If you don't want this program to change the brightness, then you can


disable that by creating a file called


[...]/appdata/flashlight/no_brightness_change


Credits:


--------


This program was made by Jon "wb" Sneyers.


Thanks to notaz for his tweaked SDL, and to Christoph.Krn for his "guihints",


which were used in the help screen.
 
Last edited by a moderator:
Finally some fun application.


Great idea.


My Pandora is now my 400 Euro flashlight :D .


Everyone: Grt one of those flashlights. There's also a Linux PC inside. :D
 
Last edited by a moderator:
Finally some fun application.


Great idea.


My Pandora is now my 400 Euro flashlight :D .


Everyone: Grt one of those flashlights. There's also a Linux PC inside. :D

Yeah, a 400 Euro flashlight sounds silly, but then again, you could also spend 600 Euro on an iPhone or iPad, pick any of the 1000 flashlight apps from the appstore (most of them will have annoying ads unless you pay $0.99 for the "full ad-free version"), and get a 600 Euro flashlight. With a completely locked-down OS inside that does not even let you access your own filesystem ;)
 
Wow, really neat!


Pretty well polished for a first release.


And I like the fact that it takes advantage of pandora specific features.


I've not encountered any annoying bugs while playing with this little beast.


My biggest remark would be that Flashlight eats about 7% of CPU when idle (running with SuperZaxxon Beta 5, no overclock) but I can live with that.


Thank you for this cool app :)

Yeah, a 400 Euro flashlight sounds silly, but then again, you could also spend 600 Euro on an iPhone or iPad, pick any of the 1000 flashlight apps from the appstore (most of them will have annoying ads unless you pay $0.99 for the "full ad-free version"), and get a 600 Euro flashlight. With a completely locked-down OS inside that does not even let you access your own filesystem ;)
...and a 400 euros handheld _without_ a flashlight sound ridiculous :D
 
Finally some fun application.


Great idea.


My Pandora is now my 400 Euro flashlight :D .


Everyone: Grt one of those flashlights. There's also a Linux PC inside. :D

Yeah, a 400 Euro flashlight sounds silly, but then again, you could also spend 600 Euro on an iPhone or iPad, pick any of the 1000 flashlight apps from the appstore (most of them will have annoying ads unless you pay $0.99 for the "full ad-free version"), and get a 600 Euro flashlight. With a completely locked-down OS inside that does not even let you access your own filesystem ;)

You're right.


Anyone want's my Pandora.


I need an iPhone.


That's what I call a flaslight. Not that cheap.

..and a 400 euros handheld _without_ a flashlight sound ridiculous :D
That's why we couldn't sell Millions of Pandoras until now.


Now we can access mass market.


Let's get serious for a little moment:


I hope I find some time to try it out today.


The next weak are exams in University and I don't have much time for flashlight testing.


The picture looks verry promising and I'm sure your flashlight is much better than thoes on the iPhone.
 
Wow, really neat!


Pretty well polished for a first release.


And I like the fact that it takes advantage of pandora specific features.
Thanks!

My biggest remark would be that Flashlight eats about 7% of CPU when idle (running with SuperZaxxon Beta 5, no overclock) but I can live with that.
Yes, I've also noticed that. I wonder why. As far as I know, if you're not pressing any buttons or doing things like strobe/cycle, no code should be running except SDL_WaitEvent(). Either the implementation of SDL_WaitEvent() is just some stupid busy loop (but I would expect something smarter, interrupt-based), or I'm missing something. If anyone has ideas on how to improve CPU usage to 0% when idle, please let me know.


Not that it will matter much for battery life - the backlight will be eating much more power than the CPU anyway. But every little bit helps I guess.
 
too bad you could sell that for lots of $ on iTunes...
 
I'm not interested in selling software, especially not on iTunes. I'd rather think I made everyone's Pandora worth another $0.99 :)


I'm currently improving some things, in particular, I'm working on a "sleep mode" that very slowly dims the screen (you'll be able to choose how long it takes, I was thinking 30 mins, 10 mins, 5 mins, 2 mins and 1 min) until it is completely gone, at which point it switches off the light (which means the backlight is switched off, so your battery should survive the night easily).


If anyone has feature requests or ideas for improvement, feel free :)


(also it would be nice to get some ratings at the repo)
 
This is interesting to me. I like the approach in configurability for the light colour, a cyan flashlight seems like a fresh idea!


However, when do we get a Pandora Fleshlight??! :ph34r:
 
I'm not interested in selling software, especially not on iTunes. I'd rather think I made everyone's Pandora worth another $0.99 :)


I'm currently improving some things, in particular, I'm working on a "sleep mode" that very slowly dims the screen (you'll be able to choose how long it takes, I was thinking 30 mins, 10 mins, 5 mins, 2 mins and 1 min) until it is completely gone, at which point it switches off the light (which means the backlight is switched off, so your battery should survive the night easily).


If anyone has feature requests or ideas for improvement, feel free :)


(also it would be nice to get some ratings at the repo)

That's some great idea.


Here comes an other one:


Make the Pandora as an alarm clock with light and music.


Let's say it's 7.00 o'clock in the morning and your Pandora begins playing you fafourite music and the screen begins to shine and is getting brighter after some time.


That'd be an advanced alarm clock feature on Pandora.


If you can access the Pandora LEDs (i know it's possible) you also could turn them off when in alarm clock mode so that they don't disturbe while sleeping.


I definitly would buy such a feature :D .
 
Yes, I've though about integrating an alarm clock in the flashlight application, but now I think it would be better to make a separate app for that, essentially a GUI frontend to schedule a cronjob that calls 1) some music player and 2) something that makes the screen increasingly bright while e.g. displaying the time.


Perhaps I'll add a feature to display the time, and to slowly fade in. Then that other alarm clock thingie (anyone feel like implementing such a thing?) could use my application for part 2).
 
I'm currently improving some things, in particular, I'm working on a "sleep mode" that very slowly dims the screen (you'll be able to choose how long it takes, I was thinking 30 mins, 10 mins, 5 mins, 2 mins and 1 min) until it is completely gone, at which point it switches off the light (which means the backlight is switched off, so your battery should survive the night easily).


If anyone has feature requests or ideas for improvement, feel free :)

Once the light is off you could trigger a user-defined command which could be for example "shutdown -h now" or anything else.
 
If anyone has feature requests or ideas for improvement, feel free :)

Once the light is off you could trigger a user-defined command which could be for example "shutdown -h now" or anything else.

Yes, although I think it will then remember the backlight setting, and the next time you boot up, you'll be confused because the screen is still off. Also, I like being able to turn the light back on during the night just by pressing a shoulder button, instead of first having to boot ;)


Perhaps I'll include a way to trigger a user-defined command, which by default would do nothing at all, but you can change it to do anything, e.g. shutdown, or kill the flashlight program and start anything else.

hum, voice control maybe?

I this a joke or are you serious? This is extremely hard to implement, I don't have time to do that.


You got me thinking though. Perhaps I could add a mode that listens to the microphone (provided I find out how to do that), and adjusts the light intensity to the loudness. Would be a nice party gadget. Still would require quite some work, but not nearly as much as voice control.


(by the way, still unrated on the repo, if you like this (or if you don't), please give a rating at the repo!)
 
hehe, that was just a suggestion for you to have fun coding... as a user I don't really see the point of theses kinds of apps axcept for the coder itself... and voice recongition seems like a fun project :) there's surely dozen package providing support for theses kind of things.
 
You got me thinking though. Perhaps I could add a mode that listens to the microphone (provided I find out how to do that), and adjusts the light intensity to the loudness. Would be a nice party gadget. Still would require quite some work, but not nearly as much as voice control.

Instead of coding several features I wonder if it could be more interesting to explore another solution that keeps your codebase small without sacrificing expandability.


On one hand let Flashlight doing just one thing and do it well, that is displaying light and colors (perhaps with text or picture support).


On the other hand allow Flashlight to be controled by external programs. A simple FIFO based communication should do the trick.


You could use a simple text based protocol with shell-like commands:


light [on|off]


brightness value


quit


fadein [start|stop|speed_value]


strobo [start|stop|freq_value]


color [color_name|color_value]


and so on...


Sure, "simple" does not mean easy to code :) It's just a suggestion.


I've not many spare time these days but if I can help you I would gladly participate.
 
Yes, I've though about integrating an alarm clock in the flashlight application, but now I think it would be better to make a separate app for that, essentially a GUI frontend to schedule a cronjob that calls 1) some music player and 2) something that makes the screen increasingly bright while e.g. displaying the time.


Perhaps I'll add a feature to display the time, and to slowly fade in. Then that other alarm clock thingie (anyone feel like implementing such a thing?) could use my application for part 2).

I'll do what I always do:


Waiting and hoping :D
 
Yes, perhaps something like that could be useful. I was thinking to just add some command line arguments that allow you to set the initial state, and then you can essentially do whatever you want. E.g. something like "flashlight --color=FFFF88 --fadein 30 --strobe". Not quite as flexible as having actual communication, but probably good enough for simple things like an alarm clock, and easier to code.
 
Just uploaded version 0.2 of the Pandora Flashlight. New features: OSD (on screen display), auto off timer, sleep mode (slow fade-out).


I also tried to make the PND as small as possible, because I think a flashlight app should be small. The full source code is still included (this doesn't take a lot of space, it compresses well), but I'm no longer including the Gimp source file for the help screen, and I'm using a screenshot that compresses better. Also the icon size was reduced from 128x128 to 64x64, which still should be enough.


If you think the OSD is annoying, you can disable it by pressing SPACE.
 
Back
Top