Rockbox

Tasklist

FS#11019 - Load background images with --root option on UI Simulator

Attached to Project: Rockbox
Opened by Fred Bauer (freddyb) - Monday, 15 February 2010, 20:13 GMT
Last edited by Fred Bauer (freddyb) - Thursday, 09 September 2010, 18:40 GMT
Task Type Patches
Category Simulator
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The purpose of this patch is to allow the simulator to load a background image when specifying the root directory. The current code ignores the --root option and tries to load from the current working directory. This patch will try to load the image from the parent of the given root directory.
This task depends upon

Closed by  Fred Bauer (freddyb)
Thursday, 09 September 2010, 18:40 GMT
Reason for closing:  Rejected
Additional comments about closing:  No interest in running the UI simulator from outside the build directory.
Comment by Fred Bauer (freddyb) - Monday, 15 February 2010, 21:15 GMT
In case there's any confusion about this, currently if you build a simulator and try to run it from a different directory using the --root option you won't get a background image because the simulator looks for the image in your current working directory, not the directory of the simulator executable. This patch looks for the background image in the parent of the given root directory because the directory will look like this after "make install":

builddir/rockboxui executable
builddir/UI256.bmp background image
builddir/simdisk/ root dir of the simulator
Comment by Frank Gevaerts (fg) - Tuesday, 16 February 2010, 17:59 GMT
I'm not sure if I like this idea. The background image corresponds to the rockboxui executable, not the root directory. If anything, the code should look at the directory containing rockboxui.
Also, I think that whatever is done, the current working directory should be tried first.
Comment by Fred Bauer (freddyb) - Tuesday, 16 February 2010, 18:57 GMT
I'm not sure how to get the path of the executable in a reliable and portable way. What if I just add a separate option to manually specify the image path?
Comment by Jonas Häggqvist (rasher) - Tuesday, 16 February 2010, 19:09 GMT
argv[0] has the path of the executable.
Comment by Fred Bauer (freddyb) - Tuesday, 16 February 2010, 23:22 GMT
That's not a safe assumption. Suppose someone uses the simulator to test WPS's and he decides to add it to his $PATH.
Comment by Fred Bauer (freddyb) - Wednesday, 17 February 2010, 05:12 GMT
I rewrote this patch so that the only change is a command line option (--playerimage [FILE]) to explicitly specify the background image. I still think some change is necessary because someone without immediate access to the source code will assume that the --remote option allows running the simulator without cd'ing to the parent directory of the simdisk.
Comment by Fred Bauer (freddyb) - Wednesday, 17 February 2010, 05:29 GMT
Oops. Make that --root instead of --remote.

Loading...