FS#10022 - Beatbox fix
Opened by Tony Huynh (insanepotato) - Saturday, 14 March 2009, 06:27 GMT
|
DetailsThis should hopefully make beatbox compile and run on any target with enough buttons.
All it needed was some key mappings (and some typo fixes). I'm assuming the function declaration for synthSamaples() simply changed over time, as the original code was missing an 's' on the end of function name and looked like this: synthSamples(&synthtemp[0], &synthtemp[1]); The second param should be the sample size or something, but it was passed an address. If it doesn't work on a particular target due to lack of a key map, please add one, or tell me the target and i'll stick a keymap in ^_^ Patch from within root rockbox source folder. Hopefully this works for you all, its many hours of fun =D |
What happened was, i thought Unix newline was CR but its LF. I my editor to use LF and re-spaced the file so its easy to read.
I edited the macro for the drum name position, so it fits on screens with height less than 100.
Added a menu when you press exit, borrowed from chopper (thanks!) =]
The order of drawing functions has also been changed, such that drawDrumName() is called last, ensures its drawn on top properly
Some of the functions have been renamed because they used mixed case identifiers, which contradicts CONTRIBUTING (only changed some of them)
And rudimentary Saving and Loading has been added, which means it can be used as a viewer ^o^
Your patch mixes style and whitespace changes with functional changes.
Please separate the functional changes from the others so they are easier to review.
I made the cursor wrap around edges in this file and changed the last instrument (virba slap) to Muted triangle =]
Ipods dont have up/down so no key mapping existed. I made a keymap for the ipods:
Scroll back = up
Scroll forward = down
Left = left
Right = Right
Center = seletc
Menu(top button) = stop/menu
Play(bottom) = play
- rockbox_style identifiers.
- /* rockbox style comments */
- e200 keymap (i'm not sure how effective your automatic keymap finder will end up being)
Problems:
- the tempo speeds up and slows down depending on how many samples are being played
- the drum name leaves a residue on the screen when the progress bar moves over it. there should be a way to clear it properly.
Mistakes in this patch:
- multiple declaration of num_samples and number_of_samples