Battery visualization Utility for Dingux
by Rodrigo Cardoso
   rodrigo(DOT)alfenas(AT)gmail(DOT)com
----------------------------------------

I made this little app because I wanted to use the native OS as little as possible, and see the battery charging is one of these unavoidable moments :(

I also noticed that the battery indicator on my white unpawnned dingoo is imprecise and incorrect, that annoyed me a little.

When developing this app I noticed that the values differ between dingoos, so I included a "Calibration" option in battinfo.txt, so you can adjust it to your dingoo's  needs.

--------------
Index:

* Changelog
* Features
* TODO
* Bugs
* Changing parameters and Themes
* Creating or modifying a Theme
* Notes

--------------
Changelog

v2 -> 2011 March 7 - bugfix release
   * fixed memory leaks that can cause crashs in some devices.
   + added an option to config.txt "faded_brightness VALUE",
      this is how much brightness the screen will have when
      idle for 10secs w/o bright_pulse enabled.
      -> 0 means screen off
      -> 100 means full brightness

v1 -> 2011 March 6 - initial release
   + all the stuff


--------------
Features:

 - show how long you are charging the battery
 - show the battery percentage
 - minimum and maximum values adjustable (battinfo.txt)
 - sound alarm when done
 - automatically adjust brightness and underclock your dingoo to charge faster! (I think...)
 - theme-able
 - pulse the screen at a minimum brightness for a nice effect… 
   (you can turn it off, and instead it will just set the brightness to minimum (use R+X) )
 - auto-calibration at first use (you can force it in battinfo.txt)

--------------
TODO:

 - show if you are actually charging the battery
    it looks easy, just need to read some GPIO pins to
    know if the usb cable is plugged in.
   I will not do this because Im lazy, but feel free to do it if you want.
   there is some info here:
    http://code.google.com/p/dingoo-linux/wiki/GPIO

--------------
Bugs:

 - AFAIK, there is no bugs, but the speakers keep doing some annoying noise, but it is not my fault, it is a dingux bug.
 - When I did the pulse effect, I noticed that the brightness settings directly affect how much noise the speakers do, weird!
 - Aparently the crashing issues in the first release got fixed.

--------------
Changing Parameters and Themes:

 - Just look at config.txt, is pretty straightforward.
   change the values to 0 to disable and to 1 to enable.
 - You can change most parameters inside the program, using
   L or R shoulder buttons + one of the face buttons.
 - it will save the changes when you exit the app.
 - proc_clock is the clock the app will use.
 - auto_brightness enabled means that the screen will go darker after some secs.
 - bright_pulse is a nice effect that you will see when using the app, you can disable if you think this shit annoy you =P
 - theme default
   …change it to
   "theme retro" (no quotes) …and see =)
   - the second word in this line is the name of the folder that contains a theme, you can create one easily.


--------------
Creating or Modifying a Theme

 - create a folder inside the app folder and put any name you want (except that the name cannot have spaces! :P),
 - change the "theme default" in config.txt to "theme nameofyourfolder".
 - you will need these files inside:

   beep.wav - not having this one is not a problem...
   bg.png
   completed.png
   fill.png
   font.ttf
   theme.txt

 - just look the other folders to know what each file does.
 - theme.txt example:
 
	bar_pos 77 76
	completed_pos 120 53
	percent_pos -1 45
	msg1_pos -1 200
	msg2_pos -1 216
	status_pos 12 6
	time_pos 267 6
	text_color 255 255 255
	text_shadow 96 146 96
	text_size 8

 - a name followed by 2 values is a coordinate (x,y),
    use the special value -1 for the x to put it centered.
 - a name followed by 3 values is a color (r,g,b), from 0 to 255.
 - text_size is in pts, not pixels.


--------------
Notes:

 - I included the PSD files of my themes in the zip, feel free to use them.
 - the source is included too
   - build this using: mipsel-linux-uclibc-gcc main.c -o battutil.dge -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer

 - thanks for using my useless app.
 - now I will go back to develop some real games...

EOF