FS#8543 - Action API for the clock plugin

Attached to Project: Rockbox
Opened by Kévin Ferrare (TiMiD) - Friday, 01 February 2008, 15:52 GMT
Last edited by Marianne Arnold (pixelma) - Monday, 22 November 2010, 00:37 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This patch only concerns the clock plugin for now.

Instead of using the pluglib generic actions which proved to be somehow unflexible, difficult to maintain and to have issues with contexts overlaping on some targets, let's redefine the whole button mappings per plugin using the action API

Could make some people happy
This task depends upon

Closed by  Marianne Arnold (pixelma)
Monday, 22 November 2010, 00:37 GMT
Reason for closing:  Rejected
Additional comments about closing:  Obsolete since the pluginlib actions were simplified (only one context) and I'm not aware of any problems left in the clock plugin. The patch is also outdated due to this rework and being left alone for over 2.5 years.
Comment by Peter D'Hoye (petur) - Sunday, 03 February 2008, 13:17 GMT
TiMiD, it would do good to follow some discussions in the IRC from time to time: many have expressed the feeling that the action-api is not wanted for plugins it its current form....
Comment by Kévin Ferrare (TiMiD) - Sunday, 03 February 2008, 13:32 GMT
I'm busy and I cannot always be on the irc, I have a life that takes me a lot of time.

Anyway this patch follows what we discussed on the irc last week :
- don't use the pluginlib_actions which is difficult to maintain and somehow broken on some targets because of key mappings overlap
- use the action API which is more powerful to express the keymaps than the old way with the buttons (action API != pluginlib_actions)

Please read the logs again (20080123 if I recall), and please stop being so bossy
Comment by Peter D'Hoye (petur) - Sunday, 03 February 2008, 13:39 GMT
long toes, have we?
Comment by Kévin Ferrare (TiMiD) - Sunday, 03 February 2008, 15:27 GMT
OK so anyway an action should be taken regarding the actual state of the buttons management in the plugins that are using pluginlib_actions.
I'm open to discussion and willing to fix the problem.
Does someone have any technical comment on this patch ?
Comment by Marianne Arnold (pixelma) - Monday, 04 February 2008, 09:02 GMT
Yes, the Ondio keypad is missing... ;)

Edit: Took the former second comment out because I didn't read correctly. *rubs eyes*
Comment by Kévin Ferrare (TiMiD) - Monday, 04 February 2008, 11:02 GMT
The ondio keypad is indeed missing ... because this is the clock plugin and ondios don't have an RTC :)
(at least if I believe what's written there :
Comment by Marianne Arnold (pixelma) - Monday, 04 February 2008, 13:42 GMT
Oops, that's true. For some stupid reason it mixed up with metronome in my head; guess I shouldn't comment on something in the morning before getting enough coffee. :)
Comment by Robert Kukla (roolku) - Wednesday, 20 February 2008, 10:01 GMT
I am in favour of this.

With all the new builds coming in, it will make the task of the developer to get plugins working for new targets much easier. Also it would be possible for targets with more buttons to assign additional functionality without having to resort to in-code #ifdefs.

However I would still like to see a set of default actions shared between all plugins (most importantly the OFF button, to overcome the current situation with no consistent way to exit plugins, but probably menu, select and directional keys.) I would expect that plugins could override these actions if the nature of the plugin and/or the device's button layout require it.
Comment by Kévin Ferrare (TiMiD) - Thursday, 21 February 2008, 01:55 GMT
Well the action API is obviously more powerful and convenient to express a keymap than the #define way.

The default actions idea was seducing, a few lines of code and no need to think about the keymap instead of a big bulky 200 lines keymap repeated for every plugin and increasing with the number of targets.

The problem with default actions is that they make the plugins more difficult to maintain :
- it's not obvious to see whether an action defined will collide with another one (even if it works on your target it could cause problems on others)
- even if when the collisions are carefully avoided, it can break when someone changes the keymap, or add a new target
- it's not flexible, some plugins that uses standard actions are now getting #ifdefs as well regarding the target to behave properly ...

A default action for quit button would be great, however there are still risks of collision so I wonder if it's a practicable solution
Comment by Kévin Ferrare (TiMiD) - Thursday, 21 February 2008, 01:56 GMT
Updated keymap