Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  User Interface and Voice
| | |-+  Hint on changing key or menu mapping
« previous next »
  • Print
Pages: [1]

Author Topic: Hint on changing key or menu mapping  (Read 2039 times)

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Hint on changing key or menu mapping
« on: March 08, 2013, 01:56:59 PM »
Hi!
I'm aware that there is no way to customize keys or menus (which I find a pity),
but I'm willing to try doing it by changing code. Sadly I was not able to find where to start for my task.

I'm running RB on a SansaClipZip. I would like to mark a song as "bad" (for later deletion) with as few clicks as possible.
What would be the easiest way:
  • change the rating of the playing song to 1, e.g. long press button up and entering "set song rating" instead of entering the pitch screen
  • delete the song
  • set some file attributes
  • write out a textfile
Pleasy, any ideas to achieve this are welcome!
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Hint on changing key or menu mapping
« Reply #1 on: March 08, 2013, 02:07:46 PM »
None of that is going to be easy.

Why can't you just delete the song?
Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Hint on changing key or menu mapping
« Reply #2 on: March 08, 2013, 02:57:17 PM »
Remapping existing keys is easy, assigning new actions less so.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Re: Hint on changing key or menu mapping
« Reply #3 on: March 08, 2013, 03:28:09 PM »
Thanks for your replies.

Simple deleting: it needs 5 clicks and makes it much more difficult to sync it to the music collection on my PC

What do you mean by "remapping existing keys"? Make changes in keymap*.c?

Can you please give me a hint where in the code the order of the menu items is written? By reordering the wps context menu so that "song rating" is the first entry I would be nearly done.

I suppose it's no easy change to open the "song rating" screen instead of the wps context menu?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Hint on changing key or menu mapping
« Reply #4 on: March 08, 2013, 03:43:54 PM »
I think on many targets this can be done by setting a hotkey to delete or song ratings (section 4.5 of the manual for devices with the feature).  However, the Zip doesn't have hotkeys enabled in sansaclipzip.h due to either a lack of buttons or a lack of someone enabling them.  You could take a look at that mechanism and see if it works for you. 
Logged

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Re: Hint on changing key or menu mapping
« Reply #5 on: March 16, 2013, 05:13:52 PM »
I was able to get the virtualbox-environment running, find and change all I needed.
Compiling and running rockboxui worked fine.
BUT when trying to do a Normal build there was the following error:  :'(

..../rockbox/apps/recorder/jpeg_idct_arm.S:363: Error: undefined symbol `pix8_size' in operation

This error is in a place where I don't have any clues what goes wrong.
With a full text search I didn't find a symbol definition of pix8_size.
Please help!
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Hint on changing key or menu mapping
« Reply #6 on: March 16, 2013, 05:27:27 PM »
Is that with completely stock code?  Or did you modify something?  If its stock code, I would do a 'make clean' and then try to build it again. 
Logged

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Re: Hint on changing key or menu mapping
« Reply #7 on: March 17, 2013, 08:53:28 AM »
Thanks, make clean did it!

Making the changes was indeed quite easy, finding the right code locations was not so easy.

In case somebody else has similar needs, I changed:
sansaclipzip.h, 220: uncommented #define HAVE_HOTKEY
root_menu.c, 490, menu_table: order of root menu
onplay.c, 936, set_rating_inline: ratings only from 0 to 2
onplay.c, 1177, onplaymenu_callback: order of WPS context menu
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Hint on changing key or menu mapping
« Reply #8 on: March 17, 2013, 04:27:37 PM »
Does the hotkey seem to work normally?  maybe it should be enabled in all builds.
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Hint on changing key or menu mapping
« Reply #9 on: March 17, 2013, 05:28:15 PM »
As far as I am aware, it can't be enabled on *all* builds (conflicts due to crowded keymaps, etc.), but if it works here and doesn't cause any regression...go for it. I'm willing to guess that there is *some* reason why this target never got it (the author was quite thorough in this respect)...but it could indeed be oversight.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Re: Hint on changing key or menu mapping
« Reply #10 on: March 18, 2013, 02:21:43 AM »
So far I didn't see anything negative by enabling the hotkey.
It's the DOWN REPEAT button which shows the playlist without hotkey, this function can be assigned to the hotkey anyways (but I assigned it to "delete").
Are there hints what is supposed to NOT "work normally"? Of course I can do some tests, if it helps.
Logged

Offline WarpEnterprises

  • Member
  • *
  • Posts: 13
Re: Hint on changing key or menu mapping
« Reply #11 on: March 23, 2013, 11:37:37 AM »
 :)   :)   :)   :)
Now I am really happy. I found the place where to put a little piece of code, so now each time a file is deleted it's logged to a text file.

Code: [Select]
onplay.d, delete_file_dir, before end of function:
int fd = open("/deleted.txt", O_CREAT|O_WRONLY|O_APPEND, 0666);
if (fd >= 0)
{
   fdprintf(fd, "%s\n", file_to_delete);
   close(fd);
}
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  User Interface and Voice
| | |-+  Hint on changing key or menu mapping
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.084 seconds with 15 queries.